1 2008-03-27 Marek Safar <marek.safar@gmail.com>
3 * convert.cs (ImplicitReferenceConversionCore): Correctly compare enum type
4 and not rely on broken IsEnum.
6 2008-03-27 Marek Safar <marek.safar@gmail.com>
8 * nullable.cs: New file, extracted from generic.cs.
10 * generic.cs, generic-mcs.cs, *.csproj, *.sources: Updated.
12 2008-03-27 Marek Safar <marek.safar@gmail.com>
14 * generic.cs, convert.cs, generic-mcs.cs, expression.cs: Added lifting of
15 predefined comparison operators and null literals.
17 * report.cs: New warning ID.
19 2008-03-25 Marek Safar <marek.safar@gmail.com>
22 * lambda.cs: Check return type too.
24 2008-03-25 Marek Safar <marek.safar@gmail.com>
27 * class.cs: Automatic properties can be declared as unsafe.
29 2008-03-20 Marek Safar <marek.safar@gmail.com>
31 * location.cs: Use string based concatenation.
33 * expression.cs: LiftedBinaryOperator is gmcs only.
35 2008-03-20 Marek Safar <marek.safar@gmail.com>
37 * generic.cs, literal.cs, ecore.cs, expression.cs: Ongoing work on nullable
38 conversions rules and expression trees.
40 2008-03-19 Marek Safar <marek.safar@gmail.com>
42 * delegate.cs: Use extension method source as delegate target.
44 2008-03-19 Marek Safar <marek.safar@gmail.com>
46 * generic.cs, generic-mcs.cs, expression.cs, ecore.cs: Rewrote nullable
47 binary operations to be purely based on binary operations and optimized
48 emitted code (30% less in some cases). Introduced ReducedExpression for ETs
49 and other ET refactoring.
51 * typemanager.cs: Fixed warning.
53 2008-03-17 Marek Safar <marek.safar@gmail.com>
55 * class.cs, decl.cs, delegate.cs: Do protected modifier check on each member
57 * symbolwriter.cs: Fixed.
59 2008-03-17 Marek Safar <marek.safar@gmail.com>
61 * anonymous.cs, driver.cs: Reset anonymous types counters.
63 2008-03-17 Marek Safar <marek.safar@gmail.com>
65 * ecore.cs (MethodGroupExpr): Skip first candidate, it's already the best.
67 * class.cs: Use fullname for all type member definitions.
69 2008-02-19 Martin Baulig <martin@ximian.com>
72 (IMethodData.EmitExtraSymbolInfo): New interface method.
73 (MethodData.Emit): Call method.EmitExtraSymbolInfo().
74 (MethodOrOperator.EmitExtraSymbolInfo): Implement this new
75 interface method here as an empty public virtual method.
78 (AnonymousMethodMethod.ctor): Added `string real_name' argument.
79 (AnonymousMethodMethod.EmitExtraSymbolInfo): Override and call
80 CodeGen.SymbolWriter.SetRealMethodName().
82 2008-02-18 Martin Baulig <martin@ximian.com>
85 (ScopeInfo.EmitType): Override this and emit debugging
86 information for captured variables.
87 (RootScopeInfo.EmitType): Override this and emit symbol
88 information for a captured `this'.
90 2008-02-15 Martin Baulig <martin@ximian.com>
92 * iterators.cs: Emit debugging info.
95 (EmitContext.Flags): Add `OmitDebuggingInfo'.
96 (EmitContext.OmitDebuggingInfo): New public property.
99 (While): Override Emit() and don't emit symbol info there; do it
100 inside DoEmit() instead.
101 (Block.Emit): Omit symbol information while emitting the scope
102 initializers; don't ec.Mark() the `EndLocation'. Fix the lexical
104 (ExplicitBlock.IsIterator): Moved here from `ToplevelBlock'.
105 (ToplevelBlock.MakeIterator): Pass the `flags' to `ExplicitBlock's
106 .ctor to make `IsIterator' work.
108 2008-03-14 Martin Baulig <martin@ximian.com>
110 * symbolwriter.cs: Added the new symbol writer function from the
111 debugger's `terrania' branch; temporarily enclose them inside
112 `#if !DISABLE_TERRANIA_CHANGES' conditionals until I'm back from
115 2008-03-14 Martin Baulig <martin@ximian.com>
118 (SymbolWriter): Make this a public static class.
121 (CodeGen.SymbolWriter): Removed; use the new static `SymbolWriter'
122 class instead of using `if (CodeGen.SymbolWriter != null)' everywhere.
124 2008-03-14 Marek Safar <marek.safar@gmail.com>
126 A fix for bug #370577
127 * statement.cs, lambda.cs: Added extra limitations when dealing with void
130 2008-03-14 Marek Safar <marek.safar@gmail.com>
132 * typemanager.cs (CSharpName): Made 250 times faster.
134 2008-03-13 Marek Safar <marek.safar@gmail.com>
136 * ecore.cs, expression.cs: Emit conversion for ET shift argument.
138 2008-03-12 Marek Safar <marek.safar@gmail.com>
140 * generic.cs, typemanager.cs, enum.cs, codegen.cs, statement.cs: Try not to
141 crash when predefined field does not exist.
143 2008-03-12 Marek Safar <marek.safar@gmail.com>
145 * ecore.cs (PropertyExpr): Fixed IsSingleDimensionalArrayLength regression.
147 2008-03-12 Marek Safar <marek.safar@gmail.com>
149 * class.cs (FixedField): Don't crash when contructors are missing.
151 2008-03-11 Marek Safar <marek.safar@gmail.com>
153 * typemanager.cs, namespace.cs, literal.cs, ecore.cs, class.cs, decl.cs,
154 convert.cs, constant.cs, expression.cs, statement.cs: Use same method to
155 check internal types accessibility for internal and external types.
156 Replaced EnumToUnderlying by GetEnumUnderlyingType.
158 2008-03-11 Marek Safar <marek.safar@gmail.com>
160 * support.cs, typemanager.cs, pending.cs, ecore.cs, class.cs, delegate.cs
161 convert.cs, const.cs, anonymous.cs, constant.cs, expression.cs,
162 attribute.cs, statement: Use corect instance of predefined types (work
165 2008-03-07 Marek Safar <marek.safar@gmail.com>
167 * expression.cs (TypeOfVoid): Fixed predefined method initialization.
169 2008-03-07 Marek Safar <marek.safar@gmail.com>
171 * generic.cs, typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs,
172 class.cs, delegate.cs, iterators.cs, const.cs, constant.cs, driver.cs,
173 expression.cs, attribute.cs, codegen.cs, statement.cs: TypeManager optional
174 predefined types clean up, delayed predefined types members initialization
175 (work related to #364674).
177 2008-03-05 Marek Safar <marek.safar@gmail.com>
179 * typemanager.cs (IsFriendAssembly): InternalsVisibleTo is not mandatory.
181 2008-03-05 Marek Safar <marek.safar@gmail.com>
183 * typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, class.cs, decl.cs,
184 delegate.cs, convert.cs, driver.cs, attribute.cs, codegen.cs: TypeManager
185 predefined types clean up (work related to #364674).
187 2008-03-04 Marek Safar <marek.safar@gmail.com>
189 * ecore.cs: Print an error message instead of throwing exception.
191 2008-03-04 Marek Safar <marek.safar@gmail.com>
193 * generic.cs, typemanager.cs, literal.cs, convert.cs, cfold.cs, constant.cs,
194 expression.cs, statement.cs: Unififed null literal representation.
196 2008-03-03 Marek Safar <marek.safar@gmail.com>
198 * anonymous.cs, cfold.cs, convert.cs, delegate.cs, doc.cs, ecore.cs,
199 expression.cs: Refactored binary operators resolve phase and improved speed.
200 The nullable code is still missing and won't work correctly, more fixes
203 It also fixes #323726, #324312, #324248, and many other unreported issues.
205 2008-02-29 Zoltan Varga <vargaz@gmail.com>
207 * report.cs (FeatureIsNotAvailable): Use 'mcs1' instead of 'mcs', and 'mcs'
210 2008-02-27 Marek Safar <marek.safar@gmail.com>
212 * ecore.cs: Clean-up and split BetterConversion.
214 2008-02-25 Raja R Harinath <harinath@hurrynot.org>
217 * enum.cs (EnumMember.Value): Only access 'value' if
218 ResolveValue says it's ok.
219 (EnumMember.DoResolveValue): Don't set prev_member.value.
220 (Enum.GetDefinition): Reverse arguments of Equals --
221 EnumMember.Value can return 'null'.
223 * statement.cs (Switch.Error_AlreadyOccurs): Fix typo in name.
225 2008-02-22 Marek Safar <marek.safar@gmail.com>
227 * generic.cs, expression.cs: More ongoing work on expression trees.
229 2008-02-21 Marek Safar <marek.safar@gmail.com>
231 * class.cs, typemanager.cs: Rewrote operator matching logic to correctly
232 handle missing matches when mutiple operators exist.
234 2008-02-20 Marek Safar <marek.safar@gmail.com>
236 A fix for bug #363218
237 * expression.cs (ArrayCreation.Clone): Deal with multi-dimensional
240 2008-02-20 Marek Safar <marek.safar@gmail.com>
242 * expression.cs, constant.cs, cfold.cs: Yet another side-effect constant
243 update. This time to deal correctly with SideEffectConstant expression used
244 as an argument for another constant folding.
246 2008-02-20 Raja R Harinath <harinath@hurrynot.org>
248 * typemanager.cs (DropGenericMethodArguments): Ensure we get an underlying
251 2008-02-19 Marek Safar <marek.safar@gmail.com>
253 * constant.cs, cfold.cs: SideEffectConstant results can apply for folding.
255 2008-02-19 Marek Safar <marek.safar@gmail.com>
257 A fix for bug #328136
258 * expression.cs: Do not fold immediately LogicalAnd operators when the left
259 side is a false constant, because we still need to evaluate the right-hand
262 * statement.cs (If): Emit two types of boolean constants (simple constant,
263 side-effect constant).
265 2008-02-19 Marek Safar <marek.safar@gmail.com>
267 * constant.cs (SideEffectConstant): Don't emit boolean constant.
269 * expression.cs: Fold immediately LogicalAnd operators when both sides are
272 2008-02-18 Marek Safar <marek.safar@gmail.com>
274 A fix for bug #361457
275 * ecore.cs (IsApplicable): Params methods have lower priority.
277 * support.cs: Return correct parameter modifier for params types.
279 2008-02-18 Marek Safar <marek.safar@gmail.com>
281 * generic.cs (TypeParameter): Cache attribute target name.
283 * support.cs: Removed unused variable.
285 * typemanager.cs: Removed debugging leftover.
287 * ecore.cs: Use local type instead of a property;
289 * class.cs (VerifyMembers): Consider also parent to test whether type member
292 * expression.cs (FullMethodDesc): Removed.
294 * attribute.cs (IsValidArgumentType): Made static.
296 2008-02-17 Raja R Harinath <harinath@hurrynot.org>
298 Cleanup to be more readable.
299 * Makefile (GMCS_PROFILE): Remove.
300 (COMPILER_NAME): New helper.
302 2008-02-15 Miguel de Icaza <miguel@novell.com>
304 * cs-tokenizer.cs: if a conditional expression happens inside a
305 (...) this also means that we do not need to de-ambiguate between
306 an parenthesized expression and a cast.
310 * constant.cs (SideEffectConstant): a constant value that happens
311 to have a side effect.
313 Fixes the build regressions introduced by the fix for #359789
315 2008-02-14 Rodrigo Kumpera <rkumpera@novell.com>
317 * expression.cs (Conditional.Emit): when emitting the ternary
318 operator, use local variables to generate code verifiable code.
320 The verifier cannot infer that the type on stack before the
321 stloc.0 is executed is of type ParentB. This happens because the
322 stack merge algorithm uses only parent types when deciding which
323 is the common type. This is described in Part III 1.8.1.3 of ECMA
326 This code compiled with mcs is not verifiable under MS. The MS
327 verifier picks the first common interface of Foo and Bar, which is
328 wrong, but doesn't use a full join type of the 2 interfaces.
330 CSC uses a clever hack to compile such code in a verifiable
331 way. It stores the intermediate values in a local variable with
336 2008-02-14 Miguel de Icaza <miguel@novell.com>
338 * expression.cs: Do not fold BitwiseAnd operators when the left
339 side is a false constant, because we still need to evaluate the
344 * support.cs: Instead of throwing an InternalErrorException when
345 the position of the stream is outside the boundary of our buffer,
346 reset the state of the reader, and restart the reading from the
347 beginning of the file.
349 2008-02-14 Marek Safar <marek.safar@gmail.com>
351 * generic.cs (TypeParameter.GetMembers): Is not supported operation.
353 2008-02-14 Marek Safar <marek.safar@gmail.com>
355 A fix for bug #361686
356 * decl.cs: A protected types used inside a private class which parents
357 derives from the protected class are accessible.
359 2008-02-13 Marek Safar <marek.safar@gmail.com>
361 * generic.cs (ConstraintChecker): Use cached member lookup when looking for
362 the parameterless constructor.
364 2008-02-13 Marek Safar <marek.safar@gmail.com>
366 * generic.cs, typemanager.cs, iterators.cs, codegen.cs: Refactored core
367 lookup methods to use standard member cache when doing member lookup.
369 2008-02-12 Marek Safar <marek.safar@gmail.com>
371 * driver.cs: Don't report full path for referenced module as assembly error.
373 2008-02-12 Marek Safar <marek.safar@gmail.com>
375 * Makefile: Fixed `qh' target to work on all machines.
377 * report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs, anonymous.cs,
378 expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type IsSubclassOf
379 and HasElementType with TypeManager implementation.
381 2008-02-08 Marek Safar <marek.safar@gmail.com>
383 A fix for bugs #325134, #359749
384 * expression.cs, ecore.cs: Try to resolve an extension method even if the
385 first binds point to non-method member expression.
387 2008-02-08 Marek Safar <marek.safar@gmail.com>
389 * cs-parser.jay: Null coalescing operator is not part of ISO-1.
391 2008-02-08 Marek Safar <marek.safar@gmail.com>
393 A fix for bugs #321394, #323028
394 * generic.cs, parameter.cs, ecore.cs, class.cs, decl.cs, delegate.cs:
395 Reworked naive IsAccessibleAs implementation to handle nested types.
397 2008-02-05 Jb Evain <jbevain@novell.com>
399 * class.cs: use generic type comparison for parameters
402 2008-02-05 Marek Safar <marek.safar@gmail.com>
404 A fix for bug #325372
405 * class.cs: Use generic type comparison when testing method signatures.
407 2008-02-05 Marek Safar <marek.safar@gmail.com>
409 A fix for bug #357047
410 * ecore.cs: Applied C# 3.0 changes to better conversion.
412 2008-02-05 Marek Safar <marek.safar@gmail.com>
414 A fix for bug #358374
415 * cs-parser.jay: Correctly set modifiers for all constructor types.
417 2008-02-04 Marek Safar <marek.safar@gmail.com>
419 A fix for bug #355251
420 * generic.cs: Added base class constraint based type inference.
422 2008-02-01 Marek Safar <marek.safar@gmail.com>
424 A fix for bug #357255
425 * decl.cs: One more missing visibility check.
427 2008-02-01 Marek Safar <marek.safar@gmail.com>
429 * support.cs: Fixed broken return.
431 2008-01-25 Marek Safar <marek.safar@gmail.com>
433 * report.cs: Correctly reset warnings count after probing.
435 2008-01-25 Martin Baulig <martin@ximian.com>
438 (NamespaceEntry.SymbolFileID): Make this work again after
439 MemberName.ToString() is gone.
441 2008-01-25 Marek Safar <marek.safar@gmail.com>
443 * expression.cs: Implemented Divide, Equal, ExclusiveOr, GreaterThanOrEqual
446 2008-01-25 Marek Safar <marek.safar@gmail.com>
448 * generic.cs: Use full implicit conversion for type inference fixing.
450 2008-01-24 Marek Safar <marek.safar@gmail.com>
452 * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
453 Fixed user operator conversions.
455 2008-01-24 Marek Safar <marek.safar@gmail.com>
457 * generic.cs: Do nullable type to null comparison optimization during
460 2008-01-24 Marek Safar <marek.safar@gmail.com>
462 A fix for bug #355163
463 * generic.cs: Enabled l-value resolve on nullable expressions.
465 2008-01-24 Marek Safar <marek.safar@gmail.com>
467 A fix for bug #353986
468 * class.cs: Ingore static ctors with parameters for any further checks.
470 2008-01-24 Marek Safar <marek.safar@gmail.com>
472 A fix for bug #354310
473 * namespace.cs: Removed redundant check.
475 2008-01-24 Marek Safar <marek.safar@gmail.com>
477 A fix for bug #354928
478 * expression.cs: ElementInitializers can be resolved only once.
480 2008-01-24 Marek Safar <marek.safar@gmail.com>
482 * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
483 Condition expressions.
485 2008-01-23 Marek Safar <marek.safar@gmail.com>
487 * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
489 2008-01-22 Marek Safar <marek.safar@gmail.com>
491 * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
494 * generic.cs: Implemented coalesce expression.
496 2008-01-22 Marek Safar <marek.safar@gmail.com>
498 A fix for bug #355145
499 * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
500 expression tree type inference.
502 2008-01-22 Raja R Harinath <harinath@hurrynot.org>
505 * expression.cs (Binary.IsUnsignedType): Fix typo.
507 2008-01-22 Marek Safar <marek.safar@gmail.com>
509 * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
511 2008-01-22 Marek Safar <marek.safar@gmail.com>
513 A fix for bug #355161
514 * ecore.cs, expression.cs: Wider range of extension method supported
517 2008-01-22 Gert Driesen <drieseng@users.sourceforge.net>
519 * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
520 AssemblyBuilder to operate in compiler context. Fixes mcs part of
523 2008-01-22 Marek Safar <marek.safar@gmail.com>
525 A fix for bug #355148
526 * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
528 2008-01-22 Miguel de Icaza <miguel@novell.com>
530 * expression.cs (CreateExpressionTree): Add support for or and
531 logical or, and indent following the coding conventions.
533 * typemanager.cs (LinqExpression): renamed from
534 ExpressionTreeManager, for a shorter name.
536 Use TypeManager.CoreLookupType to lookup types from our core
537 assemblies and turn those into "Type" variables.
539 Consumers that previously used "Namespace" and "Type" from this
540 class should instead use the TypeExpression which is a type that
541 is fully resolved (without involving the regular C# resolution
544 This typically looks like this:
546 TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
547 new MemberAccess (texpr, name, type_arguments, loc)
549 This avoids the problem in: #355178
551 2008-01-21 Marek Safar <marek.safar@gmail.com>
553 * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
554 feature in parser only as we do in other cases.
556 2008-01-21 Marek Safar <marek.safar@gmail.com>
558 * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
559 typemanager.cs: A refactoring of params arguments to reuse existing
560 expressions (params -> array initializer) to emit params argument instead
561 of specialized handling.
562 It was required by expression tree implementation and it has other benefits
563 as well, we now apply same optimization for params arguments as we do for
566 2008-01-18 Marek Safar <marek.safar@gmail.com>
568 A fix for bug #353526
569 * generic.cs: A type inference of params arguments may not required any
570 temporary array creation.
572 2008-01-18 Marek Safar <marek.safar@gmail.com>
574 A fix for bug #353534
575 * generic.cs, ecore.cs, expression.cs: A method group type inference is
576 supported for delegates only.
578 2008-01-18 Marek Safar <marek.safar@gmail.com>
580 * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
581 type for more than 1 candidates.
583 2008-01-18 Marek Safar <marek.safar@gmail.com>
585 * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
588 2008-01-16 Marek Safar <marek.safar@gmail.com>
590 * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
591 expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
592 operator) expressions.
594 2008-01-16 Zoltan Varga <vargaz@gmail.com>
596 * statement.cs: Avoid declaring an IL variable for this_variable since it is
597 not accessed from the generated IL.
599 2008-01-14 Marek Safar <marek.safar@gmail.com>
601 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
602 iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
603 statement.cs: The first expression tree implementation drop, mostly
606 2008-01-14 Marek Safar <marek.safar@gmail.com>
608 * ecore.cs (IsNestedChild): Refactored.
610 2008-01-11 Marek Safar <marek.safar@gmail.com>
612 * lambda.cs: Don't use a cast on unknown expression statement.
614 2008-01-10 Geoff Norton <gnorton@novell.com>
616 * cs-tokenizer.cs: One more token to distinguish between method and lambda
619 2008-01-09 Marek Safar <marek.safar@gmail.com>
621 * doc.cs: Report better /doc crash details.
623 2008-01-09 Marek Safar <marek.safar@gmail.com>
625 A fix for bug #352536
626 * ecore.cs, assign.cs, codegen.cs: Check event assignments.
628 2008-01-08 Marek Safar <marek.safar@gmail.com>
630 A fix for bug #352287
631 * ecore.cs, expression.cs: Do `this' access checking in all member access
634 2008-01-08 Marek Safar <marek.safar@gmail.com>
636 * rootcontext.cs, driver.cs: Switch to linq mode by default.
638 * report.cs: Reset message stacks.
640 2008-01-08 Marek Safar <marek.safar@gmail.com>
642 * generic.cs (InferInPhases): Correctly calculate params position.
644 2008-01-08 Marek Safar <marek.safar@gmail.com>
646 * cs-tokenizer.cs: No need to parse full string when parsing lambda
649 2008-01-07 Marek Safar <marek.safar@gmail.com>
651 * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
653 * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
655 * driver.cs: Updated --help option.
657 2008-01-07 Marek Safar <marek.safar@gmail.com>
659 * generic.cs (InferParamsTypeArguments): Removed.
660 (InferInPhases): Add params type inference.
661 (LowerBoundInference): Fixed scoring mechanism.
663 * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
665 2008-01-06 Gert Driesen <drieseng@users.sourceforge.net>
667 * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
668 byte array for unsigned "baked" assemblies.
670 2008-01-05 Gert Driesen <drieseng@users.sourceforge.net>
672 * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
673 array for assemblies that are not strongnamed.
675 2008-01-04 Marek Safar <marek.safar@gmail.com>
677 A fix for bug #351481
678 * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
679 declaring type for nested generic types.
681 2008-01-04 Marek Safar <marek.safar@gmail.com>
683 * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
686 2008-01-03 Marek Safar <marek.safar@gmail.com>
688 A fix for bug #351047
689 * expression.cs (Binary.ResolveOperator): Allow equality operators between
690 null and structs only when equality and inequality operators are defined
691 either as an user-operators or predefined operators.
693 2008-01-03 Marek Safar <marek.safar@gmail.com>
695 A fix for bug #351047
696 * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
698 2008-01-03 Marek Safar <marek.safar@gmail.com>
700 A fix for bug #351257
701 * cs-tokenizer.cs: Advance line number for '\r' correctly.
703 2008-01-03 Marek Safar <marek.safar@gmail.com>
705 A fix for bug #351157
706 * class.cs (Using): Fixed yet another broken cloning.
708 (Block): Put back more sensible default value for statements.
710 2008-01-01 Gert Driesen <drieseng@users.sourceforge.net>
712 * codegen.cs: Allow AssemblyVersion with only major version component.
715 2007-12-29 Marek Safar <marek.safar@gmail.com>
717 A fix for bug #324654
718 * class.cs: Use FullName property as member name.
720 2007-12-28 Marek Safar <marek.safar@gmail.com>
722 A fix for bug #342117
723 * generic.cs (ConstraintChecker): Struct constraint also satisfies default
724 constructor constraint.
726 2007-12-28 Marek Safar <marek.safar@gmail.com>
728 A fix for bug #338273
729 * class.cs (ProbertyBase): Access modifier checks are required for overrides
732 2007-12-28 Marek Safar <marek.safar@gmail.com>
734 A fix for bug #350839
735 * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
737 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
739 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
742 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
744 * statement.cs: Changed some Hashtables to use HybridDictionaries
745 instead. It was observed that some HashTables only contained a few
746 items in the vast majority of cases. Since HybridDictionary is
747 more efficient on small sets (<10 elements), "known_variables"
748 from class ExplicitBlock as well as "labels" and "constants " from
749 class Block were changed to HybridDictionaries.
751 Atsai results: (56216kb->54987kb)
753 Miguel results (bootstrap of mcs): 59819kb -> 59290kb
756 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
758 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
761 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
763 * expression.cs: foreach loop to for loop, saved on allocation of
764 enumerator (59333kb->59141kb)
766 * statement.cs. Changed foreach loops to for loops, saved on
767 allocation of enumerator (59141kb->59006kb)
769 * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
770 when constructed with no specified capacity. This was causing a
771 few ArrayLists to allocate more memory than they would potentially
772 need in the Block class and MemberCache class. Setting the
773 ArrayLists to construct with a capacity of 1 saves some
774 memory. (56216kb->55585kb)
776 2007-12-27 Marek Safar <marek.safar@gmail.com>
778 A fix for bug #347189 (2nd issue)
779 * expression.cs (MemberAccess): Nested type can be found in base non-generic
782 2007-12-27 Miguel de Icaza <miguel@novell.com>
784 * report.cs: Do not use colors if stdout and stderr are not a
787 2007-12-27 Marek Safar <marek.safar@gmail.com>
789 A fix for bug #346998
790 * ecore.cs (MethodGroupExpr): Implemented override filter for generic
793 2007-12-27 Marek Safar <marek.safar@gmail.com>
795 A fix for bug #343465
796 * class.cs: Explicit method name for nested types uses dots only.
798 2007-12-27 Marek Safar <marek.safar@gmail.com>
800 A fix for bug #343707
801 * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
803 2007-12-27 Marek Safar <marek.safar@gmail.com>
805 * ecore.cs: Report type inference errors only when arguments count matches
808 * generic.cs (NullCoalescingOperator): Cannot be applied to null.
810 * expression.cs, report.cs: New warning.
812 * typemanager.cs: Catch anonymous method type too.
814 2007-12-23 Marek Safar <marek.safar@gmail.com>
816 A fix for bug #346379
817 * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
819 2007-12-23 Marek Safar <marek.safar@gmail.com>
821 A fix for bug #347359
822 * expression.cs (Invocation): Don't resolve already resolved expression.
824 2007-12-23 Marek Safar <marek.safar@gmail.com>
826 A fix for bug #347189
827 * class.cs (FixedField): Use non-dependent code only in the define phase.
829 2007-12-23 Marek Safar <marek.safar@gmail.com>
831 A fix for bug #348076
832 * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
834 2007-12-22 Marek Safar <marek.safar@gmail.com>
836 * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
837 discovered extension methods.
839 2007-12-22 Marek Safar <marek.safar@gmail.com>
841 * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
844 2007-12-21 Miguel de Icaza <miguel@novell.com>
846 * report.cs (ErrorMessage): Add support for using colors on
847 terminals that support it.
849 2007-12-21 Marek Safar <marek.safar@gmail.com>
851 * ecore.cs: Use information about expanded params for error reporting.
853 2007-12-21 Marek Safar <marek.safar@gmail.com>
855 * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
856 and logic for params overloads.
858 2007-12-15 Miguel de Icaza <miguel@novell.com>
860 * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
861 as this is also created from the parser. Fixes #349034
863 2007-12-12 Miguel de Icaza <miguel@novell.com>
865 * statement.cs (Throw.CloneTo): it is valid to have empty
866 expressions for throw.
868 2007-12-03 Marek Safar <marek.safar@gmail.com>
870 * cs-parser.jay: Set delegate constraint parsing region correctly.
872 2007-12-03 Marek Safar <marek.safar@gmail.com>
874 A fix for bug #345467
875 * typemanager.cs (IsEqual): Compare generic parameters position only.
877 2007-11-28 Marek Safar <marek.safar@gmail.com>
879 * expression.cs (BaseAccess): Type arguments can be null.
881 2007-11-27 Raja R Harinath <harinath@gmail.com>
883 * statement.cs (Block.Resolve): Ensure flow-branching tree is
884 consistent even when an error has occured.
885 (Switch.Resolve): Likewise.
887 2007-11-22 Marek Safar <marek.safar@gmail.com>
889 A fix for bug #334505
890 * class.cs: Don't ignore InternalsVisibleTo attribute for internal
893 2007-11-22 Marek Safar <marek.safar@gmail.com>
895 * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of
896 refactorings required to resolve extension methods correctly when mixing
897 generics and non-generics members.
899 2007-11-20 Marek Safar <marek.safar@gmail.com>
901 A fix for bug #342584
902 * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
905 2007-11-19 Marek Safar <marek.safar@gmail.com>
907 A fix for bug #342512
908 * delegate.cs: Use delegate argument expression when is available. Don't
909 emit virtual call when class is sealed.
911 2007-11-16 Marek Safar <marek.safar@gmail.com>
913 A fix for bug #325423
914 * assign.cs (FieldInitializer): Use resolved expression for emit.
916 * class.cs: Print less confusing error message.
918 2007-11-16 Marek Safar <marek.safar@gmail.com>
920 * cs-tokenizer.cs: Removed GMCS ifdefs.
922 * rootcontext.cs, report.cs: Report unavailable gmcs features used by
925 * cs-parser.jay: Disabled nullable check.
927 * generic-mcs: Copied more generic stuff.
929 2007-11-16 Marek Safar <marek.safar@gmail.com>
931 * gcs-parser.jay: Merged to cs-parser.jay.
933 * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
934 * *.csproj, *.sources: Updated to use only jay parser file.
936 2007-11-16 Marek Safar <marek.safar@gmail.com>
938 * gcs-parser.jay: Added nullable and default expression feature checks.
940 2007-11-16 Marek Safar <marek.safar@gmail.com>
942 * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing,
943 it fixes many TODOs and hidden bugs.
945 * expression: Removed duplicate error check.
947 2007-11-15 Marek Safar <marek.safar@gmail.com>
949 * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
950 implicitly type local variable only when it is used in a declaration.
952 2007-11-15 Marek Safar <marek.safar@gmail.com>
954 * attribute.cs: Use CS0612 for empty strings.
956 2007-11-14 Marek Safar <marek.safar@gmail.com>
958 * lambda.cs, statement.cs: Contextual return may act as a statement.
960 2007-11-14 Marek Safar <marek.safar@gmail.com>
962 A fix for a regression cause by #324222
963 * class.cs: Don't report unused even when it implements an interface.
965 2007-11-13 Marek Safar <marek.safar@gmail.com>
967 A fix for bug #341205
968 * ecore.cs, expression.cs: Method group expression cannot do static
969 method access with an instance reference check before overloading takes
972 2007-11-13 Marek Safar <marek.safar@gmail.com>
974 A fix for bug #325359
975 * class.cs: Use predictable name for automatically generated property.
977 2007-11-12 Marek Safar <marek.safar@gmail.com>
979 A fix for bug #324996
980 * expression.cs (Is): Handle case where D is nullable and T is not
983 * generics.cs (Nullable.HasValue): Nullable HasValue expression.
985 2007-11-12 Marek Safar <marek.safar@gmail.com>
987 * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
988 anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
989 Flush small error reporting changes.
991 2007-11-09 Marek Safar <marek.safar@gmail.com>
993 A fix for bug #324996
994 * expression.cs: Rewrote Is expression implementation to work with
995 generics, nullable types, anonymous method. A const result expression
996 uses existing infrastructure instead of custom not fully-featured one.
998 2007-11-08 Marek Safar <marek.safar@gmail.com>
1000 A fix for bug #340202
1001 * class.cs: Consider generics for volatile field.
1003 2007-11-08 Marek Safar <marek.safar@gmail.com>
1005 A fix for bug #335594
1006 * expression.cs: Use conversion rules when handling string addition.
1008 2007-11-07 Marek Safar <marek.safar@gmail.com>
1010 A fix for bug #336651
1011 * expression.cs: Fixed a crash when probing is on.
1013 2007-11-07 Marek Safar <marek.safar@gmail.com>
1015 A fix for bug #324242
1016 * covert.cs: Added a conversion from any nullable-type with an
1017 underlying enum-type to the type System.Enum.
1019 2007-11-07 Marek Safar <marek.safar@gmail.com>
1021 A fix for bug #324222
1022 * class.cs: Report all non-used event fields.
1024 2007-11-07 Marek Safar <marek.safar@gmail.com>
1026 A fix for bug #325161
1027 * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
1028 qualifier for generic types.
1030 2007-11-07 Marek Safar <marek.safar@gmail.com>
1032 A fix for bug #322971
1033 * expression.cs, ecore.cs: Added intermediate result value check for
1036 2007-11-07 Marek Safar <marek.safar@gmail.com>
1038 A fix for bug #324754
1039 * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
1040 when it was requested.
1042 2007-11-07 Marek Safar <marek.safar@gmail.com>
1044 A fix for bug #325101
1045 * expression.cs: Do type not value comparison for `is' expression.
1047 2007-11-07 Marek Safar <marek.safar@gmail.com>
1049 A fix for bug #320236
1050 * convert.cs: Don't apply user conversion on underlying target type.
1052 2007-11-06 Marek Safar <marek.safar@gmail.com>
1054 * expression.cs: Don't use unresolved expression for error reporting.
1056 2007-11-06 Marek Safar <marek.safar@gmail.com>
1058 A fix for bugs #337712, #324490
1059 * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
1060 overloading resolution too.
1062 * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
1063 the process consistent and more robust.
1065 * expression.cs, linq.cs, report.cs: Update.
1067 2007-11-02 Marek Safar <marek.safar@gmail.com>
1069 A fix for bug #332909
1070 * attribute.cs: Resolve attributes in correct context using error
1073 * rootcontext.cs: Define Obsolete attribute members as core members.
1075 2007-11-02 Marek Safar <marek.safar@gmail.com>
1077 * statement.cs: Removed unused methods.
1079 2007-10-31 Wade Berrier <wberrier@novell.com>
1081 * Makefile: reenable copy of gmcs.exe.config, but include it in EXTRA
1082 DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
1085 2007-10-31 Marek Safar <marek.safar@gmail.com>
1087 A fix for bug #338102
1088 * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
1089 methods registered as non-generics.
1091 2007-10-31 Marek Safar <marek.safar@gmail.com>
1093 A fix for bugs #337712, #324490
1094 * delegate.cs: Delegate covariance and contravariance is not allowed for
1097 2007-10-31 Marek Safar <marek.safar@gmail.com>
1099 A fix for bug #337719
1100 * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
1103 2007-10-30 Marek Safar <marek.safar@gmail.com>
1105 * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
1107 2007-10-29 Marek Safar <marek.safar@gmail.com>
1109 * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
1112 2007-10-29 Raja R Harinath <rharinath@novell.com>
1114 * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
1116 2007-10-29 Marek Safar <marek.safar@gmail.com>
1118 A fix for bug #334652
1119 * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
1120 extension methods when we have not found the best candidate in normal
1123 2007-10-27 Marek Safar <marek.safar@gmail.com>
1125 * AssemblyInfo.cs: Keep up-to-date.
1127 2007-10-27 Marek Safar <marek.safar@gmail.com>
1129 * Makefile: Fixed generics compiler name.
1131 2007-10-27 Marek Safar <marek.safar@gmail.com>
1133 * lambda.test: removed, lambda parsing is done differently.
1135 * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
1137 2007-10-27 Gert Driesen <drieseng@users.sourceforge.net>
1139 * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
1141 2007-10-27 Marek Safar <marek.safar@gmail.com>
1143 * Makefile, *.sources : All C# compilers are in mcs folder.
1145 * *.cs: Use existing 2_1 define for smcs.
1147 2007-10-26 Marek Safar <marek.safar@gmail.com>
1149 A fix for bug #335847
1150 * assign.cs, expression.cs: Couple of changes to avoid creating a
1151 temporary variable for each object initializer assignment statement. It
1152 simplifies struct initialization too, otherwise two temporary variables
1154 Implemented optimization of redundant default element initializers.
1156 2007-10-25 Marek Safar <marek.safar@gmail.com>
1158 A fix for bug #336766
1159 * expression.cs (Class.CheckBase): Use generic name when method is
1162 2007-10-25 Marek Safar <marek.safar@gmail.com>
1164 A fix for bug #334737
1165 * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
1166 variable and not variable argument for prepared copies.
1168 2007-10-24 Marek Safar <marek.safar@gmail.com>
1170 A fix for bug #325110
1171 * class.cs, expression.cs, attribute.cs: Use open generic method when
1172 checking conditional attribute.
1174 2007-10-24 Marek Safar <marek.safar@gmail.com>
1176 * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs,
1177 expression.cs, statement.cs: Renamed method FeatureIsNotISO to
1178 FeatureIsNotAvailable.
1180 2007-10-24 Marek Safar <marek.safar@gmail.com>
1182 ** C# 3.0 Partial methods
1184 * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
1185 methods support. Because of member cache issue with generics only
1186 non-generics partial methods are fully supported.
1188 2007-10-23 Marek Safar <marek.safar@gmail.com>
1190 * class.cs, decl.cs: Rewrote member overloads check to cope with
1191 generics and to use member cache for member checking. It also improves
1192 performance and fixes remaining overloads issues.
1194 2007-10-20 Marek Safar <marek.safar@gmail.com>
1196 * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
1197 roottypes.cs, typemanager.cs:
1199 A member cache creation logic changed to add members immediately and
1200 not rely on fallback. The member cache is now only prefered way
1201 how to access and find type declaration members. It saves 5 MB of memory
1202 during MWF compilation and makes code ready for more optimizations and
1203 clean-ups, it's also a pre-requirement for partial methods.
1205 2007-10-18 Raja R Harinath <harinath@gmail.com>
1207 * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
1208 handling for generic parameters.
1210 2007-10-15 Marek Safar <marek.safar@gmail.com>
1212 * class.cs (FixedField): Removed redundant volatile check.
1214 2007-10-15 Marek Safar <marek.safar@gmail.com>
1216 * class.cs, decl.cs: Fixed overload members verification to do only one
1217 check per possible collision.
1219 2007-10-13 Marek Safar <marek.safar@gmail.com>
1221 A fix for bug #325478
1222 * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
1223 and create only one disposable flags container.
1225 2007-10-12 Marek Safar <marek.safar@gmail.com>
1227 A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
1228 * statement.cs (Fixed): Fixed variables cloning.
1230 2007-10-12 Marek Safar <marek.safar@gmail.com>
1232 A fix for bug #333342
1233 * class.cs (EventField): Don't mark value type event as synchronized.
1235 2007-10-12 Marek Safar <marek.safar@gmail.com>
1237 * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
1238 inference to identify best candidate method correctly.
1239 (ProperyExpr): A range variable is read only and cannot be modified.
1241 2007-10-11 Marek Safar <marek.safar@gmail.com>
1243 * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
1244 logic to identify best candidate method correctly.
1246 2007-10-11 Marek Safar <marek.safar@gmail.com>
1248 * location.cs (Equals, GetHashCode): Removed.
1250 2007-10-11 Marek Safar <marek.safar@gmail.com>
1252 * report.cs: Implemented message recorder. It is used mainly for lambda
1253 expressions to capture otherwise swallowed error messages.
1255 * anonymous.cs, lambda.cs.cs: Do full parameters check.
1257 * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
1259 (MethodGroupExpr.DoResolve): Use message recorder for error handling.
1261 * expression.cs (MemberAccess): Always report lookup failure.
1263 * location.cs: Implemented Equals, GetHashCode.
1265 * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
1267 2007-10-10 Jb Evain <jbevain@novell.com>
1269 * codegen.cs: re-enable assembly version check.
1271 2007-10-09 Marek Safar <marek.safar@gmail.com>
1273 * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
1276 * namespace.cs (UsingAlias): Do correct version check.
1278 2007-10-08 Marek Safar <marek.safar@gmail.com>
1280 * expresison.cs, ecore.cs: Issue extension method error message when
1283 * rootcontext.cs: Added ISO_2 compiler mode option.
1285 2007-10-08 Marek Safar <marek.safar@gmail.com>
1287 * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
1290 2007-10-08 Marek Safar <marek.safar@gmail.com>
1292 * attribute.cs (GetString, GetBoolean): Work with both literal and
1295 * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
1296 Moved method overload specific methods to MethodGroupExpr.
1298 (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
1299 it should be less memory consuming.
1301 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
1303 * codegen.cs: remove the assembly version check until the buildbot is
1306 2007-10-07 Jb Evain <jbevain@novell.com>
1308 * attribute.cs (Attribute.GetString): if the value
1309 expression is a StringConstant, return its string value.
1311 2007-10-07 Jb Evain <jbevain@novell.com>
1313 * typemanager.cs: add `assembly_version_attribute_type`.
1314 * codegen.cs: on attribute emission, check that the
1315 AssemblyVersionAttribute doesn't overflow.
1317 2007-10-05 Marek Safar <marek.safar@gmail.com>
1319 A fix for bug #324677
1320 * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
1321 parent container of a scope container with currently resolved one.
1323 2007-10-05 Marek Safar <marek.safar@gmail.com>
1325 A fix for bug #325534
1326 * class.cs (Invocation.DoResolve): Check invocation of object finalizer
1329 2007-10-05 Marek Safar <marek.safar@gmail.com>
1331 A fix for bug #327504
1332 * class.cs (Operator.Define): Refactored implicit and explicit user
1333 operator conversion rules.
1335 2007-10-05 Marek Safar <marek.safar@gmail.com>
1337 A fix for bug #327520
1338 * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
1340 2007-10-04 Marek Safar <marek.safar@gmail.com>
1342 A fix for bug #328022
1343 * class.cs (MethodData.Define): Use correct method to check whether
1344 a method implementents an accessor.
1346 2007-10-04 Marek Safar <marek.safar@gmail.com>
1348 A fix for bug #330069
1349 * statement.cs (Fixed.Resolve): Read the first array element only when
1350 an array is instantiated.
1352 2007-10-04 Marek Safar <marek.safar@gmail.com>
1354 * expression.cs, assign.cs, generics.cs: Print correct operator when
1355 compound assignment is used.
1357 2007-10-04 Marek Safar <marek.safar@gmail.com>
1359 A fix for bug #325841
1360 * expression.cs (ArrayAccess): Use full argument cloning only for
1361 string compound concatenation.
1363 2007-10-03 Marek Safar <marek.safar@gmail.com>
1365 A fix for bug #328774
1366 * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
1368 (PropertyExpr.EmitAssign): Fixed string concatenation compound
1371 2007-10-03 Raja R Harinath <rharinath@novell.com>
1374 * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
1375 Event accessibility checks here. Remove some bogus code that
1376 accidently made GenericMethods work.
1377 (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
1379 2007-09-25 Marek Safar <marek.safar@gmail.com>
1381 * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
1383 * statement.cs (Block): Refactored AddVariable to allow error handling
1386 * generic.cs: New stub.
1388 2007-09-23 Marek Safar <marek.safar@gmail.com>
1390 * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
1393 2007-09-17 Marek Safar <marek.safar@gmail.com>
1395 * class.cs: Use partial container to record whether any partial part
1396 contains static field initializer and therefore default contructor has
1399 2007-09-14 Marek Safar <marek.safar@gmail.com>
1401 * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
1402 mono-list when only one of two partial parts has defined accessibility
1405 2007-09-14 Marek Safar <marek.safar@gmail.com>
1407 A fix for bug #82845
1409 * class.cs (TypeContainer): Set correct resolve context for all field
1412 2007-09-13 Marek Safar <marek.safar@gmail.com>
1414 * assign.cs: Fixed a crash when field is resolved twice with an error.
1416 * codegen.cs: Changed InFieldInitializer to be flag.
1418 * anonymous.cs, ecore.cs, expression.cs: Update after
1419 IsInFieldInitializer rename.
1421 * const.cs: Removed unused parameter.
1423 * class.cs: Changed the way how we resolve and emit field initializers.
1424 The field initilizers have to have access to contructor block to emit
1425 compiler generated code.
1427 2007-09-13 Marek Safar <marek.safar@gmail.com>
1429 * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
1430 generics use TypeContainer instead.
1432 2007-09-12 Marek Safar <marek.safar@gmail.com>
1434 * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
1436 * lambda.cs (ResolveParameters): Use more powerful
1437 InflateGenericArgument.
1439 * parameters.cs: Better exception message.
1441 2007-09-10 Marek Safar <marek.safar@gmail.com>
1443 * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
1444 correct expression block type.
1446 * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
1448 * expression.cs (Invocation): Extracted method group resolve to
1451 2007-09-07 Marek Safar <marek.safar@gmail.com>
1453 * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
1454 (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
1456 * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
1457 generic extension methods.
1459 2007-09-06 Marek Safar <marek.safar@gmail.com>
1461 A fix for bug #82676 (Do I get it right now?)
1462 * convert.cs (Binary.ResolveOperator): An interface is converted to the
1463 object before a standard conversion is applied.
1465 2007-09-06 Marek Safar <marek.safar@gmail.com>
1467 * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
1470 2007-09-05 Marek Safar <marek.safar@gmail.com>
1472 A fix for bug #82676
1473 * convert.cs (ImplicitReferenceConversionCore): Check both sides for
1474 non-generic interface types.
1476 2007-09-05 Marek Safar <marek.safar@gmail.com>
1478 A fix for bug #82690
1479 * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
1481 2007-09-05 Marek Safar <marek.safar@gmail.com>
1483 A fix for bug #82571
1484 * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal
1485 modifier for container based methods.
1487 2007-09-05 Marek Safar <marek.safar@gmail.com>
1489 A fix for bug #82676
1490 * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
1491 any interface-type T means to any of interface type T.
1493 2007-09-04 Marek Safar <marek.safar@gmail.com>
1495 * namespace.cs: We have 2 versions of System.Core assembly.
1497 2007-09-04 Marek Safar <marek.safar@gmail.com>
1499 A fix for bug #82652
1500 * class.cs (Class.GetClassBases): Compare types and not expressions.
1502 2007-09-04 Marek Safar <marek.safar@gmail.com>
1504 A fix for bug #82620
1505 * expression.cs (Invocation.EmitArguments): Duplicate params arguments
1506 actually never worked before.
1507 (IndexerAccess): Emit prepared arguments before they are modified.
1509 2007-09-04 Marek Safar <marek.safar@gmail.com>
1511 A fix for bug #82563
1512 * assign.cs: Revert wrong fix.
1514 * expression.cs (VariableReference.EmitAssign): Handle ref reference
1516 (ArrayAccess): Changed the way we emit compound (prepared) assignments.
1517 Instead of ldelema/stdind we have to use temporary variables to handle
1518 cases like String.Concat (params string[]).
1520 2007-08-31 Marek Safar <marek.safar@gmail.com>
1522 * class.cs: EmitAttributes to Emit rename.
1524 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
1526 (MemberCore.HasClsCompliantAttribute): Don't depend on
1527 GetClsCompliantAttributeValue execution.
1529 2007-08-31 Marek Safar <marek.safar@gmail.com>
1531 * anonymous.cs: Use shorter type prefix.
1533 * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
1536 * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
1537 variables when probing is on.
1539 * statement.cs (LocaLInfo.Clone): Clone correctly resolved and
1540 unresolved variables.
1541 (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
1542 handle transparent identifiers.
1544 2007-08-26 Marek Safar <marek.safar@gmail.com>
1546 * attribute.cs (IsClsCompliant): Add nullable types test.
1548 2007-08-24 Atsushi Enomoto <atsushi@ximian.com>
1550 * doc.cs : catch other types of exception than XmlException to
1551 report CS1570. Fixed bug #82565.
1553 2007-08-23 Marek Safar <marek.safar@gmail.com>
1555 * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference):
1556 The number of delegate parameters has to match.
1557 (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
1560 2007-08-21 Marek Safar <marek.safar@gmail.com>
1562 * anonymous.cs (AnonymousMethod): Generate private anonymous method
1563 to fix problem with private arguments.
1565 2007-08-20 Marek Safar <marek.safar@gmail.com>
1567 * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
1569 * decl.cs (MemberName): Ignore generic type with no generic arguments.
1571 * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
1572 empty. Add cloning suport.
1574 * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
1576 2007-08-20 Marek Safar <marek.safar@gmail.com>
1578 * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method
1579 to create EmptyCast. It handles EmptyConstantCast specialization for
1582 2007-08-18 Marek Safar <marek.safar@gmail.com>
1584 * expression.cs (Binary.is_unsigned): Handle unsafe types too.
1585 (EmitArrayArgument): One routine for array arguments.
1586 (ArrayCreation.MakeByteBlob): Fixed an array alignment.
1588 2007-08-17 Marek Safar <marek.safar@gmail.com>
1590 * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
1592 2007-08-17 Marek Safar <marek.safar@gmail.com>
1594 * anonymous.cs: MemberLookupFinal update.
1596 * class.cs (ConstructorInitializer): Is expression based.
1598 * delegate.cs: MethodGroupExpr update.
1600 * ecore.cs (Error_MemberLookupFailed): Improved to report better error
1602 (Error_MemberLookupFailed): Customizable error override.
1603 (MethodGroupExpr): Keep queried type for later usage.
1604 (MethodGroupExpr.OverloadResolve): Catch errors related to overload
1607 * expression.cs: Error_MemberLookupFailed refactoring.
1608 (New.DoResolve): Resolve as much as possible.
1609 (ElementInitializer.Error_MemberLookupFailed): Object initializer
1610 customization for invalid member types.
1612 * statement.cs: MethodGroupExpr update.
1614 2007-08-16 Marek Safar <marek.safar@gmail.com>
1616 * modifier.cs (Check): Check all modifiers and not only accessibility
1619 2007-08-16 Marek Safar <marek.safar@gmail.com>
1621 * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
1622 type and not an expression.
1624 2007-08-16 Marek Safar <marek.safar@gmail.com>
1626 * statement.cs (Catch.Clone): Type and variable can be null.
1628 2007-08-16 Marek Safar <marek.safar@gmail.com>
1630 A fix for bug #81979
1631 * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
1632 I am really not sure whether this is the best fix.
1634 * expression.cs (VariableReference.EmitAssign): Do prepare_load test
1637 2007-08-14 Marek Safar <marek.safar@gmail.com>
1639 ** C# 3.0 Object and collection initializers (major re-write)
1641 * assign.cs (DoResolve): Initializers are not assign related.
1643 * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
1644 used during collection or object initialization.
1646 * expression.cs (Error_InvalidArguments): Add initializers specific
1647 messages. More will come later because it requires some general
1649 (New.DoResolve): Better error handling for unsafe types.
1650 (EmptyExpressionStatement): New class.
1651 (ElementInitializer): An object initializer expression.
1652 (CollectionElementInitializer): A collection initializer expression.
1653 (CollectionOrObjectInitializers): A block of object or collection
1655 (NewInitialize): New expression with element/object initializers.
1657 * statement.cs: Reverted object/collection initializer hacks.
1659 * typemanager.cs (CSharpName): Filter __arglist type.
1661 2007-08-09 Marek Safar <marek.safar@gmail.com>
1663 ** C# 3.0 Anonymous Types (update to the latest standard)
1665 * expression.cs (Binary.ResolveOperator): Threat all null based types
1667 (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
1668 (AnonymousTypeParameter): Updated.
1670 * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
1671 (AnonymousTypeClass): New anonymous type container.
1673 * class.cs (AddField): Return operation result.
1675 * generic.cs: Another empty TypeArguments overload.
1677 * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
1678 are stored at top of normal hierarchy.
1680 * typemanager.cs (CSharpName): Filter anonymous types.
1682 2007-08-09 Marek Safar <marek.safar@gmail.com>
1684 * expression.cs (StringConcat.Append): Handle 3 and more concatenation
1685 as single Concat call. How could we miss that :-(
1687 2007-08-08 Marek Safar <marek.safar@gmail.com>
1689 * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
1691 2007-08-07 Miguel de Icaza <miguel@novell.com>
1693 * expression.cs: Fix the previous commit, the creation of the
1694 arguments array list needs also to be conditional on the arguments
1697 * class.cs: Add a little bit of help to help narrow down problems.
1699 * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
1700 not try to copy in that case.
1702 * driver.cs: When building SMCS, include a new different set of
1703 default assemblies here. Do this here so we can control whether
1704 to include the default assemblies with /noconfig.
1706 2007-08-03 Marek Safar <marek.safar@gmail.com>
1708 A fix for bug #81979
1709 * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
1712 2007-08-03 Marek Safar <marek.safar@gmail.com>
1714 A fix for bug #82300
1716 * anonymous.cs (AnonymousContainer.Define): Don't define anything when
1717 we are in probing scope.
1719 2007-08-03 Marek Safar <marek.safar@gmail.com>
1721 A fix for bug #82301
1723 * statement.cs (Catch.CloneTo): Clone blocks in the right order.
1724 (Statement.CloneTo): Clone and not map children blocks.
1726 2007-08-03 Marek Safar <marek.safar@gmail.com>
1728 A fix for bug #82299
1730 * expression.cs (LocalVariableReference.CloneTo): Remap local info
1733 * statement.cs (Statement.CloneTo): Clone variables before statements
1734 to allow remaping of local variables.
1736 2007-08-03 Marek Safar <marek.safar@gmail.com>
1738 A fix for bug #82296
1741 * report.cs: Log crash details for future clone problems.
1743 * statement.cs (Return.Clone): Don't clone non-existent expression.
1745 2007-08-03 Raja R Harinath <harinath@gmail.com>
1747 * class.cs (TypeContainer.AddBasesForPart): Make virtual.
1748 (Class.AddBasesForPart): Move CS0537 check here from ...
1749 * cs-parser.jay (class_declaration): ... here. Move calling of
1750 'AddBasesForPart' to ...
1751 (class_bases): ... here.
1752 (struct_declaration, interface_declaration): Update to changes.
1754 2007-08-02 Marek Safar <marek.safar@gmail.com>
1756 A fix for bug #81923
1758 * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
1759 conversion is allowed.
1761 2007-08-02 Marek Safar <marek.safar@gmail.com>
1763 A fix for bug #81564
1765 * ecore.cs (EventExpr): Add IsBase handling.
1767 * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
1770 2007-08-02 Raja R Harinath <harinath@gmail.com>
1772 Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
1773 * cs-parser.jay: Some whitespace cleanups.
1774 (current_delegate): New.
1776 (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
1777 a dummy code block, and use 'type_name' instead of 'member_name'.
1778 (interface_declaration, class_declaration): Likewise.
1779 (delegate_declaration): Likewise. Rearrange slightly and use
1781 * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
1782 (GetKeyword): Update to change. Use '!foo' instead of 'foo == false'.
1784 2007-08-02 Marek Safar <marek.safar@gmail.com>
1786 A fix for bug #82039
1788 * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
1791 * typemanager.cs (CSharpName): Split to string overload.
1793 2007-08-02 Marek Safar <marek.safar@gmail.com>
1796 * report.cs: Updated warning CS0472.
1798 2007-08-01 Marek Safar <marek.safar@gmail.com>
1800 A fix for bug #82181
1802 * cs-tokenizer.cs: Ignore partial keyword inside block expression.
1804 2007-08-01 Marek Safar <marek.safar@gmail.com>
1806 A fix for bug #82277
1807 * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
1809 2007-08-01 Marek Safar <marek.safar@gmail.com>
1811 ** C# 3.0 Type Inference (major bits are working)
1813 * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
1814 (.ImplicitStandardConversionExists): Uses compatible.
1815 (.ExplicitTypeInference): Infers type arguments based on explicit arguments
1816 (.InferReturnType): New method.
1817 (.Compatible): Refactored.
1818 (.ResolveParameters): Uses factory to create resolved parameters.
1819 (.CompatibleMethod): Add probing mode support.
1820 (AnonymousContainer): Removed unused fields. Split Define and Resolve to
1821 clearly distinguish between 2 different operations.
1822 (LambdaMethod): Moved to lambda.cs.
1823 (AnonymousMethod): Removed unused fields and methods.
1824 (AnonymousDelegate): Simplified.
1826 * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
1828 * convert. cs (ImplicitConversionStandard): Compatible works differently.
1830 * delegate.cs (Delegate): New mehods to reduce code duplication.
1831 (.GetConstructor): New method.
1832 (.GetInvokeMethod): New method.
1833 (DelegateCreation): Updated.
1835 * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
1837 (OverloadResolve): Made probing little bit faster.
1839 * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
1842 * generic.cs (TypeInferenceContext): Dummy implementation.
1844 * iterators.cs: Updated after Resolve/Define rename.
1846 * lambda.cs (LambdaExpression)
1847 (.ResolveParameters): Handles both type of arguments and type inference too.
1849 * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
1850 (InflateTypes): Updated.
1852 * support.cs (InflateTypes): Changed signature and updated.
1854 * typemanager.cs (LookupMemberCache): Better dynamic type check.
1855 (MemberLookup_FindMembers): More MS tricks.
1856 (GetParameterData): Ditto.
1857 (GetDelegateParameters): Uses quick path for dynamic types.
1859 2007-08-01 Marek Safar <marek.safar@gmail.com>
1861 * class.cs (MethodData.Define): EmitContext is required for generic stuff
1864 2007-07-31 Marek Safar <marek.safar@gmail.com>
1866 * statement.cs (ProcessParameters): Don't crash when parameters have wrong
1869 2007-07-26 Jb Evain <jbevain@novell.com>
1871 * typemanager.cs (TypeManager.GetConstructor): Add a method overload
1872 which takes a boolean 'report_errors', similar to the GetMethod.
1873 (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
1874 in .net 2.1, do not report errors here.
1876 * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
1877 System.Runtime.CompilerServices.RequiredAttributeAttribute and
1878 System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
1881 * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
1882 of the type InternalsVisibleToAttribute before the first call
1883 to CoreLookupType which is allowed to fail (third boolean parameter
1884 to true). Because, during the resolution for a type that is not
1885 immediately found, we try to check if the type is not defined in
1886 a friend assembly, and to do so, we need the
1887 InternalVisibleToAttribute.
1889 2007-07-23 Miguel de Icaza <miguel@novell.com>
1891 * expression.cs (Binary): Add support for the brain-dead CSC 2.x
1892 feature that allows structs to be compared against null and inline
1893 the result as true or false.
1895 Notice that the same code is not permitted inside a generic block
1896 of code that would do:
1898 class Foo<T> where T : struct {
1905 It is only allowed if the type of T is not bound (no where
1906 clause). In my opinion, this CSC 2 behavior is broken but people
1907 seem to be using it (IronRuby does, a few bug reports on bugzilla
1908 have it and some people have complained about it).
1910 All of the users that depend on this behavior have code that is
1913 * report.cs (Warning, Error): make these take object arguments,
1914 not strings, as that allows us to take advantage of Format.
1916 2007-07-20 William Holmes <billholmes54@gmail.com>
1918 * decl.cs: Changed MemberName.CountTypeArguments to also check the
1919 Left member variable for the Count.
1920 * doc.cs: Changed DocUtil.GetMethodDocCommentName to call
1921 MemberName.CountTypeArguments to avoid a NRE.
1923 This code is contributed under the MIT X11 license
1925 2007-07-18 Marek Safar <marek.safar@gmail.com>
1927 * cs-tokenizer.cs: Improved lambda parsing and removed old code.
1929 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
1931 * doc.cs : generic method arguments are written as ``x while generic
1932 type arguments are `x. Combined with the previous change, fixed bug
1935 2007-07-18 Raja R Harinath <rharinath@novell.com>
1938 * expression.cs (Binary.ResolveOperator): When converting
1939 'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
1941 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
1943 * doc.cs : when T: or whatever x: is specified, it does not really
1944 check the doc comment's syntax correctness. Fixed bug #82006.
1946 2007-07-18 Marek Safar <marek.safar@gmail.com>
1948 * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
1949 LambdaExpression better.
1951 * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
1953 * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
1955 * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
1956 as it can be generated.
1958 * expression.cs (Invocation.Error_InvalidArguments): Show correct
1961 * lambda.cs (LambdaExpression): Refactored to share same code with
1962 AnonymousMethodExpression.
1964 2007-07-17 Marek Safar <marek.safar@gmail.com>
1966 * anonymous.cs (MakeName): Include host name for easier debugging.
1967 (LambdaMethod): New class for lambda spcecific stuff.
1969 * attribute.cs: Set EmitContext return type.
1971 * class.cs: Set EmitContext return type.
1973 * codegen.cs (EmitContext): Return type cannot be null to stop messing
1974 with null/void meaning.
1976 * iterators.cs (ContainerType): Implemented.
1978 * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
1980 * statement.cs (Return): Updated to lambda expressions.
1981 (Block.CloneTo): Parent can be null.
1983 2007-07-13 Marek Safar <marek.safar@gmail.com>
1985 A fix for bug #81917
1986 * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
1988 * class.cs (FixedField): Check whether field is in unsafe scope.
1990 * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
1991 (FieldExpr.Emit): Fixed buffers cannot be volatile.
1993 * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
1996 * statement.cs (Fixed.Resolve): Simplified fixed buffers.
1998 2007-07-13 Marek Safar <marek.safar@gmail.com>
2000 * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
2001 rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
2004 2007-07-13 Marek Safar <marek.safar@gmail.com>
2006 * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
2008 2007-07-13 Marek Safar <marek.safar@gmail.com>
2010 * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
2011 (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
2013 * codegen.cs(EmitContext): Add ProbingMode flag.
2015 * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
2017 * driver.cs: For now set both warning values.
2019 * ecore.cs (SimpleName): Name is readonly.
2020 (MethodGroup.OverloadResolve): One quick path for probing.
2022 * expression.cs (Unary): Set Oper r/o.
2023 (Binary): Set Oper r/o.
2024 (ParameterReference): Set few instance variables as r/o.
2025 (ParameterReference.DoResolveBase): Don't capture aruments when
2027 (Invocation.CloneTo): Fixed typo, looks easy, yeah.
2028 (Arglist): arguments are private.
2029 (SizeOf): type is private and r/o.
2030 (MemberAccess): arguments are private.
2032 * report.cs: Enhanced reporting on/off capabilities.
2034 * lambda.cs: Uses ec.IsInProbingMode.
2035 (ContextualReturn): Derives from return.
2037 * rootcontext.cs: For now set both warning values.
2039 * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
2041 (Return.Resolve): Don't die immediately.
2042 (Block.Resolve): Speed-up probing.
2043 (Block.CloneTo): Clone only child blocks.
2045 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
2047 * iterators.cs: reverted Miguel's latest change (r81925) as it
2048 breaks the build in System.
2050 2007-07-13 Miguel de Icaza <miguel@novell.com>
2052 * iterators.cs (Yield.CheckContext): Check for the iterator type
2053 also here as we can call into Yield even in codepaths that are not
2055 (MethodOrOperator is the only path that was checked).
2057 In addition to the standard check, use a more specific check for
2058 constructors to report a more verbose error.
2060 2007-07-12 Miguel de Icaza <miguel@novell.com>
2062 * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
2063 report the warning and continue
2065 * statement.cs (Using.EmitLocalVariableDecls): We were leaving
2066 values on the stack on the call to Emit. Use EmitStatement if
2067 possible, or using Emit + Pop if not possible. Fixes #82064
2069 2007-07-12 Raja R Harinath <rharinath@novell.com>
2071 * expression.cs (Invocation.IsApplicable): Reorganize slightly to
2072 avoid try...finally in some cases.
2074 2007-07-10 Marek Safar <marek.safar@gmail.com>
2076 * attribute.cs (Attribute.ResolveConstructor): Uses method group.
2078 * class.cs (ConstructorInitializer.Resolve): Use and keep method group
2079 instead of method. Re-use standard error handling.
2080 (ConstructorInitializer.Emit): Simplified.
2082 * delegate.cs: Updated after Invocation.EmitCall change.
2084 * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
2085 (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
2086 (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
2087 method and don't permanently changing input arguments.
2088 (MethodGroupExpr): Introduced resolved best_candidate, when method group
2089 is resolved it has one of the candidates is the best one which is later
2090 used to emit. Removed a few unused method.
2091 (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
2093 * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
2094 (Binary.ResolveOperator): Ditto.
2095 (ConditionalLogicalOperator.DoResolve): Ditto.
2096 (Invocation): Uses method group.
2097 (Invocation.DoResolve): Simplified.
2098 (Invocation.EmitCall): Removed useless is_static.
2099 (Invocation.Emit): Delegate to method group.
2100 (Invocation.EmitStatement): Simplified.
2101 (New): Uses method group.
2102 (MemberAccess.DoResolve): Don't destroy original expression.
2104 * statement.cs (ForEach.Resolve): Use null for no method arguments.
2106 2007-07-04 Marek Safar <marek.safar@gmail.com>
2108 * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
2111 * lambda.cs: Add custom error message type.
2113 2007-07-03 Marek Safar <marek.safar@gmail.com>
2115 * lambda.cs: Simplified little bit.
2117 * parameter.cs: Introduced ImplicitLambdaParameter.
2118 (Parameters.CreateFullyResolved): New factory instead of ctor.
2122 * delegate.cs: Updated parameter creation.
2124 2007-07-03 Marek Safar <marek.safar@gmail.com>
2126 * ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
2129 * generic.cs: Synchronized with gmcs.
2131 2007-07-03 Marek Safar <marek.safar@gmail.com>
2133 * class.cs (Indexer): Check return type as soon as possible.
2135 * cs-parser.jay: Initialize implicit_value_parameter_type for interface
2138 * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
2140 * expression.cs (Invocation.Error_InvalidArguments): Show type only.
2142 * parameter.cs (Parameter): Use expression type when it is available.
2144 * support.cs (ReflectionParameters.ParameterDesc): Show an extension
2145 method modifier for the first parameter only.
2147 2007-06-24 Marek Safar <marek.safar@gmail.com>
2149 A fix for bug #81938
2150 * typemanager.cs (ChangeType): Fixed couple of char conversions.
2152 * constant.cs: Tide up an exception message.
2154 2007-06-22 Marek Safar <marek.safar@gmail.com>
2156 * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
2157 an uninitialized variable is used.
2159 * expression.cs (LocalVariableReference.DoResolve): Ditto.
2161 2007-06-22 Marek Safar <marek.safar@gmail.com>
2163 * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
2164 not found error handling.
2166 * expression.cs (ArrayCreation): Removed redundant fields and little bit
2168 (ArrayCreation.ResolveArrayElement): To be ready to customization.
2169 (ArrayCreation.DoResolve): Simplified.
2170 (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
2171 its own resolve process.
2172 (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
2174 2007-06-20 Marek Safar <marek.safar@gmail.com>
2176 * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
2179 2007-06-20 Marek Safar <marek.safar@gmail.com>
2181 * cs-tokenizer.cs: Removed var related stuff.
2183 * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
2184 (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
2185 a type and a keyword at same time.
2187 * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
2190 * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
2191 implicitly typed arrays, more changes will follow.
2193 * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
2195 2007-06-19 Marek Safar <marek.safar@gmail.com>
2197 * ecore.cs (VarExpr): Removed Handled field.
2199 * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
2200 build-in assign functionality.
2201 (ForEach.Resolve): Removed all implicitly typed local variable code and
2203 (ArrayForeach.Resolve): Infer implicitly typed local variable here.
2204 (CollectionForeach.Resolve): Infer implicitly typed local variable here.
2206 2007-06-18 Marek Safar <marek.safar@gmail.com>
2208 * assign.cs: Removed implicitly typed local variable check.
2210 * expression.cs (LocalVariableReference.DoResolve): Add check for self
2211 referencing implicitly typed local variable.
2212 (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
2215 * statement.cs (Fixed): Removed unsupported implicitly typed local
2218 2007-06-15 Marek Safar <marek.safar@gmail.com>
2220 * decl.cs (MemberName): Moved all Unbound stuff to parser.
2222 2007-06-14 Marek Safar <marek.safar@gmail.com>
2224 A fix for bugs #81855 and #76274
2225 * attribute.cs (AttachTo): Always set owner for global attributes to
2228 * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
2231 * cs-parser.jay: Assembly and module attributes must precede all other
2232 elements except using clauses and extern alias declarations.
2234 2007-06-13 Marek Safar <marek.safar@gmail.com>
2236 A fix for bug #81748
2238 * expression.cs: More checks for non ISO-1 features.
2240 2007-06-12 Marek Safar <marek.safar@gmail.com>
2242 A fix for bug #81807
2243 * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
2244 present inside switch statement and it is required by nullable check.
2246 2007-06-12 Marek Safar <marek.safar@gmail.com>
2248 A fix for bug #81840
2249 * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
2250 when type matching fails.
2252 * namespace.cs: Tiny error message change.
2254 2007-06-12 Marek Safar <marek.safar@gmail.com>
2256 * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
2257 reporting. Added automatic property check.
2259 * class.cs: Updated after CheckAbstractAndExtern relocation.
2260 (AEventPropertyAccessor.GetSignatureForError): Customized.
2262 2007-06-11 Marek Safar <marek.safar@gmail.com>
2264 * class.cs (DefineBaseTypes): Base type can be undefined.
2266 * ecore.cs (TypeLookup): Minor refactoring.
2267 (DoResolveAsTypeStep): Removed redundant check.
2269 * namespace.cs (Lookup): Removed redundant check.
2271 * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal
2272 ResolveAsTypeTerminal step.
2273 (BootstrapCorlib_*): Simplified.
2274 (PopulateCoreType): Core types can be now external.
2276 2007-06-07 Marek Safar <marek.safar@gmail.com>
2278 * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
2280 (InferTypeArguments): Infers anonymous expression type arguments.
2281 (Compatible): Split to Compatible and InferTypeArguments.
2283 * lambda.cs: Updated.
2285 2007-06-08 Marek Safar <marek.safar@gmail.com>
2287 * anonymous.cs (AnonymousContainer): Marked as compiler generated.
2289 2007-06-07 Raja R Harinath <harinath@gmail.com>
2291 Fix #80477, cs0135-2.cs, cs0135-3.cs
2292 * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
2293 names to the "known" variables list.
2294 (Block.CheckInvariantMeaningInBlock): Handle the fact the
2295 parameter names are also "known".
2296 (Block.CheckError136): Remove.
2297 (ExplicitBlock.CloneTo): New. Set 'known_variables' in target to
2300 2007-06-07 Marek Safar <marek.safar@gmail.com>
2302 * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
2304 2007-06-06 Marek Safar <marek.safar@gmail.com>
2306 * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
2307 internal error not an user error.
2309 * expression.cs (IsApplicable): Refactored to make debugging easier.
2311 * support.cs: More tricks for non-mono runtimes.
2313 * typemanager.cs (CoreLookupType): Made public.
2314 (InitSystemCore): All linq specific stuff moved to linq.cs
2316 2007-06-05 Marek Safar <marek.safar@gmail.com>
2318 * typemanager.cs (CSharpSignature): One more missing build-in types
2320 More tricks for non-mono runtime.
2322 2007-06-05 Raja R Harinath <harinath@gmail.com>
2324 * statement.cs (Block.CheckError136_InParents): Remove.
2325 (Block.AddVariable): Use GetParameterInfo instead.
2326 (ToplevelBlock.ProcessArguments): Likewise.
2328 2007-06-04 Raja R Harinath <rharinath@novell.com>
2330 * statement.cs (ToplevelBlock.CloneTo): New. Copy over parameter
2332 (ToplevelBlock.GetParameterInfo): Split out of ...
2333 (ToplevelBlock.GetParameterRefernce): ... this.
2334 (ToplevelBlock.ParameterMap): Remove.
2335 * expression.cs (ParameterReference): Update to use
2336 ToplevelParameterInfo.
2338 * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
2341 * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
2342 * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
2344 * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
2345 (ToplevelBlock.ProcessParameters) ... here.
2346 (ToplevelBlock..ctor): Invoke it.
2348 * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
2351 * statement.cs (IKnownVariable): New interface.
2352 (LocalInfo): Implement it.
2353 (ToplevelParameterInfo): New class.
2354 (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
2355 (ExplicitBlock.GetKnownVariable): Likewise. Rename from
2356 GetKnownVariableInfo.
2358 2007-06-03 Raja R Harinath <harinath@gmail.com>
2360 Partly speed up CS0136 error checks.
2361 * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
2362 'recurse' parameter.
2363 (Block.DoCheckError136): Only check errors in parameters. Move
2364 local variable checks ...
2365 (Block.AddVariable): ... here, and ...
2366 (ToplevelBlock.ResolveMeta): ... here.
2368 2007-06-02 Raja R Harinath <harinath@gmail.com>
2370 * statement.cs (Block.IsChildOf): Remove.
2372 * statement.cs (Statement.Clone): Move special case code ...
2373 (Block.CloneTo): ... here.
2375 2007-05-29 Raja R Harinath <rharinath@novell.com>
2377 * statement.cs (ToplevelBlock.container): Remove field. It's
2378 redundant with 'Parent'.
2379 (ToplevelBlock.ContainerBlock): Remove accessor.
2380 (ToplevelBlock..ctor): Update to changes. Register anonymous
2381 child with parent here, ...
2382 * cs-parser.jay (end_anonymous): ... not here. Don't modify
2384 (start_anonymous): Don't save current_block.
2385 (top_current_block): Remove.
2387 * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
2388 (Block.Resolve): Update to changes.
2389 (Block..ctor): Move setting of "correct" 'Toplevel'
2390 and 'Explicit' fields to ...
2391 (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
2393 2007-05-27 Raja R Harinath <harinath@gmail.com>
2396 * statement.cs (Block.Implicit): Remove.
2397 (Block): Update to changes.
2398 * flowanalysis.cs: Likewise.
2400 Mildly speed up CheckInvariantMeaningInBlock
2401 * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
2402 Recursively call AddKnownVariable to all enclosing blocks.
2403 (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
2404 Remove recursive calls.
2405 (Block): Update to changes.
2407 New ExplicitBlock invariants
2408 * statement.cs (Block.Explicit): New field. It points to the
2409 immediately enclosing non-implicit block.
2410 (Block..ctor): Maintain the invariant.
2411 * cs-parser.jay: Take advantage of invariant.
2413 Introduce ExplicitBlock
2414 * statement.cs (ExplicitBlock): New.
2415 (ToplevelBlock): Derive from it.
2416 (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
2418 (Block.Implicit): Update to changes.
2419 * cs-parser.jay: Update to changes.
2422 * codegen.cs (EmitContext.IsLastStatement): Remove.
2423 * statement.cs (Block.DoEmit): Update to changes.
2425 2007-05-25 Raja R Harinath <rharinath@novell.com>
2427 * cs-parser.jay: Use 'start_block' and 'end_block' rather than
2428 modifying current_block directly.
2430 2007-05-23 Scott Peterson <lunchtimemama@gmail.com>
2432 * class.cs: Implemented automatic properties (C# 3.0)
2433 Thanks to Marek for the help.
2435 2007-05-23 Raja R Harinath <rharinath@novell.com>
2437 * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
2438 variable as assigned, note also that all its components are
2440 (MyBitVector.SetRange): New. Function to set multiple bits to true.
2442 2007-05-19 Marek Safar <marek.safar@gmail.com>
2444 * anonymous.cs, class.cs: Emit Compiler generated attribute when
2445 member is marked as compiler generated.
2447 * decl.cs (MemberCore): Refactored ModFlags into property.
2449 * modifiers.cs: Add new modifier (COMPILER_GENERATED).
2450 (Check): Check only accessibility modifiers.
2452 2007-05-18 Raja R Harinath <rharinath@novell.com>
2454 Track all assignable slots in one bit array
2455 * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
2456 (ToplevelBlock.ResolveMeta): Don't create a VariableMap. Move
2457 logic from VariableMap constructor here. Use the same 'offset'
2458 variable that's later used for computing offsets of local
2460 * flowanalysis.cs (UsageVector.parameters): Remove.
2461 (UsageVector): Update to changes.
2462 (VariableMap): Remove.
2464 Avoid creating ParameterMap in every block
2465 * statement.cs (Block.ParameterMap): Move ...
2466 (ToplevelBlock.ParameterMap): ... here.
2467 (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
2469 * flowanalysis.cs (FlowBranching.param_map): Remove.
2470 (FlowBranching.UsageVector): Update to changes.
2471 (FlowBranchingToplevel.CheckOutParameters): Likewise.
2473 * statement.cs (Block.CloneTo): Clone Toplevel field too.
2475 * expression.cs (ParameterReference): Distinguish between block
2476 where parameter was referenced and declared.
2478 2007-05-18 Marek Safar <marek.safar@gmail.com>
2480 * flowanalysis.cs, statement.cs: Put back improved error handling.
2482 2007-05-15 Scott Peterson <lunchtimemama@gmail.com>
2486 Imporved object and collection initialization (C# 3.0).
2488 2007-05-15 Marek Safar <marek.safar@gmail.com>
2490 A fix for bug #81380
2491 * expression.cs (Is.DoResolve): Only value types have constant `is'
2494 2007-05-15 Raja R Harinath <rharinath@novell.com>
2496 * statement.cs (ToplevelBlock.child): Remove.
2498 2007-05-15 Raja R Harinath <harinath@gmail.com>
2500 Rationalize ResolveMeta: refactoring
2501 (Block.ResolveMeta): Remove wrong or superfluous comments. Carve
2502 out constant handling code into ...
2503 (Block.DoResolveConstants): ... this.
2505 Rationalize ResolveMeta: kill local_map
2506 * statement.cs (Block.local_map, Block.LocalMap): Remove.
2507 (Block.AssignableSlots): New.
2508 (Block.ResolveMeta): Make protected. Don't create a VariableMap
2509 for locals -- move code from VariableMap here. Avoid unnecessary
2511 * flowanalysis.cs (FlowBranching.local_map): Remove.
2512 (FlowBranching..ctor): Use Block.AssignableSlots.
2513 (VariableMap): Remove unused constructors.
2515 2007-05-11 Raja R Harinath <rharinath@novell.com>
2517 * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
2519 2007-05-11 Marek Safar <marek.safar@gmail.com>
2521 * typemanager.cs (IsFriendAssembly): Should not be called for building
2524 2007-05-09 Marek Safar <marek.safar@gmail.com>
2526 * literal.cs (NullConstant): Print null in all cases.
2528 * expression.cs (Binary.ResolveOperator): Implemented delegate
2529 comparison based on C# 2.0 changes.
2531 2007-04-28 Scott Peterson <lunchtimemama@gmail.com>
2533 This code is contributed under the MIT X11 license
2535 The following enables support for several C# 3.0 language features:
2537 * cs-tokenizer.cs: Added support for the "var" keyword.
2539 * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
2540 Added VarExpr class to facilitate type inferencing.
2542 * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
2543 to support anonymous types.
2545 * assign.cs: Added support for type inferencing and initialization.
2547 * anonymous.cs: Added AnonymousClass class to enable anonymous types.
2549 * expression.cs: Added implicit array support to ArrayCreation.
2550 Added 5 types and 1 interface:
2552 IInitializable Implementing classes can inject initializing
2553 statements after object instantiation.
2555 Initializer Stores data for object initialization.
2557 AnonymousType An expression for anonymous types.
2559 AnonymousTypeParameter Stores data about an anonymous type's field.
2561 NewInitialize An expression for object initialization.
2563 CollectionInitialize An expression for collection initialization.
2565 * statement.cs: Added "var" keyword support to the foreach, using, and fixed
2568 2007-05-06 Marek Safar <marek.safar@gmail.com>
2570 A fix for bug #81500
2571 * cs-tokenizer.cs: Add special handling for coalescing operator.
2573 2007-05-06 Marek Safar <marek.safar@gmail.com>
2575 A fix for bug #81529
2576 * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
2577 its value from base class until it is redefined.
2579 2007-05-02 Raja R Harinath <rharinath@novell.com>
2581 Fix regression in cs0631-3.cs
2582 * cs-parser.jay (operator_declarator): Add opt_attributes to error
2583 fallback. Make error fallback catch more cases.
2585 2007-05-01 Miguel de Icaza <miguel@novell.com>
2587 * cs-parser.jay: Allow parameters in operator declarations to have
2590 2007-04-27 Miguel de Icaza <miguel@novell.com>
2592 * statement.cs (If.CloneTo): Only clone the FalseStatement if it
2595 * lambda.cs (ContextualReturn.Resolve): An expression is valid
2596 inside the ContextualReturn, it does not have to be an
2597 ExpressionStatement.
2599 2007-04-24 Miguel de Icaza <miguel@novell.com>
2601 * lambda.cs (ContextualReturn.Resolve): if the return type is not
2604 2007-04-23 Miguel de Icaza <miguel@novell.com>
2606 * anonymous.cs (AnonymousContainer): split the virtual Resolve
2607 method in two methods: ResolveNoDefine and Resolve.
2609 ResolveNoDefine will stop just after ResolveTopBlock has been
2612 Resolve will then continue by creating a method and issuing the
2613 call to method.Define ().
2615 (AnonymousMethod): Split and implement the new Resolve and
2616 ResolveNoDefine as well.
2618 * lambda.cs (LambdaExpression): Split the anonymous method
2619 resolution code into a separate routine (CoreCompatibilityTest)
2620 from DoCompatibleTest.
2622 (LambdaExpression.TryBuild): New method, this method tries to
2623 build the LambdaExpression with the given set of types to be used
2624 as the types for the various parameters of the lambda expression.
2626 If the compilation succeed with the given types, the infered type
2627 of the Anonymous method is returned, otherwise null is returned.
2629 2007-04-23 Marek Safar <marek.safar@gmail.com>
2631 A fix for bug #81414
2632 * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
2634 2007-04-22 Miguel de Icaza <miguel@novell.com>
2636 * cs-tokenizer.cs: Change various identifiers here from the
2637 camelCasing to the recommended Linux-like style for instance
2638 variables from the Coding Guidelines.
2640 2007-04-19 Martin Baulig <martin@ximian.com>
2643 (Convert.ImplicitReferenceConversionCore): Allow conversions from
2644 System.Enum to System.ValueType.
2646 2007-04-13 Martin Baulig <martin@ximian.com>
2648 Rewrote implicit reference conversions. We need to distinguish
2649 between implicit reference conversions (13.1.4) and implicit
2650 boxing conversions (13.1.5).
2652 According to the spec, there's an an implicit conversion
2653 "From a one-dimensional array-type S[] to IList<T> and base
2654 interfaces of this interface, provided there is an implicit
2655 reference conversion from S to T." Note that this does not
2656 include boxing conversions.
2659 (Convert.ImplicitTypeParameterBoxingConversion): New method.
2660 (Convert.ImplicitReferenceConversion): Split into
2661 ImplicitReferenceConversionCore() and
2662 ImplicitBoxingConversionExist().
2663 (Convert.ImplicitReferenceConversionExists): Use the new
2664 ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
2666 2007-04-12 Martin Baulig <martin@ximian.com>
2668 * convert.cs (Convert.ImplicitReferenceConversion): Move the
2669 `TypeManager.null_type' checks up to the top of the method.
2671 2007-04-11 Marek Safar <marek.safar@gmail.com>
2673 A fix for bug #81350
2674 * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
2677 2007-04-11 Martin Baulig <martin@ximian.com>
2679 * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
2680 Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
2681 to make this work for generic classes; fixes #79561.
2683 2007-04-11 Martin Baulig <martin@ximian.com>
2685 * expression.cs (As): Add support for nullable types; fixes #79371.
2687 2007-04-11 Martin Baulig <martin@ximian.com>
2689 * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
2690 `type.FullName' is null; fixes #80243.
2692 2007-04-11 Martin Baulig <martin@ximian.com>
2694 * expression.cs (Invocation.IsApplicable): Don't modify the method
2695 if type inference succeeded, but the method was not applicable.
2698 2007-04-10 Marek Safar <marek.safar@gmail.com>
2700 A fix for bug #81324
2701 * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
2702 internal and external namespaces containers.
2704 2007-04-10 Martin Baulig <martin@ximian.com>
2706 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
2707 TypeManager.DropGenericMethodArguments() so we also call
2708 IMethodData.SetMemberIsUsed() for generic methods. Fixes #80357.
2710 2007-04-10 Martin Baulig <martin@ximian.com>
2712 * iterators.cs (Iterator.CreateIterator): Don't crash if
2713 `method.ReturnType' is null. This happens if something went wrong
2714 while resolving that typ (we already reported an error in this case).
2716 2007-04-10 Martin Baulig <martin@ximian.com>
2718 * expression.cs (New.DoResolve): Don't call CheckComImport() on
2719 generic interfaces; report the CS0144 directly.
2721 2007-04-10 Martin Baulig <martin@ximian.com>
2723 * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
2724 `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
2726 2007-04-10 Martin Baulig <martin@ximian.com>
2728 * expression.cs (New.DoEmitTypeParameter): Fix #81109.
2730 2007-04-09 Raja R Harinath <rharinath@novell.com>
2733 * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
2734 * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
2737 * statement.cs (For.Resolve): If resolution fails, use
2740 2007-04-08 Marek Safar <marek.safar@gmail.com>
2742 * anonymous.cs (MakeName): Make faster and zero-based.
2743 (VerifyExplicitParameterCompatibility): Back to mode where generic
2744 parameter is ignored.
2745 (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
2747 * class.cs (EmitType): Method can emit another new method.
2749 * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
2751 * driver.cs: Updated.
2753 * lambda.cs: Reuse predefined empty parameters.
2755 * parameter.cs: Updated
2757 * support.cs: Implemented InflateTypes.
2759 * typemanager.cs (GetFullName): Don't use FullName as it can be null.
2760 (InitSystemCore): Introduced to isolate 3.0 dependencies.
2762 2007-04-03 Martin Baulig <martin@ximian.com>
2766 * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
2767 version of TypeManager.IsOverride() which also works with generic
2770 2007-04-03 Martin Baulig <martin@ximian.com>
2775 (Convert.ExplicitReferenceConversion): We need to cast when
2776 converting from IList<T> to S[].
2778 2007-04-01 Marek Safar <marek.safar@gmail.com>
2780 * decl.cs (FindExtensionMethods): Consider all candidates with same name
2783 * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
2785 2007-03-31 Marek Safar <marek.safar@gmail.com>
2787 * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
2788 argument and return type inferring.
2790 * codegen.cs (InferReturnType): Flag whether return can be inferred.
2791 (ReturnType): Turned to property.
2793 * statement.cs (Return): Implemented return type inferring.
2795 * support.cs (ReflectionParameters): Use local types if possible.
2797 2007-03-30 Raja R Harinath <rharinath@novell.com>
2799 * flowanalysis.cs (FlowBranching.Reachability): Remove.
2800 (FlowBranching.UsageVector): Update to changes.
2802 Prepare to kill 'Reachability'
2803 * flowanalysis.cs (UsageVector): Remove 'Reachability' from
2804 argument of constructor.
2806 2007-03-29 Raja R Harinath <rharinath@novell.com>
2808 Prepare to kill 'Reachability'
2809 * flowanalysis.cs (UsageVector.is_unreachable): New.
2810 (UsageVector): Update to maintain 'is_unreachable' in parallel to
2811 'reachability', and verify they're consistent.
2814 * expression.cs (New.EmitStatement): Handle type parameters here too.
2816 2007-03-29 Martin Baulig <martin@ximian.com>
2821 (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
2822 CompilerGeneratedClass.
2823 (ScopeInfo.EmitScopeInstance): Make this protected.
2824 (CapturedVariable.EmitInstance): Use `Ldarg_0' if
2825 `ec.CurrentAnonymousMethod.Scope == Scope'.
2827 * statement.cs (Block.ScopeInfo): Make this a property.
2829 2007-03-27 Raja R Harinath <harinath@gmail.com>
2831 Prepare to kill 'Reachability'
2832 * flowanalysis.cs (FlowBranching.Reachability): Make class private.
2833 (FlowBranching.UsageVector.Reachability): Remove property.
2834 (FlowBranching.UsageVector.IsUnreachable): New property.
2835 (FlowBranching.UsageVector.ResetBarrier): New.
2836 (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
2837 * codegen.cs, statement.cs: Update to changes.
2839 2007-03-27 Martin Baulig <martin@ximian.com>
2844 (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
2847 2007-03-26 Raja R Harinath <rharinath@novell.com>
2849 * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
2850 instead of TriState. Remove all mention of TriState.
2852 * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
2853 replaced by a boolean. Add boolean 'is_unreachable' field, check
2854 and maintain invariants.
2856 2007-03-25 Marek Safar <marek.safar@gmail.com>
2858 * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
2860 2007-03-25 Marek Safar <marek.safar@gmail.com>
2862 * expression.cs: Stop using obsolete 2.0 opcodes.
2864 2007-03-25 Marek Safar <marek.safar@gmail.com>
2866 * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
2867 one of the latests Martin's fixes.
2869 2007-03-23 Miguel de Icaza <miguel@novell.com>
2871 * expression.cs: On BigEndian systems, swap the bytes, temporary
2872 solution until we get a new bitconverter class.
2874 2007-03-23 Martin Baulig <martin@ximian.com>
2878 * decl.cs (MemberCache.AddMembers): Add generic methods both as
2879 "Method" and "Method`1". Normally, a cache lookup is done on the
2880 "Method" form (ie. without the generic arity), but this one makes
2881 lookups on the full form work as well.
2883 2007-03-22 Raja R Harinath <rharinath@novell.com>
2885 * flowanalysis.cs (Reachability): Reorganize slightly, and remove
2888 2007-03-20 Bill Holmes <billholmes54@gmail.com>
2890 Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
2891 ordered_member_list, to TypeBuilder to store members to be defined
2892 in the order they were parsed in.
2893 - ordered_explicit_member_list contains all properties indexers
2894 and methods that are defined as explicit implementation of an
2895 interface or base class.
2896 - ordered_member_list contains all properties indexers and methods
2897 that are not defined as explicit implementation of an interface
2900 Removed MethodArrayList and IndexerArrayList from TypeBuilder. The
2901 functionality in these removed classes has been replaced with
2902 ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and
2903 CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
2905 Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
2906 to CheckForDuplications inside GetMethod and SetMethod Define Method
2907 to handle method property and indexer name conflicts.
2911 All code is contributed under the MIT/X11 license.
2913 2007-03-20 Martin Baulig <martin@ximian.com>
2915 * class.cs (TypeContainer.Interfaces): Removed; they're now
2916 included in `TypeContainer.Types'.
2918 2007-03-20 Martin Baulig <martin@ximian.com>
2920 Fix #77963, #80314 and #81019. Added gtest-317, ..., gtest-320.
2922 * class.cs (TypeContainer.CreateType): New public method. This is
2923 now called before DefineType() to create the TypeBuilders.
2924 (TypeContainer.DefineType): Don't create the TypeBuilder here; it
2925 has already been created by CreateType().
2926 (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
2927 don't resolve our base classes here; this has been moved into
2928 DefineBaseTypes(). We're now called from CreateType().
2929 (TypeContainer.DefineBaseTypes): New private method; resolve our
2930 base classes here. We're now called from DefineType().
2933 (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
2934 our types first to create all the TypeBuilders. After that, call
2935 TypeContainer.DefineType() on all the types which'll resolve their
2936 base classes and setup the resolve order.
2938 2007-03-20 Martin Baulig <martin@ximian.com>
2940 * class.cs (TypeContainer.Enums): Removed; they're now included in
2941 `TypeContainer.Types'.
2943 2007-03-20 Martin Baulig <martin@ximian.com>
2946 (TypeContainer.DefineType): Don't call ResolveMembers() here.
2947 (TypeContainer.DoResolveMembers): Call DefineType() on our
2948 `compiler_generated' classes; moved here from DefineNestedTypes().
2951 (RootContext.ResolveTree): Call ResolveMembers() on all
2952 TypeContainer's in the `type_container_resolve_order'.
2954 2007-03-19 Marek Safar <marek.safar@gmail.com>
2956 * class.cs: Use corlib to handle InternalMethodImplAttribute.
2958 2007-03-17 Marek Safar <marek.safar@gmail.com>
2960 * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
2961 implementation flags.
2963 2007-03-17 Marek Safar <marek.safar@gmail.com>
2965 * class.cs: More optimizations for type parameters.
2967 2007-03-15 Marek Safar <marek.safar@gmail.com>
2969 * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
2971 * ecore.cs, parameter.cs: More common code for both corlibs.
2973 * typemanager.cs (IsGenericMethod): Simplified.
2975 2007-03-15 Raja R Harinath <rharinath@novell.com>
2977 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
2979 * statement.cs, iterators.cs, lambda.cs: Update to changes.
2981 * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
2982 unconditionally. Simplify explanation.
2983 (Try.Resolve, Using.Resolve): Likewise.
2985 2007-03-15 Martin Baulig <martin@ximian.com>
2989 * decl.cs (DeclSpace): If we're a partial class, use our
2990 `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
2992 2007-03-15 Raja R Harinath <rharinath@novell.com>
2994 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
2996 (FlowBranching.UsageVector): Update to changes.
2997 (FlowBranching.MergeSiblings): Likewise.
2998 * statement.cs: Likewise.
3000 2007-03-15 Martin Baulig <martin@ximian.com>
3005 (MemberCache): Added a special .ctor for type parameters.
3008 (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
3011 2007-03-09 Martin Baulig <martin@ximian.com>
3013 * enum.cs (Enum): Make this a TypeContainer.
3014 (EnumMember): Derive from `Const'.
3017 (Const.DoResolveValue): New protected virtual method; move most of
3018 the functionality of ResolveValue() here so we can override it in
3020 (Const.CreateConstantReference): Make this virtual.
3022 * class.cs (Kind): Add `Kind.Enum'.
3023 (TypeContainer.Emit): Don't emit the enums here; they're already
3024 in the `RootContext.typecontainer_resolve_order'.
3026 * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
3027 here; they're already in the `typecontainer_resolve_order'.
3029 * ecore.cs (EnumConstant.ConvertImplicitly): Add
3030 TypeManager.DropGenericTypeArguments().
3033 (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
3034 (TypeManager.IsEnumType): Likewise.
3035 (TypeManager.EnumToUnderlying): Likewise.
3036 (TypeManager.IsEqual): Add support for enums.
3038 2007-03-12 Raja R Harinath <rharinath@novell.com>
3040 * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
3041 DefaultParameterValueAttribute to be undefined, say if System.dll
3044 2007-03-11 Marek Safar <marek.safar@gmail.com>
3046 * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
3049 2007-03-10 Marek Safar <marek.safar@gmail.com>
3051 * class.cs, parameter.cs: Unified parameters verification.
3053 2007-03-08 Martin Baulig <martin@ximian.com>
3055 * cs-parser.jay (constructor_header): Pass the location to the
3056 newly created TopLevelBlock.
3058 2007-03-07 Martin Baulig <martin@ximian.com>
3060 * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
3062 2007-03-06 Miguel de Icaza <miguel@novell.com>
3064 * convert.cs (ExplicitReferenceConversionExists): Sync this method
3065 with the changes from David, fixes the build.
3067 2007-03-05 David Mitchell <dmitchell@logos.com>
3069 * convert.cs: Implement From System.Collecitons.Generic.IList<T>
3070 and its base interfaces to a one-dimensional array type S[],
3071 provided there is an implicit or explicit reference conversion
3074 2007-03-03 Marek Safar <marek.safar@gmail.com>
3076 * cs-tokenizer.cs: Implemented basic linq grammar.
3078 * driver.cs: Set linq lang version on demand.
3080 2007-02-26 Marek Safar <marek.safar@gmail.com>
3082 * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
3084 2007-02-25 Marek Safar <marek.safar@gmail.com>
3086 * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
3089 * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
3091 Check property and event extern attributes.
3093 * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
3096 2007-02-24 Marek Safar <marek.safar@gmail.com>
3098 A fix for bug #80407
3099 * ecore.cs: Don't report ambiguity error when methods have same parent.
3101 2007-02-23 Marek Safar <marek.safar@gmail.com>
3103 A fix for bug #80878
3104 * class.cs, cs-parser.jay: Event property can host anonymous methods.
3106 2007-02-22 Marek Safar <marek.safar@gmail.com>
3108 * attribute.cs: Enable ExtensionAttribute presence test.
3110 2007-02-22 Marek Safar <marek.safar@gmail.com>
3112 * class.cs: Warn about missing GetHashCode only when Equals is override.
3114 * decl.cs: Check accessibility of type arguments.
3116 * typemanager.cs: Correctly report nullable array.
3118 2007-02-20 Marek Safar <marek.safar@gmail.com>
3120 * class.cs, report.cs: Capture more details when things go wrong.
3122 2007-02-20 Marek Safar <marek.safar@gmail.com>
3124 A fix for bug #80650
3125 * cs-parser.jay: Anonymous container starts at constructor declaration
3126 and not at block beginning because it has to be usable in constructor
3129 * statement.cs: Use context location and not block one for error reporting.
3131 2007-02-18 Marek Safar <marek.safar@gmail.com>
3133 A fix for bug #78712
3134 * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
3137 2007-02-18 Marek Safar <marek.safar@gmail.com>
3139 A fix for bug #80493 by Atsushi Enomoto
3140 * cs-parser.jay: Ignore invalid attribute target.
3142 2007-02-18 Marek Safar <marek.safar@gmail.com>
3144 * cs-tokenizer.cs: Ignore '\0' as white space character.
3146 2007-02-17 Miguel de Icaza <miguel@novell.com>
3148 * cs-parser.jay: Add support for lambda expressions to the mcs
3151 * lambda.cs: Only clone when we are probing, not on the final call
3152 (Compatible is the final call).
3154 * statement.cs (CloneContext): Introduce class to provide block
3155 remapping during clone.
3157 All statements Clone themselves now.
3159 (Clone): special handling for blocks, when we clone a block, we
3160 register the block inside this routine, as children of the block
3161 might trigger a lookup.
3163 * expression.cs: Add support for CloneContext in all expressions.
3165 2007-02-17 Marek Safar <marek.safar@gmail.com>
3167 A fix for bug #80493
3168 * statement.cs: Report ambiguous warning when interfaces are not related.
3170 2007-02-15 Marek Safar <marek.safar@gmail.com>
3172 C# 3.0 extension methods.
3174 * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
3175 cannot be used directly.
3177 * class.cs (Class.Emit): Emit extension attribute if any class method
3178 is extension method.
3179 (Method.Define): Add basic extension method validation conditions.
3180 (Method.Emit): Emit extension attribute for method.
3182 * codegen.cs (AssemblyClass): Emit extension attribute if at least one
3183 extension method exists. Currently we follow same approach as Microsoft
3184 does, emit even if a method or a class are private but this can change
3187 * cs-parser.jay: Add handling of `this' keyword in method parameters
3190 * decl.cs (DeclSpace.IsStaticClass): New property.
3191 (MemberCache.FindExtensionMethods): Looks for extension methods with
3192 defined name and extension type.
3194 * doc.cs: Updated after OverloadResolve changes.
3196 * driver.cs: Add new soft reference to System.Core.dll.
3198 * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
3199 (ExtensionMethodGroupExpr): Represents group of extension methods.
3201 * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
3202 BetterFunction, IsOverride, IsAncestralType, OverloadResolve
3203 to MethodGroupExpr and made non-static for easier customization.
3204 (Invocation.DoResolve): Add extension method lookup when no standard
3206 (MemberAccess.DoResolve): Try extension methods if no member exists.
3208 * modifiers.cs: Add METHOD_EXTENSION modifier.
3210 * namespace.cs (RegisterExtensionMethodClass): Register class namespace
3211 as well as candidate extension type.
3212 (ComputeNamespaces): When assembly constains extension methods registers
3214 (Namespace.RegisterExternalExtensionMethodClass): Register type for later
3215 extension method lookup.
3216 (Namespace.LookupExtensionMethod): Looks for extension method in this
3218 (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
3219 find a method which matches name and extensionType.
3221 * parameter.cs (Parameter): Add This modifer.
3222 (HasExtensionMethodModifier): New property.
3223 (Resolve): Add extension parameter check.
3224 (ModFlags): turned to property to exclude this modifier as it is not real
3226 (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
3228 * support.cs (ParameterData): Add ExtensionMethodType.
3229 (ReflectionParameters): Implemented ExtensionMethodType interface property.
3231 * typemanager.cs: Add type and ctor extension attribute type.
3233 2007-02-15 Miguel de Icaza <miguel@novell.com>
3235 * report.cs (DisableErrors, EnableErrors): used to prevent error
3236 output when we are "trying" to compile various methods with
3239 * ecore.cs (Expression): Add Clone method that calls the virtual
3240 CloneTo method. The current CloneTo method in Expression throws
3241 an exception so we can track down all the places where this must
3242 be implemented (not using abstract, because that would be a lot of
3243 up-front-work before we can start testing the implementation
3246 Important: we only need Clone capabilities for expressions created
3247 by the parser, as the expressions we will be cloning are
3248 expressions in the pre-resolved state. This vastly simplifies
3251 (SimpleName): Add CloneTo that does nothing.
3252 (EmptyCast): Add CloneTo.
3254 * expression.cs (Binary): Implement CloneTo.
3255 (Invocation.IsApplicable): Store the current ec in
3256 EmitContext.TempEc and restore it on return. This is used so we
3257 do not have to sprinkle hundres of methods with an extra
3258 EmitContext, we know that the only user is the lambda expression
3259 ImplicitConversionExists code.
3261 (Argument): Add Cloning capabilities.
3262 (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
3263 Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
3264 ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
3265 UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
3266 IndexerAccess): Add Clone capability.
3268 (LocalVariableReference, This): TODO: needs cloned Block mapping.
3270 (Argument): Add cloning capability.
3272 * assign.cs (Assign): Implement CloneTo.
3274 * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
3276 * lambda.cs (ImplicitStandardConversionExists): Implement lambda
3277 version by calling Convert with the EmitContext (that we are
3278 currently storing in ec, this is not great, but will do for now,
3279 to avoid passing EmitContext parameters to hundreds of functions
3280 that do not need them now).
3282 (SetExpression): Remove, it is not needed.
3284 (ContextualReturn): Implement CloneTo.
3286 * statement.cs (Statement): Implement cloning infrastructure,
3287 similar to expressions.
3289 (Block): Partial implementation of Clone for statements.
3291 (Return): Implement clone.
3293 * constant.cs (Constant.CloneTo): New method, does nothing.
3295 * codegen.cs (TempEc): Add a static EmitContext as a temporary
3296 solution, until we decide how to exactly do this.
3298 2007-02-14 Marek Safar <marek.safar@gmail.com>
3300 A fix for bug #80493
3301 * class.cs (FindOutBaseMethod): When the base accessor does not exist and
3302 a property is override we need to use second accessor.
3304 2007-02-13 Marek Safar <marek.safar@gmail.com>
3306 A fix for bug #80418
3307 * attribute.cs, class.cs: Use correct calling conventions for pinvoke
3310 2007-02-13 Marek Safar <marek.safar@gmail.com>
3312 Another fix for bug #80749
3313 * pending.cs: Abstract class has priority over interfaces.
3315 2007-02-13 Marek Safar <marek.safar@gmail.com>
3317 Another fix for bug #80749
3318 * pending.cs: Abstract class has priority over interfaces.
3320 2007-02-13 Marek Safar <marek.safar@gmail.com>
3322 Another fix for bug #80749
3323 * pending.cs: Abstract class has priority over interfaces.
3325 2007-02-13 Marek Safar <marek.safar@gmail.com>
3327 Another fix for bug #80749
3328 * pending.cs: Abstract class has priority over interfaces.
3330 2007-02-13 Marek Safar <marek.safar@gmail.com>
3332 * class.cs Better error message.
3334 * driver.cs: Add shorter versions of -optimize option.
3336 2007-02-13 Martin Baulig <martin@ximian.com>
3338 * class.cs (Constructor.Emit): Check the return value of
3339 ec.ResolveTopBlock() and return on error.
3341 2007-02-13 Raja R Harinath <rharinath@novell.com>
3343 * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
3344 message to fix error message regression.
3346 2007-02-12 Marek Safar <marek.safar@gmail.com>
3348 * delegate.cs: Delegate creation expression cannot be of Nullable type.
3350 2007-02-12 Marek Safar <marek.safar@gmail.com>
3352 A fix for bug #80749
3353 * assign.cs (FieldInitializer): FieldInitializer has to keep track of
3354 its parent container.
3356 * class.cs (DefineFieldInitializers): Each initializer can has different
3359 * const.cs: Updated.
3361 2007-02-11 Miguel de Icaza <miguel@novell.com>
3363 * lambda.cs (LambdaExpression.Compatible): Remove some early code,
3364 now all the heavy lifting to check that embedded statements or
3365 expressions have the right form is done in the ContextualReturn.
3367 (ContextualReturn): New class.
3369 * ecore.cs (Error_InvalidExpressionStatement): Make a helper
3370 method that can be invoked to report 201, so we do not replicate
3373 * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
3375 * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
3376 treating tabs as spaces.
3378 2007-02-09 Marek Safar <marek.safar@gmail.com>
3380 A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
3381 * assign.cs: Use full implicit conversion for right side check.
3383 2007-02-09 Marek Safar <marek.safar@gmail.com>
3385 * statement.cs (Switch): Switch over boolean type is not standardized.
3387 2007-02-08 Marek Safar <marek.safar@gmail.com>
3389 A fix for bug #80755
3390 * decl.cs (FindBaseEvent): Don't use method cache for events.
3392 2007-02-07 Marek Safar <marek.safar@gmail.com>
3394 * cs-parser.jay: Better syntax error handling.
3396 * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
3397 instead of underlying type value.
3399 2007-02-06 Marek Safar <marek.safar@gmail.com>
3401 * driver.cs: Check define identifier before is registered.
3403 * namespace.cs: Use existing error message.
3405 * report.cs: New warning.
3407 2007-02-06 Marek Safar <marek.safar@gmail.com>
3409 A fix for bug #80742
3410 * expression.cs: Delegate Invoke method can be called directly.
3412 2007-02-06 Marek Safar <marek.safar@gmail.com>
3414 A fix for bug #80676
3415 * class.cs (IsEntryPoint): The Main method can have params modifier.
3417 2007-02-04 Miguel de Icaza <miguel@novell.com>
3419 * parameter.cs (Parameter, Parameters): Add Clone method.
3421 * anonymous.cs (Compatible): Turn method into virtual method, so
3422 LambdaExpression can implement a different behavior.
3424 (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
3425 out the basic checking here, so it can be used by
3428 * lambda.cs: Introduce "Compatible" function that will do the
3431 2007-02-02 Marek Safar <marek.safar@gmail.com>
3433 * attribute.cs: Unified one error message.
3435 * class.cs (Class): Use type attributes and not properties to test static
3437 (IsEntryPoint): Don's pass local variable.
3439 * convert.cs: Removed duplicate check.
3441 * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
3443 * driver.cs: Don't crash when soft reference does not exist.
3445 * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
3446 (UsingEntry): Removed redundant allocation.
3448 * parameter.cs: Add fast path for type parameters.
3450 * support.cs: Don't allocate attribute when it's not used.
3452 2007-01-30 Miguel de Icaza <miguel@novell.com>
3455 (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
3456 this into a virtual method, so we can override it in LambdaExpression.
3458 * driver.cs: Improve diagnostics in case of failure.
3460 * cs-tokenizer.cs: Instead of trying to parse a type and a name,
3461 write a function that is slightly more complex and that parses:
3463 type identifier [, type identifier]* )
3465 The old function would return incorrectly a OPEN_PARENS_LAMBDA for
3468 (canEmpty ? i >= 0 : i > 0)
3470 2007-01-30 Raja R Harinath <rharinath@novell.com>
3472 * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
3473 exception on possibly valid code.
3475 2007-01-29 Raja R Harinath <rharinath@novell.com>
3477 * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
3479 (parse_opt_type_arguments): Remove. It's almost the same as
3481 (parse_namespace_or_typename): Use parse_less_than.
3483 2007-01-28 Miguel de Icaza <miguel@novell.com>
3485 * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
3486 this bug took a few hours to find, because the state saved and
3487 restored by PushPosition and PopPosition was ignoring the state of
3488 parse_generic_less_than.
3490 I can also now remove the handling of OP_LT and OP_GT, this solves
3493 * cs-tokenizer.cs: store the location for the ARROW token, we use
3496 (PushPosition, PopPosition): save/restore also `current_token',
3497 restore `parse_generic_less_than' (was missing).
3499 (parse_opt_type_arguments): use parse_type, not
3500 parse_namespace_or_typename to parse types.
3502 * lambda.cs: Empty new file, will eventually have the lambda
3503 expression implementation.
3505 * lambda.test: used to test the internal tokenizer.
3507 * report.cs (FeatureIsNotISO1): Rename from
3508 FeatureIsNotStandardized, because it was about the language level
3509 (1 vs 2) it was not about standarization.
3511 (FeatureRequiresLINQ): New.
3513 * support.cs (SeekableStreamReader): Only require that the reader
3514 is a TextReader, not a StreamReader, so we can plug StringReader.
3516 * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
3517 given position in the input stream the following tokens can be
3518 parsed as a type followed by an identifier.
3520 (is_punct): after a '(' if parse_type_and_parameter returns true,
3521 then return a special token OPEN_PARENS_LAMBDA which is used to
3522 avoid reduce/reduce errors in the grammar for the
3523 lambda_expression rules.
3525 (parse_type): implement a type parser inside the
3526 tokenizer, the parser only returns true or false depending on
3527 whether the input at a given position can be parsed as a type.
3529 (peek_token): new method used during type parsing.
3531 2007-01-28 Raja R Harinath <rharinath@novell.com>
3534 * anonymous.cs (ScopeInfo.InflateParameters): New.
3535 (AnonymousContainer.Resolve): Use it to redirect types of
3536 delegate parameters.
3538 2007-01-27 Raja R Harinath <rharinath@novell.com>
3541 * expression.cs (Error_InvalidArguments): Don't use two different
3542 messages for CS1503. Use ExtraInformation and
3543 SymbolRelatedToPreviousError instead.
3546 * decl.cs (DeclSpace.initialize_type_params): Don't access
3547 'type_params' of a partial class directly.
3549 2007-01-26 Miguel de Icaza <miguel@novell.com>
3551 * constant.cs: Removed a handful of out-of-range checks that were
3554 2007-01-25 Marek Safar <marek.safar@gmail.com>
3556 * expression.cs (CheckUselessComparison): Add additional check for char
3559 * namespace.cs: Fixed typo.
3561 2007-01-23 Miguel de Icaza <miguel@novell.com>
3563 * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
3564 gone, instead we inline the test, preventing the needless casts to
3565 longs, ulongs and doubles for the parameters, avoiding calls to
3566 methods that overchecked stuff, and instead inlined things
3569 2007-01-20 Marek Safar <marek.safar@gmail.com>
3571 * cs-parser.jay: Better parameter error handling.
3573 2007-01-17 Marek Safar <marek.safar@gmail.com>
3575 A fix for bug #80368, #80522
3576 * expression.cs (ArrayCreation.only_constant_initializers): Indicates
3577 whether array initializer contains constants only.
3578 (ArrayCreation.Emit): Use better formula to decide when
3579 are array initializers for static initialization.
3580 (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
3581 have to emit even constants otherwise they are pre-initialized.
3583 2007-01-17 Bill Holmes <bill.holmes@ansys.com>
3584 Raja R Harinath <rharinath@novell.com>
3586 Fix emit order of 'get' vs. 'set'.
3587 * support.cs (Accessors): New.
3588 * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
3589 Note the order in which accessors are declared in the source.
3590 * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
3591 Refactored from Property.Define and Indexer.Define.
3592 (PropertyBase.DefineAccessors): New helper that calls the above in
3593 appropriate order as noted by the parser.
3594 (Property.Define, Indexer.Define): Update to changes.
3595 (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
3597 2007-01-17 Raja R Harinath <rharinath@novell.com>
3599 Fix cs0029-6.cs and gcs0029-2.cs (regression)
3600 * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
3601 there's an implicit conversion from the current type to the target
3602 type before converting the underlying constant.
3604 2007-01-16 Marek Safar <marek.safar@gmail.com>
3606 * const.cs (ResolveValue): Updated after constant conversion was made more
3609 * constant.cs (GetAttributableValue): constant to object conversion is
3610 used for attributes only.
3611 (IntConstant.ConvertImplicitly): Moved from convert to be used in all
3612 constant conversions.
3613 (LongConstant.ConvertImplicitly): Ditto.
3615 * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
3616 (ImplicitConversionStandard): Handle constant conversion as extra step.
3617 It solves the issue when constant conversion was called indirectly like
3618 inside array initializer and constant folding was skipped.
3620 * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
3623 * statement.cs(ImplicitConversionStandard): Updated after constant
3624 conversion was made more generic.
3626 2007-01-16 Sergey P. Kondratyev <se@unicom.tomica.ru>
3628 * expression.cs (As.DoResolve): Use GenericConstraints instead of
3629 Constraints, solves the problem where the compiler incorrectly
3630 reported that a type parameter was not constrained to a class (Bug
3633 2007-01-14 Marek Habersack <grendello@gmail.com>
3635 * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
3637 2007-01-14 Marek Safar <marek.safar@gmail.com>
3639 A fix for bug #80368
3640 * assign.cs (FieldInitializer): New class implements field
3641 initializer statement.
3643 * attribute.cs: Update after FieldMember rename.
3645 * class.cs (PropertyBasedMember): New common class for property based
3647 (InterfaceMemberBase): New base class for all members which can be used as
3648 an interface members.
3649 (MethodCore): Moved really common code to InterfaceMemberBase.
3650 (Method.Define): Equal and GetHasCode detection is relevant for methods
3652 (MethodData.Define): Don't assume that public event implements an
3653 interface automatically.
3654 (MethodData.DefineMethodBuilder): Issue an error even if only extern
3656 (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
3657 (FieldMember): Merged with FieldBase.
3658 (EventProperty.AEventPropertyAccessor): New specialization to check whether
3659 event extern modifier can be used.
3660 (EventField.EventFieldAccessor): Moved event field specific code here.
3661 (Event.AllowedModifiers): Even event can be extern.
3662 (Event.FindOutBaseMethod): New override specific to events.
3663 (Indexer.parameters): Reintroduce parameters because base class holds
3664 only properties common data.
3665 (Indexer.CheckForDuplications): Indexers are threated as methods so we
3666 need do extra parameters check.
3668 * const.cs: Update after FieldMember rename.
3670 * decl.cs (MemberCache.FindBaseEvent): New method.
3672 * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
3673 to reflect that indexer is now derived from PropertyBased.
3675 * ecore.cs (GetMemberType): Made public.
3676 (EventExpr.ResolveMemberAccess): Use right event cache and checks for
3679 * flowanalysis.cs, statement.cs: Update after FieldMember rename.
3681 * typemanager.cs (CSharpSignature): Correctly print event accessors.
3682 (RegisterEvent): Removed.
3683 (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
3684 (GetPrivateFieldOfEvent): Renamed to GetEventField.
3686 2007-01-11 Raja R Harinath <rharinath@novell.com>
3689 * statement.cs (CollectionForeach.TryType): Prefer generic
3690 GetEnumerator over non-generic variant. Fix code to follow comments.
3692 2007-01-09 Raja R Harinath <rharinath@novell.com>
3695 * support.cs (ReflectionParameter): Don't use an invalid index on
3696 the generic parameter data.
3698 2007-01-08 Miguel de Icaza <miguel@novell.com>
3700 * driver.cs: Just add a tiny bit of infrastructure.
3702 2007-01-02 Marek Safar <marek.safar@gmail.com>
3704 * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
3705 where field type is struct from current assembly.
3707 * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
3710 2007-01-02 Marek Safar <marek.safar@gmail.com>
3712 A fix for bug #80381
3713 * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
3716 * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
3718 (Namespace.LookupType): Always use core types from corlib when speficied.
3720 * report.cs: A new warning.
3722 * rootcontext.cs (BootstrapCorlib_ResolveInterface,
3723 BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
3724 (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
3726 * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
3727 (InitCoreTypes): Set expression type of object_type and value_type
3728 immediately after lookup.
3730 2007-01-01 Miguel de Icaza <miguel@novell.com>
3732 * cs-tokenizer.cs: Accept Pc class characters (Connector
3733 Punctuation) as valid identifiers. Fixes #78259
3735 * expression.cs (Invocation.DoResolve): Moved the check for the
3736 use of `this' for doing method calls to the Invocation resolution
3737 step, after overload resolution has taken place instead of doing
3738 the check at the low-level `This.DoResolve' level.
3740 The `This.DoResolve'(appens before overload resolution, so it has
3741 no way of knowing if the method that will be called will be
3742 instace or static, triggering an erroneous report for cs0188 (Bug
3745 We now do the check for instance method invocations after we know
3746 what method will be called.
3748 (This.CheckThisUsage): Move the actual use of this structure
3749 checking into its own method and expose it.
3751 * Everywhere that called Error_ValueCannotBeConverted: pass a new
3754 Exceptions: Null.ConvertImplicitly,
3755 Constant.ImplicitConversionRequired as there are too many call
3756 sites for passing the ec.
3758 * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
3759 EmitContext, if the value is null, then we do not try to provide
3760 the extra information from the error (If a userdefined conversion
3761 exists, as UserDefinedConversion requires a non null-EmitContext).
3765 2006-12-30 Raja R Harinath <rharinath@novell.com>
3767 * flowanalysis.cs (MyBitVector): Document some invariants.
3768 (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
3769 introduced below, and add a couple of others,
3771 2006-12-30 Marek Safar <marek.safar@gmail.com>
3773 * attribute.cs (GetMethodObsoleteAttribute): Uses new
3774 GetPropertyFromAccessor and GetEventFromAccessor.
3776 * class.cs (MethodCore.CheckBase): A new warning when obsolete member
3777 overrides non-obsolete one.
3778 (Indexer.Define): Error message has been moved to the parser.
3780 * cs-parser.jay: Better syntax errors handling.
3782 * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
3783 when an invocation has no arguments.
3785 * ecore.cs: Removed not used caching.
3787 * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
3790 * report.cs: Add a new warning.
3792 * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
3794 * typemanager.cs (enumeration_type): Removed.
3795 (CSharpSignature): Reuses IsSpecialMethod.
3796 (IsEqual): Hack for MS BCL.
3797 (GetPropertyFromAccessor): New method.
3798 (GetEventFromAccessor): New method.
3799 (IsSpecialMethod): Fixed to handle more cases.
3801 2006-12-30 Marek Safar <marek.safar@gmail.com>
3803 * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
3804 Made white spaces array static.
3806 * ecore.cs (RemoveGenericArity): Optimized.
3808 * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
3810 (MyBitVector.initialize_vector): Simplified.
3812 2006-12-22 Miguel de Icaza <miguel@novell.com>
3814 * ecore.cs: Am not entirely happy with this hack, but it seems to
3815 address the issue in 80257 (a small test case for
3818 I set the MethodGroupExpr.Type to an internal compiler type
3819 (itself in this case) to force the resolution to take place. Why
3820 it does not take place with a null is beyond me.
3822 2006-12-20 Marek Safar <marek.safar@gmail.com>
3824 A fix for bug #80288
3825 * expression.cs (ResolveOperator): Consider user defined conversion for
3826 logical and operator too.
3827 (EmitBranchable): Optimization for logical and when full constant folding
3828 could not be applied but one operand is constant.
3830 2006-12-19 Marek Safar <marek.safar@gmail.com>
3832 * class.cs (GetClassBases): Write 5 times every day, will never use
3833 FullName for error reporting.
3835 * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
3837 2006-12-19 Martin Baulig <martin@ximian.com>
3839 * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
3840 the symbol file info here.
3842 2006-12-18 Marek Safar <marek.safar@gmail.com>
3844 * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
3845 of `elseif' is taking then following sections are not taking.
3846 Fixes an issue reported on mono mailing list.
3848 2006-12-18 Marek Safar <marek.safar@gmail.com>
3850 A fix for bug #80300
3851 * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
3852 a caller is not taking.
3854 2006-12-18 Raja R Harinath <rharinath@novell.com>
3856 * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
3857 (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
3858 (RootScopeInfo, AnonymousMethodMethod): Update to changes.
3859 * iterator.cs: Change several TypeContainer declarations to DeclSpace.
3860 * class.cs: Update to changes.
3862 2006-12-17 Marek Safar <marek.safar@gmail.com>
3864 A fix for bug #79934
3865 * anonymous.cs (CompilerGeneratedClass): Register class in a shared
3868 * class.cs (ResolveMembers): Register an iterator in current container and
3871 2006-12-16 Raja R Harinath <rharinath@novell.com>
3874 * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
3875 satisfy a params annotated parameter.
3877 2006-12-16 Marek Safar <marek.safar@gmail.com>
3879 A fix for bug #77014
3880 * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
3881 paramters correctly and not rely on hacks in Parameters class.
3882 (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
3884 (Invocation.VerifyArgumentsCompat): Ditto.
3885 (Invocation.EmitArguments): Changed to correctly emit params arguments at
3888 * parameter.cs (HasParams): Don't assume that params is the last one.
3890 * support.cs (ReflectionParameters.ctor): Look for params attribute
3892 (ReflectionParameters.ParameterType): Removed hack when we returned last
3893 parameter for out of range parameters.
3894 (ParameterName, ParameterModifier): Ditto.
3896 2006-12-14 Marek Safar <marek.safar@gmail.com>
3898 A fix for bug #79987
3899 * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
3900 when assembly is not CLS compliant but type is. I have no idea why is this
3903 * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
3905 2006-12-13 Miguel de Icaza <miguel@novell.com>
3907 * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
3908 in struct constructors, they are basically no-ops.
3910 2006-12-12 Marek Safar <marek.safar@gmail.com>
3912 * cs-tokenizer.cs (Position): Save preprocessor status too.
3914 2006-12-12 Marek Safar <marek.safar@gmail.com>
3916 A fix for bug #77794
3917 * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
3919 2006-12-12 Marek Safar <marek.safar@gmail.com>
3921 * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
3923 (pp_expr): Report error for an invalid expression.
3924 (handle_preprocessing_directive): Simplified; add more error checking.
3926 2006-12-11 Marek Safar <marek.safar@gmail.com>
3928 A fix for bug #74939
3929 * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
3930 directives handling.
3932 2006-12-10 Marek Safar <marek.safar@gmail.com>
3934 A fix for bugs #80093, and #75984
3935 * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
3936 logic, it seems to me as it worked before "by coincidence".
3937 (xtoken): Simplified to use reworked handle_preprocessing_directive.
3938 (cleanup): Enabled endif check.
3940 2006-12-09 Marek Safar <marek.safar@gmail.com>
3942 A fix for bug #80162
3943 * statement.cs (CollectionForeach.TryType): Generics and non-generics
3944 enumerators are never ambiguous.
3946 2006-12-08 Raja R Harinath <rharinath@novell.com>
3949 * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
3951 2006-12-06 Marek Safar <marek.safar@gmail.com>
3953 A fix for bug #80144
3954 * class.cs (EventProperty.Define): Explicit implementation means
3955 that an even is used.
3957 2006-12-06 Marek Safar <marek.safar@gmail.com>
3959 Fixes the operators implementation (part II)
3961 * cfold.cs (DoConstantNumericPromotions): Renamed to
3962 DoBinaryNumericPromotions and simplified.
3963 (BinaryFold): Couple of conversion fixes; simplified.
3965 * constant.cs, ecore.cs, literal.cs
3966 (ToType): Renamed to ConvertImplicitly.
3967 (Reduce): Renamed to ConvertExplicitly.
3969 * class.cs, convert.cs: Updated.
3971 * expression.cs: TryReduce doesn't throw an exception.
3973 2006-12-01 Marek Safar <marek.safar@gmail.com>
3975 A fix for bug #80108
3976 * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
3979 2006-11-30 Marek Safar <marek.safar@gmail.com>
3981 Fixes unary operators implementation (part I)
3984 * cfold.cs (Error_CompileTimeOverflow): Made internal
3986 * const.cs (IConstant): Changed to use reference to constant and
3987 not constant itself.
3988 Updated IConstant implementations.
3990 * constant.cs (CreateConstant): New factory method.
3991 Updated IConstant implementation.
3993 * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
3995 * ecore.cs: Updated to use CreateConstantReference.
3997 * enum.cs: Reflects IConstant changes.
3999 * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
4001 * literal.cs (NullConstant): Change to be independently usable.
4003 2006-11-29 Martin Baulig <martin@ximian.com>
4005 * class.cs (Constructor.Emit): Correctly handle anonymous methods;
4006 we need to emit the scope initializer before calling the base .ctor.
4008 * anonymous.cs: Merged back from the new anonymous methods branch.
4009 (AnonymousMethodHost): Renamed to `RootScopeInfo'.
4011 * expression.cs (ParameterReference.DoResolveBase): Create a
4012 "normal" ScopeInfo when capturing parameters rather than using the
4013 root scope; this makes things work with anonymous methods having
4017 (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
4019 2006-11-22 Marek Safar <marek.safar@gmail.com>
4021 A fix for bug #79987
4022 * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
4023 check to a base class.
4024 * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
4025 only when assembly has missing attribute.
4026 * report.cs: Update.
4028 2006-11-21 Marek Safar <marek.safar@gmail.com>
4030 * cs-tokenizer.cs: Merged with gmcs version.
4032 2006-11-20 Marek Safar <marek.safar@gmail.com>
4035 * cs-parser.jay: Better error message when partial keyword is misplaced.
4037 2006-11-19 Gert Driesen <drieseng@users.sourceforge.net>
4039 A fix for bug #79810
4040 report.cs: CS1058 only applies to 2.0 profile (gmcs).
4041 codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
4042 a RuntimeWrappedException by default.
4044 2006-11-18 Marek Safar <marek.safar@gmail.com>
4046 A fix for bug #79843
4047 * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
4049 (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
4051 2006-11-18 Marek Safar <marek.safar@gmail.com>
4053 * driver.cs, namespace.cs: Uses faster IndexOf version.
4055 2006-11-17 Marek Safar <marek.safar@gmail.com>
4057 A fix for bug #79941
4058 * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
4060 (Operator.Define): Implicit/Explicit operator of same type is duplicate
4061 even if internal name is different.
4062 * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
4063 (UserDefinedConversion): Simplified as the operators cannot be internal.
4064 * ecore.cs (Error_ValueCannotBeConverted): Take account of user
4066 (MethodLookup): Replaced EmitContext with parentType.
4067 * expression.cs: Updated.
4069 2006-11-09 Raja R Harinath <rharinath@novell.com>
4071 * driver.cs (BadAssembly): Handle all the ugliness of
4072 DefineDynamicAssembly.
4074 2006-11-08 Raja R Harinath <rharinath@novell.com>
4076 Address parts of #58244 -- most of what's left is in the runtime
4077 * driver.cs (LoadAssembly): Simplify slightly. Add CS0009 and
4078 CS1509 error checks, and handle them for all assembly loads, not
4079 just the first invocation.
4080 (LoadModule): Likewise. Move handling of 'adder_method' ...
4081 * codegen.cs (AssemblyClass.AddModule): ... here.
4083 2006-11-02 Marek Safar <marek.safar@gmail.com>
4085 * statement.cs.cs (CollectionForeach.TryType): Issue a error when
4086 IEnumerable<T> is ambiguous.
4088 2006-10-31 Marek Safar <marek.safar@gmail.com>
4090 A fix for bug #67689
4091 * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
4092 GetEnumerator is ambiguous.
4094 * report.cs: Add new warning.
4096 2006-10-29 Marek Safar <marek.safar@gmail.com>
4098 A fix for bug #78602
4099 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
4100 to protected member can be nested type.
4102 2006-10-28 Marek Safar <marek.safar@gmail.com>
4104 A fix for bug #78965
4105 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
4106 to protected member must derive from current type.
4108 2006-10-27 Marek Safar <marek.safar@gmail.com>
4110 assign.cs: Reuses error method.
4112 ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
4113 instead of type for constants.
4114 (Expression.Error_ValueAssignment): Common error method.
4116 * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
4119 2006-10-27 Marek Safar <marek.safar@gmail.com>
4121 A fix for bug #79081
4122 * expression.cs (MemberAccess.DoResolve): Check nested type
4125 2006-10-27 Atsushi Enomoto <atsushi@ximian.com>
4127 * doc.cs : nested delegates were not handled. Fixed bug #79754.
4129 2006-10-26 Marek Safar <marek.safar@gmail.com>
4131 A fix for bug #76591
4132 * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
4134 2006-10-26 Marek Safar <marek.safar@gmail.com>
4136 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
4137 type forwarder of the same type multiple times.
4139 2006-10-26 Raja R Harinath <rharinath@novell.com>
4142 * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
4143 instance as an rvalue, even when we later resolve as an lvalue.
4145 2006-10-25 Martin Baulig <martin@ximian.com>
4147 * anonymous.cs: Fix #79673.
4149 2006-10-24 Marek Safar <marek.safar@seznam.cz>
4151 A fix for bug #79666
4152 expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
4153 ignored when is optimized (= default value) as its value is already set.
4155 2006-10-23 Marek Safar <marek.safar@seznam.cz>
4157 A fix for bug #79724
4158 * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
4159 TypeContainer for type lookup.
4161 2006-10-23 Marek Safar <marek.safar@seznam.cz>
4163 A fix for bug #79231
4164 * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
4165 * expression.cs (OverloadResolve): Always convert type name for
4167 (ResolveNamespaceOrType): Don't confuse a nested type with any
4170 2006-10-18 Martin Baulig <martin@ximian.com>
4172 * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
4174 2006-10-17 Miguel de Icaza <miguel@novell.com>
4176 * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
4177 an int32, but requesting an int64 from the conversion
4179 2006-10-12 Martin Baulig <martin@ximian.com>
4182 (AnonymousContainer.Resolve): Inflate the `ReturnType'. Fixes #79592.
4184 2006-10-12 Martin Baulig <martin@ximian.com>
4187 (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
4189 2006-10-11 Miguel de Icaza <miguel@novell.com>
4191 * convert.cs: Remove broken code: I was doing the "Existance"
4192 tests for Implicit conversions.
4194 2006-10-10 Miguel de Icaza <miguel@novell.com>
4196 * convert.cs: Added one missing case in
4197 ImplicitStandardConversionExists uint64 to intptr.
4201 * typemanager.cs (uintptr_type): another core known type.
4203 * ecore.cs (OperatorCast): routine used to do cast operations that
4204 depend on op_Explicit. We could change some of the Decimal
4205 conversions to use this.
4207 This one has a probe mechanism that checks both types for an op_
4208 which it coudl be used to eliminate two classes: CastToDecimal
4209 and CastFromDecimal.
4211 * convert.cs: Implement the conversions documented in #59800
4213 2006-10-10 Martin Baulig <martin@ximian.com>
4215 * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
4216 before RootScope.ResolveMembers().
4218 * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
4219 `CurrentType' if appropriate.
4221 2006-10-09 Marek Safar <marek.safar@seznam.cz>
4223 A fix for bug #78568
4224 * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
4225 when contains binary operators.
4226 * cs-parser.jay: Updated.
4228 2006-10-09 Martin Baulig <martin@ximian.com>
4231 (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
4232 moved that into Define() and also do the other type parameter
4233 checks there. Fixes #79094. Added gtest-292.cs.
4236 (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
4237 since that doesn't include type parameters; don't use `Ldelema'
4238 for type parameters. Fixes #78980. Added gtest-293.cs.
4240 2006-10-08 Marek Safar <marek.safar@seznam.cz>
4243 * convert.cs (ExplicitReferenceConversion): Only enum to enum value
4244 conversion is allowed.
4246 2006-10-06 Marek Safar <marek.safar@seznam.cz>
4248 * ecore.cs (Expression.MemberLookup): Don't register any symbol for
4249 error reporting when no error occurs.
4251 2006-10-06 Marek Safar <marek.safar@seznam.cz>
4253 * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
4256 2006-10-06 Raja R Harinath <rharinath@novell.com>
4259 * class.cs (DefineTypeBuilder): Check circular dependencies before
4260 setting the parent of the TypeBuilder.
4261 (CheckRecursiveDefinition): Don't use 'BaseType', since
4262 it may not be valid until after DefineTypeBuilder. Use
4263 'base_type' instead.
4265 2006-10-04 Martin Baulig <martin@ximian.com>
4267 Merged the Anonymous Methods patch.
4269 * anonymous.cs, iterators.cs: The new anonymous methods code.
4271 * statement.cs (Variable): New public abstract class.
4272 (LocalInfo.Variable): New public property.
4273 (LocalInfo.ResolveVariable): New public method.
4274 (Block.Flags): Add `IsIterator'.
4275 (Block.AddVariable): Improved the CS0136 check.
4276 (Block.AnonymousChildren): New public property.
4277 (Block.AddAnonymousChild): New public method.
4278 (ToplevelBlock): Update to use the new anonymous method framework.
4279 (ToplevelBlock.ctor): `container' is now a `Block' and not a
4280 `ToplevelBlock'; this is required to correctly implement the
4282 (Fixed, Using): Use `TemporaryVariable' instead of directly
4283 creating the `LocalBuilder'.
4285 * parameter.cs (Parameter.ResolveVariable): New public method.
4286 (Parameters.ResolveVariable): Likewise.
4288 * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
4290 * class.cs (TypeContainer): Replaced the `iterators' list and
4291 corresponding methods with a list of `CompilerGeneratedClass'es.
4292 (TypeContainer.ResolveMembers): New public method.
4293 (Method): `IIteratorContainer' has been replaced by
4296 * expression.cs (VariableReference): New public abstract base
4297 class for `LocalVariableReference', `ParameterReference' and
4300 * codegen.cs (EmitContext): Removed `capture_context',
4301 `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
4302 (EmitContext.EmitThis): Removed.
4304 * cs-parser.jay: Replace `iterator_container' with
4307 2006-10-04 Martin Baulig <martin@ximian.com>
4309 * generic.cs (GenericMethod): Don't make this abstract.
4310 (Constraints.Clone): Added dummy implementation.
4312 2006-10-04 Raja R Harinath <harinath@gmail.com>
4315 * namespace.cs (LookForAnyGenericType): Avoid nullref on
4316 'declspaces'. Avoid allocating arrays willy-nilly.
4319 * cfold.cs (BinaryFold): Move boolean Equality and Inequality
4320 cases out of the switch.
4322 2006-09-28 Marek Safar <marek.safar@seznam.cz>
4324 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
4325 message when non-generic type is used with the type arguments.
4326 * expression.cs: Updated.
4328 2006-09-28 Raja R Harinath <rharinath@novell.com>
4331 * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
4332 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
4333 Change semantics slightly. Don't insist on having only one
4334 temporary EmptyExpression -- just throttle the creation of new ones.
4337 * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
4338 non-interfaces too. If no methods are found, don't try to create
4341 2006-09-28 Marek Safar <marek.safar@seznam.cz>
4343 * ecore.cs (ResolveAsTypeStep): Print better error when type can be
4346 * namespace.cs (Namespace.LookForAnyGenericType): New method to help
4347 us produce better error message.
4349 2006-09-27 Marek Safar <marek.safar@seznam.cz>
4351 * expression.cs (Binary.ResolveOperator): Warn about a side effect
4352 of the `|' operator.
4354 * report.cs: A new warning added.
4356 2006-09-27 Martin Baulig <martin@ximian.com>
4358 * generic.cs (GenericMethod): Don't make this abstract.
4360 2006-09-27 Martin Baulig <martin@ximian.com>
4363 (InternalErrorException): Added overloaded ctor taking a params array.
4365 2006-09-26 Marek Safar <marek.safar@seznam.cz>
4367 * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
4368 Fixed the cases when same error was reported twice.
4370 * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
4371 now report symbol information.
4373 2006-09-25 Martin Baulig <martin@ximian.com>
4375 * class.cs: Completely unified with the gmcs version.
4377 2006-09-25 Martin Baulig <martin@ximian.com>
4379 * typemanager.cs (TypeManager.IsNullableType): New public function.
4380 (TypeManager.IsNullableTypeOf): Likewise.
4381 (TypeManager.IsNullableValueType): Likewise.
4383 * class.cs (MethodCore): Added the `GenericMethod' argument from
4384 gmcs and also unified all classes derived from `MethodCore' with gmcs.
4386 2006-09-24 Raja R Harinath <harinath@gmail.com>
4388 * convert.cs: Unify with gmcs version.
4390 2006-09-24 Marek Safar <marek.safar@seznam.cz>
4392 * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
4393 verify them as well.
4395 * report.cs: New warning.
4397 2006-09-24 Marek Safar <marek.safar@seznam.cz>
4399 * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
4400 for anonymous block with out argument.
4402 2006-09-24 Marek Safar <marek.safar@seznam.cz>
4404 * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
4405 not used private events only.
4407 2006-09-23 Marek Safar <marek.safar@seznam.cz>
4409 * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
4411 * const.cs (Const.Define): Check for constant type.
4412 (Const.IsConstantTypeValid): Looks for valid constant types.
4414 * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
4416 * ecore.cs (EmptyConstantCast): New common class for all constant based
4419 * expression.cs (Is.DoResolve): Handle null constant especially.
4420 (New.DoResolve): Check for new void().
4421 (MemberAccess.DoResolve): Cope with all kind of nulls.
4423 * literal.cs (NullConstant): Uses EmptyConstantCast.
4424 (NullDefault): Based on EmptyConstantCast.
4425 (NullLiteral): Uses EmptyConstantCast.
4427 * statement.cs (Block.ResolveMeta): Check for constant type.
4429 2006-09-22 Martin Baulig <martin@ximian.com>
4431 * delegate.cs, attribute.cs: Merged with the gmcs versions.
4433 2006-09-22 Raja R Harinath <rharinath@novell.com>
4435 * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
4439 * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
4440 * decl.cs (DeclSpace.FindMemberToOverride): Likewise. Reorganize
4443 2006-09-22 Martin Baulig <martin@ximian.com>
4445 * ecore.cs: Merged with the gmcs version.
4447 * generic.cs (ConstructedType): New dummy class.
4448 (TypeArguments): Don't make this abstract.
4451 (TypeManager.IsGenericTypeDefinition): New method.
4452 (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
4454 2006-09-22 Raja R Harinath <rharinath@novell.com>
4456 * expression.cs (ComposedCast): Check for arrays of TypedReference
4457 before creating the type, not after.
4459 2006-09-21 Marek Safar <marek.safar@seznam.cz>
4461 * cfold.cs, const.cs, enum.cs, statement.cs: Updated
4462 after ToType change.
4464 * constant.cs (Constant.ImplicitConversionRequired): Designed to used
4465 when constant must be implicitly convertible.
4467 * convert.cs (ImplicitReferenceConversion): Reuse ToType.
4469 * ecore.cs (NullCast): Derives from NullConstant.
4471 * expression.cs (Is.DoResolve): Removed useless variables.
4472 (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
4473 (New.Constantify): Add enum support.
4474 (MemberAccess.DoResolve): Add warning when accessing null constant or
4477 * generic.cs (GenericConstraints.IsReferenceType): Another dummy
4480 * literal.cs (NullConstant): New abstract class with common
4481 functionality for all null specializations.
4482 (NullDefault): Represents default(X) when result can be
4484 (NullLiteral): Updated.
4486 * report.cs: Add new warning.
4488 2006-09-21 Martin Baulig <martin@ximian.com>
4490 * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
4492 2006-09-21 Martin Baulig <martin@ximian.com>
4494 * generic.cs (GenericConstraints): New dummy class.
4495 (Constraints): Likewise.
4496 (TypeParameter): Likewise.
4497 (TypeParameterName): Likewise.
4498 (GenericMethod): Likewise.
4500 * typemanager.cs (TypeManager.GetGenericArguments): New method.
4502 * decl.cs: Merged with the gmcs version.
4504 2006-09-21 Raja R Harinath <rharinath@novell.com>
4506 * generic.cs (TypeParameter): Implement IMemberContainer.
4507 (GenericTypeParameterBuilder): New. An abominable repugnant hack.
4509 * rootcontext.cs: Unify with gmcs version.
4511 * report.cs: Unify with gmcs version.
4512 * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
4513 from gmcs/generics.cs.
4514 * generics.cs (TypeParameter): New dummy class.
4516 * support.cs: Unify with gmcs version.
4518 2006-09-20 Raja R Harinath <rharinath@novell.com>
4520 * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
4521 * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
4523 * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
4524 * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
4525 * mcs.exe.sources: Add generic.cs.
4527 * codegen.cs: Unify with gmcs version.
4529 * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
4530 (EmitContext): Add GenericDeclContainer implementation.
4531 * decl.cs (MemberCore, DeclSpace): Likewise.
4532 * namespace.cs: Remove #ifdef GMCS_SOURCE.
4534 * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
4535 MCS TypeManager has a corresponding dummy method.
4537 2006-09-19 Martin Baulig <martin@ximian.com>
4539 * expression.cs: Completely merged with the gmcs version.
4541 2006-09-19 Martin Baulig <martin@ximian.com>
4543 * expression.cs (Invocation): Merged with the gmcs version.
4544 (ArrayAccess.GetStoreOpcode): Likewise.
4546 2006-09-19 Martin Baulig <martin@ximian.com>
4549 (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
4550 (TypeManager.IsGenericMethodDefinition): Likewise.
4552 2006-09-19 Martin Baulig <martin@ximian.com>
4555 (TypeManager.IsEqual): Moved the gmcs implementation here.
4556 (TypeManager.DropGenericTypeArguments): Likewise.
4557 (TypeManager.DropGenericMethodArguments): Likewise.
4558 (TypeManager.GetTypeArguments): Moved here from gmcs.
4559 (TypeManager.HasGenericArguments): Likewise.
4561 2006-09-19 Martin Baulig <martin@ximian.com>
4563 * expression.cs (Binary): Merged with the gmcs version.
4565 2006-09-19 Martin Baulig <martin@ximian.com>
4567 * expression.cs (Probe, As, Is): Merged with the gmcs version.
4569 2006-09-19 Martin Baulig <martin@ximian.com>
4571 * typemanager.cs: Merged with the gmcs version.
4573 2006-09-16 Raja R Harinath <rharinath@novell.com>
4575 * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
4576 * driver.cs: Likewise.
4578 2006-09-16 Marek Safar <marek.safar@seznam.cz>
4581 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
4582 only if parent type is class.
4583 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
4586 2006-09-15 Marek Safar <marek.safar@seznam.cz>
4589 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
4591 * typemanager.cs(CSharpName): Converts NullType to null.
4593 2006-09-15 Martin Baulig <martin@ximian.com>
4596 (TypeManager.GetMethodName): Added mcs implementation.
4597 (TypeManager.IsEqual): Likewise.
4600 (SimpleName.RemoveGenericArity): Added dummy implementation.
4602 * pending.cs: Merged with the gmcs version.
4604 2006-09-15 Martin Baulig <martin@ximian.com>
4606 * statement.cs: Merge with the gmcs version.
4608 2006-09-15 Martin Baulig <martin@ximian.com>
4610 * statement.cs (Switch): Merge with the gmcs implementation
4611 (without nullables), which is newer.
4613 2006-09-15 Martin Baulig <martin@ximian.com>
4615 * statement.cs (Block.Variables): Make this public.
4616 (ToplevelBlock.Parameters): Make this a property.
4617 (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
4619 2006-09-15 Martin Baulig <martin@ximian.com>
4621 * namespace.cs: Merge with the gmcs version.
4623 2006-09-15 Martin Baulig <martin@ximian.com>
4625 * decl.cs (MemberName): Minor code cleanups.
4627 2006-09-15 Martin Baulig <martin@ximian.com>
4629 * parameter.cs: Merge with the gmcs version.
4631 2006-09-15 Martin Baulig <martin@ximian.com>
4633 * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
4634 and an error in mcs.
4636 2006-09-15 Martin Baulig <martin@ximian.com>
4638 * flowanalysis.cs: Merged from GMCS; added the generics code into
4639 a `GMCS_SOURCE' conditional so we can share this file.
4641 2006-09-08 Martin Baulig <martin@ximian.com>
4643 * typemanager.cs (TypeManager.interlocked_type): New public field.
4644 (TypeManager.int_interlocked_compare-exchange): New public field.
4645 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
4646 enumerator types here and call InitGenericCoreTypes().
4647 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
4648 after calling InitEnumUnderlyingTypes().
4651 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
4652 `classes_second_stage'.
4654 2006-09-14 Marek Safar <marek.safar@seznam.cz>
4656 * assign.cs, ecore.cs, expression.cs: Share error message text.
4657 * class.cs (FieldMember.Define): Check for varible of static type.
4658 * driver.cs (LoadAssembly): Uses error output for errors.
4659 * statement.cs: Updated.
4661 2006-09-08 Marek Safar <marek.safar@seznam.cz>
4663 * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
4666 2006-09-07 Martin Baulig <martin@ximian.com>
4669 (MainDriver): Revert r62663 from Marek; see #70506 for details.
4671 2006-08-29 Miguel de Icaza <miguel@novell.com>
4673 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
4675 2006-08-17 Miguel de Icaza <miguel@novell.com>
4677 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
4678 #52019 and #79064, the use of the \uXXXX sequence in source code
4679 to represent unicode characters.
4681 2006-08-15 Marek Safar <marek.safar@seznam.cz>
4683 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
4685 * class.cs, ecore.cs, statement.cs: Merged to one error message.
4687 2006-08-13 Miguel de Icaza <miguel@novell.com>
4689 * assign.cs: Catch attempts to assign to a method groups in += and
4692 2006-08-13 Marek Safar <marek.safar@seznam.cz>
4695 * cs-parser.jay: Don't destroy current array type by typeof of array's.
4697 2006-08-12 Marek Safar <marek.safar@seznam.cz>
4699 * class.cs (Method.Define): Issue a warning when generic method looks like
4701 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
4704 2006-08-09 Marek Safar <marek.safar@seznam.cz>
4706 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
4708 * decl.cs (MemberCache.FindMembers): When container is interface we need to
4709 search all base interfaces as a member can be ambiguous.
4710 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
4711 Constructor member type filter.
4712 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
4713 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
4714 reporting for returned memberinfos.
4715 * report.cs: Updated.
4716 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
4717 version to work on all runtimes.
4718 (TypeManager.RealMemberLookup): Removed members filtering.
4720 2006-08-08 Raja R Harinath <rharinath@novell.com>
4722 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
4723 (PropertyExpr.EmitAssign): Likewise.
4724 * expression.cs (Indirection.EmitAssign): Likewise.
4725 (LocalVariableReference.EmitAssign): Likewise.
4726 (ParameterReference.EmitAssign): Likewise.
4727 (Invocation.EmitArguments): Likewise.
4728 (ArrayAccess.EmitAssign): Likewise.
4729 (IndexerAccess.EmitAssign): Likewise.
4730 (This.EmitAssign): Likewise.
4731 (ConditionalLogicalOperator.Emit): Likewise.
4734 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
4735 instead of ArrayList. If the hashtable has a LocalBuilder, don't
4736 leave it in after returning it.
4737 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
4739 2006-08-06 Marek Safar <marek.safar@seznam.cz>
4741 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
4744 2006-08-03 Raja R Harinath <rharinath@novell.com>
4746 Fix cs0146-3.cs and cs0146-4.cs.
4747 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
4748 enclosing types don't depend on the current type.
4750 2006-08-02 Raja R Harinath <rharinath@novell.com>
4753 * class.cs (TypeContainer.DoDefineMembers): Use
4754 FindBaseMemberWithSameName on Parent, since we're interested in
4755 whether we hide inherited members or not.
4756 (FindBaseMemberWithSameName): Make slightly more robust.
4758 Fix the non-generic testcase from #77396
4759 * decl.cs (DeclSpace.DeclContainer): Remove override.
4761 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
4762 declspaces for doppelgangers too.
4763 (UsingEntry): Implement IResolveContext.
4764 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
4765 'this' as the resolve context.
4766 (LocalAliasEntry): Likewise.
4768 Implement parts of #77403
4769 * roottypes.cs (RootDeclSpace): New. Used to represent the
4770 toplevel declaration space. Each namespace declaration introduces
4771 a "partial" root declaretion space.
4772 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
4773 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
4774 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
4775 from 'current_namespace.SlaveDeclSpace'.
4776 (namespace_declaration): Likewise.
4777 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
4778 check. It can't happen now.
4779 * decl.cs (DeclSpace.LookupType): Likewise.
4780 * driver.cs (MainDriver): Sanity check.
4782 2006-08-01 Raja R Harinath <rharinath@novell.com>
4784 * decl.cs (DeclSpace.FindNestedType): Remove.
4785 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
4786 LookupTypeContainer to get the container of the nested type.
4787 * class.cs (TypeContainer.FindNestedType): Make non-override.
4789 2006-07-31 Raja R Harinath <rharinath@novell.com>
4791 * decl.cs (DeclSpace.PartialContainer): Move field from ...
4792 * class.cs (TypeContainer.PartialContainer): ... here.
4793 (TypeContainer.AddBasesForPart): New helper.
4794 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
4796 * cs-parser.jay (current_class): Convert to DeclSpace.
4797 (struct_declaration, interface_declaration, class_declaration):
4798 Use AddBasesForPart instead of .Bases directly.
4799 * const.cs, iterators.cs: Update to changes.
4801 2006-07-28 Raja R Harinath <rharinath@novell.com>
4803 * class.cs (TypeContainer.AddMemberType): Rename from
4805 (TypeContainer.AddMember): Rename from AddToMemberContainer.
4806 (AddTypeContainer): New. Combine AddClassOrStruct and
4808 (AddPartial): Update. Add 'is_partial' argument.
4809 * roottypes.cs: Update to changes.
4810 * cs-parser.jay (push_current_class): New helper for handling
4811 current_container and current_class.
4812 (struct_declaration, interface_declaration, class_declaration):
4815 2006-07-26 Raja R Harinath <rharinath@novell.com>
4817 * roottypes.cs: Rename from tree.cs.
4819 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
4820 * tree.cs (Tree, ITreeDump): Remove types.
4821 * rootcontext.cs (tree, Tree): Remove fields.
4822 (root, ToplevelTypes): New.
4823 * *.cs: Update to rename.
4825 * tree.cs (Tree.RecordDecl): Remove.
4826 (RootTypes.AddToTypeContainer): Record the toplevel type in its
4828 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
4830 2006-07-23 Raja R Harinath <harinath@gmail.com>
4832 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
4833 DoFlowAnalysis and OmitStructFlowAnalysis here.
4834 (ec.With): Rename from WithUnsafe and generalize.
4835 (ec.WithCheckState): Remove. All users can be handled by 'With'.
4836 (ec.WithFlowAnalyis): New.
4837 * ecore.cs, expression.cs, statement.cs: Update.
4839 2006-07-22 Raja R Harinath <harinath@gmail.com>
4841 * statement.cs (Block.ResolveMeta): Simplify slightly.
4843 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
4844 multiple boolean fields. Convert InUnsafe, constant_check_state,
4845 check_state to flags.
4846 (CheckState, ConstantCheckState): Update.
4847 (InUnsafe): New read-only property.
4848 (FlagsHandle): Rename from CheckStateHandle and convert to handle
4850 (WithUnsafe): New helper similar to WithCheckState.
4851 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
4852 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
4854 2006-07-21 Raja R Harinath <rharinath@novell.com>
4856 Make comparisons use the same IL irrespective of whether they're
4857 in a 'checked' or 'unchecked' context: one of the issues in #78899
4858 * codegen.cs (EmitContext.CheckState): Make read-only property.
4859 (EmitContext.ConstantCheckState): Likewise.
4860 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
4861 helper that implement a save/restore stack for CheckState
4862 values. This is the only way to change check-state.
4863 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
4864 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
4865 (CheckedExpr.EmitBranchable): New forwarding method.
4866 (UnCheckedExpr): Likewise.
4867 * statement.cs (Block.ResolveMeta): Use WithCheckState.
4868 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
4869 (Checked.Resolve, checked.DoEmit): Likewise.
4871 2006-07-20 Miguel de Icaza <miguel@novell.com>
4873 * anonymous.cs: Cache the resolved anonymous delegate, and return
4874 this so that the ResolveTopBlock is only triggered once, not
4877 Currently we trigger ResolvetopBlock twice due to a first pass of
4878 argument check compatibility, and a second pass that does the
4881 2006-07-15 Marek Safar <marek.safar@seznam.cz>
4883 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
4885 * rootcontext.cs (Reset): Add helper_classes.
4887 2006-07-15 Marek Safar <marek.safar@seznam.cz>
4890 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
4893 2006-07-13 Miguel de Icaza <miguel@novell.com>
4895 * statement.cs (Lock): Handle expressions of type
4896 TypeManager.null_type specially. Fixes #78770
4898 2006-07-08 Marek Safar <marek.safar@seznam.cz>
4900 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
4903 2006-07-08 Marek Safar <marek.safar@seznam.cz>
4905 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
4906 for accessors as well.
4907 * ecore.cs (EventExpr): Add AccessorTable.
4909 2006-07-01 Marek Safar <marek.safar@seznam.cz>
4912 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
4913 for CS0122 where appropriate.
4914 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
4916 (Filter): Assembly can be null in the case of top level attributes.
4918 2006-06-25 Marek Safar <marek.safar@seznam.cz>
4922 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
4923 is done at global level.
4925 2006-06-24 Marek Safar <marek.safar@seznam.cz>
4927 A fix for #77002, Implemented TypeForwarder support.
4929 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
4930 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
4931 * typemanager.cs (): Add type_forwarder_attr_type.
4933 2006-06-24 Marek Safar <marek.safar@seznam.cz>
4935 * report.cs: Add CS0469 warning.
4937 2006-06-21 Martin Baulig <martin@ximian.com>
4939 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
4940 the `try'-block, so we also report CS0016 etc. there.
4942 2006-06-21 Martin Baulig <martin@ximian.com>
4945 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
4947 2006-06-21 Martin Baulig <martin@ximian.com>
4949 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
4950 also report CS1686 for parameters.
4952 2006-06-21 Martin Baulig <martin@ximian.com>
4954 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
4955 instead of an error if the value is not implicitly convertible to
4956 the switch types; fixes #77964.
4958 2006-06-21 Raja R Harinath <rharinath@novell.com>
4961 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
4962 FieldBuilder is null.
4965 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
4966 'left' and 'right' before error-checking.
4968 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
4970 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
4972 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
4973 (FieldExpr.DoResolve): likewise.
4974 (PropertyExpr.InstanceResolve): likewise.
4975 (EventExpr.InstanceResolve): likewise.
4977 2006-06-04 Marek Safar <marek.safar@seznam.cz>
4979 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
4980 attribute applicable tests for attribute argument.
4982 2006-06-02 Raja R Harinath <rharinath@novell.com>
4985 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
4986 (Binary.OverloadResolve_PredefinedIntegral): New.
4987 (Binary.OverloadResolve_PredefinedFloating): New.
4988 (Binary.OverloadResolve_PredefinedString): New.
4989 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
4990 Follow the standard more closely, and treat numeric promotions in
4991 terms of overload resolution.
4992 (Binary.CheckShiftArguments): Simplify.
4994 2006-06-01 Raja R Harinath <rharinath@novell.com>
4996 * flowanalysis.cs (MyBitVector): Simplify representation.
4997 (MyBitVector.Clone): Avoid allocating BitArray.
4998 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
4999 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
5000 (*): Update. Change all references to MyBitVector.And and
5001 MyBitVector.Or to &= and |=.
5003 2006-05-29 Raja R Harinath <rharinath@novell.com>
5006 * cs-parser.jay (formal_parameter_list): Extend the pattern below
5007 to param arguments too.
5009 2006-05-26 Miguel de Icaza <miguel@novell.com>
5011 * cs-parser.jay: Catch another parsing form for arglist being
5012 followed by other arguments. Fixes #78313.
5014 2006-05-24 Raja R Harinath <rharinath@novell.com>
5016 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
5017 checking of out parameters to ...
5018 (FlowBranchingToplevel.Merge): ... here.
5019 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
5020 set, propagate the origin upward, and only complain if there was
5022 (FlowBranchingException.AddContinueOrigin): Likewise.
5023 (FlowBranchingException.AddReturnOrigin): Likewise.
5024 (FlowBranchingException.AddGotoOrigin): Likewise.
5026 2006-05-23 Raja R Harinath <rharinath@novell.com>
5028 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
5029 unreachable, skip it.
5030 (FlowBranchingException.Merge): Always propagate jumps, even if
5031 the finally block renders subsequent code unreachable.
5033 2006-05-18 Raja R Harinath <rharinath@novell.com>
5036 * statement.cs (Goto.Resolve): Move responsibility for resolving
5037 'goto' to FlowBranching.AddGotoOrigin.
5038 (Goto.SetResolvedTarget): New. Callback to set the
5039 LabeledStatement that's the target of the goto.
5040 (Goto.DoEmit): Use Leave instead of Br when crossing an
5041 unwind-protect boundary.
5042 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
5043 LookupLabel and adjust to new semantics.
5044 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
5045 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
5046 Goto.SetResolvedTarget to update target.
5047 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
5048 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
5049 AddBreakOrigin & co. Delay propagation until ...
5050 (FlowBranchingException.Merge): ... this.
5052 * statement.cs (Block.Resolve): Always depend on flow-branching to
5053 determine unreachability. Kill workaround that originally emitted
5054 only one statement after an "unreachable" label (see infloop in
5057 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
5058 This is still "wrong", but anything better would probably need a
5059 multi-pass algorithm.
5060 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
5061 usage vector. Force current usage vector to be reachable, to
5062 optimistically signify backward jumps.
5063 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
5065 (FlowBranchingLabeled.Merge): New. If no backward jump was
5066 detected, return the original salted-away usage vector instead,
5067 updated with appropriate changes. Print unreachable warning if
5069 * statement.cs (Block.Resolve): Don't print unreachable warning on
5070 a labeled statement.
5072 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
5074 * driver.cs: Pass filename without path to AssemblyBuilder's
5075 AddResourceFile. Fixes bug #78407.
5077 2006-05-17 Raja R Harinath <rharinath@novell.com>
5079 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
5080 * flowanalysis.cs (FlowBranchingLabeled): ... here.
5081 (FlowBranching.MergeChild): Overwrite
5082 reachability information from Labeled branchings too.
5084 2006-05-16 Raja R Harinath <rharinath@novell.com>
5086 * statement.cs (Goto.Resolve): Merge jump origins here ...
5087 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
5089 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
5090 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
5091 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
5092 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
5094 * statement.cs (Goto.Resolve): ... not here.
5095 (Goto.Emit): Remove CS1632 check.
5097 2006-05-14 Marek Safar <marek.safar@seznam.cz>
5099 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
5102 2006-05-11 Raja R Harinath <rharinath@novell.com>
5104 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
5105 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
5106 (FlowBranchingException.Label): Likewise.
5108 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
5110 (MyBitVector.Or): Use it to avoid losing information (Count).
5111 (FlowBranching.MergeOrigins): Likewise.
5113 * flowanalysis.cs (UsageVector.IsDirty): Remove.
5114 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
5115 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
5116 (UsageVector.ToString): Simplify.
5117 (UsageVector.MergeSiblings): Move here from ...
5118 (FlowBranching.Merge): ... here.
5119 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
5122 2006-05-10 Raja R Harinath <rharinath@novell.com>
5124 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
5125 null bitvector is treated as all-true.
5127 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
5128 (MyBitVector): Rationalize invariants. 'vector != null' implies
5129 that we have our own copy of the bitvector. Otherwise,
5130 'InheritsFrom == null' implies all inherited bits are true.
5132 2006-05-09 Marek Safar <marek.safar@seznam.cz>
5134 * statement.cs (LocalInfo): Add IsConstant.
5135 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
5136 local variable for constants.
5138 2006-05-09 Raja R Harinath <rharinath@novell.com>
5140 * flowanalysis.cs (MyBitVector.Empty): New.
5141 (MyBitVector): Don't allow InheritedFrom to be null.
5142 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
5143 (UsageVector, FlowBranching): Update to changes.
5145 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
5146 recursion. The 'Parent == null' condition isn't sufficient for
5148 (FlowBranching.AddBreakOrigin): Likewise.
5149 (FlowBranching.AddContinueOrigin): Likewise.
5150 (FlowBranching.AddReturnOrigin): Likewise.
5151 (FlowBranching.StealFinallyClauses): Likewise.
5152 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
5153 (FlowBranching.CheckOutParameters): Likewise.
5154 (FlowBranchingToplevel): Terminate all the above recursions here.
5155 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
5156 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
5158 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
5160 (FlowBranchingToplevel): New. Empty for now.
5161 (FlowBranching.MergeTopBlock): Update.
5162 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
5163 branching for the anonymous delegate.
5164 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
5166 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
5167 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
5168 information at the start of the merge. Reorganize.
5170 2006-05-07 Marek Safar <marek.safar@seznam.cz>
5172 * class.cs (MethodData.Define): Method cannot implement interface accessor.
5174 2006-05-07 Marek Safar <marek.safar@seznam.cz>
5176 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
5177 to newly introduced ctor.
5179 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
5180 message to one place.
5181 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
5184 2006-05-07 Marek Safar <marek.safar@seznam.cz>
5186 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
5188 * ecore.cs (Expression.ResolveAsConstant): Updated.
5190 * statement.cs (ResolveMeta): Updated.
5192 2006-05-06 Marek Safar <marek.safar@seznam.cz>
5194 * cs-parser.jay: __arglist cannot be used in initializer.
5196 2006-05-06 Marek Safar <marek.safar@seznam.cz>
5199 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
5202 2006-05-05 Raja R Harinath <rharinath@novell.com>
5204 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
5205 (LabeledStatement): Add 'name' parameter.
5206 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
5207 (Block.AddLabel): Update to changes.
5208 * cs-parser.jay (labeled_statement): Likewise.
5210 * flowanalysis.cs (BranchingType.Labeled): New.
5211 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
5212 (FlowBranchingLabeled): New. Does nothing for now, but will
5213 eventually handle 'goto' flows.
5214 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
5215 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
5216 that's terminated ...
5217 (Block.Resolve): ... here.
5219 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
5220 (UsageVector.MergeFinallyOrigins): Likewise.
5221 (FlowBranching.InTryOrCatch): Likewise.
5222 (FlowBranching.AddFinallyVector): Likewise.
5223 (FlowBranchingException): Update to changes.
5226 * statement.cs (Return.Resolve): Move error checking to ...
5227 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
5228 (FlowBranchingException): Handle return origins like break and
5230 (FlowBranching.UsageVector.CheckOutParameters): Remove.
5232 2006-05-04 Marek Safar <marek.safar@seznam.cz>
5235 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
5238 2006-05-04 Marek Safar <marek.safar@seznam.cz>
5241 * class.cs (MethodData.Define): Do public accessor check only when method
5242 implements an interface.
5244 2006-05-04 Raja R Harinath <rharinath@novell.com>
5246 Remove special handling of 'break'
5247 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
5248 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
5249 (UsageVector.Break): Remove.
5250 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
5252 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
5254 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
5255 UsageVector.Breaks (). Don't set NeedsReturnLabel.
5257 2006-05-03 Marek Safar <marek.safar@seznam.cz>
5260 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
5261 be the interface member.
5263 2006-05-03 Marek Safar <marek.safar@seznam.cz>
5266 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
5267 for emitting small (int) values.
5269 2006-05-03 Raja R Harinath <rharinath@novell.com>
5272 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
5273 control-flow passes through the 'finally' after merging-in all the
5274 control-flows from 'try' and the 'catch' clauses.
5276 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
5277 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
5278 always true at the only non-recursive entry point.
5279 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
5280 FlowBranchingBreakable.
5281 (FlowBranchingLoop): Remove.
5282 * statement.cs (Return.DoResolve): Update to changes.
5285 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
5286 (FlowBranching.CreateBranching): Handle it: create a
5287 FlowBranchingContinuable.
5288 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
5289 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
5290 except that it handles the 'continue' command.
5291 (FlowBranching.UsageVector.MergeOrigins): Rename from
5293 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
5294 except that it overrides AddContinueOrigin.
5295 (FlowBranchingException): Override AddContinueOrigin, similar to
5297 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
5298 Create a new branching around the embedded statement.
5299 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
5300 control flow after the embedded statement.
5301 (Continue.Resolve): Move all error checking to AddContinueOrigin.
5303 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
5304 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
5305 FlowBranchingBreakable.
5306 (FlowBranchingSwitch): Remove.
5309 * statement.cs (Break.Resolve): Simplify. Move responsibility for
5310 error reporting to ...
5311 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
5312 Rename from 'AddBreakVector'. Add new location argument. Return
5313 a bool indicating whether the 'break' crosses an unwind-protect.
5314 (FlowBranchingException.AddBreakOrigin): Add.
5315 (FlowBranchingException.Merge): Propagate 'break's to surrounding
5316 flowbranching after updating with the effects of the 'finally'
5318 (FlowBranchingBreakable): New common base class for
5319 FlowBranchingLoop and FlowBranchingSwitch.
5321 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
5323 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
5325 2006-05-02 Raja R Harinath <rharinath@novell.com>
5327 * statement.cs (Do.Resolve): If the loop is infinite, set the
5329 (While.Resolve, For.Resolve): Set a barrier after the embedded
5330 statement. There's no direct control flow that goes from the end
5331 of the embedded statement to the end of the loop.
5332 * flowanalysis.cs (FlowBranching.Infinite): Remove.
5333 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
5334 above ensure that the reachability is correctly computed.
5336 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
5337 (UsageVector.MergeBreakOrigins): If the current path is
5338 unreachable, treat it as if all parameters/locals are initialized.
5339 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
5340 infinite loops before merging-in break origins.
5342 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
5343 (Reachability.Reachable): Split part into ...
5344 (Reachability.Unreachable): ... this. Simplify.
5345 (Reachability.IsUnreachable): Use 'Unreachable' instead.
5347 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
5348 (Reachability.SetThrowsSometimes): Likewise.
5349 (FlowBranchingBlock.MergeTopBlock): Don't compare against
5350 TriState.Always, use corresponding property.
5351 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
5352 (Block.Resolve): Likewise. Remove some redundant checks.
5354 2006-05-02 Raja R Harinath <harinath@gmail.com>
5356 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
5357 (Reachability.Meet): Don't bother checking AlwaysThrows --
5358 barrier is always set.
5359 (FlowBranchingBlock.Merge): Likewise.
5361 2006-05-01 Raja R Harinath <harinath@gmail.com>
5363 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
5364 checks for unreachable.
5366 2006-05-01 Marek Safar <marek.safar@seznam.cz>
5369 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
5371 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
5372 whether field is really assigned.
5374 2006-04-30 Raja R Harinath <harinath@gmail.com>
5376 * flowanalysis.cs (Reachability): Make 4-argument constructor
5378 (Reachability.Meet): Rename from 'And'. Remove static variant.
5379 (Reachability.Always): Rename from the highly misleading
5380 'Reachability.Never'.
5381 (FlowBranching.Merge): Update to changes. Mark an impossible
5382 situation with a 'throw'.
5383 (*): Update to changes.
5385 2006-04-29 Raja R Harinath <harinath@gmail.com>
5387 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
5389 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
5390 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
5391 (*): Update to changes.
5392 * statement.cs: Update to changes.
5394 2006-04-28 Marek Safar <marek.safar@seznam.cz>
5397 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
5399 2006-04-28 Raja R Harinath <harinath@gmail.com>
5401 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
5404 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
5405 argument to two arguments: an usage-vector and a bool. Move call
5406 to FlowBranching.Merge () ...
5407 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
5409 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
5410 handling of loop and switch reachability to ...
5411 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
5413 2006-04-27 Raja R Harinath <harinath@gmail.com>
5415 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
5416 handling to FlowBranchingLoop.InLoop.
5417 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
5419 2006-04-26 Marek Safar <marek.safar@seznam.cz>
5422 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
5423 anonymous method is allowed from AnonymousContainer here.
5425 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
5427 2006-04-24 Raja R Harinath <rharinath@novell.com>
5430 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
5432 2006-04-23 Marek Safar <marek.safar@seznam.cz>
5435 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
5436 (DoubleConstant.Reduce): Ditto.
5438 2006-04-23 Raja R Harinath <rharinath@novell.com>
5440 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
5441 Remove 'lvalue_right_side' argument. Move parts to ...
5442 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
5443 (LocalVariable.DoResolveLValue): ... these.
5445 2006-04-21 Raja R Harinath <rharinath@novell.com>
5448 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
5449 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
5450 (LocalVariableReference.DoResolveBase): Use it to implement new
5452 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
5453 (Argument.Resolve): Simplify. Move CS1510 check ...
5454 * ecore.cs (Expression.ResolveLValue): ... here.
5455 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
5456 (PropertyExpr.DoResolveLValue): Likewise.
5457 (FieldExpr.Report_AssignToReadonly): Likewise.
5458 (FieldExpr.DoResolve): Add 'out_access' argument. Use
5459 LValueMemberAccess or LValueMemberOutAccess on instance depending
5461 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
5462 DoResolve as appropriate.
5464 2006-04-20 Raja R Harinath <rharinath@novell.com>
5467 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
5468 implicit conversions on 'out' and 'ref' arguments.
5470 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
5471 improve clarity. Remove dead code.
5474 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
5475 (Catch.Resolve): Resolve VarBlock if it exists.
5477 2006-04-19 Miguel de Icaza <miguel@novell.com>
5479 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
5480 twice, this was some residual code, the enumerator was emitted
5481 properly in the two branche of if later.
5483 2006-04-19 Raja R Harinath <rharinath@novell.com>
5485 * expression.cs (Cast.ResolveLValue): Remove. The result of a
5486 cast is never an lvalue.
5487 (Cast.DoResolve, Cast.ResolveRest): Combine.
5488 (Argument.Emit): Simplify slightly. Move 'Expr is
5489 IMemoryLocation' check ...
5490 (Argument.Resolve): ... here.
5491 (Argument.Error_LValueRequired): Remove. Inline into only user.
5493 Simplifications. Fix cs0191-2.cs
5494 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
5495 CS1649 and CS1651 to ...
5496 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
5497 the actual selection of the error code and message to a lookup
5498 table. Add a dummy return value to simplify callsites.
5499 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
5500 readonly fields of other instances of the same type. Move CS0197
5502 * expression.cs (Argument.Resolve): ... here. Simplify code.
5503 Ensure that ec.InRefOutArgumentResolving is only set during LValue
5504 resolution of an out or ref argument. The code simplification
5505 above uses this invariant.
5507 2006-04-18 Raja R Harinath <rharinath@novell.com>
5509 Possibly fix #77752. Fix cs1690-[4-7].cs.
5510 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
5511 CheckMarshallByRefAccess. Drop parameter.
5512 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
5514 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
5516 * report.cs (AllWarnings): Add CS1690.
5517 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
5519 (LocalVariableReference.DoResolveBase): Update.
5521 2006-04-09 Marek Safar <marek.safar@seznam.cz>
5523 * class.cs (MethodOrOperator): Moved common parts from method class.
5524 detect obsolete attributes.
5525 (Method.Define): Simplified as it reuses code from base.
5526 (Constructor.ValidAttributeTargets): Fixed issue found during
5528 (Destructor.ValidAttributeTargets): Fixed issue found during
5530 (Operator): Finished refactoring set off by #78020. Operator class is now
5531 ordinary method class.
5533 * anonymous.cs: Updated.
5535 * decl.cs (DeclSpace): Add IsGeneric
5537 2006-04-09 Marek Safar <marek.safar@seznam.cz>
5539 * class.cs (Constructor.Emit): Don't emit the attributes twice.
5541 2006-04-09 Marek Safar <marek.safar@seznam.cz>
5543 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
5544 detect obsolete attributes.
5545 (Method.CreateEmitContext): Moved to MethodOrOperator.
5547 2006-04-09 Marek Safar <marek.safar@seznam.cz>
5550 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
5551 customized exception to make crash detection easier.
5552 (MethodOrOperator): Started to work on new base class for methods and
5554 (Method): Derives from MethodOrOperator.
5555 (Constructor.Emit): Emits its own attributes.
5556 (AbstractPropertyEventMethod.Emit): Ditto.
5557 (Operator): Derives from MethodOrOperator, will refactor fully in extra
5559 (Operator.Emit): It's temporary more tricky than should be.
5561 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
5563 * report.cs (InternalErrorException): Add ctor with inner exception.
5565 2006-04-08 Marek Safar <marek.safar@seznam.cz>
5568 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
5571 2006-04-07 Marek Safar <marek.safar@seznam.cz>
5574 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
5577 2006-04-06 Marek Safar <marek.safar@seznam.cz>
5579 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
5580 attribute is present and Guid not.
5581 (Interface.ApplyAttributeBuilder): Ditto.
5583 * attribute.cs: Add error message.
5585 2006-04-06 Marek Safar <marek.safar@seznam.cz>
5589 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
5590 sources (it's composite) so hold them in extra array as they are used in
5591 Emit phase only. It worked in the previous versions by mistake.
5592 (Attribute.Emit): Emit attribute for more owners when exist.
5594 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
5595 it has now different behaviour.
5597 2006-04-04 Marek Safar <marek.safar@seznam.cz>
5599 * constant.cs (Constant.IsDefaultInitializer): New method.
5601 * class.cs: Updated.
5603 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
5604 re-initialize default values. It saves KBs almost for every assembly.
5605 Thanks Zoltan for the idea.
5606 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
5607 (ArrayCreation.DoResolve): Resolve only once.
5608 (ArrayCreation.Emit): Emit static initializer only when it is faster.
5609 (ArrayCreation.GetAttributableValue): Cope with optimized values.
5611 2006-04-03 Zoltan Varga <vargaz@gmail.com>
5613 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
5616 2006-04-01 Marek Safar <marek.safar@seznam.cz>
5618 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
5619 in an embedded statement too.
5621 2006-04-01 Raja R Harinath <rharinath@novell.com>
5624 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
5626 2006-04-01 Marek Safar <marek.safar@seznam.cz>
5630 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
5633 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
5635 2006-03-31 Marek Safar <marek.safar@seznam.cz>
5637 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
5640 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
5641 LocalTemporary change.
5643 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
5645 (ClassOrStruct.DefineFieldInitializers): Implemented static field
5646 initializers optimization.
5647 (ClassOrStruct.TypeAttr): Moved from modifiers.
5648 (Constructor.CheckBase): Don't crash when static ctor has parameters.
5649 (FieldBase.ResolveInitializer): Resolves initializer.
5650 (FieldBase.HasDefaultInitializer): New property.
5652 * cs-parser.jay: Removed message.
5654 * expression.cs (CompilerGeneratedThis): New specialization.
5656 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
5658 2006-03-28 Marek Safar <marek.safar@seznam.cz>
5660 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
5662 2006-03-27 Marek Safar <marek.safar@seznam.cz>
5664 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
5665 be now EnumConstants only.
5667 2006-03-27 Marek Safar <marek.safar@seznam.cz>
5669 * attribute.cs, driver.cs: Reset more caches.
5671 2006-03-26 Marek Safar <marek.safar@seznam.cz>
5673 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
5675 2006-03-26 Marek Safar <marek.safar@seznam.cz>
5677 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
5678 for easier reuse. Updated all overrides.
5679 (IntegralConstant): New base class for all integral constants.
5680 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
5681 of the constant range, report custom error.
5682 (UIntConstant.Reduce): Fixed uint conversion.
5684 * ecore.cs, literal.cs: Reduce updates.
5686 2006-03-26 Marek Safar <marek.safar@seznam.cz>
5690 * class.cs (Constructor.Define): Removed extra if for default ctors.
5691 A patch from Atsushi Enomoto.
5693 2006-03-26 Marek Safar <marek.safar@seznam.cz>
5695 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
5696 GetAttributableValue.
5698 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
5701 * convert.cs (ImplicitConversionRequired): Error message moved to
5704 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
5705 automatic implicit conversion of an output value.
5706 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
5708 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
5710 (TypeOf.GetAttributableValue): Add extra handling for object type.
5712 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
5713 special error message.
5715 2006-03-25 Marek Safar <marek.safar@seznam.cz>
5717 * class.cs (Constructor.Emit): Don't crash when struct ctor is
5719 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
5720 compatible with MS runtime.
5722 2006-03-23 Marek Safar <marek.safar@seznam.cz>
5724 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
5725 attribute arguments here.
5727 * class.cs (Indexer.Define): The check was moved to attribute class.
5729 2006-03-22 Marek Safar <marek.safar@seznam.cz>
5731 * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
5732 expression.cs, typemanager.cs: Minor changes from gmcs to make merging
5735 2006-03-22 Raja R Harinath <rharinath@novell.com>
5737 Support ParameterDefaultValueAttribute in gmcs. Also applied to
5738 mcs to keep code differences small.
5739 * attribute.cs (Attribute.GetParameterDefaultValue): New.
5740 * typemanager.cs (parameter_default_value_attribute_type): New.
5741 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
5744 2006-03-21 Marek Safar <marek.safar@seznam.cz>
5746 * expression.cs (StringConcat.Append): Reverted back to no warning state.
5748 2006-03-21 Marek Safar <marek.safar@seznam.cz>
5750 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
5752 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
5755 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
5757 * doc-bootstrap.cs : fix build.
5759 2006-03-20 Marek Safar <marek.safar@seznam.cz>
5761 * expression.cs (StringConcat.Append): Issue a warning when empty string
5764 2006-03-20 Marek Safar <marek.safar@seznam.cz>
5766 * assign.cs (CompoundAssign.ResolveSource): Removed.
5768 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
5771 * class.cs (TypeContainer.FindMethods): Removed.
5772 (TypeContainer.CheckMemberUsage): Made static.
5774 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
5776 * constant.cs (CheckRange): Removed unused type argument.
5777 (CheckUnsigned): Removed unused type argument.
5779 * cs-parser.jay: Updated after MemberAccess clean up.
5780 Uses Length for empty string test.
5782 * cs-tokenizer.cs: Uses Length for empty string test.
5783 (IsCastToken): Made static.
5784 (is_hex): Made static.
5785 (real_type_suffix): Made static.
5787 * decl.cs (SetupCache): Made static.
5788 (OnGenerateDocComment): Removed unused ds argument.
5790 * delegate.cs (VerifyDelegate): Removed unused argument.
5792 * doc.cs: Uses Length for empty string test.
5794 * driver.cs: Uses Length for empty string test.
5796 * enum.cs (IsValidEnumType): Made static
5798 * expression.cs (EnumLiftUp): Removed unused argument.
5799 (ResolveMethodGroup): Ditto.
5800 (BetterConversion): Ditto.
5801 (GetVarargsTypes): Ditto.
5802 (UpdateIndices): Ditto.
5803 (ValidateInitializers): Ditto.
5804 (MemberAccess.ctor): Ditto.
5805 (GetIndexersForType): Ditto.
5807 * flowanalysis.cs: (MergeFinally): Removed unused argument.
5809 * iterators.cs: Updated after MemberAccess clean up.
5811 * location.cs: Uses Length for empty string test.
5813 * namespace.cs: Uses Length for empty string test.
5815 * report.cs (CheckWarningCode): Made static.
5817 * statement.cs (LabeledStatement): Removed unused argument.
5819 * typemanager.cs (FilterNone): Removed.
5821 2006-03-18 Marek Safar <marek.safar@seznam.cz>
5823 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
5826 * class.cs: Updated.
5828 2006-03-18 Marek Safar <marek.safar@seznam.cz>
5830 * cs-parser.jay.cs: __arglist is not allowed for delegates.
5832 2006-03-18 Marek Safar <marek.safar@seznam.cz>
5836 * expression.cs (VerifyArgumentsCompat): Reverted to double error
5837 reporting, it's more tricky than I thought.
5839 2006-03-18 Marek Safar <marek.safar@seznam.cz>
5843 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
5845 (AnonymousMethod.ImplicitStandardConversionExists): New method.
5846 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
5847 Add more error reporting; Fixed issue with params.
5849 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
5851 * cs-parser.jay: AnonymousMethod requires host container.
5853 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
5855 2006-03-18 Raja R Harinath <harinath@gmail.com>
5857 * class.cs: Change 'TypeContainer ds' constructor argument to
5858 'DeclSpace parent'. Some classes were missed below due to
5859 different naming convention.
5861 * class.cs (MemberCore.Parent): Delete. This makes the
5862 ParentContainer changes below enforceable by the compiler.
5864 Treat pointers to enclosing declaration space as 'DeclSpace', not
5866 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
5867 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
5869 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
5871 (Block.AddThisVariable): Likewise.
5872 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
5873 (AbstractPropertyEventMethod.Emit): Likewise.
5874 (AbstractPropertyEventMethod.EmitMethod): Likewise.
5875 (GetMethod.Define, SetMethod.Define): Likewise.
5876 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
5877 (DelegateMethod.EmitMethod): Likewise.
5879 Fix regression test-partial-13.cs.
5880 Rationalize use of PartialContainer. Ensure that the partial
5881 class semantics can be tied to type-correctness, i.e., any
5882 violation will cause a compile error.
5883 * class.cs, const.cs: Access all fields that belong to class
5884 TypeContainer via ParentContainer. Arguments of EmitContexts and
5885 Resolve()-like functions still use 'Parent'.
5887 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
5888 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
5889 (PropertyMethod.CheckModifiers): Remove unused argument.
5890 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
5893 2006-03-17 Raja R Harinath <harinath@gmail.com>
5895 Make semantics of PartialContainer simpler.
5896 * decl.cs (DeclSpace.IsPartial): Remove.
5897 * class.cs (TypeContainer.IsPartial): Likewise.
5898 (TypeContainer..ctor): Set PartialContainer to point to self.
5899 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
5900 (TypeContainer.FindNestedType): Likewise.
5901 (MemberCore.ParentContainer): Simplify. Remove deprecation.
5903 2006-03-17 Marek Safar <marek.safar@seznam.cz>
5905 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
5907 2006-03-15 Marek Safar <marek.safar@seznam.cz>
5909 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
5912 2006-03-15 Marek Safar <marek.safar@seznam.cz>
5914 * class.cs (Operator.Define): An error for base conversion was not
5917 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
5919 * iterator.cs : yield break is allowed in try statement which has
5920 catch clauses. Fixed bug #77767.
5922 2006-03-13 Marek Safar <marek.safar@seznam.cz>
5924 A fix for #77593, #77574.
5926 * class.cs (MethodCore.CheckBase): Another if for operator.
5928 2006-03-09 Marek Safar <marek.safar@seznam.cz>
5930 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
5933 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
5934 (DelegateCreation.ImplicitStandardConversionExists): New method for just
5937 *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
5940 * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
5941 Updated after another emitcontext usage was clean up. It should help us to
5942 synchronize with gmcs easier.
5944 2006-03-04 Marek Safar <marek.safar@seznam.cz>
5948 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
5949 (Event.Define): ditto
5950 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
5952 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
5953 Removed redundant code and set NewSlot for Invoke method too.
5955 * parameter.cs (Parameters.ctor): Add custom, type ctor.
5956 (Parameters.MergeGenerated): New method. Use this method when you merge
5957 compiler generated argument with user arguments.
5959 2006-03-03 Marek Safar <marek.safar@seznam.cz>
5961 * attribute.cs (ResolveAsTypeTerminal): Removed.
5963 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
5964 specialization for predefined types; 30% speed up.
5965 Finally placed obsolete check to right place.
5966 (Expression.ResolveType): Removed.
5968 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
5969 Updated after ResolveType was removed.
5971 * expression.cs (Cast.ctor): Check void cast.
5972 (Binary.ResolveAsTypeTerminal): Is never type.
5973 (Conditional.ResolveAsTypeTerminal): Is never type.
5975 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
5977 2006-03-01 Raja R Harinath <rharinath@novell.com>
5980 * expression.cs (ParameterReference.DoResolveBase): Change return
5982 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
5986 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
5989 * typemanager.cs (GetFullNameSignature): Don't nullref on
5990 protected accessors.
5992 2006-02-27 Marek Safar <marek.safar@seznam.cz>
5994 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
5995 these two separated members to simplify the code.
5996 (Attribute.Resolve): Refactored to use new fields and methods.
5997 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
5998 implemented obsolete attribute checking.
5999 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
6000 implemented obsolete checking again. It look line never ending quest ;-)
6001 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
6003 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
6005 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
6007 *class.cs (Property.Define): Add RegisterProperty call.
6009 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
6010 argument groups (only 2).
6012 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
6013 encoding expression to arguments.
6014 (Expression.ExprClassToResolveFlags): Just turned to property.
6016 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
6017 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
6018 optimized as well as implemented support for zero-length attributes.
6020 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
6021 Add caching of PropertyInfo's.
6023 2006-02-25 Marek Safar <marek.safar@seznam.cz>
6025 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
6026 error multiple times.
6028 2006-02-25 Marek Safar <marek.safar@seznam.cz>
6030 New partial class implementation.
6031 A fix for #77027, #77029, #77403
6033 * attribute.cs (Attributable): Made attributes protected.
6035 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
6036 the replacements of ClassPart and PartialContainer.
6037 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
6038 (TypeContainer.AddInterface): Ditto.
6039 (TypeContainer.AddPartial): The main method for partial classes. It checks
6040 for errors and merges ModFlags and attributes. At the end class is added to
6042 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
6044 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
6045 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
6046 from the rest of partial classes.
6047 (TypeContainer.GetClassBases): Simplified.
6048 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
6050 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
6051 (TypeContainer.HasExplicitLayout): Uses Flags now.
6052 (PartialContainer): Removed.
6053 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
6054 (StaticClass): Was merged with Class.
6055 (Class.GetClassBases): class and static class bases are verified here.
6056 (Class.TypeAttr): Added static attributes when class is static.
6057 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
6058 (MemberBase): In some cases we need to call parent container for partial
6059 class. It should be eliminated but it's not easy now.
6061 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
6063 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
6064 partial classed to accumulate class comments.
6065 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
6067 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
6069 * driver.cs (MainDriver): Tree.GetDecl was removed.
6071 * modifiers.cs (Modifiers): Add partial modifier.
6073 * tree.cs (Tree.decl): Removed.
6074 (RootTypes): Started to use this class more often for root types
6077 2006-02-22 Marek Safar <marek.safar@seznam.cz>
6081 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
6082 external interface does not have an attribute.
6084 2006-02-22 Marek Safar <marek.safar@seznam.cz>
6086 Another prerequisites for new partial classs implementation.
6088 * attribute.cs (Attribute.Equal): Implemented.
6089 (Attribute.Emit): Changed as attributes can be applied more than twice.
6090 (Attributes.Emit): Check for duplicate attributes here.
6092 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
6093 as a parameter, clean-up.
6095 2006-02-11 Marek Safar <marek.safar@seznam.cz>
6099 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
6100 contains obsolete attribute check which can in some cases look for base
6101 type of current class which is not initialized yet.
6102 (TypeContainer.BaseType): Replacement of ptype.
6104 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
6106 2006-02-11 Marek Safar <marek.safar@seznam.cz>
6108 First of prerequisites for new partial classs implemention.
6110 * attribute.cs (Attributable): Extended by ResolveContext;
6111 Attributes finally have correct context for resolving in all cases.
6112 (AttachTo): Attribute owner is assigned here.
6114 * codegen.cs (IResolveContext): Introduce new interface to hold
6115 all information needed in resolving phase.
6116 (EmitContext): Implements IResolveContext; more clean-up needed here.
6118 * decl.cs (MemberCore): Implemented IResolveContext.
6120 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
6121 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
6122 parameter.cs, statement.cs, tree.cs, typemanager.cs:
6123 Refactored to use new IResolveContext instead of EmitContext; cleanup
6125 2006-02-06 Miguel de Icaza <miguel@novell.com>
6127 * codegen.cs (EmitScopeInitFromBlock): check here the
6128 capture_context, there is no need to make two calls to the
6131 * anonymous.cs: Add some debugging messages that might help me
6132 track other instances of this problem in the future (the
6133 regression of test 467).
6135 * cs-parser.jay: track the variable block, as we need to initalize
6136 any captured variables declared in this block for the "catch"
6137 portion of the "Try" statement.
6139 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
6140 scope initialization for captured variables.
6142 Also, move the emit for the variables after the block location has
6145 2006-02-06 Marek Safar <marek.safar@seznam.cz>
6147 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
6149 2006-02-02 Miguel de Icaza <miguel@novell.com>
6151 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
6152 commit yesterday, the initialization for the roots is necessary.
6153 What is not necessary is the scope activation.
6155 2006-02-02 Raja R Harinath <rharinath@novell.com>
6157 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
6158 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
6160 (Argument.Resolve): Remove CS0206 checks.
6162 2006-02-01 Miguel de Icaza <miguel@novell.com>
6164 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
6165 scopes for all the roots, the scopes will now be emitted when the
6166 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
6168 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
6169 code. This reduces a lot of existing cruft.
6171 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
6172 that the ScopeInfo is generated as we enter the scope, not at the
6173 time of use, which is what we used to do before.
6175 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
6176 every time a Block is about to be emitted if we have a
6179 2006-02-01 Raja R Harinath <rharinath@novell.com>
6181 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
6183 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
6185 * typemanager.cs (cons_param_array_attribute): Make private.
6186 (Reset): Set it to null.
6187 (InitCoreHelpers): Don't initialize it.
6188 (ConsParamArrayAttribute): New. Initialize it as needed.
6189 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
6191 2006-01-31 Miguel de Icaza <miguel@novell.com>
6193 * expression.cs: There might be errors reported during the
6194 selection of applicable methods. If there are errors, do not
6195 continue execution as it will lead the compiler to crash.
6197 2006-01-30 Miguel de Icaza <miguel@novell.com>
6199 * expression.cs: Member access is not allowed on anonymous
6200 methods. Fixes #77402.
6202 2006-01-30 Raja R Harinath <rharinath@novell.com>
6205 * cs-parser.jay (VariableDeclaration): Don't set
6206 current_array_type to null.
6207 (field_declaration, event_declaration, declaration_statement):
6208 Set it to null here.
6210 2006-01-28 Raja R Harinath <harinath@gmail.com>
6212 * typemanager.cs (GenericParameterPosition): New.
6215 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
6217 * doc.cs : To process "include" elements, first we should create
6218 another list than XmlNodeList, because it could result in node
6219 removal, which could result in that the XmlNodeList gives up
6222 (Also made code identical to gmcs again.)
6224 2006-01-25 Miguel de Icaza <miguel@novell.com>
6226 * ecore.cs: Introduce an error report that we were not catching
6227 before, if not silent, we must report the error. Gonzalo ran into
6230 2006-01-23 Miguel de Icaza <miguel@novell.com>
6232 A fix for bug: #76957
6234 * iterators.cs (MoveNextMethod.CreateMethodHost): call
6235 ComputeMethodHost before creating the method, this is a new
6238 * anonymous.cs (AnonymousContainer): Now we track all the scopes
6239 that this method references (RegisterScope). The actual scope
6240 where the method is hosted is computed with the ComputeMethodHost
6241 before we create the method.
6243 Moved the Deepest routine here.
6245 (AnonymousContainer.ComputeMethodHost): New routine used to
6246 compute the proper ScopeInfo that will host the anonymous method.
6248 (ScopeInfo): Deal with multiple roots. The problem was that we
6249 did not have a unique root where all ScopeInfos could be hanged
6250 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
6253 Remove AdjustMethodScope which is now computed at the end. Remove
6254 LinkScope which did a partial link, instead link all ScopeInfos
6255 before code generation from the new "LinkScopes" routine.
6257 Simplify all the Add* routines as they no longer need to maintain
6258 the tree, they just need to record that they are using variables
6261 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
6262 routines to produce the forest of ScopeInfo trees.
6264 * class.cs (TypeContainer.AppendMethod): This is just like
6265 AddMethod, but ensures that an interface implementation method
6266 (IEnumerable.XXX) is not inserted at the beginning of the queue of
6267 methods, but at the end.
6269 We use this functionality to ensure that the generated MoveNext
6270 method in the iterator class is resolved/emitted before the
6271 enumerator methods created.
6273 This is required because the MoveNext method computes the right
6274 ScopeInfo for the method. And the other methods will eventually
6275 need to resolve and fetch information computed from the anonymous
6278 2006-01-21 Raja R Harinath <harinath@gmail.com>
6279 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6282 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
6284 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
6285 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
6287 2006-01-18 Raja R Harinath <rharinath@novell.com>
6289 Fix #76656, cs0231-2.cs.
6290 * cs-parser.jay (formal_parameter_list): Make error case catch
6292 (parenthesized_expression_0): Add CS1026 check.
6293 (invocation_expression): Remove unused { $$ = lexer.Location }.
6295 2006-01-17 Raja R Harinath <rharinath@novell.com>
6298 * cs-parser.jay (statement_expression): Don't list out the
6299 individual statement-expressions. Convert syntax error into
6302 2006-01-16 Raja R Harinath <rharinath@novell.com>
6305 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
6306 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
6307 CheckIntermediateModification.
6308 (FieldExpr.DoResolve): Add new two-argument version that
6309 allows us to resolve the InstanceExpression as an lvalue.
6310 The one-argument variant is now just a wrapper.
6311 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
6312 Resolve the lhs as an lvalue if the it has a value type.
6313 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
6314 from Assign.DoResolve.
6315 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
6316 resolved as an lvalue.
6317 (PropertyExpr.DoResolve): Update.
6318 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
6319 has a value type. Move CS1612 check here from
6320 CheckIntermediateModification.
6321 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
6322 * expression.cs (EmptyExpression.OutAccess): New. Used as the
6323 'right_side' of a ResolveLValue on an 'out' argument.
6324 (EmptyExpression.LValueMemberAccess): New. Used as the
6325 'right_side' of a propagated ResolveLValue on a value type.
6326 (LocalVariableReference.DoResolveBase): Recognize
6327 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
6329 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
6330 EmptyExpression.Null.
6332 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
6334 * typemanager.cs : added IsGenericParameter(). In mcs it always
6336 * doc.cs : for generic parameters, use GenericParameterPosition,
6339 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
6341 * expression.cs: Fix Console.WriteLine ((this = x).foo);
6343 2006-01-12 Miguel de Icaza <miguel@novell.com>
6345 This fixes the problem where we used ldfld instead of ldflda to
6346 load the "THIS" pointer on captured parameters, when THIS is a
6347 value type. See bug #77205.
6349 * iterators.cs (CapturedThisReference.Emit): Pass false to
6350 EmitThis (we do not need the address).
6352 * codegen.cs (EmitThis): it needs to know whether we need the
6353 address of `this' or not. This is used by value types.
6355 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
6356 every other call passes false.
6358 2006-01-12 Raja R Harinath <rharinath@novell.com>
6361 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
6363 * expression.cs (Invocation.OverloadResolve): Update.
6364 (Invocation.DoResolve): Avoid double resolution of invocation.
6366 2006-01-11 Raja R Harinath <rharinath@novell.com>
6369 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
6370 unary negation of floating point types as 0-expr; negation cannot
6371 overflow in floating point types.
6374 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
6375 on operands of 'void' type.
6378 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
6379 and ExclusiveOr for boolean constants too.
6381 2006-01-09 Raja R Harinath <rharinath@novell.com>
6384 * expression.cs (Invocation.OverloadResolve): Replace reflected
6385 override methods with their base virtual methods, rather than
6387 * typemanager.cs (TypeManager.GetOverride): New.
6389 2006-01-05 Jb Evain <jbevain@gmail.com>
6391 * class.cs (Property.Define, Indexer.Define): do not tag the
6392 properties as SpecialName | RTSpecialName.
6394 2006-01-04 Miguel de Icaza <miguel@novell.com>
6396 * class.cs (MethodCore.IsDuplicateImplementation): This method was
6397 doing a low-level comparission of parameter types. It was lacking
6398 a check for __argslist.
6400 2005-12-30 Miguel de Icaza <miguel@novell.com>
6402 * expression.cs (ParameterReference.DoResolveBase): Allow
6403 reference parameters if they are local to this block.
6405 This allows the ref and out parameters of a delegate to be used in
6406 an anonymous method, for example:
6408 delegate void set (out int x);
6410 set s = delegate (out int x){
6414 This is used by functionality introduced late in the C# language.
6416 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
6417 method that take ref and out parameters.
6419 Fixes #77119 which was a late change in the spec.
6421 2005-12-23 Miguel de Icaza <miguel@novell.com>
6423 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
6424 parent if its the same scope. Fixes #77060.
6426 2005-12-21 Miguel de Icaza <miguel@novell.com>
6428 * driver.cs: Report the case of no source files and no -out:
6431 2005-12-20 Raja R Harinath <rharinath@novell.com>
6434 * expression.cs (ComposedCast.GetSignatureForError): Define.
6436 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6440 * namespace.cs (NamespaceEntry): Add extern_aliases as a
6441 ListDictionary, to contain the ExternAliasEntry entries (in
6442 addition to the NamespaceEntry.aliases hashtable). This field is
6443 shared between the original entry and its doppelganger (bodyless
6445 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
6446 extern_aliases field.
6447 (NamespaceEntry.Lookup): Move the IsImplicit check after the
6448 lookup in extern_aliases.
6450 2005-12-16 Raja R Harinath <rharinath@novell.com>
6453 * class.cs (TypeContainer.Mark_HasEquals): New.
6454 (TypeContainer.Mark_HasGetHashCode): New.
6455 (ClassPart): Override them.
6456 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
6459 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
6460 'parent' argument to the base constructor.
6462 Remove all mention of TypeContainer from decl.cs.
6463 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
6464 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
6465 (DeclSpace.DeclSpace): Likewise.
6466 (DeclSpace.DefineMembers): Remove unused argument.
6467 * cs-parser.jay (pop_current_class): Update to changes. Simplify
6468 debugging check -- we don't care if the debug code throws an
6469 InvalidCastException instead of an InternalErrorException.
6470 * class.cs (TypeContainer.DefineMembers): Update to changes.
6471 (TypeContainer.DoDefineMembers): Likewise.
6472 (TypeContainer.GetMethods): Likewise.
6473 (PropertyMember.Define): Likewise.
6474 (MemberBase.Parent): New property that forwards to
6475 MemberCore.Parent, but ensures that we get a TypeContainer.
6476 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
6477 (RootContext.PopulateTypes): Likewise. Remove special case code
6478 for !RootContext.StdLib: DefineMembers is idempotent.
6480 2005-12-14 Miguel de Icaza <miguel@novell.com>
6482 * convert.cs (ExplicitConversionCore): Check the return value from
6483 ExplicitConversionCore which can return null on failure. Fixes #76914
6485 2005-12-13 Marek Safar <marek.safar@seznam.cz>
6487 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
6489 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
6491 * doc.cs : The search for referenced namespace was insufficient to
6492 get global one as it used to do. Fixed bug #76965.
6494 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
6496 * doc.cs : check name in cref in the last phase that whether it is
6499 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
6501 * cs-tokenizer.cs : reverted the latest change: it somehow broke
6504 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
6506 * doc.cs : so it turned out that we cannot skip override check for
6507 interface members. Fixed bug #76954.
6509 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
6511 * cs-tokenizer.cs : fixed bug #75984:
6512 - #warning and #error should not be handled when the source line
6514 - #line is not checked strictly when the source line is disabled.
6515 - #define and #undef is on the other hand checked strictly at any
6518 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
6520 * cs-tokenizer.cs : missing Location (actually, filename) in one of
6523 2005-12-05 Marek Safar <marek.safar@seznam.cz>
6525 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
6527 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
6529 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
6530 (FieldBase.Initializer): Initializer is now optional.
6531 (EventField.Define): Only event field can have initializer.
6533 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
6535 * const.cs (Const): Reuse initializer.
6537 * cs-parser.jay: Updated after FieldBase changes.
6538 Added current_array_type to simplify array initializers.
6540 * ecore.cs (NullCast.IsDefaultValue): Implemented.
6542 * expression.cs, iterators.cs: Updated.
6544 * namespace.cs (NamespaceEntry): Made UsingFound private.
6546 2005-12-05 Marek Safar <marek.safar@seznam.cz>
6548 * parameterCollection.cs: Obsolete, removed.
6549 * parser.cs: Obsolete, removed.
6551 2005-12-05 Marek Safar <marek.safar@seznam.cz>
6554 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
6556 * enum.cs (Enum.Define): Set obsolete context here.
6558 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
6561 - FindDocumentedMember() now expects 1) paramList as null
6562 when "we don't have to check the number of parameters" and
6563 2) Type.EmptyTypes when "there is no arguments".
6564 - Introduced FoundMember struct to hold the exact type which was
6565 used to find the documented member (the above change broke
6566 test-xml-044; it might be better just to use DeclaringType than
6567 what MS does, like this change does, but it depends on usage.)
6569 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
6571 * doc.cs : documented member might be from DeclaringType for nested
6572 types. Fixed bug #76782.
6574 2005-12-03 Ben Maurer <bmaurer@ximian.com>
6576 * anonymous.cs: Have the param code handle leaving copies on the
6577 stack etc. Allows anonymous params to take part in the assignment
6578 code (++, +=, etc). Fixes bug #76550
6580 * expression.cs: Handle the prepare_for_load/leave_copy by passing
6581 it down to the anon code.
6583 * iterators.cs: Use dummy var here
6585 * codegen.cs: Handle new vars
6587 2005-12-01 Marek Safar <marek.safar@seznam.cz>
6590 * class.cs (MethodData.Define): Set proper Obsolete context.
6592 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
6594 (FieldExpr.DoResolve): Ditto.
6596 2005-12-01 Marek Safar <marek.safar@seznam.cz>
6599 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
6600 parent is not obsolete.
6602 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
6604 * doc.cs : (FindDocumentedMember) find parameterless members first
6605 and get CS0419 in the early stage. Fixed first case of bug #76727.
6607 2005-11-30 Marek Safar <marek.safar@seznam.cz>
6610 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
6611 no error was reported.
6613 *expression.cs (Binary.DoResolve): left can be null.
6615 2005-11-22 Marek Safar <marek.safar@seznam.cz>
6618 * class.cs (MethodData.Emit): Parameters should be labeled first.
6620 2005-11-21 Marek Safar <marek.safar@seznam.cz>
6623 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
6625 2005-11-18 Marek Safar <marek.safar@seznam.cz>
6627 * attribute.cs (AreParametersCompliant): Moved to Parameter.
6629 * class.cs (MethodCore): Parameter clean up.
6630 (IMethodData): Added ParameterInfo.
6631 (MethodData): Parameter clean up.
6632 (Indexer.Define): Parameter clean up.
6644 * typemanager.cs: Parameter clean up.
6646 * delegate.cs (Define): Get rid of duplicated code.
6648 * expression.cs (ParameterReference): Removed useless parameters
6650 (Invocation): Ditto.
6652 * parameter.cs (ParamsParameter): New class, params specialization.
6653 (ArglistParameter): Attemp to separate arglist.
6654 (Parameter): Refactored to be reusable and faster.
6655 (Parameter.Modifier): Made understandable.
6656 (Parameters): Changed to be used as a class for `this' assembly
6657 parameters. Refactored to use new specialized classes.
6659 * support.cs (ParameterData): Added Types property.
6660 (InternalParameters): Deleted.
6662 2005-08-20 Martin Baulig <martin@ximian.com>
6664 Merging this patch from GMCS to fix #75867.
6666 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
6667 scope if we don't already have it.
6669 2005-11-17 Martin Baulig <martin@ximian.com>
6672 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
6673 inherit the scope from our parent. Fixes #76653.
6675 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
6677 * doc.cs : the previous patch does not actually fix the bug.
6678 PropertyInfo override check is now implemented and really fixed it.
6679 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
6681 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
6683 * doc.cs : apply "override filter" also to properties.
6686 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
6688 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
6689 no need to check overrides. For classes, omit those results from
6690 interfaces since they must exist in the class. Fixed bug #76726.
6692 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
6694 * typemanager.cs : (GetFullNameSignature) differentiate indexers
6695 with different parameters. Fixed the second problem in #76685.
6697 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
6699 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
6700 get expected 'protected' access in CheckValidFamilyAccess()).
6703 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
6705 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
6706 Fixed bug #76705. CS1569 was incorrectly commented out.
6708 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
6710 * doc.cs : use Invocation.IsOverride() to do real override check.
6711 * expression.cs : made Invocation.IsOverride() internal.
6713 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
6715 * doc.cs : use TypeManager.FindMembers() instead of (possible)
6716 TypeBuilder.FindMembers() and filter overriden base members out.
6719 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
6721 * doc.cs : ref/out parameters are represented as '@' (instead of
6722 '&' in type FullName). Fixed bug #76630 (additionally crefs).
6724 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
6726 * doc.cs : when there was no '.' in cref to methods in doc comment,
6727 then parameters were missing in the output. Fixed bug #76691.
6729 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
6731 * driver.cs : don't output docs when there is an error.
6734 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
6737 Now it should detect indexers. Fixed primary concern in bug #76685.
6738 Fixed CS0419 message to not show the identical member signature in
6741 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
6743 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
6744 instead of Type.FindMembers() since it does not handle events.
6747 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
6749 * codegen.cs: Fixed typo (speficied -> specified).
6751 2005-11-11 Marek Safar <marek.safar@seznam.cz>
6754 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
6756 2005-11-11 Marek Safar <marek.safar@seznam.cz>
6758 * attribute.cs: Changed error message.
6760 * cs-tokenizer.cs: One more check.
6762 2005-11-10 Marek Safar <marek.safar@seznam.cz>
6764 * statement.cs (Block.Resolve): Ignore empty statement.
6766 2005-11-10 Marek Safar <marek.safar@seznam.cz>
6768 * report.cs: Made error/warning methods more strict to avoid
6771 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
6772 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
6773 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
6774 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
6776 2005-11-08 Marek Safar <marek.safar@seznam.cz>
6778 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
6779 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
6781 * class.cs (TypeContainer.IsComImport): New property.
6782 (Constructor.Define): Create proper ctor for ComImport types.
6784 * expression.cs (New.CheckComImport): Fixed.
6786 2005-11-07 Miguel de Icaza <miguel@novell.com>
6788 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
6789 that a parameter has been captured does not mean that we do not
6790 have to do the rest of the processing. This fixes the second part
6791 of #76592. If there was another anonymous method capturing
6792 values in the past, the Scope would never be set for the second
6793 method that captured the same parameter.
6795 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
6796 properly manipulate the stack. Second part of fix for #76592.
6798 * expression.cs (New): Add support for invoking "new" on
6799 interfaces that have been flagged with the ComImport attribute and
6800 the CoClass. Fixes #76637
6802 * statement.cs (Try.DoEmit): When a variable is captured, do not
6803 try to emit the vi.LocalBuilder variable as it has been captured.
6804 Create a temporary variable and store the results on the
6805 FieldBuilder. Fixes #76642
6807 2005-11-07 Marek Safar <marek.safar@seznam.cz>
6809 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
6811 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
6813 * expression.cs (Binary.DoResolve): Added && optimalization.
6815 * typemanager.cs (AddUserType): Removed useless argument.
6817 2005-11-04 Marek Safar <marek.safar@seznam.cz>
6819 * statement.cs (Block.variables): Uses ListDictionary.
6821 2005-11-03 Marek Safar <marek.safar@seznam.cz>
6824 * class.cs (PartialContainer.EmitType): Customized to emit
6825 security attributes.
6826 (ClassPart.ApplyAttributeBuilder): Transform security attribute
6827 for partial classes.
6829 2005-11-03 Marek Safar <marek.safar@seznam.cz>
6832 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
6833 access has to be fixed.
6835 * typemanager.cs (IsUnmanagedType): Wrong common field type.
6837 2005-11-01 Marek Safar <marek.safar@seznam.cz>
6840 * ecore.cs (NullCast.Reduce): Implemented.
6842 * expression.cs (ArrayCreation.CheckIndices): Correcly check
6845 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
6847 (Foreach.Resolve): Catch null properly.
6849 2005-10-29 Marek Safar <marek.safar@seznam.cz>
6851 * cs-tokenizer.cs: Warning text fix.
6853 * driver.cs: AllWarningNumbers exposed on public interface.
6855 * report.cs (): Reviewed warning numbers.
6856 (IsValidWarning): Use binary search.
6858 2005-10-29 Marek Safar <marek.safar@seznam.cz>
6860 * driver.cs: Implemeted resource visibility.
6861 (Resources): New class for code sharing between /res: and
6864 2005-10-28 Marek Safar <marek.safar@seznam.cz>
6867 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
6870 * convert (Convert.ImplicitReferenceConversion): NullCast holds
6873 * ecore.cs (NullCast): Child is contant only.
6875 * literal.cs (NullLiteral.Reduce): null can be converted to any
6878 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
6880 * driver.cs: Use Encoding.Default as default code page instead
6883 2005-10-27 Raja R Harinath <rharinath@novell.com>
6886 * expression.cs (Invocation.Error_InvalidArguments): Handle
6887 __arglist parameters.
6888 (Invocation.VerifyArgumentsCompat): Likewise.
6889 * support.cs (ReflectionParameters.GetSignatureForError): Print
6890 __arglist parameters.
6891 (InternalParamters.GetSignatureForError): Likewise.
6892 * parameter.cs (Parameters.GetSignatureForError): Likewise.
6894 2005-10-26 Marek Safar <marek.safar@seznam.cz>
6896 * attribute.cs (GetPropertyValue): Made public.
6898 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
6900 Add new property WrapNonExceptionThrows to handle 2.0 assembly
6902 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
6905 * driver.cs: Reflect method name change.
6907 * statement.cs (Try.Resolve): Warn when try has both general
6910 * typemanager.cs: runtime_compatibility_attr_type new predefined
6913 2005-10-26 Raja R Harinath <harinath@gmail.com>
6916 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
6917 treat it as an empty parameter list.
6919 2005-10-26 Raja R Harinath <rharinath@novell.com>
6922 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
6923 ResolveAsTypeStep silent.
6924 * statement.cs (Block.AddConstant): Mark block as used.
6925 (Block.ResolveMeta): Avoid piling on error messages
6926 if a constant initializer resolution fails.
6928 2005-10-25 Raja R Harinath <rharinath@novell.com>
6930 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
6932 (NamespaceEntry.VerifyAllUsing): New.
6933 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
6934 behaviour. Delegates actual resolution of alias to ...
6935 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
6936 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
6938 * driver.cs (Driver.MainDriver): Update.
6940 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
6941 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
6943 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
6945 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
6946 RootNamespace.DefineNamespacesForAll.
6948 2005-10-24 Raja R Harinath <harinath@gmail.com>
6950 * typemanager.cs (assemblies, external_aliases, modules)
6951 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
6952 (ComputeNamespaces, GetRootNamespace): Remove extra staging
6953 overhead. Move resposibility ...
6954 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
6955 * driver.cs, attribute.cs, codegen.cs: Update to changes.
6957 2005-10-23 Raja R Harinath <harinath@gmail.com>
6959 * namespace.cs (RootNamespace.all_namespaces): Renamed from
6960 cached_namespaces. Improve usage.
6961 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
6962 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
6963 Move from GlobalRootNamespace and simplify.
6964 (RootNamespace.Global): Make instance variable.
6965 (RootNamespace.RootNamespace): Add "alias name" parameter.
6966 (GlobalRootNamespace): Simplify drastically.
6967 (Namespace.Lookup): Don't use GetNamespace.
6968 * typemanager.cs (GetRootNamespace): Rename from
6969 ComputeNamespaceForAlias.
6970 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
6972 2005-10-23 Marek Safar <marek.safar@seznam.cz>
6974 * anonymous.cs (AnonymousContainer): Don't crash when container
6977 2005-10-23 Marek Safar <marek.safar@seznam.cz>
6979 * expression.cs (Binary.DoResolve): Warn when comparing same
6982 2005-10-23 Marek Safar <marek.safar@seznam.cz>
6985 * expression.cs (Binary.DoResolve): It looks like there are no
6986 convetsion rules in enum context.
6988 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6990 Add support for extern alias qualifiers.
6991 * typemanager.cs: Move some LookupTypeReflection code
6992 to namespace.cs, to have cleaner code. Added some methods
6993 to help us keep track of the extern aliased references.
6994 * driver.cs: Add suport for extern alias assemblies on command
6995 line and check for their warnings/errors. Also keep track of the
6996 extern aliased assemblies.
6997 * namespace.cs: Move the global functionality of Namespace
6998 to GlobalRootNamespace/RootNamespace. Now the global namespace
6999 is GlobalRootNamespace.Globa. Also the code moved from
7000 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
7001 Finally added LocalAliasEntry (AliasEntry before) and
7002 ExternAliasEntry, to handle alias statements.
7003 * cs-parser.jay: Add support in the grammar for extern alias
7005 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
7006 Update callings to Namespace (now in GlobalRootNamespace).
7008 2005-10-18 Raja R Harinath <rharinath@novell.com>
7011 * class.cs (TypeContainer.DefineType): Move updating of
7012 topological sort earlier in the code.
7013 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
7015 2005-10-18 Marek Safar <marek.safar@seznam.cz>
7018 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
7020 * constant.cs (Constant.TryReduce): Moved from Cast class.
7021 (Reduce): Made little bit more OO and fixed missing conversions.
7023 * ecore.cs (Reduce): Implemented.
7024 (Binary.EnumLiftUp): New method to upgrade values to enum values.
7026 * literal.cs (Reduce): Implemented.
7028 * class.cs: Reverted Miguel's wrong commit.
7030 2005-10-14 Miguel de Icaza <miguel@novell.com>
7032 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
7034 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
7036 * cs-parser.jay, expression.cs : CS0214 was missing error location
7037 for constants. Fixed bug #76404.
7039 2005-10-11 Marek Safar <marek.safar@seznam.cz>
7042 * convert.cs (ExplicitConversionCore): Fixed object->enum
7045 2005-10-10 Raja R Harinath <rharinath@novell.com>
7047 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
7049 (PropertyExpr.EmitCall): Likewise.
7050 * expression.cs (Invocation.EmitArguments): Handle case where
7052 (Invocation.EmitCall): Avoid allocating temporary variable if
7053 there are no arguments.
7055 2005-10-07 Raja R Harinath <rharinath@novell.com>
7058 * convert.cs (ImplicitConversionStandard): Move conversion of
7059 void* to arbitrary pointer types ...
7060 (ExplicitConversionStandard): .. here.
7061 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
7062 error to always print typenames.
7064 2005-10-07 Raja R Harinath <rharinath@novell.com>
7066 * convert.cs (GetConversionOperator): Rename from
7067 GetConversionOperators. Move operator selection code from ...
7068 (UserDefinedConversion): ... here.
7070 2005-10-06 Marek Safar <marek.safar@seznam.cz>
7072 * convert.cs (ExplicitConversionCore): Removed duplicate enum
7075 2005-10-05 Marek Safar <marek.safar@seznam.cz>
7077 * assign.cs (Assign.DoResolve): Error method changed.
7079 * cfold.cs (DoConstantNumericPromotions): Error method changed.
7081 * const.cs (ResolveValue): Reset in_transit immediately.
7083 * constant.cs: Error method changed.
7085 * convert.cs: Removed useless location parameter.
7086 (ExplicitNumericConversion): Don't do double enum check.
7087 (ExplicitConversionCore): Renamed from ExplicitConversion.
7088 (ExplicitUnsafe): Extracted from ExplicitConversion.
7089 (ExplicitConversion): Uses for error reporting.
7091 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
7093 (ResolveBoolean): Uses common error method.
7094 (CastToDecimal): Get rid of ec.
7095 (CastFromDecimal): Optimized.
7096 (ConvCast): Get rid of ec.
7098 * enum.cs (ResolveValue): Reset in_transit immediately.
7099 (Emit): Return after first error.
7101 * expression.cs: Convert changes.
7103 * literal.cs: Error method changed.
7105 * statement.cs: Error method changed.
7107 2005-10-03 Raja R Harinath <rharinath@novell.com>
7109 * support.cs (SeekableStreamReader.Position): Don't error out when
7110 the requested position is just beyond the end of the current
7113 2005-09-28 Raja R Harinath <rharinath@novell.com>
7115 * support.cs (SeekableStreamReader): Simplify drastically. Don't
7116 try to keep in sync with the byte count of the underlying Stream.
7117 However, this limits us to a window size of 2048 characters: i.e.,
7118 the maximum lookahead of our lexer/parser can be 2048 characters.
7120 2005-09-28 Marek Safar <marek.safar@seznam.cz>
7123 * driver.cs: Fix compilation files with full root path.
7125 2005-09-25 Miguel de Icaza <miguel@novell.com>
7127 * report.cs (SymbolRelatedToPreviousError): Format the output so
7128 it does not use an open parenthesis that is never closed.
7130 * driver.cs: Follow coding guidelines
7132 2005-09-27 Marek Safar <marek.safar@seznam.cz>
7135 * const.cs (Const.ResolveValue): Check for assigning non-null
7136 value to reference type.
7138 2005-09-27 Marek Safar <marek.safar@seznam.cz>
7140 * anonymous.cs: Implemented ExprClassName.
7142 * assign.cs (Assign.DoResolve): Don't chrash when type is not
7145 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
7148 * class.cs (StaticClass.DefineContainerMembers): Report protected
7151 * codegen.cs: if(ed) PRODUCTION.
7153 * convert.cs (Error_CannotImplicitConversion): Better error
7156 * cs-parser.jay: More error checks.
7158 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
7160 * driver.cs (CSCParseOption): Enabled wrong option check.
7162 * ecore.cs (Expression.ExprClassName): Turned to property.
7163 (MemberExpr.CheckIntermediateModification): For checking boxed
7164 value types modification.
7166 * statement.cs (Fixed.Resolve): Expression type must be
7167 convertible to fixed type.
7168 (CollectionForeach.GetEnumeratorFilter,TryType):
7169 Small refactoring for easier error checking.
7171 2005-09-26 Marek Safar <marek.safar@seznam.cz>
7173 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
7176 * class.cs (GeneratedBaseInitializer): New class for customization
7177 compiler generated initializers.
7178 (MemberBase.DoDefine): Check Obsolete attribute here.
7179 (FieldMember.DoDefine): Ditto.
7181 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
7184 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
7185 (MemberCore.GetObsoleteAttribute): Removed argument.
7186 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
7187 (MemberCore.CheckObsoleteType): New helper.
7191 * statement.cs: Updates after MemberCore changes.
7193 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
7194 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
7196 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
7197 obsolete attribute for compiler construct.
7198 (As.DoResolve): Cache result.
7200 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
7202 2005-09-26 Raja R Harinath <rharinath@novell.com>
7205 * expression.cs (This.VerifyFixed): In a value type T, the type of
7206 'this' is T&, iow, 'this' is either an out or ref parameter. In a
7207 value type R, 'this' is treated as a value parameter.
7209 2005-09-22 Miguel de Icaza <miguel@novell.com>
7211 * statement.cs (Lock): Use the TemporaryVariable class instead of
7212 manually using local variables as those do not work when variables
7215 * ecore.cs: Moved the TemporaryVariable class from being a nested
7216 class inside Foreach to be a public class that can be employed in
7219 2005-09-19 Marek Safar <marek.safar@seznam.cz>
7221 * cs-parser.jay: interface_accessors replaced by
7222 accessor_declarations.
7224 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
7227 * statement.cs (GotoCase.Resolve): Convert null constant to
7229 (SwitchLabel.ResolveAndReduce): Ditto.
7230 (SwitchLabel.NullStringCase): Custom null stamp.
7231 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
7233 typemanager.cs (CSharpSignature): Don't skip first argument
7236 2005-09-18 Miguel de Icaza <miguel@novell.com>
7238 * driver.cs: Set InEmacs based on the environment variable EMACS.
7240 * location.cs (InEmacs): in this mode, do not report column
7241 location as it confuses Emacs.
7243 2005-09-16 Marek Safar <marek.safar@seznam.cz>
7245 * cfold.cs, constant.cs, convert.cs, ecore.cs,
7246 expression.cs, iterators.cs, literal.cs: Store constants and
7249 * class.cs (MemberBase.ShortName): Pass location.
7251 * cs-parser.jay: Some location fixes.
7253 * ecore.cs (Expression.Location): Made virtual.
7255 2005-09-05 Miguel de Icaza <miguel@novell.com>
7257 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
7258 if the underlying types are the same, otherwise we need to produce
7259 code that will do the proper cast.
7261 This was exposed by Marek's constant rewrite which produced
7262 invalid code for the call site:
7265 void Method (X v) {}
7269 This fixes test-49.cs
7271 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
7273 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
7274 Type/Object should be allowed as well. Fixed bug #75968.
7276 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
7278 * expression.cs : (Binary.DoResolve): when one is enum constant and
7279 another is constant 0, then return enum one *as enum type*.
7282 2005-09-02 Raja R Harinath <rharinath@novell.com>
7284 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
7288 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
7289 flow-branching for LocalVariableReferences in case we were invoked
7290 from a MemberAccess.
7291 * expression.cs (LocalVariableReference.VerifyAssigned): New.
7293 (LocalVariableReference.DoResolveBase): ... this.
7294 (MemberAccess.Resolve): Do the check that was disabled during
7297 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
7300 (PartialContainer.Create): check abstract/sealed/static strictly
7301 but abstract/sealed can exist only at one side. Fixed bug #75883.
7303 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
7306 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
7307 specified, don't default to UnmanagedType.I4.
7309 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
7311 * expression.cs : conditional operator should check possibly
7312 incorrect assign expression. Fixed bug #75946.
7314 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
7316 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
7317 Reverting the change. gmcs is much complex than mcs on this matter.
7319 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
7321 * cs-tokenizer.cs : To read another token ahead of the actual
7322 consumption, use new SavedToken and cache token instead of moving
7323 back the stream with SeekableStreamReader (it seemed problematic).
7325 driver.cs : Thus use StreamReader directly.
7326 * support.cs : Thus removed SeekableStreamReader.
7328 2005-08-30 Raja R Harinath <rharinath@novell.com>
7331 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
7332 (ScopeInfo.EmitScopeType): Use it to construct field names from
7333 names of captured locals.
7336 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
7337 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
7338 Pass 'target_type' to BoxedCast. Don't default to 'object'.
7339 (ExplicitConversion): Remove enum cases already handled by
7340 implicit conversion. Move implicit conversion check to the beginning.
7341 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
7342 * expression.cs (ArrayCreation.EmitDynamicInitializers):
7343 Don't treat System.Enum as a struct.
7345 2005-08-30 Jb Evain <jbevain@gmail.com>
7347 * attribute.cs: handles as expression in parameters.
7349 2005-08-30 Raja R Harinath <rharinath@novell.com>
7352 * class.cs (TypeContainer.VerifyClsName): Don't use a
7353 PartialContainer when verifying CLS compliance.
7354 (AbstractPropertyEventMethod): Set Parent here, ...
7355 (PropertyMethod): ... not here.
7357 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
7359 * attribute.cs : escaped attribute name should not be allowed to be
7360 resolved (e.g. @class as classAttribute). Fixed bug #75930.
7362 2005-08-29 Raja R Harinath <rharinath@novell.com>
7365 * convert.cs (ImplicitStandardConversionExists): Allow zero also
7366 when converting a long constant to unsigned long.
7367 * expression.cs (Invocation.OverloadResolve): Add sanity check to
7368 detect where IsApplicable and VerifyArgumentsCompat disagree.
7370 2005-08-29 Raja R Harinath <rharinath@novell.com>
7371 and Carlos Alberto Cortez <carlos@unixmexico.org>
7374 * class.cs (TypeContainer.CanElideInitializer): New helper.
7375 (TypeContainer.EmitFieldInitializers): Use it to determine if we
7376 can safely emitting the initializer of a field.
7378 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
7380 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
7381 allowed inside a switch (without loop). Fixed bug #75433.
7383 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
7385 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
7386 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
7388 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
7390 * driver.cs : kinda reverting the default encoding changes (not exact
7391 revert since I noticed that "codepage:reset" might not work fine).
7393 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
7395 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
7396 Location. Now getter and setter store location correctly.
7397 (errors/cs0111-12.cs now reports the expected location.)
7399 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
7401 * driver.cs : Use default encoding on the environment.
7402 Removed (now that) extra parameter for SeekableStreamReader.
7403 * support.cs : (SeekableStreamReader) third .ctor() argument for
7404 StreamReader is not required (always true). preamble size could
7405 be acquired in simpler and safe way.
7407 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
7409 * cs-parser.jay: report CS0642 at warning level 3
7410 and report CS0642 for an if else statement also
7411 fixes bug #74745. Patch by John Luke (and a bit
7413 Removed extra CS0642 warning check for "while",
7415 * statement.cs: In Block.Resolve(), CS0642 check
7416 is reimplemented to check a sequence of an empty
7417 statement and a block.
7419 Both fix bug #66777.
7421 2005-08-24 Marek Safar <marek.safar@seznam.cz>
7423 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
7424 detection until I fix it.
7426 * cs-tokenizer.cs: Changed error message.
7428 * cs-parser.jay: Fixed 2 error locations.
7430 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
7431 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
7434 * enum.cs (GetSignatureForError): Fixed.
7436 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
7440 * typemanager.cs (RegisterProperty): Removed.
7442 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
7444 2005-08-24 Raja R Harinath <rharinath@novell.com>
7447 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
7448 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
7450 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
7452 * expression.cs : tiny fix is required for not warning positive ulong.
7455 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
7457 * expression.cs : add CS0652 check for constant and integral
7458 expression. Fixed bug #53974.
7460 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
7462 * expression.cs : in DoNumericPromotions(), check if there is implicit
7463 conversion overload for string (to check CS0034). Fixed bug #52492.
7465 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
7467 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
7469 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
7471 * ecore.cs : report location when it is *not* Null.
7473 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
7479 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
7480 correctly. Fixed bug #75721.
7482 2005-08-23 Raja R Harinath <rharinath@novell.com>
7484 * support.cs (SeekableStreamReader.Position): Avoid an expensive
7485 loop that performs 'min (pos, char_count)'.
7488 * expression.cs (Unary.ResolveOperator): Don't discard implicit
7489 converted value in Operator.OnesComplement.
7491 2005-08-22 Ben Maurer <bmaurer@ximian.com>
7493 * anonymous.cs: If the anon method is pulled into a helper class,
7494 it needs to be `internal' not `private'. Fixes runtime behavior on
7497 2005-08-20 Martin Baulig <martin@ximian.com>
7499 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
7500 scope if we don't already have it.
7502 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
7503 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
7506 2005-08-17 Marek Safar <marek.safar@seznam.cz>
7509 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
7512 2005-08-16 Marek Safar <marek.safar@seznam.cz>
7514 The big constants rewrite
7515 Fix #75746, #75685 and more
7516 As a side effect saved 1MB for MWF ;-)
7518 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
7519 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
7520 enum based for corlib compilation.
7522 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
7525 * class.cs (FixedField.Define): Use ResolveAsConstant.
7527 * const.cs (IConstant): Interface constants and enums.
7528 (Const.ResolveValue): New method for constant resolvning.
7529 (ExternalConstant): Constants from imported assemblies.
7531 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
7532 conversion; like enums.
7533 (Constant.ToType): Converts this constant to different type.
7534 (Constant.Increment): Adds 1.
7536 * convert.cs (ImplicitConversionRequired): Simplified.
7538 * cs-parser.jay: Create EnumMember directly.
7540 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
7542 * doc.cs (GenerateEnumDocComment): Removed.
7544 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
7545 (ConvertIntLiteral): Removed.
7546 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
7548 * enum.cs (EnumMember): Implement IConstant.
7549 (Enum.IsValidEnumConstant): Removed.
7550 (Enum.GetNextDefaultValue): Removed.
7551 (Enum.FindMembers): Updated.
7552 (Enum.GenerateDocComment): Iterate enum members.
7554 * expression.cs (Cast.TryReduce): Handle enums correctly.
7555 (New.Constantify): Made public.
7556 (MemberAccess.DoResolve): Removed contant specific if(s).
7558 * literal.cs (NullLiteral): Implement new abstract methods.
7560 * statement.cs (GotoCase.Resolve): Use new constant methods.
7561 (SwitchLabel.ResolveAndReduce): Use new constant methods.
7563 * typemanager.cs (LookupEnum): Removed.
7564 (IsEnumType): Fixed to work with corlib.
7565 (RegisterConstant): Removed.
7566 (LookupConstant): Removed.
7567 (GetConstant): Changed to work with IConstant.
7569 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
7571 * location.cs : Fixed overflown (>255) column number.
7573 2005-08-03 Raja R Harinath <rharinath@novell.com>
7575 First cut of the qualified-alias-member feature.
7576 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
7578 * cs-parser.jay (DOUBLE_COLON): New token.
7579 (namespace_or_type_name): Add rule for recognizing
7580 qualified-alias-members.
7581 (primary_expression): Likewise.
7582 (element_access): Allow QualifiedAliasMember as a possible
7583 type-bearing expression.
7584 (local_variable_type, local_variable_pointer_type): Likewise.
7585 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
7586 aliases in the current and enclosing namespace declarations.
7587 (NamespaceEntry.UsingAlias): Add CS0440 warning.
7588 * decl.cs (MemberName.is_double_colon): New.
7589 (MemberName.MemberName): Add new constructor for alias-member.
7590 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
7591 * expression.cs (QualifiedAliasMember): New expression type.
7593 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
7595 * location.cs : it borked when no argument was specified.
7597 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
7599 * location.cs : tiny ToString() format fix.
7601 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
7603 * statement.cs : oops, it was missing.
7605 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
7607 A set of fixes for precise line/column location.
7610 "token" field now holds a file/line "delta", a line number offset
7611 from the segment, and a column number. See also:
7612 http://lists.ximian.com/pipermail/mono-devel-list/2004-
7613 December/009508.html
7614 Removed static IsNull. Use instance IsNull property instead.
7616 For some tokens it stores Location. For Identifier it stores
7617 LocatedToken which is a pair of string name and location.
7618 Column numbers are adjusted only at getChar().
7620 Use Location.ToString() for reporting (it now contains column).
7622 Largely modified to use LocatedToken instead of
7623 string (IDENTIFIER), and to acquire Location from some tokens.
7624 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
7625 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
7627 Now MemberName holds Location. DeclSpace.ctor() receives Location
7628 as a parameter. Removed extra parameters to all derived classes.
7629 Replaced Location.IsNull() with instance property.
7630 * assign.cs, expression.cs :
7631 Added .ctor() overload that omits Location.
7633 Added "nameEscaped" flag that indicates the identifier was escaped
7634 in the source file. This fixes bug #57047.
7636 2005-08-02 Marek Safar <marek.safar@seznam.cz>
7638 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
7639 New method, looking for lo-case imported cls type.
7641 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
7644 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
7646 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
7648 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
7650 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
7652 Optimized to save 3.5 MB for SWF compilation.
7654 2005-08-01 Marek Safar <marek.safar@seznam.cz>
7656 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
7657 (PartialContainer.Create): Moved logic AddToContainer.
7658 (PartialContainer.MarkForDuplicationCheck): Shares name.
7660 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
7663 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
7665 (Namespace.GetSignatureForError): New method.
7667 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
7668 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
7670 2005-08-01 Raja R Harinath <rharinath@novell.com>
7673 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
7674 member lookup rather than qualifier_type, since qualifier_type can
7677 2005-08-01 Marek Safar <marek.safar@seznam.cz>
7679 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
7682 2005-07-31 Miguel de Icaza <miguel@novell.com>
7684 * statement.cs: Copy the local exception into the exception
7685 captured local. Fixes 75674
7687 2005-07-31 Raja R Harinath <harinath@gmail.com>
7690 * expression.cs (Invocation.OverloadResolve): Don't report error
7691 CS1501 if error CS1502 has been reported.
7692 (New.DoResolve): Delegate CS1501 reporting to
7693 Invocation.OverloadResolve.
7696 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
7697 invariant-meaning-in-block property in an enclosing block if
7700 2005-07-29 Marek Safar <marek.safar@seznam.cz>
7702 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
7703 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
7704 (Switch.CheckSwitch): Just save 50kb for SWF.
7706 2005-07-27 Martin Baulig <martin@ximian.com>
7708 * anonymous.cs (CaptureContext.AddField): Added
7709 `AnonymousContainer am' argument; compute its toplevel scope if
7710 it's not already computed. Fixes #75649.
7712 2005-07-26 Raja R Harinath <rharinath@novell.com>
7715 * class.cs (Constructor.Emit): Reset block to null if the block
7718 2005-07-25 Marek Safar <marek.safar@seznam.cz>
7720 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
7722 2005-07-25 Marek Safar <marek.safar@seznam.cz>
7724 * class.cs (MethodData.Define): Check whether accessor implementing
7725 interface is public.
7727 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
7729 2005-07-22 Marek Safar <marek.safar@seznam.cz>
7732 * namespace.cs (LookupType): Moved same type check to...
7734 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
7737 2005-07-21 Raja R Harinath <rharinath@novell.com>
7739 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
7740 already found a typebuilder.
7741 * class.cs (MethodCore.IsDuplicateImplementation): Compare
7742 MemberNames, not strings.
7744 * const.cs (Error_ExpressionMustBeConst):
7745 Rename from Error_EpressionMustBeConst.
7746 * const.cs, class.cs, statement.cd: Update.
7748 2005-07-21 Marek Safar <marek.safar@seznam.cz>
7752 * const.cs (Const.LookupConstantValue): Report missing contant expression
7754 (Error_EpressionMustBeConstant): Only one error method.
7756 * class.cs, statement.c: Updated.
7758 2005-07-20 Raja R Harinath <rharinath@novell.com>
7760 * statement.cs (Block.Flags): Add back HasVarargs.
7761 (Block.flags): Make protected.
7762 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
7764 * typemanager.cs (types, typecontainers, user_types): Remove.
7765 (UserTypes, TypeContainers): Likewise.
7766 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
7767 (CleanUp, Reset): Update.
7768 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
7769 (GetNestedType): Use Type.GetNestedType.
7770 (CoreLookupType): Take two arguments, the namespace and the
7771 basename of the type. Update to use the Namespace.Lookup
7773 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
7774 (RealMemberLookup): Use IsNestedChildOf instead of playing with
7775 string concatenation and substring matches.
7776 * class.cs, enum.cs, delegate.cs: Update to changes.
7778 2005-07-20 Marek Safar <marek.safar@seznam.cz>
7780 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
7781 Expression and made virtual.
7783 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
7784 (ImplicitStandardConversionExists): Fixed `byte' typo ?
7786 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
7788 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
7791 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
7794 2005-07-18 Marek Safar <marek.safar@seznam.cz>
7797 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
7798 AssemblyCultureAttribute is not used on executable.
7801 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
7803 2005-07-16 Raja R Harinath <rharinath@novell.com>
7806 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
7807 New. Reports CS0252/CS0253.
7808 Mostly taken from preliminary patch by Duncak Mak.
7809 (Binary.DoResolveOperator): Store results of operator lookup.
7810 Use them to detect if we need to warn about unintended reference
7813 2005-07-15 Raja R Harinath <rharinath@novell.com>
7816 * namespace.cs (Namespace.Lookup): Add back location parameter.
7817 (Namespace.LookupType): Add CS0436 report. Add location parameter.
7818 * delegate.cs, ecore.cs, expression.cs: Update to changes.
7820 * codegen.cs (EmitContext.DeclSpace): Make readonly.
7821 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
7822 (Namespace.LookupType): ... this.
7823 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
7825 * typemanager.cs (LookupTypeReflection): Remove buggy code that
7826 purported to handle pointers.
7827 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
7830 2005-07-15 Marek Safar <marek.safar@seznam.cz>
7832 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
7835 2005-07-15 Raja R Harinath <rharinath@novell.com>
7837 * namespace.cs (Namespace.Lookup): Drop location parameter.
7838 (NamespaceEntry.LookupAlias): Remove. Merge into ...
7839 (NamespaceEntry.Lookup): ... this.
7840 (NamespaceEntry.Error_AmbiguousTypeReference):
7841 Move here from DeclSpace.
7842 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
7844 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
7845 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
7846 Move to NamespaceEntry.
7847 * delegate.cs, expression.cs: Update to changes.
7849 2005-07-14 Marek Safar <marek.safar@seznam.cz>
7851 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
7852 CheckAttributeType and refactored.
7853 (Attribute.ResolvePossibleAttributeType): Changed to reuse
7854 ResolveAsTypeTerminal error handling.
7855 (ResolveAsTypeTerminal): Introduced because of global attributes extra
7857 (GetSignatureForError): Print errors in same way.
7860 * codegen.cs: Reflect attribute GetSignatureForError change.
7863 * expression.cs: Add silent parameter to ResolveAsTypeStep.
7865 * namespace.cs (UsingEntry): Refactored to make fields private.
7868 statement.cs: Error_UnexpectedKind has extra parameter.
7870 2005-07-14 Raja R Harinath <rharinath@novell.com>
7872 * ecore.cs (IAlias): Remove.
7873 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
7874 that implement the interface.
7875 * namespace.cs (Namespace): Likewise.
7876 (Namespace.declspaces): Renamed from 'defined_names'.
7877 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
7878 DeclSpace instead of an IAlias.
7879 * tree.cs (Tree.AddDecl): Update.
7881 2005-07-12 Raja R Harinath <rharinath@novell.com>
7883 * statement.cs (Block.Flags); Remove HasVarargs.
7884 (Block.HasVarargs): Move to ToplevelBlock.
7885 (Block.ThisVariable, Block.AddThisVariable): Likewise.
7886 (Block.Variables): Make protected. Initialize variable hashtable
7888 (Block.AddVariable): Update.
7889 (Block.Resolve): Update to changes.
7890 (ToplevelBlock.HasVarargs): New boolean.
7891 (ToplevelBlock.ThisVariable): Move here from Block.
7892 (ToplevelBlock.AddThisVariable): Likewise.
7893 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
7894 * expression.cs (This.ResolveBase): Update to changes.
7895 (ArglistAccess.DoResolve): Likewise.
7897 2005-07-11 Marek Safar <marek.safar@seznam.cz>
7900 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
7902 * class.cs (TypeContainer.VerifyMembers): Distinguish between
7903 not used and not used & assigned.
7904 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
7906 2005-07-11 Marek Safar <marek.safar@seznam.cz>
7909 * expression.cs (Is.DoResolve): null is never provided type.
7911 2005-07-08 Marek Safar <marek.safar@seznam.cz>
7914 * cs-parser.jay: Less strict event error rule to catch more errors.
7916 2005-07-08 Martin Baulig <martin@ximian.com>
7918 Fix test-iter-10.cs - distinguish whether we `yield' in a property
7919 gettter (allowed) or setter (not allowed).
7921 * class.cs (Accessor): Implement IIteratorContainer.
7922 (Accessor.Yields): New public field.
7923 (PropertyBase.PropertyMethod.Define): Handle iterators on a
7927 (get_accessor_declaration, set_accessor_declaration): Set the
7928 `yields' flag on the accessor, not the property.
7929 (property_declaration): Do the iterators check on a per-accessor
7930 basis and not for the whole property.
7932 2005-07-08 Martin Baulig <martin@ximian.com>
7934 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
7935 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
7937 2005-07-07 Marek Safar <marek.safar@seznam.cz>
7940 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
7941 (ExtractSecurityPermissionSet): Cope with self referencing security
7942 attributes properly.
7944 * driver.cs (SetOutputFile): Made public property OutputFile.
7946 2005-07-07 Raja R Harinath <rharinath@novell.com>
7949 * class.cs (TypeContainer.first_nonstatic_field): Rename from
7950 has_nonstatic_fields. Make into a FieldBase pointer.
7951 (TypeContainer.AddField): Add CS0282 check.
7952 (TypeContainer.EmitType): Update.
7954 2005-07-06 Miguel de Icaza <miguel@novell.com>
7956 * cs-tokenizer.cs (consume_identifier): Do not create strings to
7957 compare if they start with __.
7959 2005-07-06 Raja R Harinath <rharinath@novell.com>
7961 * statement.cs (Switch.SwitchGoverningType): Only look at
7962 UserCasts that don't need implicit standard conversions to one of
7963 the allowed switch types (Fixes test-322.cs).
7964 (LocalInfo.Resolve): Re-enable sanity-test.
7966 2005-07-06 Marek Safar <marek.safar@seznam.cz>
7968 * cs-tokenizer.cs (consume_identifier): Detect double undescores
7970 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
7972 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
7974 2005-07-06 Raja R Harinath <rharinath@novell.com>
7977 * ecore.cs (SimpleName.GetSignatureForError): Add.
7978 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
7979 (MemberAccess.GetSignatureForError): Add.
7981 2005-07-05 Marek Safar <marek.safar@seznam.cz>
7983 The big error and warning messages review.
8013 * typemanager.cs: Updated.
8015 * class.cs: (MethodCore.SetYields): Moved here to share.
8016 (PropertyMethod.Define): Moved iterator setup here.
8018 * iterators.cs: Add orig_method to have full access to parent
8021 2005-07-05 Raja R Harinath <rharinath@novell.com>
8023 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
8024 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
8025 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
8026 variable of struct type.
8027 * expression.cs (Unary.ResolveOperator): Update to change.
8028 (Indirection.VerifyFixed): Likewise.
8029 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
8030 (ParameterReference.VerifyFixed): Value parameters are fixed.
8031 (This.VerifyFixed): Treat 'this' as a value parameter.
8032 * statement.cs (LocalInfo.IsFixed): Remove.
8034 2005-07-01 Martin Baulig <martin@ximian.com>
8036 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
8037 `ec.EmitThis ()' to get the correct scope.
8039 2005-07-01 Martin Baulig <martin@ximian.com>
8041 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
8042 instance is a ParameterReference; fixes #75299.
8044 2005-07-01 Martin Baulig <martin@ximian.com>
8046 Reverted Marek's latest patch (r46725):
8047 - it contains structural changes which are neither mentioned in
8048 the ChangeLog nor explained anywhere; for example the additional
8049 argument of EmitContext's and Iterator's .ctor's and the
8050 TypeContainer.DefineMembers() change.
8051 - structural changes like this should go in in seperate patches
8052 and not be hidden in a huge patch which just seems to affect
8053 warnings and errors.
8054 a big and hard to understand patch.
8055 - it breaks iterators and causes regressions, for instance in
8058 2005-06-30 Raja R Harinath <rharinath@novell.com>
8061 * expression.cs (Indexers.map): Remove.
8062 (Indexers.Append): Filter out inaccessible setters and getters.
8063 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
8066 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
8068 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
8069 (FieldExpr.Emit, PropertyExpr.Emit): Update.
8070 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
8071 * expression.cs (Invocation.EmitCall): Add CS0120 check.
8073 2005-06-30 Marek Safar <marek.safar@seznam.cz>
8076 * class.cs (FieldBase.GetInitializerExpression): One more field
8079 2005-06-28 Miguel de Icaza <miguel@novell.com>
8081 * pending.cs: Do not define a proxy if the base method is virtual,
8082 it will be picked up by the runtime (bug 75270).
8084 2005-06-08 Martin Baulig <martin@ximian.com>
8086 The big Iterators rewrite :-)
8088 * iterators.cs: Rewrite this to use the anonymous methods framework.
8090 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
8091 before the TypeContainers; see 2test-21.cs.
8094 (TypeContainer.DefineType): Don't create a new EmitContext if we
8095 already have one (this only happens if we're an Iterator).
8096 (TypeContainer.Define): Also call Define() on all our iterators.
8097 (Method.CreateEmitContext): Added support for iterators.
8100 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
8101 (AnonymousContainer.CreateMethodHost): Moved here from
8102 AnonymousMethod and made abstract.
8103 (AnonymousContainer.CreateScopeType): New abstract method.
8104 (AnonymousContainer.IsIterator): New public property.
8105 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
8106 get the ScopeTypeBuilder rather than manually defining it here.
8107 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
8110 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
8111 before RootContext.DefineTypes().
8113 * codegen.cs (EmitContext.RemapToProxy): Removed.
8114 (EmitContext.CurrentAnonymousMethod): Changed type from
8115 AnonymousMethod -> AnonymousContainer.
8116 (EmitContext.ResolveTopBlock): Protect from being called twice.
8117 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
8118 (EmitContext.EmitThis): Removed the iterators hacks; use the
8119 anonymous methods framework for that.
8122 (ToplevelBlock.Container): Make this a property, not a field.
8123 (ToplevelBlock.ReParent): New public method; move the
8124 ToplevelBlock into a new container.
8125 (Foreach.TemporaryVariable): Simplify.
8127 2005-06-05 Martin Baulig <martin@ximian.com>
8129 * statement.cs (LocalInfo.CompilerGenerated): New flag.
8130 (Block.AddTemporaryVariable): New public method; creates a new
8131 `LocalInfo' for a temporary variable.
8132 (Block.EmitMeta): Create the LocalBuilders for all the temporary
8134 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
8135 non-iterator variables.
8137 2005-06-05 Martin Baulig <martin@ximian.com>
8139 * statement.cs (Foreach.TemporaryVariable): Create the
8140 LocalBuilder in the Emit phase and not in Resolve since in some
8141 situations, we don't have an ILGenerator during Resolve; see
8142 2test-19.cs for an example.
8144 2005-06-04 Martin Baulig <martin@ximian.com>
8146 **** Merged r45395 from GCS ****
8148 The big Foreach rewrite - Part II.
8150 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
8151 with `PropertyInfo ienumerator_getcurrent'.
8153 * codegen.cs (VariableStorage): Removed.
8156 (Foreach): Derive from Statement, not ExceptionStatement.
8157 (Foreach.CollectionForeach): New nested class. Moved all the code
8158 dealing with collection foreach here.
8159 (Foreach.ForeachHelperMethods): Removed.
8160 (Foreach.TemporaryVariable): Implement IMemoryLocation.
8162 2005-05-23 Martin Baulig <martin@ximian.com>
8164 * statement.cs (Try.DoResolve): Don't create a `finally' if we
8165 don't need to. Fix #75014.
8167 2005-05-20 Martin Baulig <martin@ximian.com>
8169 Merged r44808 from GMCS.
8171 * class.cs (TypeContainer.CircularDepException): Removed.
8172 (TypeContainer.DefineType): Removed the `InTransit' stuff.
8173 (TypeContainer.CheckRecursiveDefinition): Check for circular class
8174 (CS0146) and interface (CS0529) dependencies here.
8176 2005-06-21 Raja R Harinath <rharinath@novell.com>
8178 * expression.cs (Invocation.EmitCall): Fix initialization
8179 'this_call' to reflect current behaviour. Fix indentation.
8181 * convert.cs (FindMostEncompassedType): Add two trivial special
8182 cases (number_of_types == 0 || number_of_types == 1).
8183 (FindMostEncompasingType): Likewise.
8185 2005-06-17 Raja R Harinath <rharinath@novell.com>
8187 Some cleanups preparing for the fix of #75283.
8188 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
8190 (EventExpr.InstanceResolve): Likewise.
8191 (EventExpr.DoResolve): Remove redundant checks.
8193 2005-06-10 Duncan Mak <duncan@novell.com>
8195 * cs-tokenizer.cs (process_directives): New flag for controlling
8196 the processing of preprocessor directives.
8197 (x_token): After seeing a '#', return Token.NONE instead of going
8198 to handle_preprocessing_directive() when not processing
8199 directives. This avoids unnecessary processing during the token peek in
8204 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
8205 the existing error reporting methods instead of Report.Error.
8207 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
8208 after Raja's rewrite.
8210 2005-06-08 Miguel de Icaza <miguel@novell.com>
8212 * class.cs: Small fix.
8214 2005-06-08 Raja R Harinath <rharinath@novell.com>
8217 * class.cs (GetPartialBases): Fix return value check of
8220 2005-06-07 Raja R Harinath <rharinath@novell.com>
8222 Ensure that partial classes are registered in their enclosing
8223 namespace. Initial part of fix of #75160.
8224 * tree.cs (Tree.RecordDecl): Add new namespace argument.
8225 Register declspace with namespace here, not in
8226 DeclSpace.RecordDecl.
8227 * cs-parser.jay: Pass namespace to RecordDecl.
8228 * class.cs (PartialContainer.Create): Likewise.
8229 (ClassPart.DefineType): New sanity-check. Throws an exception if
8231 * decl.cs (Declspace.RecordDecl): Remove.
8232 * namespace.cs (NamespaceEntry.DefineName): Remove.
8234 2005-06-06 Marek Safar <marek.safar@seznam.cz>
8236 * rootcontext.cs: Reset TargetExt as well.
8238 2005-06-03 Raja R Harinath <rharinath@novell.com>
8240 * ecore.cs (Expression.Resolve): Emit CS0654 error when
8243 2005-06-02 Raja R Harinath <rharinath@novell.com>
8245 Fix #75080, cs0119.cs.
8246 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
8248 (Expression.Resolve): ... this. Use it. Remove bogus code
8249 allowing ExprClass.Type and ExprClass.Namespace for
8250 ResolveFlags.VariableOrValue.
8251 (Expression.Resolve) [1-argument variant]: Change default resolve
8252 flags based on language version.
8253 (Expression.Error_UnexpectedKind): Use a simple string array
8254 rather than an ArrayList.
8255 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
8257 (TypeOfVoid.DoResolve): Likewise.
8258 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
8259 flags argument -- it always has the same value.
8261 2005-05-31 Raja R Harinath <rharinath@novell.com>
8264 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
8265 Use it in the error message.
8266 * assign.cs, expression.cs, statement.cs: Update.
8268 2005-05-30 Raja R Harinath <rharinath@novell.com>
8271 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
8272 the "almostMatchedMember" case too.
8273 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
8274 that failed the accessibility checks to 'almost_match'.
8276 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
8278 * attribute.cs: Use internal MethodBuilder methods to set
8279 ExactSpelling and SetLastError on PInvoke methods, instead
8280 of passing them via charset. Fixes #75060.
8282 2005-05-27 Raja R Harinath <rharinath@novell.com>
8284 * parameter.cs (Parameter): Remove TODO comment.
8285 (Parameter.DefineParameter): Remove Location parameter.
8286 (Parameters.LabelParameters): Likewise.
8287 * class.cs (Constructor.Emit): Update to change.
8288 (MethodData.Emit): Likewise.
8289 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
8290 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
8292 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
8295 Removed Parameters.Location and added Parameter.Location instead.
8296 Removed Location parameter from Emit() and GetSignature().
8303 Modified all related calls.
8305 2005-05-26 Raja R Harinath <rharinath@novell.com>
8307 Improve user-defined conversion handling.
8308 * convert.cs (GetConversionOperators): Rewrite. Return only the
8309 applicable operators.
8310 (AddConversionOperators): New. Helper for GetConversionOperators.
8311 (FindMostEncompassedType, FindMostEncompassingType): Verify that
8312 there is only one most encompassed/encompassing type.
8313 (FindMostSpecificSource, FindMostSpecificTarget): Remove
8314 "applicable operator" handling.
8315 (UserConversion): Move cache here from GetConversionOperators.
8316 Directly cache the chosen operator, rather than the whole
8318 (ExplicitNumericConversion): Fix buggy implementation of Decimal
8319 case. Allow conversion of decimal to sbyte and byte too.
8320 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
8321 New static methods. Used to avoid allocating EmptyExpressions in
8324 2005-05-24 Duncan Mak <duncan@novell.com>
8326 * ecore.cs (CastFromDecimal): New class for casting a decimal to
8327 another class, used in Convert.ExplicitNumericConversion.
8328 (CastToDecimal): New class, similar to above, but casts to
8329 System.Decimal, used in Convert.ImplicitNumericConversion and also
8330 in explicit convesion from double/float to decimal.
8332 * convert.cs (ImplicitNumericConversion): Handle implicit
8333 conversions to System.Decimal.
8334 (ExplicitNumericConversion): handle explicit conversions to
8339 2005-05-20 Miguel de Icaza <miguel@novell.com>
8341 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
8342 know the type at this stage, just break through. Fixes #75008
8344 2005-05-19 Martin Baulig <martin@ximian.com>
8347 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
8348 to disable error reporting.
8350 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
8351 here since we don't want to report an error; see the new test-336.cs.
8353 2005-05-19 Raja R Harinath <rharinath@novell.com>
8355 * statement.cs (ToplevelBlock.GetParameterReference)
8356 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
8357 Move here from class Block.
8358 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
8359 * expression.cs (ParameterReference.DoResolveBase): Likewise.
8361 2005-05-18 Martin Baulig <martin@ximian.com>
8366 (FlowBranching.Reachability): Add non-static public And() and Or()
8368 (FlowBranchingSwitch): New class; do the `break_origins' thing
8369 like in FlowBranchingLoop.
8370 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
8371 reachability, not just locals and parameters.
8372 (FlowBranching.MergeChild): Remove some of the hacks for loop and
8373 switch; MergeBreakOrigins() now takes care of that.
8375 2005-05-18 Martin Baulig <martin@ximian.com>
8377 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8378 a loop and may leave it, reset the barrier; fixes #74974.
8380 2005-05-17 Marek Safar <marek.safar@seznam.cz>
8382 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
8385 * cs-parser.jay: Catch more lexical errors.
8387 * report.cs: Add one more Error method.
8390 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
8392 2005-05-17 Martin Baulig <martin@ximian.com>
8394 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
8397 2005-05-16 Raja R Harinath <rharinath@novell.com>
8399 Fix test-382.cs. Emit values of decimal constants.
8400 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
8402 (TypeContainer.AddField): ... this.
8403 (TypeContainer.EmitFieldInitializers): Allow the list of fields
8404 with initializers to include 'Const's.
8405 (ClassPart.RegisterFieldForInitialization): Forward to
8407 * const.cs (Const.Const): Pass initializer to base class.
8408 (Const.Define): In case of decimal constants, register them for
8409 initialization in a static constructor.
8411 2005-05-14 Martin Baulig <martin@ximian.com>
8413 * statement.cs (Block.Resolve): Correctly handle unreachable code;
8414 do not call ResolveUnreachable() on unreachable statements in
8415 here, see the comment in the source code.
8417 2005-05-13 Raja R Harinath <rharinath@novell.com>
8420 * expression.cs (BinaryResolveOperator): If one of the operands of
8421 an equality comparison is 'null' and the other is a pointer type,
8422 convert the null to a NullPointer.
8423 * convert.cs (ImplicitReferenceConversion): If the expression is a
8424 NullLiteral and the target type is a pointer type, return a
8425 NullPointer instead.
8426 (ImplicitConversionStandard): Likewise.
8428 2005-05-13 Marek Safar <marek.safar@seznam.cz>
8430 * cs-parser.jay: Set readonly context based on special constructs.
8432 * expression.cs (LocalVariableReference.DoResolveBase): Improved
8433 readonly variable error handling.
8435 * rootcontext.cs (EmitCode): Don't verify members when error
8438 * statement.cs (LocalInfo): Add reaodnly context information.
8439 (SetReadOnlyContext, GetReadOnlyContext): New methods.
8441 2005-05-13 Raja R Harinath <rharinath@novell.com>
8443 * statement.cs (Block.Resolve): Revert change below. Modify fix
8444 for #74041 to initialize 'resolved' to false only for explicit
8445 blocks. Fixes #74873.
8447 2005-05-12 Raja R Harinath <harinath@gmail.com>
8450 * typemanager.cs (unmanaged_enclosing_types): New.
8451 (IsUnmanagedType): Avoid infloops by using
8452 'unmanaged_enclosing_types' to talk with recursive invocations.
8454 2005-05-13 Martin Baulig <martin@ximian.com>
8456 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
8457 instance variable, not a local. Fix #74873.
8458 (Block.ResolveUnreachable): Set it to true here.
8460 2005-05-11 Duncan Mak <duncan@novell.com>
8462 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
8463 continuing to process for 'arg'.
8464 (handle_preprocessing_directive): Check the argument of the #endif
8465 directive and report error CS1025 if there are any trailing
8468 According to the C# spec, having even whitespace after the #endif
8469 directive is illegal; however, because we call arg.TrimEnd ()
8470 beforehand, we have the same behavior as csc, allowing whitespace
8471 after the directive.
8475 2005-05-11 Marek Safar <marek.safar@seznam.cz>
8479 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
8480 (Constructor.GetObsoleteAttribute): Implemented correctly.
8482 2005-05-10 Martin Baulig <martin@ximian.com>
8484 * support.cs (ReflectionParameters.ParameterModifier): Use
8485 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
8486 and `ParameterAttributes.In'. Fixes #74884.
8488 2005-05-10 Marek Safar <marek.safar@seznam.cz>
8490 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
8492 * expression.cs (Argument.GetParameterModifier): Turned to property.
8493 (Invocation.Error_InvalidArguments): Add more descriptive errors.
8495 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
8498 2005-05-09 Raja R Harinath <rharinath@novell.com>
8501 * decl.cs (MemberCache.AddMethods): Register override methods,
8502 rather than non-override methods.
8503 * typemanager.cs (RegisterOverride): New.
8504 (IsOverride): Update.
8506 2005-05-09 Marek Safar <marek.safar@seznam.cz>
8510 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
8511 recursive declaration.
8513 * statement.cs (Block.ResolveMeta): Report any error in resolving.
8515 2005-05-06 Marek Safar <marek.safar@seznam.cz>
8517 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
8519 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
8521 2005-05-05 Raja R Harinath <rharinath@novell.com>
8524 * decl.cs (DeclSpace.FamilyAccessible):
8525 Use TypeManager.IsNestedFamilyAccessible.
8527 Fix reopened #64812.
8528 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
8531 2005-05-04 Raja R Harinath <rharinath@novell.com>
8532 Abin Thomas <projectmonokochi@rediffmail.com>
8533 Anoob V E <projectmonokochi@rediffmail.com>
8534 Harilal P R <projectmonokochi@rediffmail.com>
8537 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
8538 allow access to all static members.
8540 2005-05-04 Martin Baulig <martin@ximian.com>
8542 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
8544 2005-05-04 Martin Baulig <martin@ximian.com>
8548 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
8549 section at the end; make things work if `default' is not the last
8552 2005-05-04 Martin Baulig <martin@ximian.com>
8556 * statement.cs (Switch): Replaced the `got_default' field with a
8557 `default_section' one.
8558 (Switch.CheckSwitch): Set `default_section' here.
8559 (Switch.Resolve): If we're a constant switch and the constant is
8560 not found, use the default section.
8562 2005-05-03 Martin Baulig <martin@ximian.com>
8564 * expression.cs (ArrayAccess.EmitGetLength): New public method.
8566 * statement.cs (Foreach.ArrayForeach): New nested class.
8567 (Foreach.TemporaryVariable): New nested class.
8568 (Foreach.EmitArrayForeach): Removed; this is now in the new
8571 2005-05-03 Raja R Harinath <rharinath@novell.com>
8573 * pending.cs (BaseImplements): Move the #74773 fix here. This is
8575 (VerifyPendingMethods): Revert change below.
8577 * typemanager.cs (IsOverride, RegisterNonOverride): New.
8578 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
8579 that used to trigger warning -28. Remove warning -28.
8580 * expression.cs (Invocation.OverloadResolve): Use
8581 TypeManager.IsOverride to distinguish override methods.
8584 * pending.cs (VerifyPendingMethods): If a base type implements the
8585 requested interface, don't bother checking individual methods of
8586 the base type. As a side-effect, this prevents the creation of
8587 unnecessary proxies.
8589 2005-05-02 Martin Baulig <martin@ximian.com>
8593 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
8594 Also `And' the locals if the old vector is null.
8595 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
8596 null; in this case we basically reset all the variables.
8598 2005-05-02 Martin Baulig <martin@ximian.com>
8602 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
8603 Added `FlowBranching branching' argument; always `and' the
8604 variables instead of `or'ing them unless we're an infinite loop.
8606 * statement.cs (While.Resolve): Create a new sibling unless we're
8609 2005-05-02 Martin Baulig <martin@ximian.com>
8613 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
8614 arguments; use it instead of creating a new TopLevelBlock.
8615 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
8616 our ConstructorInitializer.
8619 (TopLevelBlock.TopLevelBranching): New public property.
8620 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
8621 and create our `TopLevelBranching'.
8623 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
8624 anonymous method host, use `block.TopLevelBranching' rather than
8625 creating a new branching.
8627 2005-04-20 Miguel de Icaza <miguel@novell.com>
8629 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
8630 a ScopeInfo, if any of the current children is a child of the new
8631 entry, move those children there.
8633 2005-04-30 Martin Baulig <martin@ximian.com>
8635 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
8636 at the beginning of a SwitchSection. Fix #73335.
8638 2005-04-27 Marek Safar <marek.safar@seznam.cz>
8641 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
8643 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
8644 (FieldExpr.DoResolve): Obsolete members are ignored for field
8647 2005-04-26 Marek Safar <marek.safar@seznam.cz>
8649 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
8650 of arrays detection.
8652 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
8654 (Field.VerifyClsCompliance): Volatile fields are not compliant.
8656 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
8659 2005-04-25 Ben Maurer <bmaurer@ximian.com>
8661 * cs-parser.jay: Use the prefered version of -unsafe in error
8664 2005-04-22 Marek Safar <marek.safar@seznam.cz>
8666 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
8669 2005-04-20 John Luke <john.luke@gmail.com>
8671 * driver.cs: fix typo in error message, --outout to --output
8673 2005-04-20 Marek Safar <marek.safar@seznam.cz>
8675 * codegen.cs (InRefOutArgumentResolving): New field.
8677 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
8678 fields outside contructor.
8680 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
8682 2005-04-19 Miguel de Icaza <miguel@novell.com>
8684 * anonymous.cs (CaptureContext.EmitParameterInstance): The
8685 parameter code was not completed ever, so it was not as up-to-date
8686 as local variables. Must finish it.
8688 The bug fix was to compare the Toplevel of the block, not the
8689 current block. Thanks for Ben for pointing this out.
8691 2005-04-19 Raja R Harinath <rharinath@novell.com>
8693 * decl.cs (AddMethods): Use the declaring type of the problem
8694 method to determine if we want to squash a warning.
8696 2005-04-19 Marek Safar <marek.safar@seznam.cz>
8698 * attribute.cs: Removed debug output.
8700 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
8702 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
8705 2005-04-18 Raja R Harinath <rharinath@novell.com>
8708 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
8709 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
8710 all null comparisons against reference types.
8712 2005-04-18 Marek Safar <marek.safar@seznam.cz>
8715 * class.cs (TypeContainer.CircularDepException) New nested
8717 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
8718 (TypeContainer.DefineType): Removed error, reset InTransit before
8720 (Class.DefineType): Throw exception when is in Transit.
8721 Catch exception and report error.
8722 (Struct.DefineType): Throw exception when is in Transit.
8723 Catch exception and report error.
8724 (Interface.DefineType): Throw exception when is in Transit.
8725 Catch exception and report error.
8727 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
8728 handle nested exception handlers.
8730 * flowanalysis.cs (InTryWithCatch): New method, search for try with
8733 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
8734 InFinally and InCatch storage.
8736 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
8737 (Catch.Resolve): Set and Restore ec.InCatch.
8738 (Try.Resolve): Set and Restore ec.InFinally.
8739 (Try.HasCatch): True when try has catch.
8741 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
8743 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
8744 for the same event member, so exclude such cases from warning 419.
8747 2005-04-16 Miguel de Icaza <miguel@novell.com>
8749 * expression.cs (Binary.ResolveOperator): Apply patch from John
8750 Luke to fix bug 59864: operators &, | and ^ on enumerations
8751 require that the same enum type on both sides.
8753 * driver.cs: Add warnings to old flag usage, this is to assist
8754 people who produce Makefiles and hope that the Makefiles will be
8757 * class.cs (TypeContainer.EmitType): Moved the definition of the
8758 special $PRIVATE$ field from the resolve phase to the Emit phase.
8759 During resolve we do not know if we are a struct with
8760 HasExplicitLayout, we know this only after the attributes for the
8763 Set the FieldOffset to zero on the dummy field that we create for
8764 the class. Fixes 74590.
8766 2005-04-16 Raja R Harinath <rharinath@novell.com>
8769 * ecore.cs (PropertyExpr.resolved): New.
8770 (DoResolve): Use it to handle a case of double resolution here.
8771 Handle a case of identical-name-and-type-name.
8772 * expression.cs (ArrayCreation.CheckIndices): Avoid double
8773 resolution by storing the results of expression resolution back
8774 into the "probes" array.
8776 2005-04-15 Raja R Harinath <rharinath@novell.com>
8778 Fix cs0208-7.cs and cs0208-8.cs.
8779 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
8780 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
8781 error reporting to point out the reason a struct is not unmanaged.
8783 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
8785 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
8786 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
8788 2005-04-13 Raja R Harinath <rharinath@novell.com>
8791 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
8792 IdenticalNameAndTypeName here.
8793 (EventExpr.InstanceResolve): Likewise.
8795 2005-04-13 Marek Safar <marek.safar@seznam.cz>
8797 C# 2.0 DefaultCharSetAttribute implementation
8799 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
8800 which allows us to set GlobalNamespace for every resolve.
8801 (Attribute.ResolveArguments): Cut from Resolve.
8802 (Attribute.GetCharSetValue): Returns CharSet named argument.
8803 (Attribute.DefinePInvokeMethod): Gets default charset from
8805 (GlobalAttribute.ResolveAsTypeStep): Override.
8806 (GlobalAttribute.ResolveArguments): Override.
8808 * class.cs (TypeAttr): Is protected.
8810 * codegen.cs (ModuleClass.DefaultCharSet): New member.
8811 (ModuleClass.DefaultCharSetType): New memeber.
8812 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
8814 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
8815 charset from module.
8817 * delegate.cs (TypeAttr): Override.
8818 (Delegate.DefineType): Use this TypeAttr.
8820 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
8821 at very early stage (before types are defined) to resolve model
8822 module attributes. It will probably not work with corlib but it
8825 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
8826 charset from module.
8828 * typemanager.cs (default_charset_type): New type.
8830 2005-04-13 Raja R Harinath <rharinath@novell.com>
8832 * decl.cs (MemberCache.AddMethods): Don't warn if
8833 System.Object.Finalize has buggy MethodAttributes.
8835 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
8838 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
8840 * doc.cs : detect ambiguous reference to overloaded members.
8841 Fixed bug #71603. MS 1.1 csc does not detect it.
8843 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
8845 * doc.cs : delegates must not be referenced with parameters.
8848 2005-04-12 Miguel de Icaza <miguel@novell.com>
8850 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
8852 2005-04-10 Miguel de Icaza <miguel@novell.com>
8854 * driver.cs (MainDriver): Stop processing if the CLS stage found
8857 (CompilerCallableEntryPoint.InvokeCompiler): Always
8858 reset after execution; Take a TextWriter argument for the
8861 * report.cs: Use the error stream instead of hardcoding stderr.
8863 2005-04-09 Miguel de Icaza <miguel@novell.com>
8865 * class.cs: Reduce code paths to test, too small of an
8866 optimization to make it worth the extra testing. Always perform
8869 2005-04-08 Raja R Harinath <rharinath@novell.com>
8872 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
8873 operators that had errors reported on them.
8875 2005-04-08 Marek Safar <marek.safar@seznam.cz>
8877 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
8879 (Attribute.Resolve): Add named argument type checking.
8881 * class.cs (FixedField.Define): Use IsPrimitiveType
8883 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
8885 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
8886 unsafe parameter types.
8888 * statement.cs (Using.ResolveExpression): Add better error description.
8890 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
8892 2005-04-08 Raja R Harinath <rharinath@novell.com>
8895 * attribute.cs (Attribute.GetAttributeUsage): Resolve
8896 AttributeUsageAttribute in the emitcontext of the attribute class,
8897 not in the emitcontext of the attributable entity it was attached to.
8898 * cs-parser.jay: Use 'current_class', not 'current_container',
8899 when creating a GlobalAttribute.
8901 2005-04-08 Alp Toker <alp@atoker.com>
8903 * pending.cs: The fix to #58413 failed to compile methods implementing
8904 interfaces with/without params modifiers and vice versa, even though
8905 params modifiers aren't part of the signature. Make the modifier check
8906 less strict as in csc.
8908 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
8909 Anoob V E <projectmonokochi@rediffmail.com>
8910 Harilal P R <projectmonokochi@rediffmail.com>
8913 * pending.cs (TypeAndMethods.mods): New. Store the parameter
8914 modifiers of pending methods.
8915 (PendingImplementation.PendingImplementation): Initialize it.
8916 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
8917 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
8918 with ParameterData. Add check for modifiers.
8919 * class.cs (MethodData.Define): Update to changes.
8921 2005-04-07 Raja R Harinath <rharinath@novell.com>
8923 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
8925 2005-04-07 Marek Safar <marek.safar@seznam.cz>
8927 * class.cs (PropertyMethod.Define): Check private accessor in abstract
8930 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
8933 * typemanager.cs: Registered RequiredAttributeAttribute.
8935 2005-04-06 Marek Safar <marek.safar@seznam.cz>
8937 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
8938 Warning CS0169 is back at level 3.
8939 (IMethodData.SetMemberIsUsed): New method.
8941 * decl.cs (IsUsed): New value; moved from FieldBase.Status
8942 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
8944 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
8946 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
8948 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
8951 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
8954 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
8955 to avoid the problems with nested types.
8957 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
8958 Anoob V.E <projectmonokochi@rediffmail.com>
8959 Harilal P.R <projectmonokochi@rediffmail.com>
8960 Raja R Harinath <rharinath@novell.com>
8963 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
8965 * typemanager (GetConstructor): Make public.
8967 2005-04-05 John Luke <john.luke@gmail.com>
8968 Raja R Harinath <rharinath@novell.com>
8971 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
8972 struct too. Return false quicker in a few cases.
8973 (VerifyUnManaged): Use it.
8975 2005-04-05 Raja R Harinath <rharinath@novell.com>
8978 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
8979 not 'unreachable_seen'.
8981 2005-04-04 Marek Safar <marek.safar@seznam.cz>
8983 * attribute.cs (Attribute.GetValue): Removed unused.
8985 * codegen.cs (CodeGen.TrimExt): Removed unused.
8987 * cs-parser.jay (output): Removed unused.
8989 * cs-tokenizer.cs (hex_digits): Removed unused.
8991 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
8993 * expression.cs (Indirection.LoadExprValue): Removed unused.
8994 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
8996 * iterators.cs (Iterator.param_types): Removed unused.
8998 * statement.cs (Goto.block): Removed unused.
8999 (ToplevelBlock.did): Removed unused.
9000 (Switch.ResolveConstantSwitch): Removed unused.
9002 2005-04-01 Ben Maurer <bmaurer@ximian.com>
9004 * rootcontext.cs: Allow mcs to bootstrap with the compilation
9007 2005-04-01 Raja R Harinath <rharinath@novell.com>
9009 Fix #74232 and cs0208-3.cs.
9010 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
9011 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
9012 unmanaged type. Don't use FieldBuilders when 't' is a
9013 TypeBuilder. Use ModFlags and MemberType fields.
9014 * class.cs (MemberBase.member_type): Rename from MemberType.
9015 (MemberBase.MemberType): New property. Determines member_type on
9017 (MemberBase.DoDefine): Don't initialize MemberType here.
9018 (FieldMember.Define): Likewise.
9020 2005-04-01 Marek Safar <marek.safar@seznam.cz>
9023 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
9024 Attributes are emitted there.
9026 2005-04-01 Raja R Harinath <rharinath@novell.com>
9028 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
9029 keyword in 'partial enum' too.
9030 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
9032 Report from Kamil Skalski <nazgul@omega.pl>.
9035 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
9036 have partial containers too.
9038 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
9039 in block' checks to Block.CheckInvariantMeaningInBlock.
9040 * statement.cs (Block.GetKnownVariableInfo): Make private.
9041 (Block.IsVariableUsedInChildBlock): Remove.
9042 (Block.IsVariableUsedInBlock): Likewise.
9043 (Block.CheckInvariantMeaningInBlock): New. Show location of
9044 conflicting declaration.
9045 (Block.AddVariable): Make error messages less long-winded and more
9046 specific. Show location of conflicting declaration.
9047 * parameter.cs (Parameters.Location): New readonly property.
9049 2005-03-31 Raja R Harinath <rharinath@novell.com>
9051 Clean up semantics of invoking ResolveMemberAccess.
9052 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
9053 can have an instance, ensure that we pass in a non-TypeExpression
9054 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
9055 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
9056 argument. Update to changes and simplify.
9057 (FieldExpr.Emitinstance): Remove CS0120 check.
9058 (PropertyExpr.EmitInstance): Likewise.
9059 * expression.cs (Argument.Resolve): Likewise.
9060 (Invocation.DoResolve): Update to changes in semantics of
9063 2005-03-31 Marek Safar <marek.safar@seznam.cz>
9066 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
9069 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
9071 2005-03-31 Raja R Harinath <rharinath@novell.com>
9073 Fix difference in behaviour with commandline invocation.
9074 * driver.cs (Driver.Reset): New.
9075 (CompilerCallableEntryPoint): Call it.
9077 * statement.cs (If.Resolve): Avoid spurious "uninitialized
9078 variable" warnings if the boolean expression failed to resolve.
9080 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
9082 * attribute.cs: Fix the union of several permissions when some of them
9083 are unrestricted (so the result isn't an unrestricted permission set).
9086 2005-03-30 Raja R Harinath <rharinath@novell.com>
9088 * ecore.cs (MemberExpr): New class. Convert from interface
9090 (MemberExpr.ResolveMemberAccess): Refactor and move here from
9091 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
9093 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
9094 (MethodGroupExpr.IsExplicitImpl): Remove.
9095 (Expression.GetFieldFromEvent): Remove.
9096 (SimpleName.MemberStaticCheck): Remove.
9097 (SimpleName.DoSimpleNameResolve): Update to changes.
9098 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
9099 (MemberAccess.IdenticalNameAndTypeName): Remove.
9100 (MemberAccess.error176): Move to MemberExpr.
9101 (MemberAccess.DoResolve): Update to changes.
9102 (BaseAccess.DoResolve): Likewise.
9104 2005-03-30 Marek Safar <marek.safar@seznam.cz>
9106 C# 2.0 Conditional attribute class implementation
9108 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
9109 Analyzes class whether it has attribute which has ConditionalAttribute
9110 and its condition is not defined.
9112 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
9113 (Class.IsExcluded): New method. Search for at least one defined
9114 condition in ConditionalAttribute of attribute class.
9116 2005-03-30 Raja R Harinath <rharinath@novell.com>
9118 * ecore.cs (PropertyExpr): Derive from Expression, not
9119 ExpressionStatement.
9120 (PropertyExpr.EmitStatement): Remove.
9122 2005-03-29 Raja R Harinath <rharinath@novell.com>
9125 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
9126 internal field "value__" of an enum be private. The examples for
9127 "value__" that I found on MSDN all used FieldAttributes.Private.
9129 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
9130 Don't mention IL method attribute names.
9132 Fix #47991. Remove a TODO.
9133 * statement.cs (Block.Toplevel): Make into a field.
9134 (Block.Parameters): Move into ToplevelBlock.
9135 (Block.known_variables): Rename from child_variable_names.
9136 (Block.Block): Remove variants that take Parameters. Initialize
9137 'Toplevel' with the immediately surrounding toplevel block.
9138 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
9139 LocalInfo parameter.
9140 (Block.GetKnownVariableInfo): New.
9141 (Block.IsVariableNameUsedInChildBlock): Update.
9142 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
9143 the block, even though it may not be in scope.
9144 (Block.AddVariable): Remove Parameters parameter. Use
9145 Toplevel.Parameters instead.
9146 (Block.AddConstant): Remove Parameters parameter.
9147 (Block.GetParameterReference): Update to use Toplevel.Parameters.
9148 (Block.IsParamaterReference): Likewise.
9149 (Block.IsLocalParameter): Likewise. Simplify a lot.
9150 (ToplevelBlock.Parameters): New. Moved from Block.
9151 (ToplevelBlock.ToplevelBlock): Update to changes. Always
9152 initialize Parameters to a non-null value.
9153 * cs-parser.jay: Update to changes.
9154 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
9155 simple names that mean different things in the same block. Use
9156 Block.IsVariableNameUsedInBlock.
9158 2005-03-28 Raja R Harinath <rharinath@novell.com>
9160 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
9161 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
9162 GetTypeHandle. It is possible for a reflected type to derive from
9163 a TypeBuilder (e.g., int[] derives from the TypeBuilder
9164 System.Array during mscorlib compilation).
9165 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
9166 contain a method_hash, don't create one either. Don't create a
9167 deep copy of the base cache's method_hash.
9168 (MemberCache.SetupCache): Rename back from DeepCopy.
9169 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
9170 already initialized. If we see an override function, add its
9171 underlying base virtual function to the member_hash too.
9173 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
9175 2005-03-26 Raja R Harinath <harinath@acm.org>
9178 * assign.cs (Assign.DoResolve): When the RHS of an assignment
9179 fails to resolve, ensure that the LHS is still resolved as an
9182 2005-03-25 Raja R Harinath <harinath@acm.org>
9184 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
9186 (Enum.current_ec): Remove.
9187 (Enum.LookupEnumValue): Remove EmitContext argument.
9188 Just uses the one created during DefineType.
9189 (Enum.FindMembers): Update.
9190 * expression.cs (MemberAccess.DoResolve): Update.
9192 2005-03-22 Marek Safar <marek.safar@seznam.cz>
9194 * assign.cs (Assign.DoResolve): Check for CS1717 when
9195 source and target are same (uses Equals).
9197 * expression.cs (LocalVariableReference, ParameterReference,
9198 This): Implemented Equals, GetHashCode.
9200 * statement.cs (Block.GetParameterReference): Removed useless
9203 2005-03-22 Raja R Harinath <rharinath@novell.com>
9206 * statement.cs (Block.AddVariable): Ensure that we skip implicit
9207 blocks before deciding whether the error is cs0136 or cs0128.
9209 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
9210 (using_alias_directive, using_namespace_directive): Pass
9211 MemberName, not an expression to Namespace.UsingAlias and
9213 (MakeName): Use the MemberName of the namespace.
9214 * namespace.cs (Namespace.MemberName): New.
9215 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
9216 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
9218 * decl.cs (MemberName.Name): Make readonly.
9219 (MemberName.FromDotted): New "constructor".
9220 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
9221 (MemberCore.Name): Compute from MemberName on demand.
9222 (MemberCore.SetMemberName): Provide a way to change the
9224 (MemberCore.AddToContainer): Don't take a fullname parameter.
9225 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
9226 fully qualified name of the container to the member name.
9227 (TypeContainer.AddToTypeContainer): Use a fully qualified name
9228 only if the type is a member of the root container.
9229 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
9230 MemberName.Left rather than searching for an embedded ".".
9231 (PartialContainer.CreatePart): Update to changes in RootContext.
9232 (MemberBase.ShortName): Turn into a property. Use
9233 MemberCore.SetMemberName.
9234 (MemberBase.ExplicitInterfaceName): Remove.
9235 (MemberBase.UpdateMemberName): Remove.
9236 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
9237 (PropertyBase.SetMemberName): New override.
9238 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
9239 (Tree.GetDecl): New.
9240 (Tree.AllDecls): Rename from Decls.
9241 * attribute.cs, enum.cs, report.cs: Update to changes.
9242 * driver.cs (MainDriver): Use MemberName.FromDotted on
9243 RootContext.MainClass.
9245 2005-03-21 Marek Safar <marek.safar@seznam.cz>
9247 * class.cs (FixedField.Define): Check for CS1664 and more sanity
9250 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
9252 2005-03-18 Marek Safar <marek.safar@seznam.cz>
9254 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
9255 property accessor modifiers.
9257 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
9258 fixed buffer attribute (CS1716).
9259 (PropertyMethod.HasCustomAccessModifier): When property accessor
9260 has custom modifier.
9262 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
9264 (PropertyExpr.DoResolveLValue): Add CS0272.
9266 2005-03-17 Miguel de Icaza <miguel@novell.com>
9268 * convert.cs: When converting to a pointer, use the proper Conv.U
9269 or Conv.I depending on the source data type.
9271 * cs-tokenizer.cs: Make the size for large decimal constants,
9274 2005-03-17 Martin Baulig <martin@ximian.com>
9276 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
9277 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
9279 2005-03-17 Martin Baulig <martin@ximian.com>
9281 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
9282 to bool so we can return an error condition.
9283 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
9286 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
9288 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
9291 2005-03-16 Raja R Harinath <rharinath@novell.com>
9293 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
9294 Refactor to avoid traversing the list of assemblies, and to avoid
9295 string concatenation.
9296 * typemanager.cs (guid_attr_type): Remove.
9297 (negative_hits, pointers, references): Remove hashes.
9299 (GetConstructedType): New. Uses type_hash to handle constructed
9300 types (arrays, references, pointers).
9301 (GetReferenceType, GetPointerType): Use it.
9302 (GetNestedType): New. Uses type_hash to handle nested types of
9304 (LookupType, LookupTypeDirect): Remove.
9305 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
9306 'types' hash and LookupTypeReflection directly.
9307 (params_string, params_object): Use GetConstructedType.
9308 * namespace.cs (Namespace.cached_types): New. Cache of reflected
9310 (Namespace.Lookup): Use cached_types.
9311 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
9312 provided by old TypeManager.LookupType.
9313 * rootcontext.cs (MakeFQN): Remove.
9314 * decl.cs (DeclSpace.MakeFQN): Likewise.
9315 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
9316 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
9317 TypeManager.GetConstructedType.
9318 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
9320 2005-03-15 Marek Safar <marek.safar@seznam.cz>
9322 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
9325 * cs-parser.jay: Reports CS1527 for any namespace element.
9327 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
9330 * expression.cs (ParameterReference.IsAssigned): Changed error to
9332 (Error_WrongNumArguments): Moved CS0245 detection here.
9334 * statement.cs (Return.Resolve): Add CS1622 report.
9336 2005-03-11 Marek Safar <marek.safar@seznam.cz>
9338 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
9340 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
9342 * attribute.cs expression.cs: Get rid of some allocations.
9344 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
9346 * doc.cs : just eliminate the latest change.
9348 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
9350 * doc.cs : commented out the latest change. It breaks xml-030.cs
9352 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
9354 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
9355 fail. So invoke CreateType() in FindDocumentedType().
9357 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
9359 * cs-tokenizer.cs : added IsKeyword().
9360 * doc.cs : Detect keyword incorrectly used as identifier.
9361 Allow identifiers prefixed by @.
9363 2005-03-10 Marek Safar <marek.safar@seznam.cz>
9365 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
9366 It caused exception in namespace resolving (again!).
9368 * class.cs (Class.ctor): Removed exit.
9369 (PropertyMethod.ctor): ditto.
9371 * codegen.cs (Codegen.Reset): Reset static data.
9372 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
9374 * cs-tokenizer.cs (Cleanup): Removed.
9376 * driver.cs (GetSystemDir): Rewrote to one line command.
9377 It caused problem with unloaded dynamic modules.
9378 (UnixParseOption): Removed Exit.
9379 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
9380 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
9381 Now can be mcs used as library.
9383 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
9386 * location.cs (Reset): Reset static data.
9388 * namespace.cs (Reset): Reset static data.
9390 * report.cs (Report.Reset): Reset static data.
9392 * rootcontext.cs (RootContext.Reset): Reset static data.
9394 * tree.cs (RootTypes.ctor): Use Location.Null
9396 * typemanager.cs (TypeManager.Reset): Reset static data.
9397 (CoreLookupType): Removed Exit.
9398 (TypeHandle.Reset): Reset static data.
9400 2005-03-10 Raja R Harinath <rharinath@novell.com>
9403 * typemanager.cs (ComputeNamespaces): Import namespaces from
9404 referenced modules too.
9406 2005-03-09 Raja R Harinath <rharinath@novell.com>
9408 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
9411 2005-03-09 Raja R Harinath <rharinath@novell.com>
9413 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
9414 enclosing DeclSpace. This ensures that a name-lookup populates
9415 more caches and there are fewer 'TypeExpression's. Carve out
9416 nested type lookup into ...
9417 (LookupNestedTypeInHierarchy): ... this.
9419 2005-03-09 Raja R Harinath <rharinath@novell.com>
9421 Clean up a few partial-class semantics.
9422 Fixes test-357.cs and cs1618-2.cs.
9423 * cs-parser.jay (struct_declaration): Use 'current_class' as
9424 parent of newly-created struct. Remove call to Register ().
9425 Use 'pop_current_class' to complete handing the current struct.
9426 (interface_declaration): Likewise.
9427 (class_declaration): Likewise.
9428 (enum_declaration): Use 'current_class' as parent of newly created
9430 (delegate_declaration): Likewise.
9431 (pop_current_class): New function. This is used to handle closing
9432 up the 'current_class' and 'current_container', and pointing them
9433 to the enclosing class/container.
9434 (CSharpParser): Initialize 'current_class' too.
9435 * decl.cs (MemberCore): Add check for invariant: a partial
9436 container is not a parsed entity, and thus does not enclose any
9438 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
9439 (DeclSpace.BaseTypeExpr): Use it.
9440 (DeclSpace.LookupType): Add check for invariant.
9441 * class.cs (TypeContainer): Add check for invariant: a nested
9442 class should have the same NamespaceEntry as its enclosing class.
9443 (TypeContainer.EmitFieldInitializers): Make virtual.
9444 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
9446 (TypeContainer.Register): Remove.
9447 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
9448 null. Use TypeResolveEmitContext for resolving base types and
9449 interfaces. Move initialization of Parts.TypeBuilder here from
9451 (TypeContainer.DefineNestedTypes): ... here.
9452 (PartialContainer): Take a Namespace not a NamespaceEntry.
9453 (PartialContainer.Create): Don't use Register. Call the
9454 appropriate Add... function directly.
9455 (ClassPart): Take both the PartialContainer and the enclosing
9456 class as constructor arguments.
9457 (ClassPart.EmitFieldInitializers): Override.
9458 (ClassPart.PartFindNestedTypes): Remove.
9459 (FieldBase.GetInitializerExpression): Resolve the initializer
9460 expression in the emit context of the enclosing class.
9461 * tree.cs (RootTypes): Remove Register ().
9463 2005-03-08 Marek Safar <marek.safar@seznam.cz>
9465 * cs-parser.jay: Removed CS0134.
9467 * driver.cs: Removed CS1901.
9469 * expression.cs (SizeOf.DoResolve): Don't report CS0233
9470 for predefined types.
9472 2005-03-07 Duncan Mak <duncan@novell.com>
9474 * codegen.cs (Save): Catch UnauthorizedAccessException as
9475 well. Fixes bug #73454.
9477 2005-03-07 Marek Safar <marek.safar@seznam.cz>
9479 * cs-tokenizer.cs (xtoken): Add CS1035.
9481 * class.cs (MethodData.Define): Add CS0683.
9482 (FieldMember.ctor): Add CS0681.
9484 2005-03-07 Raja R Harinath <rharinath@novell.com>
9486 * ecore.cs (SimpleName.DoResolve): Rename from
9487 SimpleName.DoResolveAllowStatic.
9488 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
9489 Pass 'intermediate' flag to MemberStaticCheck.
9490 (SimpleName.MemberStaticCheck): Skip "static check" only in case
9491 of "intermediate" lookups via MemberAccess.
9492 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
9493 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
9495 2005-03-07 Raja R Harinath <rharinath@novell.com>
9498 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
9499 slipped in because of variable names that are identical to a
9500 builtin type's BCL equivalent ('string String;', 'int Int32;').
9501 (PropertyExpr.EmitInstance): Likewise.
9503 2005-03-04 Marek Safar <marek.safar@seznam.cz>
9505 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
9507 * report.cs (warning_ignore_table): Made public.
9509 2005-03-04 Raja R Harinath <rharinath@novell.com>
9512 * class.cs (MethodData.Emit): Pass 'container' to
9513 container.GetObsoleteAttribute instead of 'container.Parent'.
9515 2005-03-03 Marek Safar <marek.safar@seznam.cz>
9517 * cs-parser.jay: Add 1534 error test.
9519 * iterators.cs (Yield.CheckContext): Add error 1629.
9520 (Iterator.ctor): Save unsafe modifier.
9521 (MoveNextMethod.DoEmit): Restore unsafe context.
9523 * namespace.cs (UsingAlias): Better error message.
9525 2005-03-03 Dan Winship <danw@novell.com>
9527 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
9528 the warning message [#73219]
9530 2005-03-03 Raja R Harinath <rharinath@novell.com>
9532 Fix compile with MCS 1.0.0.0.
9533 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
9534 w_restore to not depend on string constant folding.
9536 2005-03-03 Raja R Harinath <rharinath@novell.com>
9538 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
9539 CS0246 check to users who passed 'silent = false'.
9540 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
9542 (SimpleName.SimpleNameResolve): Update.
9543 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
9544 (MemberAccess.IdenticalNameAndTypeName): Update.
9545 * doc.cs (FindDocumentedTypeNonArray): Update.
9547 2005-03-03 Raja R Harinath <rharinath@novell.com>
9549 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
9550 * parameters.cs (ComputeAndDefineParameters): Remove.
9551 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
9552 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
9553 Use GetParameterInfo.
9555 2005-03-02 Marek Safar <marek.safar@seznam.cz>
9557 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
9559 2005-03-02 Raja R Harinath <rharinath@novell.com>
9561 Unify DeclSpace.LookupType and DeclSpace.FindType.
9562 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
9563 is in charge of defining nested types on demand.
9564 (DeclSpace.LookupType): Use it when the current_type is a
9565 TypeBuilder. Use LookupTypeDirect for reflected types.
9566 (DeclSpace.FindType): Remove.
9567 (DeclSpace.LookupInterfaceOrClass): Likewise.
9568 (DeclSpace.DefineTypeAndParents): Likewise.
9569 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
9570 DeclSpace.LookupType.
9571 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
9572 * typemanager.cs (LookupType): Simplify.
9573 (AddUserType): Remove type from negative_hits.
9574 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
9575 * class.cs (TypeContainer.FindMembers): Move handling of nested
9577 (TypeContainer.FindMembers_NestedTypes): ... here.
9578 (TypeContainer.FindNestedType): Implement override.
9579 (ClassPart.FindNestedType): Delegate to PartialContainer.
9580 (ClassPart.PartFindNestedType): Looks up the nested types of the
9583 2005-03-02 Martin Baulig <martin@ximian.com>
9585 * class.cs (TypeContainer.DoDefineMembers): We also need a default
9586 static constructor in static classes.
9588 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
9590 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
9591 sizeParamIndex is not specified.
9593 2005-03-01 Marek Safar <marek.safar@seznam.cz>
9596 * report.cs (WarningMessage.IsEnabled): Missing null check.
9598 2005-02-28 Marek Safar <marek.safar@seznam.cz>
9600 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
9601 in the fields and not in the properties.
9603 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
9605 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
9608 2005-02-28 Marek Safar <marek.safar@seznam.cz>
9610 * attribute.cs: Small refactoring (improved robustness).
9611 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
9612 (ValidateGuid): Removed.
9613 (Resolve): Removed referenced to above mentioned.
9614 (GetAttributeUsage): Made private and changed to work without
9616 (GetIndexerAttributeValue): Don't crash.
9617 (GetConditionalAttributeValue): Ditto.
9618 (GetClsCompliantAttributeValue): Ditto.
9619 (ExtractSecurityPermissionSet): All attributes exceptions are
9621 (GetPropertyValue): New helper.
9622 (GetMethodImplOptions): New method.
9623 (DefinePInvokeMethod): Reuse common code. Implemented handling of
9624 some missing properties.
9626 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
9627 (Method.ApplyAttributeBuilder): Updated.
9629 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
9632 2005-02-28 Raja R Harinath <rharinath@novell.com>
9635 * report.cs (Report.SymbolRelatedToPreviousError): Handle
9636 non-simple types (array, pointer, reference).
9638 2005-02-28 Marek Safar <marek.safar@seznam.cz>
9640 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
9642 * class.cs (MethodCore.IsDuplicateImplementation): Special error
9644 (Method.CheckBase): Catch wrong destructor here.
9645 (MethodData.Define): Add errors 550, 668.
9647 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
9649 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
9651 * pending.cs (VerifyPendingMethods): Add error 551.
9653 * typemanager.cs (CSharpName): Next error report helper.
9655 2005-02-25 Marek Safar <marek.safar@seznam.cz>
9657 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
9658 attributes. Removed useless attribute double check.
9659 It saves almost 2MBs for corlib.
9661 2005-02-25 Raja R Harinath <rharinath@novell.com>
9664 * statement.cs (ExpressionStatement.Resolve): Make robust to being
9665 called twice in case of error.
9667 2005-02-23 Chris Toshok <toshok@ximian.com>
9669 Fix compiler portions of #72827.
9670 * statement.cs (Block.Emit): call Begin/EndScope on the
9671 EmitContext instead of the ILGenerator.
9673 * codegen.cs (EmitContext.BeginScope): new method, call
9674 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
9676 (EmitContext.BeginScope): same, but EndScope and CloseScope
9678 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
9679 offset and call the superclass's OpenScope(int) with it.
9680 (SymbolWriter.CloseScope): get the current il
9681 offset and call superclass's CloseScope(int) with it.
9683 2005-02-23 Marek Safar <marek.safar@seznam.cz>
9685 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
9686 CS1677 for out and ref as well.
9688 * class.cs (Method.Define): Add error CS1599 detection.
9690 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
9692 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
9694 * delegate.cs (Delegate.Define): Add error CS1599 detection.
9696 * support.cs.cs (ModifierDesc): New helper method.
9698 2005-02-23 Raja R Harinath <rharinath@novell.com>
9699 Abin Thomas <projectmonokochi@rediffmail.com>
9700 Anoob V E <projectmonokochi@rediffmail.com>
9701 Harilal P R <projectmonokochi@rediffmail.com>
9704 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
9705 MemberLookup (used for error reporting) actually returns a result.
9706 Fix error report number (122, not 112).
9708 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
9709 Anoob V E <projectmonokochi@rediffmail.com>
9710 Harilal P R <projectmonokochi@rediffmail.com>
9713 * pending.cs (PendingImplementation.GetAbstractMethods):
9714 Find NonPublic members too.
9716 2005-02-22 Marek Safar <marek.safar@seznam.cz>
9718 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
9721 * class.cs (MethodCore.CheckMethodAgainstBase):
9722 Add error 239 report.
9724 2005-02-21 Raja R Harinath <rharinath@novell.com>
9727 * expression.cs (Invocation.IsApplicable): Make public.
9728 (Invocation.IsParamsMethodApplicable): Likewise.
9729 * delegate.cs (Delegate.VerifyApplicability): Don't use
9730 Invocation.VerifyArgumentCompat for parameter applicability
9731 testing. Use Invocation.IsApplicable and
9732 Invocation.IsParamsMethodApplicable.
9734 2005-02-21 Marek Safar <marek.safar@seznam.cz>
9736 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
9738 * class.cs (Operator.Define): Add error 217 report.
9740 2005-02-21 Raja R Harinath <rharinath@novell.com>
9742 * namespace.cs (UsingEntry.Resolve): Undo change below.
9744 2005-02-21 Raja R Harinath <rharinath@novell.com>
9747 * ecore.cs (Expression.MemberLookupFailed): Add argument to
9748 disable the error message when the extended MemberLookup also
9750 (Expression.MemberLookupFinal): Update.
9751 (SimpleName.DoSimpleNameResolve): Update.
9752 * expression.cs (MemberAccess.ResolveNamespaceOrType):
9753 Don't use MemberLookupFinal.
9754 (New.DoResolve): Update.
9755 (BaseAccess.CommonResolve): Update.
9757 2005-02-21 Raja R Harinath <rharinath@novell.com>
9760 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
9761 occured previously, don't resolve again.
9763 2005-02-21 Marek Safar <marek.safar@seznam.cz>
9766 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
9767 argument. Call ResolveAttributeUsage for unresolved.
9768 when types doesn't match ctor arguments.
9770 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
9771 for nested attribute classes.
9772 (Class.attribute_usage): Removed.
9773 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
9774 for attribute class.
9776 * ecore.cs (IsAttribute): Removed.
9778 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
9780 * rootcontext.cs (RegisterAttribute): Removed, attributes are
9782 (attribute_types): Removed.
9783 (EmitCode): Global attributes are emited as the latest.
9785 2005-02-18 Marek Safar <marek.safar@seznam.cz>
9787 * class.cs (EmitFieldInitializers): Don't emit field initializer
9788 for default values when optimilization is on.
9790 * constant.cs (Constant.IsDefaultValue): New property.
9792 * driver.cs: Add /optimize handling.
9796 * literal.cs: Implement new IsDefaultValue property.
9798 * rootcontext.cs (Optimize): New field, holds /optimize option.
9800 2005-02-18 Raja R Harinath <rharinath@novell.com>
9802 Fix crasher in re-opened #72347.
9803 * namespace.cs (Namespace.Lookup): Return null if
9804 DeclSpace.DefineType returns null.
9807 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
9809 2005-02-18 Raja R Harinath <rharinath@novell.com>
9811 Fix remainder of #63202. Change semantics of DoResolveLValue: it
9812 now returns null if it cannot resolve to an lvalue.
9813 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
9814 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
9815 returned null. Remove check for SimpleName.
9816 (EventExpr.DoResolveLValue): New.
9817 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
9818 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
9820 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
9822 (Unary.ResolveOperator): Move CS0211 check ...
9823 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
9825 (Unary.DoResolveLValue): Simplify.
9826 (AddressOf.DoResolveLValue): New.
9827 (ArrayAccess.DoResolveLValue): New.
9829 2005-02-16 Marek Safar <marek.safar@seznam.cz>
9831 * attribute.cs (Attribute.Resolve): Add arguments casting for
9832 when types doesn't match ctor arguments.
9834 2005-02-16 Raja R Harinath <rharinath@novell.com>
9836 Fix parts of #63202.
9837 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
9838 lookup of operator in base type. Ensure that all checks happen
9839 when the operator resolves to an "op_..." method.
9841 2005-02-15 Raja R Harinath <rharinath@novell.com>
9844 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
9845 'ignore_cs0104' parameter. Pass it to ...
9846 (NamespaceEntry.Lookup): ... this.
9847 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
9848 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
9849 (TypeLookupExpression.DoResolveAsTypeStep): Update.
9850 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
9851 Update. Request that cs0104 errors be ignored.
9852 (ComposedCast.ResolveAsTypeStep): Update.
9854 2005-02-14 Raja R Harinath <rharinath@novell.com>
9857 * expression.cs (Invocation.BetterFunction): Remove support for
9858 comparing virtual functions and their overrides.
9859 (Invocation.IsOverride): New.
9860 (Invocation.OverloadResolve): Don't consider 'override' functions
9861 during candidate selection. Store them in a lookaside list.
9862 If the selected method is a 'virtual' function, use the list to
9863 find any overrides that are closer to the LHS type.
9865 2005-02-14 Marek Safar <marek.safar@seznam.cz>
9867 * expression.cs (New.DoResolve): Add complex core type reduction.
9868 (New.Constantify): Converts complex core type syntax like 'new int ()'
9871 2005-02-14 Raja R Harinath <rharinath@novell.com>
9873 * decl.cs (EntryType.EntryType): New constructor to create an
9874 updated copy of a cache entry.
9875 (MemberCache.AddMethods): Use it.
9876 (MemberCache.ClearDeclaredOnly): Remove.
9877 (MemberCache.MemberCache): Update.
9879 2005-02-11 Miguel de Icaza <miguel@novell.com>
9881 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
9882 variable. This one is represents the actual low-level declaration
9883 of the method, as opposed to the semantic level `IsStatic'.
9885 An anonymous method which is hosted into a static method might be
9886 actually an instance method. IsStatic would reflect the
9887 container, while MethodIsStatic represents the actual code
9890 * expression.cs (ParameterReference): Use the new MethodIsStatic
9891 instead of IsStatic.
9893 * anonymous.cs (AnonymousMethod.Compatible): Pass the
9894 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
9895 set on the current EmitContext.
9897 * expression.cs (Cast): Overload DoResolveLValue so we can pass
9898 resolve our casted expression as an LValue. This triggers the
9899 proper LValue processing that is later required by Assign.
9903 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
9905 2005-02-11 Marek Safar <marek.safar@seznam.cz>
9907 C# 2.0 Fixed buffer implementation
9909 * anonymous.cs: Update after RegisterHelperClass renaming.
9911 * attribute.cs (AttributeTester.fixed_buffer_cache):
9912 Cache of external fixed buffers.
9913 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
9914 implementation if field is fixed buffer else null.
9917 (TypeContainer.AddField): Accept FieldMember instead of Field.
9918 (FieldBase.IsFieldClsCompliant): Extracted code from
9919 VerifyClsCompliance descendant customization.
9920 (FixedField): New class handles fixed buffer fields.
9921 (FixedFieldExternal): Keeps information about imported fixed
9923 (IFixedField): Make access to internal or external fixed buffer
9926 * cs-parser.jay: Add fixed buffer parsing.
9928 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
9931 * expression.cs (Indirection): Extended implementation to accept
9933 (PointerArithmetic.Emit): Get element from fixed buffer as well.
9934 (ElementAccess.MakePointerAccess): Get type as parameter.
9935 (DoResolve): Add fixed buffer field expression conversion.
9936 (DoResolveLValue): Ditto.
9937 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
9938 (ArrayPtr): Derives from FixedBufferPtr.
9939 (ArrayPtr.Emit): Add extra emit for array elements.
9941 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
9943 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
9944 for compiler generated types.
9945 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
9947 * statement.cs (Fixed): Refactored to be easier add fixed buffer
9948 and consume less memory.
9949 (Fixed.Resolve): Add fixed buffer case.
9951 * typemanager.cs (compiler_generated_attr_ctor,
9952 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
9953 (HasElementType): Add our own implementation to work on every
9956 2005-02-11 Miguel de Icaza <miguel@novell.com>
9958 * anonymous.cs (CaptureContext): Track whether `this' has been
9961 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
9962 only captured `this' if it was implicitly done (instance
9963 methods/variables were used).
9965 * codegen.cs (EmitContext.CaptureThis): New method to flag that
9966 `this' must be captured.
9968 2005-01-30 Miguel de Icaza <miguel@novell.com>
9970 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
9971 is null it means that there has been no need to capture anything,
9972 so we just create a sibling.
9974 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
9976 Just a partial fix. The other half is fairly elusive.
9978 2005-02-10 Raja R Harinath <rharinath@novell.com>
9980 Fix #52586, cs0121-4.cs.
9981 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
9982 and return a hashtable.
9983 (MemberCache.ClearDeclaredOnly): New.
9984 (MemberCache.MemberCache): Update to change. Make a deep copy of
9985 the method_hash of a base type too.
9986 (MemberCache.AddMethods): Adapt to having a deep copy of the base
9987 type methods. Overwrite entries with the same MethodHandle so
9988 that the ReflectedType is correct. The process leaves in base
9989 virtual functions and their overrides as distinct entries.
9990 (CacheEntry): Now a class instead of a struct. It shouldn't alter
9991 matters since it was boxed in a ArrayList before.
9992 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
9994 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
9995 case of a virtual function and its override (choose the overload
9997 (Invocation.OverloadResolve): Avoid 'override' members during
9998 'applicable_type' calculation.
10000 2005-02-09 Raja R Harinath <rharinath@novell.com>
10002 Combine two near-redundant caches.
10003 * typemanager.cs (method_params): Rename from method_internal_params.
10004 (TypeManager.GetParameterData): New. Replace
10005 Invocation.GetParameterData.
10006 (TypeManager.LookupParametersByBuilder): Remove.
10007 * expression.cs (Invocation.method_parameter_cache): Remove.
10008 (Invocation.GetParameterData): Remove.
10010 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
10013 2005-02-08 Raja R Harinath <rharinath@novell.com>
10016 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
10017 TypeManager.multicast_delegate_type is null, resolve it by looking
10018 up "System.MulticastDelegate".
10019 * rootcontext.cs (RootContext.ResolveCore): Simplify.
10021 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
10022 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
10023 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
10026 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
10027 (LabeledStatement.AddReference): New. Set 'referenced'.
10028 (Goto.Resolve): Use it.
10030 2005-02-05 John Luke <john.luke@gmail.com>
10032 * driver.cs: remove duplicate -doc line in Usage ()
10034 2005-02-04 Raja R Harinath <rharinath@novell.com>
10036 * location.cs (Location.AddFile): Fix CS2002 error report.
10038 2005-02-02 Martin Baulig <martin@ximian.com>
10040 * delegate.cs (Delegate.DefineType): Report an internal error if
10041 TypeManager.multicast_delegate_type is null. See bug #72015 for
10044 2005-02-02 Raja R Harinath <rharinath@novell.com>
10046 Fix a crasher in a variant of #31984.
10047 * const.cs (Constant.CheckBase): New override that defers the
10048 new-or-override check in case the base type hasn't been populated
10050 (Constant.Define): Ensure the new-or-override check is performed.
10052 2005-02-01 Duncan Mak <duncan@ximian.com>
10054 * const.cs (LookupConstantValue): Check that `ce' is not null
10055 before calling GetValue ().
10057 2005-02-01 Raja R Harinath <rharinath@novell.com>
10059 Fix test-334.cs (#69519).
10060 * cs-parser.jay (using_alias_directive): Pass in an expression to
10061 NamespaceEntry.UsingAlias.
10062 (using_namespace_directive): Pass in an expression to
10063 NamespaceEntry.Using.
10064 (namespace_name): Don't flatten to a string.
10065 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
10066 (NamespaceEntry.AliasEntry.Resolve): Lookup using
10068 (NamespaceEntry.UsingEntry): Likewise.
10069 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
10071 (NamespaceEntry.LookupForUsing): Remove.
10072 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
10074 (NamespaceEntry.Lookup): Remove support for dotted names.
10076 2005-02-01 Raja R Harinath <rharinath@novell.com>
10078 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
10080 (NamespaceEntry.ImplicitParent): Compute on demand.
10081 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
10082 parallels the current.
10083 (NamespaceEntry.LookupForUsing): Use it.
10084 (NamespaceEntry.Lookup): If the current namespace-entry is
10085 implicit, don't search aliases and using tables.
10087 2005-02-01 Raja R Harinath <rharinath@novell.com>
10090 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
10092 (TypeContainer.BaseCache): Compute on demand.
10093 (TypeContainer.FindMembers): Define constants and types if they're
10094 not already created.
10095 (FieldMember.Define): Move resetting of ec.InUnsafe before error
10097 * const.cs (Constant.Define): Make idempotent.
10099 2005-01-29 Miguel de Icaza <miguel@novell.com>
10101 * pending.cs: Produce better code (no nops produced by using Ldarg
10104 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
10105 i - 1' it should be arg + 1.
10109 2005-01-28 Raja R Harinath <rharinath@novell.com>
10111 * attribute.cs (Attribute.CheckAttributeType): Make private
10113 (Attribute.ResolveType): Make virtual.
10114 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
10115 handling of RootContext.Tree.Types.
10117 2005-01-27 Raja R Harinath <rharinath@novell.com>
10119 Update attribute-handling to use the SimpleName/MemberAccess
10121 * cs-parser.jay (attribute): Pass in an expression to the
10122 constructors of Attribute and GlobalAttribute.
10123 * attribute.cs (Attribute): Take an expression for the name.
10124 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
10125 passed in attribute name expression.
10126 (Attribute.CheckAttributeType): Use it.
10127 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
10128 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
10129 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
10130 argument to prevent error messages if the lookup fails.
10132 2005-01-27 Marek Safar <marek.safar@seznam.cz>
10134 * expression.cs (Indirection): Implemented IVariable interface
10135 to support indirection in AddressOf operator.
10136 (PointerArithmetic.Emit): Add optimalization for case where
10137 result can be precomputed.
10139 2005-01-26 Martin Baulig <martin@ximian.com>
10141 * class.cs (TypeContainer.AttributeTargets): Return the correct
10142 AttributeTargets depending on our `Kind' instead of throwing an
10143 exception; fixes #71632.
10145 2005-01-26 Marek Safar <marek.safar@seznam.cz>
10148 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
10151 2005-01-25 Raja R Harinath <rharinath@novell.com>
10154 * expression.cs (MemberAccess.DoResolve): Don't complain with
10155 cs0572 when the LHS of a member access has identical name and type
10158 2005-01-25 Marek Safar <marek.safar@seznam.cz>
10161 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
10163 Create custom PermissionSet only for PermissionSetAttribute.
10165 2005-01-24 Marek Safar <marek.safar@seznam.cz>
10168 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
10169 delegates in static class.
10171 2005-01-24 Martin Baulig <martin@ximian.com>
10173 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
10174 merging an implicit block, just use its reachability.
10176 * statement.cs (Block.Resolve): Make the unreachable code check
10177 work wrt. implicit blocks; see test-337 from #63842.
10179 2005-01-21 Alp Toker <alp@atoker.com>
10181 * cs-parser.jay: destructor_declaration's container is PartialContainer
10182 not Class when partial types are used, so use Kind prop instead of
10185 2005-01-22 Miguel de Icaza <miguel@ximian.com>
10187 * cs-parser.jay: Improve error reporting when an interface
10188 declares new types.
10190 2005-01-20 Dick Porter <dick@ximian.com>
10192 * support.cs: SeekableStreamReader fix from Sandor Dobos
10193 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
10194 chars are read. Fixes bug 70369.
10196 2005-01-20 Raja R Harinath <rharinath@novell.com>
10198 * cs-parser.jay (catch_clause): Simplify current_block handling
10201 2005-01-17 Miguel de Icaza <miguel@ximian.com>
10203 * convert.cs (ImplicitStandardConversionExists): Synchronize the
10204 code with ImplicitStandardConversion to handle the implicit
10205 conversion of method groups into valid delegate invocations.
10207 The problem is that in parameter handling we were using this code
10208 path. Fixes bug #64698
10210 2005-01-19 Raja R Harinath <rharinath@novell.com>
10212 * cs-parser.jay: Fix several infelicities.
10213 - Avoid assigning to the parser value stack. Code like
10214 '$3 = null' is unclean. Synthesize a value for the code block
10216 - Avoid using oob_stack for storing location information. Use ...
10217 (_mark_): ... this. New (empty) rule. Saves the current location
10219 (foreach_statement): Avoid using oob_stack for current_block
10220 handling. Use technique used in for_statement and
10221 using_statement. Synthesize a value for the code block to store
10222 additional intermediate information.
10224 2005-01-13 Miguel de Icaza <miguel@ximian.com>
10226 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
10227 of a different type is only allowed to private fields of a
10228 containing type, not on fields of a base class.
10230 See test-174.cs and error cs0122-9.cs
10232 2005-01-13 Raja R Harinath <rharinath@novell.com>
10234 Fix test-335.cs (bug #58126).
10235 * cs-parser.jay (argument): Split out non-expression parts of the
10236 rule into 'non_simple_argument'.
10237 (invocation_expression): Support parenthesized invocations with
10238 multiple arguments, and with single non-simple arguments.
10240 2005-01-13 Raja R Harinath <rharinath@novell.com>
10242 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
10245 2005-01-12 Raja R Harinath <rharinath@novell.com>
10247 Fix cs0038-1.cs, cs1640-6.cs.
10248 * ecore.cs (Expression.Resolve): Remove special-case for
10249 SimpleName in error-handling.
10250 (Expression.almostMatchedMembers): Relax access permission to
10252 (Expression.MemberLookupFailed): Handle duplicates in
10253 almostMatchedMembers list.
10254 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
10255 * expression.cs (New.DoResolve): Report CS1540 for more cases.
10256 * typemanager.cs (GetFullNameSignature): Use the MethodBase
10257 overload if the passed in MemberInfo is a MethodBase.
10259 2005-01-12 Marek Safar <marek.safar@seznam.cz>
10262 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
10263 for non-CAS & merge permission sets properly.
10265 2005-01-11 Raja R Harinath <rharinath@novell.com>
10267 Improve standard-compliance of simple name and member access
10268 resolution. Fixes bugs #52697, #57200, #67520, #69519.
10269 * ecore.cs (FullNamedExpression): New abstract base class
10270 for Namespaces and TypeExpressions.
10271 (ResolveFlags.SimpleName): Remove.
10272 (SimpleName): Remove support for dotted names.
10273 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
10274 DeclSpace.FindType and DeclSpace.LookupType.
10275 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
10276 (Expression.ExprClassName): Make member function.
10277 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
10278 a namespace. Remove creation of dotted "SimpleName"s.
10279 (MemberAccess.DoResolve): Likewise.
10280 * decl.cs (DeclSpace.Cache): Make private.
10281 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
10282 (DeclSpace.FindType): Update.
10283 (DeclSpace.LookupType): Move here from RootContext. Return a
10284 FullNamedExpression.
10285 * namespace.cs (Namespace): Derive from FullNamedExpression
10286 so that it can be part of expression resolution.
10287 (Namespace.Lookup): Return an FullNamedExpression.
10288 (NamespaceEntry.LookupAlias): Lookup aliases only in current
10290 * rootcontext.cs (NamespaceLookup): Remove.
10291 (LookupType): Move to DeclSpace.
10292 * attribute.cs (CheckAttributeType): Update.
10293 * doc.cs (FindDocumentedType): Remove allowAlias argument.
10294 (FindDocumentedTypeNonArray): Likewise.
10296 2005-01-11 Raja R Harinath <rharinath@novell.com>
10298 Fix cs0509.cs, cs1632.cs.
10299 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
10300 is the same as IsInterface.
10301 (TypeContainer.GetClassBases): Likewise.
10302 * statement.cs (LabeledStatement.ig): New field.
10303 (LabeledStatement.LabelTarget): Save ILGenerator which created the
10305 (LabeledStatement.DoEmit): Check that the label was created with
10306 the same ILGenerator.
10308 2005-01-10 Marek Safar <marek.safar@seznam.cz>
10311 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
10312 accessors to its properties.
10314 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
10315 from accessors to property.
10317 2005-01-10 Marek Safar <marek.safar@seznam.cz>
10320 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
10321 only for overrides.
10323 2005-01-08 Miguel de Icaza <miguel@ximian.com>
10325 * attribute.cs: Check for null and empty strings.
10327 I have lost another battle to Paolo.
10329 2005-01-07 Marek Safar <marek.safar@seznam.cz>
10332 * class.cs (PropertyMethod): Set Parent field in ctors.
10333 (SetMethod.InternalParameters): Add unsafe switch hack.
10334 Override MarkForDuplicationCheck where it is appropriate.
10336 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
10337 It says whether container allows members with the same name.
10338 Base default is no.
10339 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
10340 Removed is_method parameter.
10342 2005-01-06 Duncan Mak <duncan@ximian.com>
10344 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
10345 because the previous change led to incorrect reporting of CS1032
10346 ("Cannot define/undefine preprocessor symbols after first token in
10347 file"). Instead of using `tokens_seen' as the only flag that
10348 triggers CS1040, introduce `comments_seen'. This new flag is used
10349 to signify having seen comments on the current line, so it is
10350 unset after a newline.
10352 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
10354 * doc.cs : When searching for a type, find nested type too.
10355 This fixes bug #71040.
10357 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
10360 - Warn missing member comment on those classes which also does not
10361 have doc comments. Fixed bug #71041.
10362 - Don't warn missing doc comment on default constructor.
10365 2005-01-06 Duncan Mak <duncan@ximian.com>
10367 * cs-tokenizer.cs (xtoken): After handling traditional C-style
10368 comments, set `tokens_seen' to true. This allows us to detect
10369 misplaced preprocessor directives (i.e. not at the beginning of
10370 the a line, nor after whitespaces). In that case, report error
10371 CS1040. This fixes bug #56460.
10373 * cs-parser.jay (interface_member_declaration): Add checks for
10374 IsExplicitImpl, and report CS0541 error if an interface member is
10375 defined as an explicit interface declaration.
10377 2005-01-06 Marek Safar <marek.safar@seznam.cz>
10380 * class.cs (PropertyMethod): Set Parent field in ctors.
10381 (SetMethod.InternalParameters): Add unsafe switch hack.
10383 * decl.cs (MemberCore.Parent): Cannot be readonly.
10385 2005-01-06 Raja R Harinath <rharinath@novell.com>
10387 * decl.cs (DeclSpace.ResolveType): Remove.
10388 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
10389 Merge in code from ...
10390 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
10391 * class.cs, enum.cs: Update to changes.
10393 2005-01-06 Miguel de Icaza <miguel@ximian.com>
10395 * anonymous.cs: Ensure that we init the scope of our parent if it
10396 has not been initialized yet.
10398 2004-12-30 Duncan Mak <duncan@ximian.com>
10400 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
10401 if field.FieldBuilder is null. Fixes #70758.
10403 * convert.cs: Fixed some typos and updated some of the comments.
10404 (ImplicitStandardConversionExists):
10405 (TryImplicitIntConversion): If `target_type' is an interface and
10406 the type of `ic' implements this interface, return true or a new
10407 BoxedCast instead of null. This fixes #70468.
10409 2004-12-29 Duncan Mak <duncan@ximian.com>
10411 * expression.cs (Argument.Emit): Check that Expr is
10412 IMemoryLocation before casting to it, and report CS1510 otherwise.
10416 2004-12-21 Ben Maurer <bmaurer@ximian.com>
10418 * statement.cs (Block.ThisVariable): remove the recursion here, to
10419 make the --profile more sane.
10421 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
10423 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
10424 assembly, by JB Evain.
10426 2004-12-17 Raja R Harinath <rharinath@novell.com>
10428 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
10429 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
10430 "parent" refers to enclosing type/class. "base" refers to superclass.
10432 2004-12-17 Raja R Harinath <rharinath@novell.com>
10434 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
10435 Ensure that we only have GlobalAttributes.
10436 * attribute.cs (Attribute.Emit): Make non-virtual.
10437 (GlobalAttribute.Emit): Remove.
10438 (Attribute.Resolve): Make virtual.
10439 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
10440 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
10441 the argument. Don't create one.
10442 (Attribute.GetObsoleteAttribute): Likewise.
10443 (Attribute.GetClsCompliantAttributeValue): Likewise.
10444 * class.cs, decl.cs: Update to changes.
10446 2004-12-17 Marek Safar <marek.safar@seznam.cz>
10448 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
10450 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
10452 * statement.cs (Foreach.Resolve): Add error 186 report.
10454 2004-12-16 Marek Safar <marek.safar@seznam.cz>
10456 * expression.cs (Conditional.DoResolve): Add warning 429.
10458 * statement.cs (If.Resolve): Add warning 665.
10460 2004-12-16 Raja R Harinath <rharinath@novell.com>
10462 New invariant: RootContext.Tree.Types.NamespaceEntry == null
10463 except when in the parser, and in GlobalAttribute.
10464 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
10465 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
10466 RootContext.Tree.Types.NamespaceEntry once work is done.
10467 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
10468 and resets RootContext.Tree.Types.NamespaceEntry.
10470 2004-12-15 Marek Safar <marek.safar@seznam.cz>
10472 * cs-parser.jay: Don't create a block for every variable.
10474 2004-12-14 Miguel de Icaza <miguel@ximian.com>
10476 * location.cs: Provide extra information.
10478 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
10479 variables from the captured environment, it is the ldarg_0.
10481 2004-12-14 Marek Safar <marek.safar@seznam.cz>
10483 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
10486 * class.cs: Changed warning level for 169 to avoid developer
10487 displeasure from warning flooding. It will be changed back when they
10488 fix most of current BCL warnings.
10490 * RootContext.cs: Pushed default WarningLevel to 3.
10492 * statement.cs: Removed unused variable.
10494 2004-12-14 Marek Safar <marek.safar@seznam.cz>
10496 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
10497 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
10498 Add error 502 report.
10499 (StaticClass.DefineType): Add error 441 report.
10500 (Class.AllowedModifiersProp): New virtual property as temporary
10501 extension to AllowedModifiers.
10502 (Class.DefineType): Add error 418 report. Moved ModFlags check here
10503 to share implementation with StaticClass and don't call virtual
10506 * driver.cs (MainDriver): Add error 1558 test.
10508 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
10509 report. Moved error 36 test here.
10511 * statement.cs (Throw.Resolve): Add error 724 report.
10513 * typemanager.cs: Add out_attribute_type core type.
10515 2004-12-13 Marek Safar <marek.safar@seznam.cz>
10517 * class.cs (TypeContainer.VerifyClsCompliance): Add error
10519 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
10521 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
10524 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
10526 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
10527 Add error 3023 report.
10528 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
10530 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
10533 2004-12-12 John Luke <john.luke@gmail.com>
10535 * driver.cs (AddArgs): take -- into account when
10536 adding arguments, fixes bug 65710
10538 2004-12-12 Martin Baulig <martin@ximian.com>
10540 * expression.cs (Unary.TryReduceNegative): Added support for
10541 SByteConstant and ByteConstant.
10542 (Unary.Reduce): Check error values from TryReduceNegative().
10544 2004-12-10 Marek Safar <marek.safar@seznam.cz>
10546 * attributes.cs (Attribute.Resolve): Avoid multiple error report
10547 and report exception as error 182.
10549 2004-12-10 Raja R Harinath <rharinath@novell.com>
10551 * driver.cs (Main): Fix message when there are warnings.
10553 2004-12-09 Miguel de Icaza <miguel@ximian.com>
10555 * delegate.cs: Fixed my fix from yesterday, sorry about that.
10557 2004-12-09 Marek Safar <marek.safar@seznam.cz>
10559 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
10560 Reduced number of warnings.
10562 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
10564 2004-12-08 Miguel de Icaza <miguel@ximian.com>
10566 * driver.cs: Removed message.
10568 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
10570 2004-12-08 <vargaz@freemail.hu>
10572 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
10574 2004-12-08 Martin Baulig <martin@ximian.com>
10576 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
10577 instead of a CS3002 for properties and indexer.
10579 2004-12-08 Martin Baulig <martin@ximian.com>
10581 * decl.cs (MemberName.ToString): Make this work again.
10583 2004-12-08 Marek Safar <marek.safar@seznam.cz>
10585 * attribute.cs (Resolve): Add error 591 detection.
10587 * class.cs (FieldMember.Define): Add error 1547 detection.
10588 (Indexer.Define): Add error 620 detection.
10589 (Operator.Define): Add error 590 detection.
10591 * ecore.cs: Missing argument for error 79.
10593 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
10596 2004-12-07 Marek Safar <marek.safar@seznam.cz>
10599 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
10602 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
10604 * cs-parser.jay : handle doc comments on implicit/explicit operators.
10605 Some operator comments were suppressed.
10606 * doc.cs : Implicit/explicit operator name in doc comments are like
10607 "op_Explicit(type)~returnType", so added suffix handling.
10609 2004-12-07 Martin Baulig <martin@ximian.com>
10612 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
10613 (MemberCore.GetClsCompliantAttributeValue): Likewise.
10614 (DeclSpace.ec): New protected field; store the EmitContext here.
10615 (DeclSpace.EmitContext): New public property; moved here from
10617 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
10620 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
10621 (Enum.Emit): Don't create a new EmitContext.
10623 * delegate.cs (Delegate.DefineType): Always create the
10626 * iterators.cs (Iterators.DefineIterator): Create a new
10627 EmitContext and store it in `ec'.
10629 2004-08-24 Martin Baulig <martin@ximian.com>
10632 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
10633 this for accessibility checks.
10634 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
10635 IsNestedFamilyAccessible.
10636 (TypeManager.IsSubclassOf): New method, do what the name actually
10639 2004-12-06 Raja R Harinath <rharinath@novell.com>
10641 Fix crash on cs0657-17.cs.
10642 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
10643 Use RootContext.Tree.Types, not 'new RootTypes ()'.
10644 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
10645 the case where the NamespaceEntry gets overwritten.
10647 2004-12-06 Marek Safar <marek.safar@seznam.cz>
10649 Fixed #69195, #56821
10650 * ecore.cs (ResolveBoolean): Tiny refactoring.
10652 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
10653 of right expression resolving when left is false constant and
10654 operator is LogicalAnd OR true constant and operator is LogicalOr.
10656 * statement.cs (ResolveUnreachable): Always reports warning.
10658 2004-12-05 Miguel de Icaza <miguel@ximian.com>
10660 * class.cs: Distinguish between 1721 and 1722 (just a little help
10661 for the programmer).
10663 2004-12-03 Miguel de Icaza <miguel@ximian.com>
10665 * delegate.cs: Only allow this on new versions of the language.
10667 2004-12-02 Duncan Mak <duncan@ximian.com>
10669 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
10671 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
10672 here as a static method. Take an additional bool out parameter
10673 `must_do_cs1540_check' for signaling to InstanceResolve.
10674 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
10675 member field from PropertyExpr class and made it an argument of
10676 the method instead.
10677 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
10678 check for MarshalByRefObject, and report CS0122 instead of CS1540.
10679 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
10680 and `remove_accessor' as well as InstanceResolve: report CS0122
10685 2004-12-03 Raja R Harinath <rharinath@novell.com>
10687 Fix test-327.cs, test-328.cs, and put in early infrastructure
10688 for eventually fixing #52697.
10689 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
10690 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
10691 from other methods.
10692 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
10693 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
10694 (VerifyUsing, error246): Update.
10695 * rootcontext.cs (RootContext.NamespaceLookup): Just use
10696 'NamespaceEntry.LookupNamespaceOrType'.
10698 2004-12-03 Martin Baulig <martin@ximian.com>
10700 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
10701 method as our child, call AnonymousMethod.Compatible() on it.
10703 2004-12-03 Raja R Harinath <rharinath@novell.com>
10705 Disable XML documentation support in 'basic' profile.
10706 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
10707 Redirect XmlElement to System.Object.
10708 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
10709 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
10710 * mcs.exe.sources: Add doc-bootstrap.cs.
10711 * doc-bootstrap.cs: New file. Contains empty stub implementation
10714 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
10716 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
10717 comments are allowed.
10719 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
10721 * delegate.cs: Add checks for subtypes in paramaters and return values
10722 in VerifyMethod () to add support for Covariance/Contravariance
10725 2004-12-02 Miguel de Icaza <miguel@ximian.com>
10727 * report.cs: Remove extra closing parenthesis.
10729 * convert.cs (Error_CannotImplicitConversion): If the name of the
10730 types are the same, provide some extra information.
10732 * class.cs (FieldBase): Use an unused bit field from the field to
10733 encode the `has_offset' property from the FieldMember. This saves
10734 a couple of Ks on bootstrap compilation.
10736 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
10737 method as our child, return the AnonymousMethod resolved
10740 * expression.cs (New.DoResolve): Allow return values from
10741 NewDelegate to also include AnonymousMethods.
10745 2004-12-02 Marek Safar <marek.safar@seznam.cz>
10748 * attribute.cs (Resolve): Improved implementation of params
10749 attribute arguments.
10751 * support.cs (ParameterData): Add HasParams to be faster.
10753 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
10755 all things are for /doc support:
10757 * doc.cs: new file that supports XML documentation generation.
10758 * mcs.exe.sources: added doc.cs.
10760 Handle /doc command line option.
10761 Report error 2006 instead of 5 for missing file name for /doc.
10762 Generate XML documentation when required, after type resolution.
10764 Added support for picking up documentation (/// and /** ... */),
10765 including a new XmlCommentState enumeration.
10767 Added lines to fill Documentation element for field, constant,
10768 property, indexer, method, constructor, destructor, operator, event
10769 and class, struct, interface, delegate, enum.
10770 Added lines to warn incorrect comment.
10772 Added Documentation field (passed only when /doc was specified).
10774 Added DocComment, DocCommentHeader, GenerateDocComment() and
10775 OnGenerateDocComment() and some supporting private members for
10776 /doc feature to MemberCore.
10778 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
10780 Added overriden DocCommentHeader.
10782 Added overriden DocCommentHeader and GenerateDocComment().
10784 2004-12-01 Miguel de Icaza <miguel@ximian.com>
10786 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
10787 unwrapping the enumeration values, chain to
10788 DoConstantNumericPromotions again, so we can promote things to the
10789 fundamental types (takes care of enums that are bytes, sbytes).
10793 2004-12-01 Raja R Harinath <rharinath@novell.com>
10795 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
10796 Fix long-standing bug in type-lookup. Use FindType instead of
10797 LookupType when ec.ResolvingTypeTree.
10798 (Attribute.ResolveType, Attribute.Resolve)
10799 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
10801 (Attributes.Search): Remove internal version. Update.
10802 (Attributes.SearchMulti): Update.
10803 (Attributes.GetClsCompliantAttribute): Remove.
10804 (Attributes.GetIndexerNameAttribute): Remove.
10805 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
10806 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
10807 * class.cs (Indexer.Define): Likewise.
10809 2004-12-01 Marek Safar <marek.safar@seznam.cz>
10812 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
10813 MarshallByReference members access.
10815 * expression.cs: Use CheckMarshallByRefAccess;
10816 Better error CS0197 message.
10818 * report.cs: Print whole related error message.
10820 2004-11-30 Raja R Harinath <rharinath@novell.com>
10822 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
10823 the current directory to help debugging.
10825 2004-11-29 Marek Safar <marek.safar@seznam.cz>
10827 * class (GetClassBases): Better error 60 report.
10828 (EventProperty): Disabled warning 67 detection.
10830 2004-11-29 Marek Safar <marek.safar@seznam.cz>
10833 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
10835 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
10838 2004-11-29 Marek Safar <marek.safar@seznam.cz>
10841 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
10843 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
10845 2004-11-26 Miguel de Icaza <miguel@ximian.com>
10847 * attribute.cs (Attribute.Resolve): Refine error reporting and
10848 report a cs0117 if the identifier does not exist, to distinguish
10849 from 0617 which is a miss-use of the actual identifier.
10851 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
10852 between cs0070 and cs0079.
10854 * class.cs (MemberBase.DoDefine): When reporting a wrong
10855 accessibility level, we use MethodCore to compare instead of
10856 Method (this was a regression in some refactoring effort).
10858 So now we correctly report cs0056 again.
10860 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
10861 testing the target_type (which was known to be object_type) and
10862 not the source type (which is anonymous_method).
10864 Fixed reporting of error cs1660.
10866 * expression.cs (UserCast.Source): Expose the underlying cast.
10868 * statement.cs (Switch.SwitchGoverningType): Sort the list of
10869 allowed types to find a match to int32 first (most common).
10871 In addition, it ignores any ImplicitUserConversions that did an
10872 internal implicit conversion (as the switch statement allows only
10873 one integral conversion to exist).
10875 * class.cs (PartialContainer.Create): rename `name' to
10876 `member_name' for clarity. Then replace the string calls with a
10877 call to MemberName.GetPartialName, as now using
10878 MemberName.ToString is an error (this is due to the side effects
10879 it had, that were fixed in the past).
10881 This will restore the error reporting on a number of partial class
10882 errors that were missusing this (and getting an exception as a
10883 results, which is now just a plain textual warning, because
10884 yyparse debug output would crash otherwise).
10886 2004-11-26 Raja R Harinath <rharinath@novell.com>
10888 * Makefile (PROGRAM_INSTALL_DIR): Remove.
10890 2004-11-25 Ben Maurer <bmaurer@ximian.com>
10892 * rootcontext.cs (LookupType): Make sure to cache lookups that
10893 don't give us a negative result. This saves about 5% of corlib
10896 2004-11-25 Miguel de Icaza <miguel@ximian.com>
10898 * report.cs (AbstractMessage.Print): messages are sent to stderr
10900 * class.cs (TypeContainer.GetClassBases): It is an error to have a
10901 non-interface in the list of interfaces (at this point, either
10902 parent was properly set, or a base class is being listed in the
10903 interfaces section).
10905 This flags error 1722, and resolves the crash from bug 69259.
10907 2004-11-25 Ben Maurer <bmaurer@ximian.com>
10909 * statement.cs (Using.EmitExpressionFinally): make this work right
10910 for valuetypes. Fixes 69926.
10912 2004-11-25 Miguel de Icaza <miguel@ximian.com>
10914 * const.cs (Const.ChangeType): Cope with the "0 literal can be
10915 converted to an enum" here, before we try to change the underlying
10916 type. This code exists, but it is a different code path than the
10917 one used while encoding constants.
10919 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
10920 old bug: when converting from the null literal to a pointer,
10921 return an EmptyCast, not the NullLiteral.
10923 This fixes #69921, the recent null_type changes probably made this
10924 bug more prominent.
10926 (ImplicitReferenceConversionExists): In addition, resynchronized
10927 the code here, so it matches the same code in
10928 ImplicitReferenceConversionExists for the `from any class-type S
10929 to any interface-type T'.
10932 2004-11-25 Marek Safar <marek.safar@seznam.cz>
10934 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
10936 2004-11-24 Miguel de Icaza <miguel@ximian.com>
10938 * cs-parser.jay: Use verbosity accordingly.
10940 2004-11-24 Marek Safar <marek.safar@seznam.cz>
10942 * expression.cs (Unary.ResolveOperator): Do not report warning;
10943 AddressOf reads from variable.
10945 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
10947 2004-11-24 Marek Safar <marek.safar@seznam.cz>
10951 * attribute.cs (Attributable): Removed CheckTargets.
10952 (Attributes.Emit): Explicit attribute targets are tested here.
10954 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
10955 not enabled for interfaces.
10957 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
10958 (GetAssemblyName): Ouch next bug there.
10960 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
10962 * expression.cs: Error 275 added.
10964 2004-11-23 Marek Safar <marek.safar@seznam.cz>
10966 Fix bug #69177 (Implemented decimal constant support)
10968 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
10969 (BinaryFold): Add DecimalConstant.
10971 * const.cs (Define): Decimal constant
10973 (ChangeType): Add decimal type handling.
10974 (LookupConstantValue): Don't set value for decimal type but
10975 emit DecimalConstantAttribute. Needed for constant optimization.
10977 * constant.cs (ToDecimal): New method.
10978 (ConvertToDecimal): New method.
10979 (IntConstant): Implemented ConvertToDecimal.
10980 (DecimalConstant.Emit): Emit optimized version for decimals in
10983 * expression.cs (ResolveOperator): Changed order of constant
10984 reduction to work correctly with native types which have
10985 overloaded operators.
10986 (ResolveMemberAccess): Extract constant value from attribute
10989 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
10991 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
10992 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
10993 (ChangeType): Decimal is special.
10994 (TypeToCoreType): Add decimal type.
10996 2004-11-22 Marek Safar <marek.safar@seznam.cz>
10998 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
11001 2004-11-22 Marek Safar <marek.safar@seznam.cz>
11003 * class.cs (EventField.ApplyAttributeBuilder): Fix error
11006 2004-11-19 Marek Safar <marek.safar@seznam.cz>
11008 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
11010 * pending.cs (PendingImplementation): Grab only interfaces.
11012 2004-11-19 Marek Safar <marek.safar@seznam.cz>
11014 * statement.cs (ForeachHelperMethods): Add location member and
11015 error 202 detection.
11017 2004-11-19 Raja R Harinath <rharinath@novell.com>
11019 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
11020 automatically handled by executable.make.
11021 (PROGRAM): Make profile-specific.
11023 2004-11-18 Marek Safar <marek.safar@seznam.cz>
11025 * expression.cs (DoResolveBase): Fixed wrong warning for out
11028 2004-11-18 Martin Baulig <martin@ximian.com>
11030 Merged latest changes into gmcs. Please keep this comment in
11031 here, it makes it easier for me to see what changed in MCS since
11032 the last time I merged.
11034 2004-11-17 Raja R Harinath <rharinath@novell.com>
11036 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
11037 (TypeHandle.GetMemberCache): New.
11038 (TypeHandle.TypeHandle): Update.
11039 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
11040 (TypeManager.LookupParentInterfacesCache):
11041 Rename from LookupInterfaceCache. Optimize slightly.
11042 (TypeManager.MemberLookup_FindMembers): Update.
11043 * decl.cs (MemberCache.MemberCache): Set Container to null in the
11044 multi-type variant.
11045 (AddCacheContents): Rename from AddHashtable.
11046 * class.cs (TypeContainer.parent_container): Remove.
11047 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
11048 (TypeContainer.DoDefineMembers): Don't initialize it.
11049 Update to name changes.
11051 2004-11-17 Miguel de Icaza <miguel@ximian.com>
11053 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
11054 that factors the code to check access modifiers on override.
11056 (PropertyBase): Use the code here.
11058 Patch from Lluis S'anchez, fixes bug #69361.
11060 2004-11-15 Miguel de Icaza <miguel@ximian.com>
11062 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
11063 routine that is used to report the use of a captured variable
11064 whose address has been taken.
11066 There are two checks: one when variables are being captured and
11067 the other check is when the address of a variable is taken.
11069 (because an anonymous methods might be resolved before *or* after
11070 the address has been taken) and
11072 * expression.cs (Conditional.DoResolve): Remove the special
11073 casing that Martin added to trueExpr and falseExpr being both
11074 NullLiteral. We get the right behavior now just by introducing
11075 the null_type into the compiler.
11077 * convert.cs (ExplicitConversion): Change the code to use
11078 null_type instead of testing `expr is NullLiteral'.
11079 (ImplicitConversionStandard): use null_type too.
11080 (ImplicitReferenceConversionExists): use null_type too.
11081 (ImplicitReferenceConversion): use null_type too.
11083 * literal.cs: The type of `NullLiteral' is now null_type instead
11085 (Resolve): Set the type here.
11087 * typemanager.cs: Introduce null_type.
11089 2004-11-17 Martin Baulig <martin@ximian.com>
11091 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
11092 direction, like FindMembers() does. Fixes #69546, testcase is in
11095 2004-11-16 Martin Baulig <martin@ximian.com>
11097 This is based on a patch from Marek Safar, see bug #69082.
11098 Fixes bugs #63705 and #67130.
11100 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
11101 method; create a MemberCache for an interface type and cache the
11104 * decl.cs (IMemberContainer.ParentContainer): Removed.
11105 (IMemberContainer.ParentCache): New property.
11106 (MemberCache.SetupCacheForInterface): Removed.
11107 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
11108 to create a cache for an interface's "parent".
11110 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
11113 2004-11-16 Martin Baulig <martin@ximian.com>
11115 Merged back from gmcs; these changes already went into gmcs a
11116 couple of weeks ago.
11119 (TypeManager.AddUserType): Removed the `ifaces' argument.
11120 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
11122 (TypeManager.AddUserInterface): Removed.
11123 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
11125 (TypeManager.GetInterfaces): Likewise.
11126 (TypeManager.GetExplicitInterfaces): Likewise.
11128 * ecore.cs (TypeExpr.GetInterfaces): Removed.
11130 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
11131 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
11133 2004-11-14 Ben Maurer <bmaurer@ximian.com>
11135 * statement.cs: Avoid adding bools to a hashtable.
11137 2004-11-07 Miguel de Icaza <miguel@ximian.com>
11139 * expression.cs (Invocation.OverloadResolve): Flag error if we are
11140 calling an unsafe method from a safe location.
11142 2004-11-06 Marek Safar <marek.safar@seznam.cz>
11145 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
11147 2004-11-06 Miguel de Icaza <miguel@ximian.com>
11149 * namespace.cs (VerifyUsing): use GetPartialName instead of
11152 2004-11-05 Miguel de Icaza <miguel@ximian.com>
11154 * statement.cs (Return.Resolve): Fix regression in typo: if
11155 `in_exc', we have to request a NeedReturnLabel, this was a typo
11156 introduced in the anonymous method check-in. Fixes #69131.
11158 * Indexers were using the ShortName when defining themselves,
11159 causing a regression in the compiler bootstrap when applying the
11160 patch from 2004-11-02 (first part), now they use their full name
11161 and the bug is gone.
11163 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
11165 * driver.cs: Strip the path from the names of embedded resources. Fixes
11168 2004-11-04 Raja R Harinath <rharinath@novell.com>
11170 Fix error message regression: cs0104-2.cs.
11171 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
11172 (AliasEntry.Resolve): Update.
11173 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
11175 (RootContext.LookupType): Update.
11177 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
11179 * cs-parser.jay: Add support for handling accessor modifiers
11180 * class: Add support port accessor modifiers and error checking,
11181 define PropertyMethod.Define as virtual (not abstract anymore)
11182 * ecore.cs: Add checking for proeprties access with access modifiers
11183 * iterators.cs: Modify Accessor constructor call based in the modified
11185 2004-11-02 Ben Maurer <bmaurer@ximian.com>
11187 * expression.cs (StringConcat): Handle being called twice,
11188 as when we have a concat in a field init with more than two
11191 2004-11-02 Miguel de Icaza <miguel@ximian.com>
11193 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
11194 special case explicit implementations, we should always produce
11195 the .property or .event declaration.
11197 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
11198 since it will not return correct data if people use this
11199 unresolved in the presence of using statements (see test-313).
11201 * class.cs (MethodData.Define): If we are an explicit interface
11202 implementation, set the method name to the full name of the
11203 interface plus the name of the method.
11205 Notice that using the method.MethodName.GetFullName() does not
11206 work, as it will only contain the name as declared on the source
11207 file (it can be a shorthand in the presence of using statements)
11208 and not the fully qualifed type name, for example:
11212 class D : ICloneable {
11213 object ICloneable.Clone () {
11217 Would produce a method called `ICloneable.Clone' instead of
11218 `System.ICloneable.Clone'.
11220 * namespace.cs (Alias.Resolve): Use GetPartialName.
11222 2004-11-01 Marek Safar <marek.safar@seznam.cz>
11224 * cs-parser.jay: Add error 1055 report.
11226 2004-11-01 Miguel de Icaza <miguel@ximian.com>
11228 * assign.cs (Assign.DoResolve): Only do the transform of
11229 assignment into a New if the types are compatible, if not, fall
11230 through and let the implicit code deal with the errors and with
11231 the necessary conversions.
11233 2004-11-01 Marek Safar <marek.safar@seznam.cz>
11235 * cs-parser.jay: Add error 1031 report.
11237 * cs-tokenizer.cs: Add location for error 1038.
11239 2004-10-31 Marek Safar <marek.safar@seznam.cz>
11241 * cs-parser.jay: Add error 1016 report.
11243 2004-10-31 Marek Safar <marek.safar@seznam.cz>
11245 * cs-parser.jay: Add errors 1575,1611 report.
11247 2004-10-31 Marek Safar <marek.safar@seznam.cz>
11249 * cs-parser.jay: Add error 1001 report.
11251 2004-10-31 Marek Safar <marek.safar@seznam.cz>
11254 * attribute.cs (GetMarshal): Add method argument for
11255 caller identification.
11257 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
11258 agument for GetMarshal and RuntimeMissingSupport.
11260 2004-10-31 Marek Safar <marek.safar@seznam.cz>
11262 * attribute.cs (ExtractSecurityPermissionSet): Removed
11263 TypeManager.code_access_permission_type.
11265 * typemanager.cs: Removed TypeManager.code_access_permission_type.
11267 2004-10-27 Miguel de Icaza <miguel@ximian.com>
11269 * expression.cs (LocalVariableReference.DoResolveLValue): Check
11270 for obsolete use of a variable here. Fixes regression on errors
11271 cs0619-25 and cs0619-26.
11273 2004-10-27 Marek Safar <marek.safar@seznam.cz>
11275 Fix #62358, implemented security attribute encoding.
11277 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
11278 Tests permitted SecurityAction for assembly or other types.
11279 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
11280 data from SecurityPermissionAttribute to PermisionSet class.
11282 * class.cs (ApplyAttributeBuilder): Added special handling
11283 for System.Security.Permissions.SecurityAttribute based types.
11285 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
11286 special handling for System.Security.Permissions.SecurityAttribute
11289 * enum.cs (ApplyAttributeBuilder): Added special handling
11290 for System.Security.Permissions.SecurityAttribute based types.
11292 * parameter.cs (ApplyAttributeBuilder): Added special handling
11293 for System.Security.Permissions.SecurityAttribute based types.
11295 * rootcontext.cs: Next 2 core types.
11297 * typemanager.cs (TypeManager.security_permission_attr_type):
11298 Built in type for the SecurityPermission Attribute.
11299 (code_access_permission_type): Build in type.
11301 2004-10-17 Miguel de Icaza <miguel@ximian.com>
11303 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
11304 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
11305 all of this information into
11306 EmitContext.EmitCapturedVariableInstance.
11308 * codegen.cs (EmitCapturedVariableInstance): move here the
11309 funcionality of emitting an ldarg.0 in the presence of a
11310 remapping. This centralizes the instance emit code.
11312 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
11313 then emit a load of this: it means that we have reached the
11314 topmost ScopeInfo: the one that contains the pointer to the
11315 instance of the class hosting the anonymous method.
11317 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
11318 captures to the topmost CaptureContext.
11320 2004-10-12 Miguel de Icaza <miguel@ximian.com>
11322 * expression.cs (LocalVariableReference): Move the knowledge about
11323 the iterators into codegen's EmitCapturedVariableInstance.
11325 2004-10-11 Miguel de Icaza <miguel@ximian.com>
11327 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
11328 all code paths return a value from an anonymous method (it is the
11329 same as the 161 error, but for anonymous methods).
11331 2004-10-08 Miguel de Icaza <miguel@ximian.com>
11333 The introduction of anonymous methods in the compiler changed
11334 various ways of doing things in the compiler. The most
11335 significant one is the hard split between the resolution phase
11336 and the emission phases of the compiler.
11338 For instance, routines that referenced local variables no
11339 longer can safely create temporary variables during the
11340 resolution phase: they must do so from the emission phase,
11341 since the variable might have been "captured", hence access to
11342 it can not be done with the local-variable operations from the runtime.
11346 (Block.Flags): New flag `IsTopLevel' to indicate that this block
11347 is a toplevel block.
11349 (ToplevelBlock): A new kind of Block, these are the blocks that
11350 are created by the parser for all toplevel method bodies. These
11351 include methods, accessors and anonymous methods.
11353 These contain some extra information not found in regular blocks:
11354 A pointer to an optional CaptureContext (for tracking captured
11355 local variables and parameters). A pointer to the parent
11358 (Return.Resolve): Catch missmatches when returning a value from an
11359 anonymous method (error 1662).
11360 Invoke NeedReturnLabel from the Resolve phase instead of the emit
11363 (Break.Resolve): ditto.
11365 (SwitchLabel): instead of defining the labels during the
11366 resolution phase, we now turned the public ILLabel and ILLabelCode
11367 labels into methods called GetILLabelCode() and GetILLabel() that
11368 only define the label during the Emit phase.
11370 (GotoCase): Track the SwitchLabel instead of the computed label
11371 (its contained therein). Emit the code by using
11372 SwitchLabel.GetILLabelCode ().
11374 (LocalInfo.Flags.Captured): A new flag has been introduce to track
11375 whether the Local has been captured or not.
11377 (LocalInfo.IsCaptured): New property, used to tell whether the
11378 local has been captured.
11380 * anonymous.cs: Vastly updated to contain the anonymous method
11383 The main classes here are: CaptureContext which tracks any
11384 captured information for a toplevel block and ScopeInfo used to
11385 track the activation frames for various local variables.
11387 Each toplevel block has an optional capture context associated
11388 with it. When a method contains an anonymous method both the
11389 toplevel method and the anonymous method will create a capture
11390 context. When variables or parameters are captured, they are
11391 recorded on the CaptureContext that owns them, for example:
11395 MyDelegate d = delegate {
11400 Here `a' will be recorded as captured on the toplevel
11401 CapturedContext, the inner captured context will not have anything
11402 (it will only have data if local variables or parameters from it
11403 are captured in a nested anonymous method.
11405 The ScopeInfo is used to track the activation frames for local
11406 variables, for example:
11408 for (int i = 0; i < 10; i++)
11409 for (int j = 0; j < 10; j++){
11410 MyDelegate d = delegate {
11415 At runtime this captures a single captured variable `i', but it
11416 captures 10 different versions of the variable `j'. The variable
11417 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
11418 recorded on a child.
11420 The toplevel ScopeInfo will also track information like the `this'
11421 pointer if instance variables were referenced (this is necessary
11422 as the anonymous method lives inside a nested class in the host
11423 type of the method).
11425 (AnonymousMethod): Expanded to track the Toplevel, implement
11426 `AnonymousMethod.Compatible' to tell whether an anonymous method
11427 can be converted to a target delegate type.
11429 The routine now also produces the anonymous method content
11431 (AnonymousDelegate): A helper class that derives from
11432 DelegateCreation, this is used to generate the code necessary to
11433 produce the delegate for the anonymous method that was created.
11435 * assign.cs: API adjustments for new changes in
11436 Convert.ImplicitStandardConversionExists.
11438 * class.cs: Adjustments to cope with the fact that now toplevel
11439 blocks are of type `ToplevelBlock'.
11441 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
11442 insteda of standard blocks.
11444 Flag errors if params arguments are passed to anonymous methods.
11446 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
11447 `CurrentAnonymousMethod' which points to the current Anonymous
11448 Method. The variable points to the AnonymousMethod class that
11449 holds the code being compiled. It is set in the new EmitContext
11450 created for the anonymous method.
11452 (EmitContext.Phase): Introduce a variable and an enumeration to
11453 assist in enforcing some rules about when and where we are allowed
11454 to invoke certain methods (EmitContext.NeedsReturnLabel is the
11455 only one that enfonces this right now).
11457 (EmitContext.HaveCaptureInfo): new helper method that returns
11458 whether we have a CapturedContext initialized.
11460 (EmitContext.CaptureVariable): New method used to register that a
11461 LocalInfo must be flagged for capturing.
11463 (EmitContext.CapturedParameter): New method used to register that a
11464 parameters must be flagged for capturing.
11466 (EmitContext.CapturedField): New method used to register that a
11467 field must be flagged for capturing.
11469 (EmitContext.HaveCapturedVariables,
11470 EmitContext.HaveCapturedFields): Return whether there are captured
11471 variables or fields.
11473 (EmitContext.EmitMethodHostInstance): This is used to emit the
11474 instance for the anonymous method. The instance might be null
11475 (static methods), this (for anonymous methods that capture nothing
11476 and happen to live side-by-side with the current method body) or a
11477 more complicated expression if the method has a CaptureContext.
11479 (EmitContext.EmitTopBlock): Routine that drives the emission of
11480 code: it will first resolve the top block, then emit any metadata
11481 and then emit the code. The split is done so that we can extract
11482 any anonymous methods and flag any captured variables/parameters.
11484 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
11485 during this phase, the ILGenerator should not be used as labels
11486 and local variables declared here might not be accessible to any
11487 code that is part of an anonymous method.
11489 Exceptions to this include the temporary variables that are
11490 created by some statements internally for holding temporary
11493 (EmitContext.EmitMeta): New routine, in charge of emitting all the
11496 (EmitContext.TemporaryReturn): This method is typically called
11497 from the Emit phase, and its the only place where we allow the
11498 ReturnLabel to be defined other than the EmitMeta. The reason is
11499 that otherwise we would have to duplicate a lot of logic in the
11500 Resolve phases of various methods that today is on the Emit
11503 (EmitContext.NeedReturnLabel): This no longer creates the label,
11504 as the ILGenerator is not valid during the resolve phase.
11506 (EmitContext.EmitThis): Extended the knowledge in this class to
11507 work in anonymous methods in addition to iterators.
11509 (EmitContext.EmitCapturedVariableInstance): This emits whatever
11510 code is necessary on the stack to access the instance to a local
11511 variable (the variable will be accessed as a field).
11513 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
11514 EmitContext.EmitAddressOfParameter): Routines to support
11515 parameters (not completed at this point).
11517 Removals: Removed RemapLocal and RemapLocalLValue. We probably
11518 will also remove the parameters.
11520 * convert.cs (Convert): Define a `ConstantEC' which points to a
11521 null. This is just to prefity some code that uses
11522 ImplicitStandardConversion code and do not have an EmitContext
11525 The idea is to flag explicitly that at that point in time, it is
11526 known that the conversion will not trigger the delegate checking
11527 code in implicit conversions (which requires a valid
11530 Everywhere: pass new EmitContext parameter since
11531 ImplicitStandardConversionExists now requires it to check for
11532 anonymous method conversions.
11534 (Convert.ImplicitStandardConversionExists): If the type of an
11535 expression is the anonymous_method_type, and the type is a
11536 delegate, we invoke the AnonymousMethod.Compatible method to check
11537 whether an implicit conversion is possible.
11539 (Convert.ImplicitConversionStandard): Only do implicit method
11540 group conversions if the language level is not ISO_1.
11542 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
11543 MethodInfo for the Invoke method. used by Delegate and
11546 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
11547 method conversions if the target type is a delegate.
11549 Removed extra debugging nops.
11551 (LocalVariableReference): Turn the `local_info' into a public
11554 Add `prepared' field, the same hack used for FieldExprs to cope
11555 with composed assignments, as Local variables do not necessarily
11556 operate purely on the stack as they used to: they can be captured
11559 Add `temp' for a temporary result, like fields.
11561 Refactor DoResolve and DoResolveLValue into DoResolveBase.
11563 It now copes with Local variables that are captured and emits the
11564 proper instance variable to load it from a field in the captured
11567 (ParameterReference.DoResolveBase): During the resolve phase,
11568 capture parameters if we are in an anonymous method.
11570 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
11571 anonymous method, use the EmitContext helper routines to emit the
11572 parameter reference.
11574 * iterators.cs: Set RemapToProxy to true/false during the
11577 * parameters.cs (GetParameterByName): New helper method.
11579 * typemanager.cs (anonymous_method_type) a new type that
11580 represents an anonyous method. This is always an internal type,
11581 used as a fencepost to test against the anonymous-methodness of an
11584 2004-10-20 Marek Safar <marek.safar@seznam.cz>
11586 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
11588 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
11590 2004-10-18 Martin Baulig <martin@ximian.com>
11592 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
11593 `Type' directly, but call ResolveType() on it.
11594 (Catch.Resolve): Likewise.
11595 (Foreach.Resolve): Likewise.
11597 2004-10-18 Martin Baulig <martin@ximian.com>
11599 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
11600 `Type' directly, but call ResolveType() on it.
11601 (Probe.DoResolve): Likewise.
11602 (ArrayCreation.LookupType): Likewise.
11603 (TypeOf.DoResolve): Likewise.
11604 (SizeOf.DoResolve): Likewise.
11606 2004-10-18 Martin Baulig <martin@ximian.com>
11608 * expression.cs (Invocation.BetterFunction): Put back
11609 TypeManager.TypeToCoreType().
11611 2004-10-18 Raja R Harinath <rharinath@novell.com>
11613 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
11616 2004-10-18 Martin Baulig <martin@ximian.com>
11618 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
11619 `Type' directly, but call ResolveType() on it.
11621 2004-10-18 Martin Baulig <martin@ximian.com>
11623 * class.cs (FieldMember.Define): Don't access the TypeExpr's
11624 `Type' directly, but call ResolveType() on it.
11625 (MemberBase.DoDefine): Likewise.
11627 * expression.cs (New.DoResolve): Don't access the TypeExpr's
11628 `Type' directly, but call ResolveType() on it.
11629 (ComposedCast.DoResolveAsTypeStep): Likewise.
11631 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
11632 `Type' directly, but call ResolveType() on it.
11634 2004-10-17 John Luke <john.luke@gmail.com>
11636 * class.cs (Operator.GetSignatureForError): use CSharpName
11638 * parameter.cs (Parameter.GetSignatureForError): Returns
11639 correct name even if was not defined.
11641 2004-10-13 Raja R Harinath <rharinath@novell.com>
11644 * class.cs (TypeContainer.EmitContext): New property.
11645 (DefineNestedTypes): Create an emitcontext for each part.
11646 (MethodCore.DoDefineParameters): Use container's emitcontext.
11647 Pass type array to InternalParameters.
11648 (MemberBase.DoDefine): Use container's emitcontext.
11649 (FieldMember.Define): Likewise.
11650 (Event.Define): Likewise.
11651 (SetMethod.GetParameterInfo): Change argument to EmitContext.
11652 Pass type array to InternalParameters.
11653 (SetIndexerMethod.GetParameterInfo): Likewise.
11654 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
11655 * delegate.cs (Define): Pass emitcontext to
11656 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
11657 array to InternalParameters.
11658 * expression.cs (ParameterReference.DoResolveBase): Pass
11659 emitcontext to GetParameterInfo.
11660 (ComposedCast.DoResolveAsTypeStep): Remove check on
11661 ec.ResolvingTypeTree.
11662 * parameter.cs (Parameter.Resolve): Change argument to
11663 EmitContext. Use ResolveAsTypeTerminal.
11664 (Parameter.GetSignature): Change argument to EmitContext.
11665 (Parameters.ComputeSignature): Likewise.
11666 (Parameters.ComputeParameterTypes): Likewise.
11667 (Parameters.GetParameterInfo): Likewise.
11668 (Parameters.ComputeAndDefineParameterTypes): Likewise.
11669 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
11670 * support.cs (InternalParameters..ctor): Remove variant that takes
11672 * typemanager.cs (system_intptr_expr): New.
11673 (InitExpressionTypes): Initialize it.
11675 2004-10-12 Chris Toshok <toshok@ximian.com>
11677 * cs-parser.jay: fix location for try_statement and catch_clause.
11679 2004-10-11 Martin Baulig <martin@ximian.com>
11681 * report.cs: Don't make --fatal abort on warnings, we have
11682 -warnaserror for that.
11684 2004-10-07 Raja R Harinath <rharinath@novell.com>
11686 More DeclSpace.ResolveType avoidance.
11687 * decl.cs (MemberCore.InUnsafe): New property.
11688 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
11689 with newly created EmitContext.
11690 (FieldMember.Define): Likewise.
11691 * delegate.cs (Delegate.Define): Likewise.
11692 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
11693 only if normal name-lookup fails.
11694 (TypeExpr.DoResolve): Enable error-checking.
11695 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
11696 (SizeOf.DoResolve): Likewise.
11697 (ComposedCast.DoResolveAsTypeStep): Likewise.
11698 (StackAlloc.DoResolve): Likewise.
11699 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
11700 (Block.Unsafe): New property.
11701 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
11702 (Unsafe): Set 'unsafe' flag of contained block.
11703 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
11704 (Fixed.Resolve): Likewise.
11705 (Catch.Resolve): Likewise.
11706 (Using.ResolveLocalVariableDecls): Likewise.
11707 (Foreach.Resolve): Likewise.
11709 2004-10-05 John Luke <john.luke@gmail.com>
11711 * cs-parser.jay: add location to error CS0175
11713 2004-10-04 Miguel de Icaza <miguel@ximian.com>
11715 * ecore.cs (Expression.Constantity): Add support for turning null
11718 * const.cs (Const.Define): Allow constants to be reference types
11719 as long as the value is Null.
11721 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
11723 * namespace.cs (NamespaceEntry.Using): No matter which warning
11724 level is set, check if this namespace name has already been added.
11726 2004-10-03 Ben Maurer <bmaurer@ximian.com>
11728 * expression.cs: reftype [!=]= null should always use br[true,false].
11731 2004-10-03 Marek Safar <marek.safar@seznam.cz>
11734 * attribute.cs: Enum conversion moved to
11735 GetAttributeArgumentExpression to be applied to the all
11738 2004-10-01 Raja R Harinath <rharinath@novell.com>
11740 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
11741 * class.c (TypeContainer.DefineType): Flag error if
11742 base types aren't accessible due to access permissions.
11743 * decl.cs (DeclSpace.ResolveType): Move logic to
11744 Expression.ResolveAsTypeTerminal.
11745 (DeclSpace.ResolveTypeExpr): Thin layer over
11746 Expression.ResolveAsTypeTerminal.
11747 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
11748 Refactor code into NestedAccess. Use it.
11749 (DeclSpace.NestedAccess): New.
11750 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
11751 argument to silence errors. Check access permissions.
11752 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
11753 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
11754 (Cast.DoResolve): Likewise.
11755 (New.DoResolve): Likewise.
11756 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
11757 (TypeOf.DoResolve): Likewise.
11759 * expression.cs (Invocation.BetterConversion): Return the Type of
11760 the better conversion. Implement section 14.4.2.3 more faithfully.
11761 (Invocation.BetterFunction): Make boolean. Make correspondence to
11762 section 14.4.2.2 explicit.
11763 (Invocation.OverloadResolve): Update.
11764 (Invocation): Remove is_base field.
11765 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
11766 (Invocation.Emit): Likewise.
11768 2004-09-27 Raja R Harinath <rharinath@novell.com>
11770 * README: Update to changes.
11772 2004-09-24 Marek Safar <marek.safar@seznam.cz>
11774 * cs-parser.jay: Reverted 642 warning fix.
11776 2004-09-23 Marek Safar <marek.safar@seznam.cz>
11779 * decl.cs (FindMemberWithSameName): Indexer can have more than
11782 2004-09-23 Marek Safar <marek.safar@seznam.cz>
11784 * expression.cs (LocalVariableReference.DoResolveLValue):
11785 Do not report warning 219 for out values.
11786 (EmptyExpression.Null): New member to avoid extra allocations.
11788 2004-09-23 Marek Safar <marek.safar@seznam.cz>
11790 * cs-parser.jay: Fix wrong warning 642 report.
11792 * cs-tokenizer.cs (CheckNextToken): New helper;
11793 Inspect next character if is same as expected.
11795 2004-09-23 Martin Baulig <martin@ximian.com>
11797 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
11798 (Convert.ImplicitReferenceConversionExists): Likewise.
11800 2004-09-23 Marek Safar <marek.safar@seznam.cz>
11802 * class.cs (Operator.Define): Add error 448 and 559 report.
11804 2004-09-22 Marek Safar <marek.safar@seznam.cz>
11806 * class.cs (MemberBase.IsTypePermitted): New protected
11807 method for checking error CS0610.
11809 2004-09-22 Marek Safar <marek.safar@seznam.cz>
11811 * class.cs (TypeContainer.HasExplicitLayout): New property
11812 Returns whether container has StructLayout attribute set Explicit.
11813 (FieldMember): New abstract class for consts and fields.
11814 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
11815 (Field): Reuse FieldMember.
11817 * const.cs (Const): Reuse FieldMember.
11819 * rootcontext.cs: EmitConstants call moved to class.
11821 2004-09-22 Martin Baulig <martin@ximian.com>
11823 Thanks to Peter Sestoft for this bug report.
11825 * expression.cs (Conditional): If both the `trueExpr' and the
11826 `falseExpr' is a NullLiteral, return a NullLiteral.
11828 2004-09-22 Martin Baulig <martin@ximian.com>
11830 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
11831 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
11832 for the "get_Current" call.
11834 2004-09-22 Martin Baulig <martin@ximian.com>
11836 Marek and me just fixed one of our oldest bugs: #28562 :-)
11838 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
11840 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
11841 we're an EnumConstant, just return that.
11842 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
11843 an EnumConstant. In this case, we need to use GetValueAsEnumType()
11844 to get the value which'll actually be written into the attribute.
11845 However, we have to use GetValue() to access the attribute's value
11848 2004-09-22 Marek Safar <marek.safar@seznam.cz>
11850 * constant.cs (Constant.IsNegative): New abstract property
11853 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
11854 (StackAlloc.DoResolve): Reused IsNegative.
11856 2004-09-21 Martin Baulig <martin@ximian.com>
11858 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
11859 if we're used in an iterator, we may be called from different
11862 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
11863 we actually have an exception block.
11865 2004-09-20 John Luke <jluke@cfl.rr.com>
11867 * class.cs, cs-parser.jay: Improve the error report for 1520:
11868 report the actual line where the error happens, not where the
11869 class was declared.
11871 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
11872 Pass location information that was available elsewhere.
11874 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
11876 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
11877 runtime to delay sign assemblies.
11879 2004-09-19 Miguel de Icaza <miguel@ximian.com>
11881 * cs-parser.jay: Do not report the stack trace, this is barely
11884 2004-08-22 John Luke <john.luke@gmail.com>
11886 * driver.cs : check that a resource id is not already used
11887 before adding it, report CS1508 if it is, bug #63637
11889 2004-09-19 Miguel de Icaza <miguel@ximian.com>
11891 * ecore.cs: Removed dead code.
11893 2004-09-18 Marek Safar <marek.safar@seznam.cz>
11895 * class.cs: Do not report warning CS0067 on the interfaces.
11897 2004-09-16 Marek Safar <marek.safar@seznam.cz>
11899 * cs-parser.jay: Add error 504 report.
11901 2004-09-16 Marek Safar <marek.safar@seznam.cz>
11903 * rootcontext.cs: WarningLevel is 4 by default now.
11905 * statement.cs (Fixed.Resolve): Do not null
11908 2004-09-16 Marek Safar <marek.safar@seznam.cz>
11911 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
11912 deep search when property is not virtual.
11913 (PropertyExpr.ResolveAccessors): Make one call for both
11916 2004-09-15 Marek Safar <marek.safar@seznam.cz>
11919 * statement.cs: Error 152 report constains also location.
11921 2004-09-15 Marek Safar <marek.safar@seznam.cz>
11924 * const.cs: Explicitly set constant as static.
11926 2004-09-15 Marek Safar <marek.safar@seznam.cz>
11929 * cs-parser.jay: Add error 1017 report.
11931 2004-09-15 Marek Safar <marek.safar@seznam.cz>
11933 Fixed bug #59980, #64224
11934 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
11936 * typemanager.cs (IsSpecialMethod): Simplified
11938 2004-09-14 Marek Safar <marek.safar@seznam.cz>
11940 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
11941 condition with better params.
11943 2004-09-14 Marek Safar <marek.safar@seznam.cz>
11946 * attribute.cs (Resolve): Property has to have both
11949 2004-09-14 Martin Baulig <martin@ximian.com>
11951 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
11953 2004-09-14 Marek Safar <marek.safar@seznam.cz>
11956 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
11957 called and is obsolete then this member suppress message
11958 when call is inside next [Obsolete] method or type.
11960 * expression.cs: Use TestObsoleteMethodUsage member.
11962 2004-09-14 Martin Baulig <martin@ximian.com>
11964 * cs-parser.jay: Sync a bit with the GMCS version.
11966 2004-09-14 Martin Baulig <martin@ximian.com>
11968 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
11969 (CSharpParser.yacc_verbose_flag): New public field.
11971 * genericparser.cs: Removed.
11973 2004-09-14 Raja R Harinath <rharinath@novell.com>
11975 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
11977 2004-09-13 Marek Safar <marek.safar@seznam.cz>
11979 * class.cs (MethodCore.CheckBase): Fix bug #65757.
11981 2004-09-10 Martin Baulig <martin@ximian.com>
11983 Backported my MemberName changes from GMCS into MCS.
11985 - we are now using a special `MemberName' class instead of using
11986 strings; in GMCS, the `MemberName' also contains the type
11989 - changed the grammar rules a bit:
11990 * the old `member_name' is now a `namespace_or_type_name':
11991 The rule is that we use `namespace_or_type_name' everywhere
11992 where we expect either a "member name" (GetEnumerator) or a
11993 "member name" with an explicit interface name
11994 (IEnumerable.GetEnumerator).
11995 In GMCS, the explicit interface name may include type arguments
11996 (IEnumerable<T>.GetEnumerator).
11997 * we use `member_name' instead of just `IDENTIFIER' for
11999 The rule is that we use `member_name' wherever a member may
12000 have type parameters in GMCS.
12002 * decl.cs (MemberName): New public class.
12003 (MemberCore.MemberName): New public readonly field.
12004 (MemberCore.ctor): Take a `MemberName' argument, not a string.
12005 (DeclSpace): Likewise.
12007 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
12008 * enum.cs (Enum.ctor): Likewise.
12010 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
12012 (AliasEntry.ctor): Take a MemberName, not an Expression.
12013 (AliasEntry.UsingAlias): Likewise.
12015 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
12016 (IMethodData.MemberName): Changed type from string to MemberName.
12017 (MemberBase.ExplicitInterfaceName): Likewise.
12018 (AbstractPropertyEventMethod.SetupName): Make this private.
12019 (AbstractPropertyEventMethod.ctor): Added `string prefix'
12020 argument; compute the member name here.
12021 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
12022 on the `member.MemberName' and the `prefix'.
12024 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
12026 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
12027 thus, we get a `MemberName' instead of a `string'. These
12028 declarations may have type parameters in GMCS.
12029 (interface_method_declaration, delegate_declaration): Likewise.
12030 (class_declaration, interface_declaration): Likewise.
12031 (method_header): Use `namespace_or_type_name' instead of
12032 `member_name'. We may be an explicit interface implementation.
12033 (property_declaration, event_declaration): Likewise.
12034 (member_name): This is now just an `IDENTIFIER', not a
12035 `namespace_or_type_name'.
12036 (type_name, interface_type): Removed.
12037 (namespace_or_type_name): Return a MemberName, not an Expression.
12038 (primary_expression): Use `member_name' instead of `IDENTIFIER';
12039 call GetTypeExpression() on the MemberName to get an expression.
12040 (IndexerDeclaration.interface_type): Changed type from string to
12042 (MakeName): Operate on MemberName's instead of string's.
12044 2004-09-13 Raja R Harinath <rharinath@novell.com>
12047 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
12048 (NamespaceEntry.Lookup): Add new argument to flag if we want the
12049 lookup to avoid symbols introduced by 'using'.
12050 * rootcontext.cs (NamespaceLookup): Update.
12052 2004-09-12 Marek Safar <marek.safar@seznam.cz>
12054 * class.cs (TypeContainer.DoDefineMembers): Do not call
12055 DefineDefaultConstructor for static classes.
12057 2004-09-12 Marek Safar <marek.safar@seznam.cz>
12059 * attribute.cs (Attribute.Resolve): Add error 653 report.
12061 * class.cs (Class.ApplyAttributeBuilder): Add error 641
12063 (Method.ApplyAttributeBuilder): Add error 685 report.
12064 (Operator.Define): Add error 564 report.
12066 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
12068 * expression.cs (Invocation.DoResolve): Add error
12069 245 and 250 report.
12071 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
12074 2004-09-11 Marek Safar <marek.safar@seznam.cz>
12076 * class.cs (ConstructorInitializer.Resolve):
12077 Wrong error number (515->516).
12079 2004-09-11 Marek Safar <marek.safar@seznam.cz>
12081 * class.cs (Indexer.Define): Add error 631 report.
12083 2004-09-11 Marek Safar <marek.safar@seznam.cz>
12085 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
12087 2004-09-11 Marek Safar <marek.safar@seznam.cz>
12089 * expression.cs (Probe.DoResolve): Add error CS0241 report.
12091 2004-09-10 Marek Safar <marek.safar@seznam.cz>
12093 * cs-parser.jay: Added error CS0241 report.
12095 2004-09-10 Raja R Harinath <rharinath@novell.com>
12097 * cs-parser.jay (fixed_statement): Introduce a scope for the
12098 declaration in the 'fixed' statement.
12100 2004-09-09 Marek Safar <marek.safar@seznam.cz>
12102 * cs-parser.jay: Added CS0230 error report.
12104 2004-09-09 Marek Safar <marek.safar@seznam.cz>
12106 * cs-parser.jay: Added errors CS0231 and CS0257 report.
12108 2004-09-09 Marek Safar <marek.safar@seznam.cz>
12110 * expression.cs (Argument.Resolve): Added error CS0192 and
12113 2004-09-09 Marek Safar <marek.safar@seznam.cz>
12115 C# 2.0 #pragma warning feature
12117 * cs-tokenizer.cs (PreProcessPragma): New method;
12118 Handles #pragma directive.
12120 * report.cs (WarningRegions): New class; Support
12121 class for #pragma warning directive. It tests whether
12122 warning is enabled for a given line.
12124 2004-09-08 Miguel de Icaza <miguel@ximian.com>
12126 * const.cs: Add more descriptive error report, tahnks to
12129 2004-09-08 Marek Safar <marek.safar@seznam.cz>
12131 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
12133 2004-09-07 Miguel de Icaza <miguel@ximian.com>
12135 * expression.cs: Apply patch from Ben: Remove dead code from
12136 ArrayCreation, and remove the TurnintoConstant call in const.cs,
12137 as that code just threw an exception anwyays.
12139 * const.cs: Remove the call to the turnintoconstant, for details
12142 * literal.cs: The type of the null-literal is the null type; So
12143 we use a placeholder type (literal.cs:System.Null, defined here)
12146 * expression.cs (Conditional.DoResolve): Remove some old code that
12147 is no longer needed, conversions have been fixed.
12149 (ArrayCreationExpression.DoResolve): Return false if we fail to
12150 resolve the inner expression.
12152 2004-09-07 Raja R Harinath <rharinath@novell.com>
12155 * cs-parser.jay (delegate_declaration): Record a delegate
12156 declaration as a type declaration.
12157 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
12159 2004-09-06 Miguel de Icaza <miguel@ximian.com>
12161 * parameter.cs: Do not crash if the type can not be resolved.
12163 * expression.cs: Report errors with unsafe pointers, fixes #64896
12165 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
12167 * expression.cs: Pointer arith always needs to do a conv.i
12168 if the operand is a long. fix 65320
12170 2004-09-04 Marek Safar <marek.safar@seznam.cz>
12172 Fixed cs0619-37.cs, cs0619-38.cs
12174 * enum.cs (GetObsoleteAttribute): Removed.
12176 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
12177 on Enum member is double staged. The first is tested member
12180 2004-09-04 Marek Safar <marek.safar@seznam.cz>
12182 Fixed #56986, #63631, #65231
12184 * class.cs: (TypeContainer.AddToMemberContainer): New method,
12185 adds member to name container.
12186 (TypeContainer.AddToTypeContainer): New method, adds type to
12188 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
12189 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
12190 AddOperator): Simplified by reusing AddToMemberContainer.
12191 (TypeContainer.UserDefinedStaticConstructor): Changed to property
12193 (Method.CheckForDuplications): Fixed implementation to test all
12195 (MemberBase): Detection whether member is explicit interface
12196 implementation is now in constructor.
12197 (MemberBase.UpdateMemberName): Handles IndexerName.
12198 (Accessor): Changed to keep also location information.
12199 (AbstractPropertyEventMethod): Is derived from MemberCore.
12200 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
12201 will be emited or not.
12202 (PropertyBase.AreAccessorsDuplicateImplementation):
12203 Tests whether accessors are not in collision with some method.
12204 (Operator): Is derived from MethodCore to simplify common
12207 * decl.cs (Flags.TestMethodDuplication): Test for duplication
12209 (DeclSpace.AddToContainer): Adds the member to defined_names
12210 table. It tests for duplications and enclosing name conflicts.
12212 * enum.cs (EnumMember): Clean up to reuse the base structures
12214 2004-09-03 Martin Baulig <martin@ximian.com>
12216 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
12217 into TypeContainer, to make partial classes work again.
12219 2004-09-03 Martin Baulig <martin@ximian.com>
12221 * rootcontext.cs (RootContext.V2): Removed.
12223 2004-03-23 Martin Baulig <martin@ximian.com>
12225 * expression.cs (Invocation.OverloadResolve): Added `bool
12226 may_fail' argument and use it instead of the Location.IsNull() hack.
12228 2004-09-03 Martin Baulig <martin@ximian.com>
12230 Merged latest changes into gmcs. Please keep this comment in
12231 here, it makes it easier for me to see what changed in MCS since
12232 the last time I merged.
12234 2004-09-03 Raja R Harinath <rharinath@novell.com>
12237 * expression.cs (BetterConversion): Don't allow either conversion
12238 to be null. Remove redundant implicit conversion test when 'q ==
12239 null' -- when this function is invoked, we already know that the
12240 implicit conversion exists.
12241 (BetterFunction): Assume that 'best' is non-null. Remove
12242 redundant reimplementation of IsApplicable when 'best' is null.
12243 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
12244 number of arguments.
12245 (IsAncestralType): Extract from OverloadResolve.
12246 (OverloadResolve): Make robust to the MethodGroupExpr being
12247 unsorted. Implement all the logic of Section 14.5.5.1, and
12248 support overloading of methods from multiple applicable types.
12249 Clean up logic somewhat. Don't pass null methods to BetterFunction.
12251 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
12252 (RealError, Warning): Append type of report to related symbol.
12254 2004-09-03 Marek Safar <marek.safar@seznam.cz>
12256 * enum.cs: Fixed CLS-Compliance checks for enum members.
12257 Error tests cs3008-8.cs, cs3014-8.cs
12259 2004-09-02 Marek Safar <marek.safar@seznam.cz>
12261 Fixed bug #62342, #63102
12262 * class.cs: ImplementIndexer uses member.IsExplicitImpl
12263 like ImplementMethod.
12265 2004-09-02 Marek Safar <marek.safar@seznam.cz>
12267 * attribute.cs (Attribute.GetAttributeArgumentExpression):
12270 2004-09-02 Martin Baulig <martin@ximian.com>
12272 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
12273 TypeManager.GetArgumentTypes() rather than calling GetParameters()
12276 2004-09-01 Marek Safar <marek.safar@seznam.cz>
12278 C# 2.0 Static classes implemented
12280 * class.cs (TypeContainer): instance_constructors,
12281 initialized_fields, initialized_static_fields,
12282 default_constructor, base_inteface_types are protected to be
12283 accessible from StaticClass.
12284 (TypeContainer.DefineDefaultConstructor): New virtual method
12285 for custom default constructor generating
12286 (StaticClass): New class to handle "Static classes" feature.
12288 * cs-parser.jay: Handle static keyword on class like instance
12291 * driver.cs: Added "/langversion" command line switch with two
12292 options (iso-1, default).
12294 2004-08-31 Marek Safar <marek.safar@seznam.cz>
12296 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
12298 2004-08-31 Miguel de Icaza <miguel@ximian.com>
12300 * delegate.cs: Style.
12302 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
12304 * delegate.cs: Add seperate instance expr field for miguel.
12306 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
12308 * PointerArithmetic (Resolve): make sure we are not doing
12309 pointer arith on void*. Also, make sure we are resolved
12310 by not setting eclass until resolve.
12312 All callers: Make sure that PointerArithmetic gets resolved.
12314 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
12316 * ArrayCreation (LookupType): If the type does not resolve
12317 to an array, give an error.
12319 2004-08-27 Marek Safar <marek.safar@seznam.cz>
12321 * statement.cs (Try.Resolve): Fixed bug #64222
12323 2004-08-27 Martin Baulig <martin@ximian.com>
12326 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
12329 2004-08-26 Marek Safar <marek.safar@seznam.cz>
12331 * ecore.cs (Constantify): Get underlying type via
12332 System.Enum.GetUnderlyingType to avoid StackOverflow on the
12333 Windows in special cases.
12335 2004-08-26 Marek Safar <marek.safar@seznam.cz>
12337 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
12338 for obtaining also private methods.
12339 (GetRemoveMethod): Used GetRemoveMethod (true)
12340 for obtaining also private methods.
12342 2004-08-24 Martin Baulig <martin@ximian.com>
12344 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
12345 MethodAttributes.HideBySig for operators.
12347 2004-08-23 Martin Baulig <martin@ximian.com>
12349 Back to the old error reporting system :-)
12351 * report.cs (Message): Removed.
12352 (Report.MessageData, ErrorData, WarningData): Removed.
12353 (Report.Error, Warning): Back to the old system.
12355 2004-08-23 Martin Baulig <martin@ximian.com>
12357 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
12359 * class.cs (TypeContainer.ParentContainer): New public virtual
12360 method; replaces the explicit interface implementation.
12361 (ClassPart.ParentContainer): Override.
12363 2004-08-23 Martin Baulig <martin@ximian.com>
12365 * statement.cs (Switch): Added support for constant switches; see
12366 #59428 or test-285.cs.
12368 2004-08-22 Marek Safar <marek.safar@seznam.cz>
12371 * statement.cs (GetEnumeratorFilter): Removed useless
12372 logic because C# specs is strict. GetEnumerator must be
12375 2004-08-22 Martin Baulig <martin@ximian.com>
12377 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
12378 a switch and may break, reset the barrier. Fixes #59867.
12380 2004-08-22 Marek Safar <marek.safar@seznam.cz>
12382 CLS-Compliance speed up (~5% for corlib)
12384 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
12385 New method. Tests container for CLS-Compliant names
12387 * class.cs (TypeContainer.VerifyClsName): New method.
12388 Checks whether container name is CLS Compliant.
12389 (Constructor): Implements IMethodData.
12391 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
12392 low-case table for CLS Compliance test.
12393 (MemberCache.VerifyClsParameterConflict): New method.
12394 Checks method parameters for CS3006 error.
12396 * enum.cs (EnumMember): Is derived from MemberCore.
12397 (Enum.VerifyClsName): Optimized for better performance.
12399 2004-08-06 Marek Safar <marek.safar@seznam.cz>
12401 * report.cs: Renamed Error_T to Error and changed all
12404 2004-08-06 Marek Safar <marek.safar@seznam.cz>
12406 * class.cs (TypeContainer.IndexerArrayList): New inner class
12407 container for indexers.
12408 (TypeContainer.DefaultIndexerName): New constant for default
12409 indexer name. Replaced all "Item" with this constant.
12410 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
12412 * typemanager.cs (TypeManager.default_member_ctor): Cache here
12413 DefaultMemberAttribute constructor.
12415 2004-08-05 Martin Baulig <martin@ximian.com>
12417 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
12420 2004-08-05 Marek Safar <marek.safar@seznam.cz>
12422 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
12423 multi platforms problem.
12425 * compiler.csproj: Included shared files.
12427 2004-08-04 Marek Safar <marek.safar@seznam.cz>
12429 Fix bug 60333, 55971 in the more general way
12430 * attribute.cs (Attribute.GetAttributeArgumentExpression):
12431 Added arg_type argument for constant conversion.
12432 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
12434 2004-08-04 Marek Safar <marek.safar@seznam.cz>
12437 * class.cs (TypeContainer ): New inner classes MethodArrayList,
12438 OperatorArrayList, MethodCoreArrayList for typecontainer
12439 containers. Changed class member types to these new types.
12440 (MethodArrayList.DefineMembers): Added test for CS0659.
12442 2004-08-04 Miguel de Icaza <miguel@ximian.com>
12444 * cfold.cs: Synchronize the folding with the code in expression.cs
12445 Binary.DoNumericPromotions for uint operands.
12447 * attribute.cs: Revert patch from Raja, it introduced a regression
12448 while building Blam-1.2.1 (hard to isolate a test case).
12450 2004-08-04 Marek Safar <marek.safar@seznam.cz>
12454 (TypeContainer.Define): Renamed to DefineContainerMembers because of
12456 (MethodCore.parent_method): New member. The method we're overriding
12457 if this is an override method.
12458 (MethodCore.CheckBase): Moved from Method class and made common.
12459 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
12461 (MethodCore.CheckForDuplications): New abstract method. For custom
12462 member duplication search in a container
12463 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
12464 method and its return type.
12465 (Event.conflict_symbol): New member. Symbol with same name in the
12469 (MemberCache.FindMemberWithSameName): New method. The method
12470 is looking for conflict with inherited symbols.
12472 2004-08-04 Martin Baulig <martin@ximian.com>
12474 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
12476 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
12478 2004-08-03 Marek Safar <marek.safar@seznam.cz>
12480 * report.cs (Message): New enum for better error, warning reference in
12482 (MessageData): New inner abstract class. It generally handles printing of
12483 error and warning messages.
12484 Removed unused Error, Warning, Message methods.
12486 2004-08-03 Marek Safar <marek.safar@seznam.cz>
12488 Fix for cs0592-8.cs test
12490 (Attributable.ValidAttributeTargets): Made public.
12491 (Attribute.ExplicitTarget): New member for explicit target value.
12492 (Attribute.CheckTargets): Now we translate explicit attribute
12493 target to Target here.
12495 2004-08-03 Ben Maurer <bmaurer@ximian.com>
12497 * ecore.cs (MethodGroupExpr): new IsBase property.
12499 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
12501 * delegate.cs (DelegateCreation): store a MethodGroupExpr
12502 rather than an instance expr.
12504 (DelegateCreation.Emit): Use the method group rather than
12505 the instance expression. Also, if you have base.Foo as the
12506 method for a delegate, make sure to emit ldftn, not ldftnvirt.
12508 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
12510 (NewDelegate.DoResolve): Only check for the existance of Invoke
12511 if the method is going to be needed. Use MethodGroupExpr.
12513 (NewDelegate.Emit): Remove, DelegateCreation implements this.
12515 * expression.cs: For pointer arith., make sure to use
12516 the size of the type, not the size of the pointer to
12519 2004-08-03 Marek Safar <marek.safar@seznam.cz>
12522 * class.cs (Class): Added error CS0502 test.
12524 2004-08-03 John Luke <jluke@cfl.rr.com>
12525 Raja R Harinath <rharinath@novell.com>
12528 * attribute.cs (Attribute.complained_before): New flag.
12529 (Attribute.ResolveType, Attribute.Resolve),
12530 (Attribute.DefinePInvokeMethod): Set it.
12531 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
12533 2004-08-03 Martin Baulig <martin@ximian.com>
12535 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
12536 use a user-defined operator; we still need to do numeric
12537 promotions in case one argument is a builtin type and the other
12538 one has an implicit conversion to that type. Fixes #62322.
12540 2004-08-02 Martin Baulig <martin@ximian.com>
12542 * statement.cs (LocalInfo.Flags): Added `IsThis'.
12543 (LocalInfo.IsThis): New public property.
12544 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
12546 2004-08-01 Martin Baulig <martin@ximian.com>
12548 * class.cs (TypeContainer.GetClassBases): Don't set the default
12549 here since we may get called from GetPartialBases().
12550 (TypeContainer.DefineType): If GetClassBases() didn't return a
12551 parent, use the default one.
12553 2004-07-30 Duncan Mak <duncan@ximian.com>
12555 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
12557 2004-07-30 Martin Baulig <martin@ximian.com>
12559 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
12561 * class.cs (SourceMethod): New public class, derive from the
12562 symbol writer's ISourceMethod.
12563 (Method): Use the new symbol writer API.
12565 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
12566 as argument and use the new symbol writer.
12569 (SourceFile): Implement the symbol writer's ISourceFile.
12570 (Location.SymbolDocument): Removed.
12571 (Location.SourceFile): New public property.
12573 * symbolwriter.cs: Use the new symbol writer API.
12575 2004-07-30 Raja R Harinath <rharinath@novell.com>
12577 * Makefile (install-local): Remove. Functionality moved to
12580 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
12582 * Makefile: Install mcs.exe.config file together with mcs.exe.
12583 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
12584 correct runtime version.
12586 2004-07-25 Martin Baulig <martin@ximian.com>
12589 (TypeContainer.RegisterOrder): Removed, this was unused.
12590 (TypeContainer, interface_order): Removed.
12591 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
12592 TypeContainer as argument since we can also be called with a
12593 `PartialContainer' for a partial class/struct/interface.
12594 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
12595 of checking whether we're an `Interface' - we could be a
12596 `PartialContainer'.
12597 (PartialContainer.Register): Override; call
12598 AddClass()/AddStruct()/AddInterface() on our parent.
12600 * cs-parser.jay (interface_member_declaration): Add things to the
12601 `current_container', not the `current_class'.
12603 * rootcontext.cs (RegisterOrder): The overloaded version which
12604 takes an `Interface' was unused, removed.
12606 * typemanager.cs (TypeManager.LookupInterface): Return a
12607 `TypeContainer', not an `Interface'.
12608 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
12609 contain a `PartialContainer' for an interface, so check it's
12610 `Kind' to figure out what it is.
12612 2004-07-25 Martin Baulig <martin@ximian.com>
12614 * class.cs (Class.DefaultTypeAttributes): New public constant.
12615 (Struct.DefaultTypeAttributes): Likewise.
12616 (Interface.DefaultTypeAttributes): Likewise.
12617 (PartialContainer.TypeAttr): Override this and add the
12618 DefaultTypeAttributes.
12620 2004-07-25 Martin Baulig <martin@ximian.com>
12622 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
12623 we can just use the `Parent' field instead.
12625 2004-07-25 Martin Baulig <martin@ximian.com>
12627 * class.cs (TypeContainer.Emit): Renamed to EmitType().
12629 2004-07-25 Martin Baulig <martin@ximian.com>
12631 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
12632 our parts before defining any methods.
12633 (TypeContainer.VerifyImplements): Make this virtual.
12634 (ClassPart.VerifyImplements): Override and call VerifyImplements()
12635 on our PartialContainer.
12637 2004-07-25 Martin Baulig <martin@ximian.com>
12639 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
12641 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
12642 argument, we can just use the `Parent' field instead.
12645 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
12646 (MemberBase.DoDefine): Likewise.
12648 2004-07-24 Martin Baulig <martin@ximian.com>
12650 * decl.cs (MemberCore.Parent): New public field.
12651 (DeclSpace.Parent): Moved to MemberCore.
12653 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
12654 (MemberBase.ctor): Added TypeContainer argument, pass it to our
12656 (FieldBase, Field, Operator): Likewise.
12657 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
12658 (EventField, Event): Likewise.
12660 2004-07-23 Martin Baulig <martin@ximian.com>
12662 * class.cs (PartialContainer): New public class.
12663 (ClassPart): New public class.
12664 (TypeContainer): Added support for partial classes.
12665 (TypeContainer.GetClassBases): Splitted some of the functionality
12666 out into GetNormalBases() and GetPartialBases().
12668 * cs-tokenizer.cs (Token.PARTIAL): New token.
12669 (Tokenizer.consume_identifier): Added some hacks to recognize
12670 `partial', but only if it's immediately followed by `class',
12671 `struct' or `interface'.
12673 * cs-parser.jay: Added support for partial clases.
12675 2004-07-23 Martin Baulig <martin@ximian.com>
12677 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
12678 a `DeclSpace' and also made it readonly.
12679 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
12680 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
12681 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
12683 * cs-parser.jay: Pass the `current_class', not the
12684 `current_container' (at the moment, this is still the same thing)
12685 to a new Method, Property, Event, Indexer or Constructor.
12687 2004-07-23 Martin Baulig <martin@ximian.com>
12689 * cs-parser.jay (CSharpParser): Added a new `current_class' field
12690 and removed the `current_interface' one.
12691 (struct_declaration, class_declaration, interface_declaration):
12692 Set `current_class' to the newly created class/struct/interface;
12693 set their `Bases' and call Register() before parsing their body.
12695 2004-07-23 Martin Baulig <martin@ximian.com>
12697 * class.cs (Kind): New public enum.
12698 (TypeContainer): Made this class abstract.
12699 (TypeContainer.Kind): New public readonly field.
12700 (TypeContainer.CheckDef): New public method; moved here from
12702 (TypeContainer.Register): New public abstract method.
12703 (TypeContainer.GetPendingImplementations): New public abstract
12705 (TypeContainer.GetClassBases): Removed the `is_class' and
12706 `is_iface' parameters.
12707 (TypeContainer.DefineNestedTypes): Formerly known as
12709 (ClassOrStruct): Made this class abstract.
12711 * tree.cs (RootTypes): New public type.
12713 2004-07-20 Martin Baulig <martin@ximian.com>
12715 * tree.cs (Tree.RecordNamespace): Removed.
12716 (Tree.Namespaces): Removed.
12718 * rootcontext.cs (RootContext.IsNamespace): Removed.
12720 * cs-parser.jay (namespace_declaration): Just create a new
12721 NamespaceEntry here.
12723 2004-07-20 Martin Baulig <martin@ximian.com>
12725 * statement.cs (ExceptionStatement): New abstract class. This is
12726 now used as a base class for everyone who's using `finally'.
12727 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
12728 our local variables before using them.
12730 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
12731 virtual method. This is used by Yield.Resolve() to "steal" an
12732 outer block's `finally' clauses.
12733 (FlowBranchingException): The .ctor now takes an ExceptionStatement
12736 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
12737 version which takes an ExceptionStatement. This version must be
12738 used to create exception branchings.
12741 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
12742 (Iterator.EmitMoveNext): Added exception support; protect the
12743 block with a `fault' clause, properly handle 'finally' clauses.
12744 (Iterator.EmitDispose): Run all the `finally' clauses here.
12746 2004-07-20 Martin Baulig <martin@ximian.com>
12748 * iterator.cs: This is the first of a set of changes in the
12749 iterator code. Match the spec more closely: if we're an
12750 IEnumerable, then GetEnumerator() must be called. The first time
12751 GetEnumerator() is called, it returns the current instance; all
12752 subsequent invocations (if any) must create a copy.
12754 2004-07-19 Miguel de Icaza <miguel@ximian.com>
12756 * expression.cs: Resolve the constant expression before returning
12759 2004-07-19 Martin Baulig <martin@ximian.com>
12761 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
12762 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
12763 the return type of the new EmitContext.
12765 2004-07-18 Martin Baulig <martin@ximian.com>
12767 * class.cs (Property.Define): Fix iterators.
12769 * iterators.cs (Iterator.Define): Moved the
12770 `container.AddInterator (this)' call here from the .ctor; only do
12771 it if we resolved successfully.
12773 2004-07-17 Miguel de Icaza <miguel@ximian.com>
12775 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
12776 `true' for preprocessing directives that we parse. The return
12777 value indicates whether we should return to regular tokenizing or
12778 not, not whether it was parsed successfully.
12780 In the past if we were in: #if false ... #line #endif, we would
12781 resume parsing after `#line'. See bug 61604.
12783 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
12784 building: IsEnumType should return true only for enums, not for
12785 enums or System.Enum itself. This fixes #61593.
12787 Likely what happened is that corlib was wrong: mcs depended on
12788 this bug in some places. The bug got fixed, we had to add the
12789 hack, which caused bug 61593.
12791 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
12792 that was a workaround for the older conditions.
12794 2004-07-16 Ben Maurer <bmaurer@ximian.com>
12796 * assign.cs: IAssignMethod has a new interface, as documented
12797 inline. All assignment code now uses this new api.
12799 * ecore.cs, expression.cs: All classes which implement
12800 IAssignMethod now use the new interface.
12802 * expression.cs (Invocation): add a hack to EmitCall so that
12803 IndexerAccess can be the target of a compound assignment without
12804 evaluating its arguments twice.
12806 * statement.cs: Handle changes in Invocation api.
12808 2004-07-16 Martin Baulig <martin@ximian.com>
12810 * iterators.cs: Rewrote this. We're now using one single Proxy
12811 class for both the IEnumerable and the IEnumerator interface and
12812 `Iterator' derives from Class so we can use the high-level API.
12814 * class.cs (TypeContainer.AddIterator): New method.
12815 (TypeContainer.DoDefineType): New protected virtual method, which
12816 is called from DefineType().
12817 (TypeContainer.DoDefineMembers): Call DefineType() and
12818 DefineMembers() on all our iterators.
12819 (TypeContainer.Emit): Call Emit() on all our iterators.
12820 (TypeContainer.CloseType): Call CloseType() on all our iterators.
12822 * codegen.cs (EmitContext.CurrentIterator): New public field.
12824 2004-07-15 Martin Baulig <martin@ximian.com>
12827 (TypeManager.not_supported_exception_type): New type.
12829 2004-07-14 Martin Baulig <martin@ximian.com>
12831 * iterators.cs: Use real error numbers.
12833 2004-07-14 Martin Baulig <martin@ximian.com>
12835 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
12836 requires this to be a System.Collection.IEnumerable and not a
12837 class implementing that interface.
12838 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
12840 2004-07-13 Marek Safar <marek.safar@seznam.cz>
12842 * class.cs: Fixed previous fix, it broke some error tests.
12844 2004-07-12 Martin Baulig <martin@ximian.com>
12846 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
12849 2004-07-09 Miguel de Icaza <miguel@ximian.com>
12851 * assign.cs (LocalTemporary): Add new argument: is_address,If
12852 `is_address' is true, then the value that we store is the address
12853 to the real value, and not the value itself.
12855 * ecore.cs (PropertyExpr): use the new local temporary
12856 stuff to allow us to handle X.Y += z (where X is a struct)
12858 2004-07-08 Martin Baulig <martin@ximian.com>
12860 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
12861 not always return, just like we're doing in Using.Resolve().
12863 2004-07-07 Miguel de Icaza <miguel@ximian.com>
12865 * cs-parser.jay (fixed_statement): flag this as Pinned.
12867 2004-07-06 Miguel de Icaza <miguel@ximian.com>
12869 * typemanager.cs (TypeManager): Removed MakePinned method, this
12870 mechanism is replaced with the .NET 2.x compatible mechanism of
12871 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
12873 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
12874 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
12875 `IsFixed' property which has a different meaning.
12877 2004-07-02 Raja R Harinath <rharinath@novell.com>
12879 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
12880 visible from inside a nested class, not just the names of the
12881 immediately enclosing class.
12882 Fix for bug #60730.
12884 2004-06-24 Raja R Harinath <rharinath@novell.com>
12886 * expression.cs (BetterConversion): Remove buggy special-case
12887 handling of "implicit constant expression conversions". At this
12888 point, we already know that the conversion is possible -- we're
12889 only checking to see which is better.
12891 2004-06-24 Marek Safar <marek.safar@seznam.cz>
12893 * cs-parser.jay: Added error CS0210 test.
12895 2004-06-24 Marek Safar <marek.safar@seznam.cz>
12897 * cs-parser.jay: Added error CS0134 test.
12899 2004-06-24 Marek Safar <marek.safar@seznam.cz>
12902 * cs-parser.jay: Added error CS0145 test.
12904 2004-06-24 Marek Safar <marek.safar@seznam.cz>
12906 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
12908 2004-06-23 Ben Maurer <bmaurer@ximian.com>
12910 * expression.cs (StackAlloc.Resolve): The argument may not
12911 be a constant; deal with this case.
12913 2004-06-23 Marek Safar <marek.safar@seznam.cz>
12915 * attribute.cs (IndexerName_GetIndexerName): Renamed to
12916 GetIndexerAttributeValue.
12917 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
12919 * class.cs (Indexer.Define): Added error tests for CS0415,
12922 2004-06-23 Miguel de Icaza <miguel@ximian.com>
12924 * attribute.cs (Attribute.Resolve): Keep field code in sync with
12927 2004-06-23 Martin Baulig <martin@ximian.com>
12929 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
12930 neither return nor throw, reset the barrier as well. Fixes #60457.
12932 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
12934 * class.cs : EventAttributes is now set to None by default.
12935 This fixes bug #60459.
12937 2004-06-18 Marek Safar <marek.safar@seznam.cz>
12940 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
12941 Don't throw exception but return null (it's sufficient now).
12943 2004-06-18 Marek Safar <marek.safar@seznam.cz>
12945 * typemanager.cs (GetArgumentTypes): Faster implementation.
12947 2004-06-18 Martin Baulig <martin@ximian.com>
12949 * attribute.cs (Attribute.Resolve): Check whether we're an
12950 EmptyCast which a Constant child. Fixes #60333.
12952 2004-06-17 Ben Maurer <bmaurer@ximian.com>
12954 * statement.cs (EmitCollectionForeach): Account for the fact that
12955 not all valuetypes are in areas which we can take the address of.
12956 For these variables, we store to a temporary variable. Also, make
12957 sure that we dont emit a `callvirt' on a valuetype method.
12959 2004-06-15 Marek Safar <marek.safar@seznam.cz>
12961 * expression.cs (StackAlloc.DoReSolve): Added test for
12962 negative parameter (CS0247).
12964 2004-06-15 Marek Safar <marek.safar@seznam.cz>
12967 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
12969 2004-06-15 Marek Safar <marek.safar@seznam.cz>
12972 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
12975 2004-06-14 Marek Safar <marek.safar@seznam.cz>
12977 Fix bug #58254 & cs1555.cs, cs1556.cs
12978 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
12980 2004-06-14 Marek Safar <marek.safar@seznam.cz>
12982 * cs-parser.jay: Added error CS1669 test for indexers.
12984 2004-06-11 Martin Baulig <martin@ximian.com>
12986 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
12987 call this twice: for params and varargs methods.
12989 2004-06-11 Marek Safar <marek.safar@seznam.cz>
12992 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
12994 2004-06-11 Marek Safar <marek.safar@seznam.cz>
12996 * attribute.cs (Attribute.GetValidTargets): Made public.
12999 (AbstractPropertyEventMethod): New class for better code sharing.
13000 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
13002 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
13004 2004-06-11 Raja R Harinath <rharinath@novell.com>
13007 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
13008 that the call to Resolve is part of a MemberAccess.
13009 (Expression.Resolve): Use it for SimpleName resolution.
13010 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
13011 Add 'intermediate' boolean argument.
13012 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
13013 error message when the SimpleName can be resolved ambiguously
13014 between an expression and a type.
13015 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
13017 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
13018 call on the left-side.
13020 2004-06-11 Marek Safar <marek.safar@seznam.cz>
13023 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
13025 2004-06-11 Marek Safar <marek.safar@seznam.cz>
13027 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
13029 2004-06-11 Martin Baulig <martin@ximian.com>
13031 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
13032 varargs methods if applicable.
13034 2004-06-11 Martin Baulig <martin@ximian.com>
13036 * expression.cs (Invocation.EmitCall): Don't use
13037 `method.CallingConvention == CallingConventions.VarArgs' since the
13038 method could also have `CallingConventions.HasThis'.
13040 2004-06-11 Marek Safar <marek.safar@seznam.cz>
13042 * class.cs (Event.GetSignatureForError): Implemented.
13043 Fixed crash in error test cs3010.cs
13045 2004-06-10 Miguel de Icaza <miguel@ximian.com>
13047 * cs-tokenizer.cs: Change the way we track __arglist to be
13048 consistent with the other keywords.
13050 2004-06-09 Miguel de Icaza <miguel@ximian.com>
13052 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
13055 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
13057 * codegen.cs: Check that all referenced assemblies have a strongname
13058 before strongnaming the compiled assembly. If not report error CS1577.
13059 Fix bug #56563. Patch by Jackson Harper.
13060 * typemanager.cs: Added a method to return all referenced assemblies.
13061 Fix bug #56563. Patch by Jackson Harper.
13063 2004-06-08 Marek Safar <marek.safar@seznam.cz>
13066 (Method.ApplyAttributeBuilder): Moved and added conditional
13067 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
13070 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
13072 2004-06-08 Marek Safar <marek.safar@seznam.cz>
13075 * class.cs: (EventField.attribute_targets): Changed default target.
13077 2004-06-08 Martin Baulig <martin@ximian.com>
13079 * expression.cs (Invocation.EmitCall): Enable varargs methods.
13081 2004-06-08 Martin Baulig <martin@ximian.com>
13083 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
13085 2004-06-07 Martin Baulig <martin@ximian.com>
13087 Added support for varargs methods.
13089 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
13092 * cs-parser.jay: Added support for `__arglist'.
13094 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
13096 * expression.cs (Argument.AType): Added `ArgList'.
13097 (Invocation): Added support for varargs methods.
13098 (ArglistAccess): New public class.
13099 (Arglist): New public class.
13101 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
13103 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
13104 a method's top-level block if the method has varargs.
13106 * support.cs (ReflectionParameters, InternalParameters): Added
13107 support for varargs methods.
13109 2004-06-07 Miguel de Icaza <miguel@ximian.com>
13111 * class.cs: Provide location in indexer error report.
13113 * driver.cs: Use standard names.
13115 * namespace.cs: Catch the use of using after a namespace has been
13116 declared also on using aliases.
13118 2004-06-03 Raja R Harinath <rharinath@novell.com>
13121 * typemanager.cs (closure_private_ok, closure_invocation_type)
13122 (closure_qualifier_type, closure_invocation_assembly)
13123 (FilterWithClosure): Move to ...
13124 (Closure): New internal nested class.
13125 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
13126 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
13127 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
13128 (MemberLookup, MemberLookupFailed): Use it.
13129 * expression.cs (New.DoResolve): Treat the lookup for the
13130 constructor as being qualified by the 'new'ed type.
13131 (Indexers.GetIndexersForTypeOrInterface): Update.
13133 2004-06-03 Marek Safar <marek.safar@seznam.cz>
13136 (GetConditionalAttributeValue): New method. Returns
13137 condition of ConditionalAttribute.
13138 (SearchMulti): New method. Returns all attributes of type 't'.
13139 Use it when attribute is AllowMultiple = true.
13140 (IsConditionalMethodExcluded): New method.
13143 (Method.IsExcluded): Implemented. Returns true if method has conditional
13144 attribute and the conditions is not defined (method is excluded).
13145 (IMethodData): Extended interface for ConditionalAttribute support.
13146 (PropertyMethod.IsExcluded): Implemented.
13149 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
13152 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
13155 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
13157 * expression.cs (ArrayCreationExpression): Make this just an
13158 `expression'. It can't be a statement, so the code here was
13161 2004-06-02 Marek Safar <marek.safar@seznam.cz>
13164 * typemanager.cs (GetFullNameSignature): New method for
13167 2004-06-02 Marek Safar <marek.safar@seznam.cz>
13170 * class.cs (MemberBase.GetSignatureForError): New virtual method.
13171 Use this method when MethodBuilder is null.
13172 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
13173 Added test for error CS0626 (MONO reports error for this situation).
13174 (IMethodData.GetSignatureForError): Extended interface.
13176 2004-06-01 Marek Safar <marek.safar@seznam.cz>
13179 (AttributeTester.GetObsoleteAttribute): Returns instance of
13180 ObsoleteAttribute when type is obsolete.
13183 (TypeContainer.VerifyObsoleteAttribute): Override.
13184 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
13185 (MethodCode.VerifyObsoleteAttribute): Override.
13186 (MemberBase.VerifyObsoleteAttribute): Override.
13189 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
13190 and report proper error.
13193 Delegate.VerifyObsoleteAttribute): Override.
13196 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
13197 and report proper error.
13198 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
13201 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
13205 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
13206 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
13207 Added test for ObsoleteAttribute.
13210 (Catch): Derived from Statement.
13212 2004-06-01 Marek Safar <marek.safar@seznam.cz>
13214 Fixed bug #59071 & cs0160.cs
13216 * statement.cs (Try.Resolve): Check here whether order of catch
13217 clauses matches their dependencies.
13219 2004-05-31 Miguel de Icaza <miguel@ximian.com>
13221 * Reverted patch to namespace.cs (Use lookuptypedirect). This
13222 caused a regression: #59343. Referencing nested classes from an
13223 assembly stopped working.
13225 2004-05-31 Martin Baulig <martin@ximian.com>
13227 MCS is now frozen for beta 2.
13229 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
13231 * convert.cs: add a trivial cache for overload operator resolution.
13233 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
13235 * decl.cs: If possible, use lookuptypedirect here. We can only do
13236 this if there is no `.' after the namespace. Avoids using
13237 LookupType, which does lots of slow processing.
13238 (FindNestedType) New method, does what it says :-).
13239 * namespace.cs: use LookupTypeDirect.
13240 * rootcontext.cs: use membercache, if possible.
13241 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
13243 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
13246 According to the spec,
13248 In a member access of the form E.I, if E is a single identifier,
13249 and if the meaning of E as a simple-name (§7.5.2) is a constant,
13250 field, property, localvariable, or parameter with the same type as
13251 the meaning of E as a type-name (§3.8), then both possible
13252 meanings of E are permitted.
13254 We did not check that E as a simple-name had the same type as E as
13257 This trivial check gives us 5-7% on bootstrap time.
13259 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
13261 * expression.cs (Invocation.OverloadResolve): Avoid the
13262 use of hashtables and boxing here by allocating on demand.
13264 2004-05-30 Martin Baulig <martin@ximian.com>
13266 * rootcontext.cs (RootContext.LookupType): Don't cache things if
13267 we're doing a silent lookup. Don't try to lookup nested types in
13268 TypeManager.object_type (thanks to Ben Maurer).
13270 2004-05-30 Martin Baulig <martin@ximian.com>
13272 Committing a patch from Ben Maurer.
13274 * rootcontext.cs (RootContext.LookupType): Cache negative results.
13276 2004-05-29 Martin Baulig <martin@ximian.com>
13278 * class.cs (IMethodData.ShouldIgnore): New method.
13280 * typemanager.cs (TypeManager.MethodFlags): Don't take a
13281 `Location' argument, we don't need it anywhere. Use
13282 `IMethodData.ShouldIgnore ()' instead of
13283 `MethodData.GetMethodFlags ()'.
13284 (TypeManager.AddMethod): Removed.
13285 (TypeManager.AddMethod2): Renamed to AddMethod.
13287 2004-05-29 Martin Baulig <martin@ximian.com>
13289 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
13291 * convert.cs (Convert.ImplicitReferenceConversion): If we're
13292 converting from a class type S to an interface type and we already
13293 have an object on the stack, don't box it again. Fixes #52578.
13295 2004-05-29 Martin Baulig <martin@ximian.com>
13297 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
13298 Added support for `params' parameters. Fixes #59267.
13300 2004-05-29 Martin Baulig <martin@ximian.com>
13302 * literal.cs (NullPointer): Provide a private .ctor which sets
13303 `type' to TypeManager.object_type. Fixes #59048.
13305 2004-05-29 Martin Baulig <martin@ximian.com>
13307 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
13308 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
13310 * ecore.cs (EventExpr.instance_expr): Make the field private.
13312 2004-05-26 Marek Safar <marek.safar@seznam.cz>
13314 Fixed bug #50080 & cs0214-2.cs
13315 * expression.cs (Cast.DoResolve): Check unsafe context here.
13317 * statement.cs (Resolve.DoResolve): Likewise.
13319 2004-05-26 Martin Baulig <martin@ximian.com>
13321 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
13323 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
13324 (RootContext.LookupType): Pass down the `silent' flag.
13326 2004-05-25 Martin Baulig <martin@ximian.com>
13329 (MethodGroupExpr.IdenticalTypeName): New public property.
13330 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
13331 expression actually refers to a type.
13333 2004-05-25 Martin Baulig <martin@ximian.com>
13335 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
13336 for #56176 and made it actually work.
13338 2004-05-25 Martin Baulig <martin@ximian.com>
13340 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
13341 (FieldExpr, PropertyExpr): Override and implement
13342 CacheTemporaries. Fixes #52279.
13344 2004-05-25 Miguel de Icaza <miguel@ximian.com>
13346 * location.cs: In the new compiler listing a file twice is a
13347 warning, not an error.
13349 2004-05-24 Martin Baulig <martin@ximian.com>
13351 * enum.cs (Enum.DefineType): For the `BaseType' to be a
13352 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
13354 2004-05-24 Martin Baulig <martin@ximian.com>
13356 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
13357 walking the `using' list. Fixes #53921.
13359 2004-05-24 Martin Baulig <martin@ximian.com>
13361 * const.cs (Const.LookupConstantValue): Added support for
13362 EmptyCast's; fixes #55251.
13364 2004-05-24 Martin Baulig <martin@ximian.com>
13366 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
13367 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
13368 which does the CS0135 check. The reason is that we first need to
13369 check whether the variable actually exists.
13371 2004-05-24 Martin Baulig <martin@ximian.com>
13373 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
13374 than RootContext.LookupType() to find the explicit interface
13375 type. Fixes #58584.
13377 2004-05-24 Raja R Harinath <rharinath@novell.com>
13379 * Makefile: Simplify. Use executable.make.
13380 * mcs.exe.sources: New file. List of sources of mcs.exe.
13382 2004-05-24 Anders Carlsson <andersca@gnome.org>
13386 Use the invariant culture when doing String.Compare for CLS case
13389 2004-05-23 Martin Baulig <martin@ximian.com>
13391 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
13392 don't have any dots. Fixes #52622, added cs0246-8.cs.
13394 * namespace.cs (NamespaceEntry.Lookup): Likewise.
13396 2004-05-23 Marek Safar <marek.safar@seznam.cz>
13398 * class.cs (MemberBase.Define): Reuse MemberType member for
13399 resolved type. Other methods can use it too.
13401 2004-05-23 Martin Baulig <martin@ximian.com>
13403 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
13404 the variable also exists in the current block (otherwise, we need
13405 to report a CS0103). Fixes #58670.
13407 2004-05-23 Martin Baulig <martin@ximian.com>
13409 * flowanalysis.cs (Reachability.Reachable): Compute this
13410 on-the-fly rather than storing it as a field.
13412 2004-05-23 Martin Baulig <martin@ximian.com>
13414 * flowanalysis.cs (Reachability.And): Manually compute the
13415 resulting `barrier' from the reachability.
13417 2004-05-23 Marek Safar <marek.safar@seznam.cz>
13420 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
13421 instance of ObsoleteAttribute when symbol is obsolete.
13424 (IMethodData): Extended interface for ObsoleteAttribute support.
13426 2004-05-22 Marek Safar <marek.safar@seznam.cz>
13428 * attribute.cs: Fix bug #55970
13430 2004-05-22 Marek Safar <marek.safar@seznam.cz>
13434 (GetObsoleteAttribute): New method. Creates the instance of
13436 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
13437 ObsoleteAttribute when member is obsolete.
13438 (AttributeTester.Report_ObsoleteMessage): Common method for
13439 Obsolete error/warning reporting.
13442 (TypeContainer.base_classs_type): New member for storing parent type.
13445 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
13446 for this MemberCore.
13448 2004-05-21 Marek Safar <marek.safar@seznam.cz>
13450 * attribute.cs, const.cs: Fix bug #58590
13452 2004-05-21 Martin Baulig <martin@ximian.com>
13454 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
13455 out parameters if the end of the method is unreachable. Fixes
13458 2004-05-21 Marek Safar <marek.safar@seznam.cz>
13460 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
13461 Hari was right, why extra method.
13463 2004-05-21 Marek Safar <marek.safar@seznam.cz>
13465 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
13467 2004-05-20 Martin Baulig <martin@ximian.com>
13469 Merged this back from gmcs to keep the differences to a minumum.
13471 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
13472 instead of a Declspace.
13473 (Attribute.ResolveType): Likewise.
13474 (Attributes.Search): Likewise.
13475 (Attributes.Contains): Likewise.
13476 (Attributes.GetClsCompliantAttribute): Likewise.
13478 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
13480 (MethodData.ApplyAttributes): Take an EmitContext instead of a
13483 2004-05-19 Marek Safar <marek.safar@seznam.cz>
13485 Fix bug #58688 (MCS does not report error when the same attribute
13488 * attribute.cs (Attribute.Emit): Distinction between null and default.
13490 2004-05-19 Raja R Harinath <rharinath@novell.com>
13492 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
13493 of a top-level attribute without an attribute target.
13494 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
13496 (Attribute.Conditional_GetConditionName),
13497 (Attribute.Obsolete_GetObsoleteMessage): Update.
13498 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
13499 part of ScanForIndexerName.
13500 (Attribute.CanIgnoreInvalidAttribute): New function.
13501 (Attribute.ScanForIndexerName): Move to ...
13502 (Attributes.ScanForIndexerName): ... here.
13503 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
13504 (Attributes.Search): New internal variant that can choose not to
13505 complain if types aren't resolved. The original signature now
13507 (Attributes.GetClsCompliantAttribute): Use internal variant, with
13508 complaints suppressed.
13509 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
13510 only if it not useful.
13511 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
13512 top-level for attributes that are shared between the assembly
13513 and a top-level class.
13514 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
13515 * class.cs: Update to reflect changes.
13516 (DefineIndexers): Fuse loops.
13517 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
13518 a couple more variants of attribute names.
13520 2004-05-18 Marek Safar <marek.safar@seznam.cz>
13522 Fix bug #52585 (Implemented explicit attribute declaration)
13525 (Attributable.ValidAttributeTargets): New abstract method. It gets
13526 list of valid attribute targets for explicit target declaration.
13527 (Attribute.Target): It holds target itself.
13528 (AttributeSection): Removed.
13529 (Attribute.CheckTargets): New method. It checks whether attribute
13530 target is valid for the current element.
13533 (EventProperty): New class. For events that are declared like
13534 property (with add and remove accessors).
13535 (EventField): New class. For events that are declared like field.
13538 * cs-parser.jay: Implemented explicit attribute target declaration.
13540 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
13541 Override ValidAttributeTargets.
13544 (ReturnParameter): Class for applying custom attributes on
13546 (ParameterAtribute): New class. Class for applying custom
13547 attributes on the parameter type.
13549 2004-05-17 Miguel de Icaza <miguel@ximian.com>
13551 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
13554 (Method): Allow UNSAFE here.
13556 * modifiers.cs: Support unsafe reporting.
13558 2004-05-17 Marek Safar <marek.safar@seznam.cz>
13560 * decl.cs: Fix bug #58478.
13562 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13564 * statement.cs: When checking for unreachable code on an EmptyStatement,
13565 set the location. Fixes bug #58488.
13567 2004-05-13 Miguel de Icaza <miguel@ximian.com>
13569 * driver.cs: Add -pkg handling.
13571 From Gonzalo: UseShelLExecute=false
13573 2004-05-12 Marek Safar <marek.safar@seznam.cz>
13576 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
13578 (Attribute.IsClsCompliaceRequired): Moved to base for better
13580 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
13581 when attribute is AttributeUsageAttribute.
13582 (Attribute.GetValidTargets): Simplified.
13583 (Attribute.GetAttributeUsage): New method returns AttributeUsage
13584 attribute for this type.
13585 (Attribute.ApplyAttributes): Method renamed to Emit and make
13587 (GlobalAttributeSection): New class for special handling of global
13588 attributes (assembly, module).
13589 (AttributeSection.Emit): New method.
13591 * class.cs: Implemented Attributable abstract methods.
13592 (MethodCore.LabelParameters): Moved to Parameter class.
13593 (Accessor): Is back simple class.
13594 (PropertyMethod): Implemented Attributable abstract class.
13595 (DelegateMethod): Implemented Attributable abstract class.
13596 (Event): New constructor for disctintion between normal Event
13597 and Event with accessors.
13599 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
13601 * codegen.cs, const.cs, decl.cs, delegate.cs:
13602 (CommonAssemblyModulClass): Implemented Attributable abstract class
13605 * enum.cs: Implement IAttributeSupport interface.
13606 (EnumMember): New class for emum members. Implemented Attributable
13610 (ParameterBase): Is abstract.
13611 (ReturnParameter): New class for easier [return:] attribute handling.
13613 * typemanager.cs: Removed builder_to_attr.
13615 2004-05-11 Raja R Harinath <rharinath@novell.com>
13618 * attribute.cs (Attribute.GetPositionalValue): New function.
13619 * class.cs (TypeContainer.VerifyMembers): New function.
13620 (TypeContainer.Emit): Use it.
13621 (ClassOrStruct): New base class for Class and Struct.
13622 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
13623 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
13625 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
13626 then each non-static field should have a FieldOffset attribute.
13627 Otherwise, none of the fields should have a FieldOffset attribute.
13628 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
13629 and FieldOffset attributes.
13630 * typemanager.cs (TypeManager.struct_layout_attribute_type)
13631 (TypeManager.field_offset_attribute_type): New core types.
13632 (TypeManager.InitCoreTypes): Initialize them.
13634 2004-05-11 Michal Moskal <malekith@pld-linux.org>
13636 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
13637 Return correct type.
13640 2004-05-09 Miguel de Icaza <miguel@ximian.com>
13642 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
13643 be implicitly converted to ulong.
13645 * expression.cs: The logic for allowing operator &, | and ^ worked
13646 was wrong, it worked before because we did not report an error in
13647 an else branch. Fixes 57895.
13649 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
13650 allow volatile fields to be reference types.
13652 2004-05-07 Miguel de Icaza <miguel@ximian.com>
13654 * driver.cs: Add support for /debug-
13656 2004-05-07 Raja R Harinath <rharinath@novell.com>
13658 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
13659 Add a 'complain' parameter to silence errors.
13660 (Attribute.Resolve): Update to changes. Put in sanity check to catch
13661 silently overlooked type-resolutions.
13662 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
13663 to reflect changes.
13664 (Attributes.Search): New function.
13665 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
13666 (Attributes.GetAttributeFullName): Remove hack.
13667 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
13668 Update to reflect changes.
13669 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
13670 Use Attributes.Search instead of nested loops.
13672 2004-05-07 Marek Safar <marek.safar@seznam.cz>
13675 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
13676 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
13677 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
13679 * report.cs: (Report.Warning): Renamed to Warning_T because of
13680 parameter collision.
13682 2004-05-05 Raja R Harinath <rharinath@novell.com>
13684 * expression.cs (MemberAccess.ResolveMemberAccess):
13685 Exit with non-zero status after Report.Error.
13686 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
13688 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
13690 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
13692 * support.cs: Don't hang when the file is empty.
13694 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
13696 * support.cs: In SeekableStreamReader, compute the preamble size of the
13697 underlying stream. Position changes should take into account that initial
13700 2004-05-03 Todd Berman <tberman@sevenl.net>
13702 * driver.cs: remove unused GetSysVersion function.
13704 2004-05-03 Todd Berman <tberman@sevenl.net>
13706 * driver.cs: Remove the hack from saturday, as well as the hack
13707 from jackson (LoadAssemblyFromGac), also adds the CWD to the
13708 link_paths to get that bit proper.
13710 2004-05-01 Todd Berman <tberman@sevenl.net>
13712 * driver.cs: Try a LoadFrom before a Load, this checks the current
13713 path. This is currently a bug in mono that is be fixed, however, this
13714 provides a workaround for now. This will be removed when the bug
13717 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
13719 * CryptoConvert.cs: Updated to latest version. Fix issue with
13720 incomplete key pairs (#57941).
13722 2004-05-01 Todd Berman <tberman@sevenl.net>
13724 * driver.cs: Remove '.' from path_chars, now System.* loads properly
13727 2004-04-30 Jackson Harper <jackson@ximian.com>
13729 * codegen.cs: Open keys readonly.
13731 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13733 * typemanager.cs: don't report cyclic struct layout when a struct
13734 contains 2 or more fields of the same type. Failed for Pango.AttrShape
13735 which has 2 Pango.Rectangle fields.
13737 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
13739 * expression.cs: Handle IntPtr comparisons with IL code
13740 rather than a method call.
13742 2004-04-29 Martin Baulig <martin@ximian.com>
13744 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
13745 the list of PropertyInfo's in class hierarchy and find the
13746 accessor. Fixes #56013.
13748 2004-04-29 Martin Baulig <martin@ximian.com>
13750 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
13752 2004-04-29 Martin Baulig <martin@ximian.com>
13754 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
13756 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
13758 2004-04-29 Martin Baulig <martin@ximian.com>
13760 * class.cs (ConstructorInitializer.Resolve): Check whether the
13761 parent .ctor is accessible. Fixes #52146.
13763 2004-04-29 Martin Baulig <martin@ximian.com>
13765 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
13767 * statement.cs (Using.EmitLocalVariableDecls): Use
13768 TypeManager.idisposable_type, not typeof (IDisposable).
13769 (Foreach.EmitCollectionForeach): Added support for valuetypes.
13771 2004-04-29 Martin Baulig <martin@ximian.com>
13773 * class.cs (Event.Define): Don't emit the field and don't set
13774 RTSpecialName and SpecialName for events on interfaces. Fixes
13777 2004-04-29 Raja R Harinath <rharinath@novell.com>
13779 Refactor Attribute.ApplyAttributes.
13780 * attribute.cs (Attributable): New base class for objects that can
13781 have Attributes applied on them.
13782 (Attribute): Make AttributeUsage fields public.
13783 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
13784 (Attribute.IsInternalCall): New property.
13785 (Attribute.UsageAttr): Convert to a public read-only property.
13786 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
13787 (Attribute.ResolveType, Attribute.Resolve)
13788 (Attribute.ScanForIndexerName): Update to reflect changes.
13789 (Attribute.CheckAttributeTarget): Re-format.
13790 (Attribute.ApplyAttributes): Refactor, to various
13791 Attributable.ApplyAttributeBuilder methods.
13792 * decl.cs (MemberCore): Make Attributable.
13793 * class.cs (Accessor): Make Attributable.
13794 (MethodData.ApplyAttributes): Use proper attribute types, not
13796 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
13797 (TypeContainer.ApplyAttributeBuilder)
13798 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
13799 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
13800 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
13801 (Operator.ApplyAttributeBuilder): New factored-out methods.
13802 * const.cs (Const.ApplyAttributeBuilder): Likewise.
13803 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
13804 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
13805 * parameter.cs (ParameterBase): New Attributable base class
13806 that can also represent Return types.
13807 (Parameter): Update to the changes.
13809 2004-04-29 Jackson Harper <jackson@ximian.com>
13811 * driver.cs: Prefer the corlib system version when looking for
13812 assemblies in the GAC. This is still a hack, but its a better hack
13815 2004-04-29 Marek Safar <marek.safar@seznam.cz>
13817 * decl.cs, enum.cs: Improved error 3005 reporting.
13819 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
13820 (related_symbols): New private member for list of symbols
13821 related to reported error/warning.
13823 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
13825 2004-04-29 Martin Baulig <martin@ximian.com>
13827 * ecore.cs (Expression.Constantify): If we're an enum and
13828 TypeManager.TypeToCoreType() doesn't give us another type, use
13829 t.UnderlyingSystemType. Fixes #56178.
13831 2004-04-29 Martin Baulig <martin@ximian.com>
13833 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
13834 interfaces and for each interface, only add members directly
13835 declared in that interface. Fixes #53255.
13837 2004-04-28 Martin Baulig <martin@ximian.com>
13839 * expression.cs (ConditionalLogicalOperator): Use a temporary
13840 variable for `left' to avoid that we evaluate it more than once;
13843 2004-04-28 Martin Baulig <martin@ximian.com>
13845 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
13848 2004-04-28 Martin Baulig <martin@ximian.com>
13850 * statement.cs (LocalInfo.Resolve): Check whether the type is not
13853 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
13854 whether the type is not void (CS1547).
13856 2004-04-28 Martin Baulig <martin@ximian.com>
13858 * expression.cs (Unary.DoResolveLValue): Override this and report
13859 CS0131 for anything but Operator.Indirection.
13861 2004-04-28 Martin Baulig <martin@ximian.com>
13863 Committing a patch from Ben Maurer; see bug #50820.
13865 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
13868 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
13871 2004-04-28 Martin Baulig <martin@ximian.com>
13873 Committing a patch from Ben Maurer; see bug #50820.
13875 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
13878 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
13881 2004-04-28 Martin Baulig <martin@ximian.com>
13883 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
13884 (Block.AddLabel): Call DoLookupLabel() to only search in the
13887 2004-04-28 Martin Baulig <martin@ximian.com>
13889 * cfold.cs (ConstantFold.BinaryFold): Added special support for
13890 comparing StringConstants and NullLiterals in Equality and Inequality.
13892 2004-04-28 Jackson Harper <jackson@ximian.com>
13894 * driver.cs: Attempt to load referenced assemblies from the
13895 GAC. This is the quick and dirty version of this method that
13896 doesnt take into account versions and just takes the first
13897 canidate found. Will be good enough for now as we will not have more
13898 then one version installed into the GAC until I update this method.
13900 2004-04-28 Martin Baulig <martin@ximian.com>
13902 * typemanager.cs (TypeManager.CheckStructCycles): New public
13903 static method to check for cycles in the struct layout.
13905 * rootcontext.cs (RootContext.PopulateTypes): Call
13906 TypeManager.CheckStructCycles() for each TypeContainer.
13907 [Note: We only need to visit each type once.]
13909 2004-04-28 Martin Baulig <martin@ximian.com>
13911 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
13913 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
13914 success and added `out object value'. Use a `bool resolved' field
13915 to check whether we've already been called rather than
13916 `ConstantValue != null' since this breaks for NullLiterals.
13918 2004-04-28 Raja R Harinath <rharinath@novell.com>
13920 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
13921 setting of this flag, since the 'set' method may be non-public.
13923 2004-04-28 Raja R Harinath <rharinath@novell.com>
13925 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
13926 check on current_vector.Block.
13928 2004-04-27 Martin Baulig <martin@ximian.com>
13930 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
13931 a field initializer. Fixes #56459.
13933 2004-04-27 Martin Baulig <martin@ximian.com>
13935 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
13936 we're not attempting to use an indexer. Fixes #52154.
13938 2004-04-27 Martin Baulig <martin@ximian.com>
13940 * statement.cs (Return): Don't create a return label if we don't
13941 need it; reverts my change from January 20th. Thanks to Ben
13944 2004-04-27 Martin Baulig <martin@ximian.com>
13946 According to the spec, `goto' can only leave a nested scope, but
13949 * statement.cs (Block.LookupLabel): Only lookup in the current
13950 block, don't recurse into parent or child blocks.
13951 (Block.AddLabel): Check in parent and child blocks, report
13952 CS0140/CS0158 if we find a duplicate.
13953 (Block): Removed this indexer for label lookups.
13954 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
13955 this already does the error reporting for us.
13958 (FlowBranching.UsageVector.Block): New public variable; may be null.
13959 (FlowBranching.CreateSibling): Added `Block' argument.
13960 (FlowBranching.LookupLabel): New public virtual method. Lookup a
13961 label for the target of a `goto' and check whether we're not
13962 leaving a `finally'.
13964 2004-04-27 Martin Baulig <martin@ximian.com>
13966 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
13967 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
13970 2004-04-27 Martin Baulig <martin@ximian.com>
13972 * statement.cs (Block.AddLabel): Also check for implicit blocks
13973 and added a CS0158 check.
13975 2004-04-27 Martin Baulig <martin@ximian.com>
13977 * flowanalysis.cs (FlowBranchingLoop): New class.
13978 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
13979 UsageVector's instead of an ArrayList.
13980 (FlowBranching.Label): Likewise.
13981 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
13982 (FlowBranching.AddBreakVector): New method.
13984 2004-04-27 Miguel de Icaza <miguel@ximian.com>
13986 * attribute.cs: Small regression fix: only convert the type if we
13987 the type is different, fixes System.Drawing build.
13989 2004-04-27 Martin Baulig <martin@ximian.com>
13991 * attribute.cs (Attribute.Resolve): If we have a constant value
13992 for a named field or property, implicity convert it to the correct
13995 2004-04-27 Raja R Harinath <rharinath@novell.com>
13997 * statement.cs (Block.Block): Implicit blocks share
13998 'child_variable_names' fields with parent blocks.
13999 (Block.AddChildVariableNames): Remove.
14000 (Block.AddVariable): Mark variable as "used by a child block" in
14001 every surrounding block.
14002 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
14003 been used in a child block, complain about violation of "Invariant
14004 meaning in blocks" rule.
14005 * cs-parser.jay (declare_local_variables): Don't use
14006 AddChildVariableNames.
14007 (foreach_statement): Don't create an implicit block: 'foreach'
14008 introduces a scope.
14010 2004-04-23 Miguel de Icaza <miguel@ximian.com>
14012 * convert.cs (ImplicitNumericConversion): 0 is also positive when
14013 converting from 0L to ulong. Fixes 57522.
14015 2004-04-22 Marek Safar <marek.safar@seznam.cz>
14017 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
14018 derived class hides via 'new' keyword field from base class (test-242.cs).
14019 TODO: Handle this in the more general way.
14021 * class.cs (CheckBase): Ditto.
14023 2004-04-22 Marek Safar <marek.safar@seznam.cz>
14025 * decl.cs (caching_flags): New member for storing cached values
14027 (MemberCore.Flags): New enum where bit flags for caching_flags
14029 (MemberCore.cls_compliance): Moved to caching_flags.
14030 (DeclSpace.Created): Moved to caching_flags.
14032 * class.cs: Use caching_flags instead of DeclSpace.Created
14034 2004-04-21 Miguel de Icaza <miguel@ximian.com>
14036 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
14037 if we are only a derived class, not a nested class.
14039 * typemanager.cs: Same as above, but do this at the MemberLookup
14040 level (used by field and methods, properties are handled in
14041 PropertyExpr). Allow for the qualified access if we are a nested
14044 2004-04-21 Marek Safar <marek.safar@seznam.cz>
14046 * class.cs: Refactoring.
14047 (IMethodData): New inteface; Holds links to parent members
14048 to avoid member duplication (reduced memory allocation).
14049 (Method): Implemented IMethodData interface.
14050 (PropertyBase): New inner classes for get/set methods.
14051 (PropertyBase.PropertyMethod): Implemented IMethodData interface
14052 (Event): New inner classes for add/remove methods.
14053 (Event.DelegateMethod): Implemented IMethodData interface.
14055 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
14056 EmitContext (related to class.cs refactoring).
14058 2004-04-21 Raja R Harinath <rharinath@novell.com>
14060 * delegate.cs (Delegate.VerifyApplicability): If the number of
14061 arguments are the same as the number of parameters, first try to
14062 verify applicability ignoring any 'params' modifier on the last
14066 2004-04-16 Raja R Harinath <rharinath@novell.com>
14068 * class.cs (TypeContainer.AddIndexer): Use
14069 'ExplicitInterfaceName' to determine if interface name was
14070 explicitly specified. 'InterfaceType' is not initialized at this time.
14071 (TypeContainer.DefineIndexers): Remove use of temporary list. The
14072 Indexers array is already in the required order. Initialize
14073 'IndexerName' only if there are normal indexers.
14074 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
14075 (TypeContainer.Emit): Emit DefaultMember attribute only if
14076 IndexerName is initialized.
14079 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
14081 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
14084 2004-04-15 Raja R Harinath <rharinath@novell.com>
14086 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
14090 * attribute.cs (Attribute.Resolve): Check for duplicate named
14094 2004-04-15 Miguel de Icaza <miguel@ximian.com>
14096 * iterators.cs (MarkYield): track whether we are in an exception,
14097 and generate code accordingly. Use a temporary value to store the
14098 result for our state.
14100 I had ignored a bit the interaction of try/catch with iterators
14101 since their behavior was not entirely obvious, but now it is
14102 possible to verify that our behavior is the same as MS .NET 2.0
14106 2004-04-14 Miguel de Icaza <miguel@ximian.com>
14108 * iterators.cs: Avoid creating temporaries if there is no work to
14111 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
14112 Enumerations, use TypeManager.EnumToUnderlying and call
14115 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
14118 (This.Emit): Use EmitContext.EmitThis to emit our
14121 (This.EmitAssign): Ditto.
14123 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
14124 codepaths, we will move all the functionality into
14127 (FieldExpr.EmitAssign): Ditto.
14129 This fixes several hidden bugs that I uncovered while doing a code
14130 review of this today.
14132 * codegen.cs (EmitThis): reworked so the semantics are more clear
14133 and also support value types "this" instances.
14135 * iterators.cs: Changed so that for iterators in value types, we
14136 do not pass the value type as a parameter.
14138 Initialization of the enumerator helpers is now done in the caller
14139 instead of passing the parameters to the constructors and having
14140 the constructor set the fields.
14142 The fields have now `assembly' visibility instead of private.
14144 2004-04-11 Miguel de Icaza <miguel@ximian.com>
14146 * expression.cs (Argument.Resolve): Check if fields passed as ref
14147 or out are contained in a MarshalByRefObject.
14149 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
14150 another compiler type.
14152 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
14154 * class.cs (Indexer.Define): use the new name checking method.
14155 Also, return false on an error.
14156 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
14157 (is_identifier_[start/part]_character): make static.
14159 2004-04-10 Miguel de Icaza <miguel@ximian.com>
14161 * expression.cs (Binary.ResolveOperator): Do no append strings
14162 twice: since we can be invoked more than once (array evaluation)
14163 on the same concatenation, take care of this here. Based on a fix
14164 from Ben (bug #56454)
14166 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
14168 * codegen.cs: Fix another case where CS1548 must be reported (when
14169 delay-sign isn't specified and no private is available #56564). Fix
14170 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
14171 error when MCS is used on the MS runtime and we need to delay-sign
14172 (which seems unsupported by AssemblyBuilder - see #56621).
14174 2004-04-08 Marek Safar <marek.safar@seznam.cz>
14176 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
14177 (TypeManager.ComputeNamespaces): Faster implementation for
14180 * compiler.csproj: Updated AssemblyName to mcs.
14182 2004-04-07 Miguel de Icaza <miguel@ximian.com>
14184 * rootcontext.cs: Add new types to the boot resolution.
14186 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
14187 MulticastDelegate is not allowed.
14189 * typemanager.cs: Add new types to lookup: System.TypedReference
14192 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
14193 check for TypedReference or ArgIterator, they are not allowed.
14195 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
14196 makes us properly catch 1510 in some conditions (see bug 56016 for
14199 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
14201 * CryptoConvert.cs: update from corlib version
14204 2004-04-05 Miguel de Icaza <miguel@ximian.com>
14206 * class.cs (Indexer.Define): Check indexername declaration
14208 2004-04-05 Marek Safar <marek.safar@seznam.cz>
14210 * attribute.cs (IsClsCompliant): Fixed problem with handling
14211 all three states (compliant, not-compliant, undetected).
14213 2004-03-30 Marek Safar <marek.safar@seznam.cz>
14215 * attribute.cs (Attribute): Location is now public.
14216 (Resolve): Store resolved arguments (pos_values) in attribute class.
14217 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
14218 (GetClsCompliantAttributeValue): New method that gets
14219 CLSCompliantAttribute value.
14220 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
14221 if exists else null.
14222 (AttributeTester): New class for CLS-Compliant verification routines.
14224 * class.cs (Emit): Add CLS-Compliant verification.
14225 (Method.GetSignatureForError): Implemented.
14226 (Constructor.GetSignatureForError): Implemented
14227 (Constructor.HasCompliantArgs): Returns if constructor has
14228 CLS-Compliant arguments.
14229 (Constructor.Emit): Override.
14230 (Construcor.IsIdentifierClsCompliant): New method; For constructors
14231 is needed to test only parameters.
14232 (FieldBase.GetSignatureForError): Implemented.
14233 (TypeContainer): New member for storing base interfaces.
14234 (TypeContainer.FindMembers): Search in base interfaces too.
14236 * codegen.cs (GetClsComplianceAttribute): New method that gets
14237 assembly or module CLSCompliantAttribute value.
14238 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
14240 (ModuleClass.Emit): Add error 3012 test.
14242 * const.cs (Emit): Override and call base for CLS-Compliant tests.
14244 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
14245 state for all decl types.
14246 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
14247 if CLS-Compliant tests are required.
14248 (IsClsCompliaceRequired): New method. Analyze whether code
14249 must be CLS-Compliant.
14250 (IsExposedFromAssembly): New method. Returns true when MemberCore
14251 is exposed from assembly.
14252 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
14253 value or gets cached value.
14254 (HasClsCompliantAttribute): New method. Returns true if MemberCore
14255 is explicitly marked with CLSCompliantAttribute.
14256 (IsIdentifierClsCompliant): New abstract method. This method is
14257 used to testing error 3005.
14258 (IsIdentifierAndParamClsCompliant): New method. Common helper method
14259 for identifier and parameters CLS-Compliant testing.
14260 (VerifyClsCompliance): New method. The main virtual method for
14261 CLS-Compliant verifications.
14262 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
14263 null. I don't know why is null (too many public members !).
14264 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
14265 and get value of first CLSCompliantAttribute that found.
14267 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
14268 (VerifyClsCompliance): Override and add extra tests.
14270 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
14271 clscheck- disable CLS-Compliant verification event if assembly is has
14272 CLSCompliantAttribute(true).
14274 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
14275 ApllyAttribute is now called in emit section as in the other cases.
14276 Possible future Emit integration.
14277 (IsIdentifierClsCompliant): New override.
14278 (VerifyClsCompliance): New override.
14279 (GetEnumeratorName): Returns full enum name.
14281 * parameter.cs (GetSignatureForError): Implemented.
14283 * report.cs (WarningData): New struct for Warning message information.
14284 (LocationOfPreviousError): New method.
14285 (Warning): New method. Reports warning based on the warning table.
14286 (Error_T): New method. Reports error based on the error table.
14288 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
14289 verifications are done here.
14291 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
14293 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
14294 CLSCompliantAttribute.
14295 (all_imported_types): New member holds all imported types from other
14297 (LoadAllImportedTypes): New method fills static table with exported types
14298 from all referenced assemblies.
14299 (Modules): New property returns all assembly modules.
14301 2004-03-30 Miguel de Icaza <miguel@ximian.com>
14303 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
14304 throwing a parser error.
14306 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
14307 which removes the hardcoded get_/set_ prefixes for properties, as
14308 IL allows for the properties to be named something else.
14312 * expression.cs: Do not override operand before we know if it is
14313 non-null. Fix 56207
14315 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
14317 * typemanager.cs: support for pinned variables.
14319 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
14321 * decl.cs, typemanager.cs: Avoid using an arraylist
14322 as a buffer if there is only one result set.
14324 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
14326 * expression.cs: Make sure you cant call a static method
14327 with an instance expression, bug #56174.
14329 2004-03-29 Miguel de Icaza <miguel@ximian.com>
14331 * class.cs (IsDuplicateImplementation): Improve error reporting to
14332 flag 663 (method only differs in parameter modifier).
14334 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
14335 in preprocessor directives.
14337 * location.cs (LookupFile): Allow for the empty path.
14339 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
14340 better approach for some of that patch, but its failing with the
14341 CharSet enumeration. For now try/catch will do.
14343 * typemanager.cs: Do not crash if a struct does not have fields.
14346 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
14348 * expression.cs: cs0213, cant fix a fixed expression.
14351 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
14353 * cs-parser.jay: detect invalid embeded statements gracefully.
14356 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
14358 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
14361 the invocation type may not be a subclass of the tye of the item/
14362 The type of the item must be a subclass of the invocation item.
14367 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
14369 * attribute.cs: Added methods to get a string and a bool from an
14370 attribute. Required to information from AssemblyKeyFileAttribute,
14371 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
14372 * codegen.cs: Modified AssemblyName creation to include support for
14373 strongnames. Catch additional exceptions to report them as CS1548.
14374 * compiler.csproj: Updated include CryptoConvert.cs.
14375 * compiler.csproj.user: Removed file - user specific configuration.
14376 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
14377 Mono.Security assembly. The original class is maintained and tested in
14378 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
14379 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
14380 like CSC 8.0 (C# v2) supports.
14381 * Makefile: Added CryptoConvert.cs to mcs sources.
14382 * rootcontext.cs: Added new options for strongnames.
14384 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
14386 * driver.cs: For --expect-error, report error code `2'
14387 if the program compiled with no errors, error code `1' if
14388 it compiled with an error other than the one expected.
14390 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
14392 * compiler.csproj: Updated for Visual Studio .NET 2003.
14393 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
14394 * compiler.sln: Updated for Visual Studio .NET 2003.
14396 2004-03-24 Ravi Pratap M <ravi@ximian.com>
14398 * expression.cs: Fix bug #47234. We basically need to apply the
14399 rule that we prefer the conversion of null to a reference type
14400 when faced with a conversion to 'object' (csc behaviour).
14402 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
14404 * statement.cs: Shorter form for foreach, eliminates
14405 a local variable. r=Martin.
14407 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
14409 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
14410 checks if we can use brtrue/brfalse to test for 0.
14411 * expression.cs: use the above in the test for using brtrue/brfalse.
14412 cleanup code a bit.
14414 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
14416 * expression.cs: Rewrite string concat stuff. Benefits:
14418 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
14419 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
14420 rather than a concat chain.
14422 * typemanager.cs: Add lookups for more concat overloads.
14424 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
14426 * expression.cs: Emit shorter il code for array init.
14443 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
14445 * statement.cs: Before, two switch blocks would be merged if the
14446 total size of the blocks (end_item - begin_item + 1) was less than
14447 two times the combined sizes of the blocks.
14449 Now, it will only merge if after the merge at least half of the
14454 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
14456 * class.cs : csc build fix for GetMethods(). See bug #52503.
14458 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
14460 * expression.cs: Make sure fp comparisons work with NaN.
14461 This fixes bug #54303. Mig approved this patch a long
14462 time ago, but we were not able to test b/c the runtime
14465 2004-03-19 Miguel de Icaza <miguel@ximian.com>
14467 * ecore.cs (TypExpr.GetHashCode): implement this overload.
14469 2004-03-19 Martin Baulig <martin@ximian.com>
14471 * class.cs (MemberCore.IsDuplicateImplementation): Report the
14472 error here and not in our caller.
14474 2004-03-19 Martin Baulig <martin@ximian.com>
14476 * interface.cs: Completely killed this file.
14477 (Interface): We're now a TypeContainer and live in class.cs.
14479 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
14480 argument; we're now also called for interfaces.
14481 (TypeContainer.DefineMembers): Allow this method being called
14483 (TypeContainer.GetMethods): New public method; formerly known as
14484 Interface.GetMethod(). This is used by PendingImplementation.
14485 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
14486 it's now private and non-static.
14487 (Interface): Moved this here; it's now implemented similar to
14489 (Method, Property, Event, Indexer): Added `bool is_interface'
14490 argument to their .ctor's.
14491 (MemberBase.IsInterface): New public field.
14493 * cs-parser.jay: Create normal Method, Property, Event, Indexer
14494 instances instead of InterfaceMethod, InterfaceProperty, etc.
14495 (opt_interface_base): Removed; we now use `opt_class_base' instead.
14496 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
14498 2004-03-19 Martin Baulig <martin@ximian.com>
14500 * class.cs (MethodCore.IsDuplicateImplementation): New private
14501 method which does the CS0111 checking.
14502 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
14503 Use IsDuplicateImplementation().
14505 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
14507 * decl.cs (FindMemberToOverride): New method to find the correct
14508 method or property to override in the base class.
14510 - Make Method/Property use the above method to find the
14511 version in the base class.
14512 - Remove the InheritableMemberSignatureCompare as it is now
14515 This patch makes large code bases much faster to compile, as it is
14516 O(n) rather than O(n^2) to do this validation.
14518 Also, it fixes bug 52458 which is that nested classes are not
14519 taken into account when finding the base class member.
14521 Reviewed/Approved by Martin.
14523 2004-03-17 Marek Safar <marek.safar@seznam.cz>
14525 * interface.cs: In all interface classes removed redundant
14526 member initialization.
14528 2004-03-16 Martin Baulig <martin@ximian.com>
14530 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
14532 2004-03-15 Miguel de Icaza <miguel@ximian.com>
14534 * decl.cs (DefineTypeAndParents): New helper method to define a
14535 type's containers before the type itself is defined; This is a
14536 bug exposed by the recent changes to Windows.Forms when an
14537 implemented interface was defined inside a class that had not been
14540 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
14542 (Check): Loop correctly to report errors modifiers
14543 (UNSAFE was not in the loop, since it was the same as TOP).
14545 * interface.cs: Every interface member now takes a ModFlags,
14546 instead of a "is_new" bool, which we set on the base MemberCore.
14548 Every place where we called "UnsafeOk" in the interface, now we
14549 call the proper member (InterfaceMethod.UnsafeOK) instead to get
14550 the unsafe settings from the member declaration instead of the
14551 container interface.
14553 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
14555 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
14556 `set_indexer_name' to the pending bits (one per type).
14558 We fixed a bug today that was picking the wrong method to
14559 override, since for properties the existing InterfaceMethod code
14560 basically ignored the method name. Now we make sure that the
14561 method name is one of the valid indexer names.
14563 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
14565 * support.cs (SeekableStreamReader): Keep track of stream byte
14566 positions and don't mix them with character offsets to the buffer.
14568 Patch from Gustavo Giráldez
14570 2004-03-15 Marek Safar <marek.safar@seznam.cz>
14572 * interface.cs (InterfaceSetGetBase): Removed double member
14573 initialization, base class does it as well.
14575 2004-03-13 Martin Baulig <martin@ximian.com>
14577 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
14578 when compiling corlib.
14580 2004-03-13 Miguel de Icaza <miguel@ximian.com>
14582 * convert.cs (ExplicitConversion): We were reporting an error on
14583 certain conversions (object_type source to a value type, when the
14584 expression was `null') before we had a chance to pass it through
14585 the user defined conversions.
14587 * driver.cs: Replace / and \ in resource specifications to dots.
14590 * class.cs: Add check for duplicate operators. Fixes 52477
14592 2004-03-11 Miguel de Icaza <miguel@ximian.com>
14594 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
14595 that are in the middle of the statements, not only at the end.
14598 * class.cs (TypeContainer.AddField): No longer set the
14599 `HaveStaticConstructor' flag, now we call it
14600 `UserDefineStaticConstructor' to diferentiate the slightly
14601 semantic difference.
14603 The situation is that we were not adding BeforeFieldInit (from
14604 Modifiers.TypeAttr) to classes that could have it.
14605 BeforeFieldInit should be set to classes that have no static
14610 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
14612 And most importantly Zoltan's comment:
14614 http://bugzilla.ximian.com/show_bug.cgi?id=44229
14616 "I think beforefieldinit means 'it's ok to initialize the type sometime
14617 before its static fields are used', i.e. initialization does not need
14618 to be triggered by the first access to the type. Setting this flag
14619 helps the JIT to compile better code, since it can run the static
14620 constructor at JIT time, and does not need to generate code to call it
14621 (possibly lots of times) at runtime. Unfortunately, mcs does not set
14622 this flag for lots of classes like String.
14624 csc sets this flag if the type does not have an explicit static
14625 constructor. The reasoning seems to be that if there are only static
14626 initalizers for a type, and no static constructor, then the programmer
14627 does not care when this initialization happens, so beforefieldinit
14630 This bug prevents the AOT compiler from being usable, since it
14631 generates so many calls to mono_runtime_class_init that the AOT code
14632 is much slower than the JITted code. The JITted code is faster,
14633 because it does not generate these calls if the vtable is type is
14634 already initialized, which is true in the majority of cases. But the
14635 AOT compiler can't do this."
14637 2004-03-10 Miguel de Icaza <miguel@ximian.com>
14639 * class.cs (MethodData.Emit): Refactor the code so symbolic
14640 information is generated for destructors; For some reasons we
14641 were taking a code path that did not generate symbolic information
14644 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
14646 * class.cs: Create a Constructor.CheckBase method that
14647 takes care of all validation type code. The method
14648 contains some code that was moved from Define.
14650 It also includes new code that checks for duplicate ctors.
14651 This fixes bug #55148.
14653 2004-03-09 Joshua Tauberer <tauberer@for.net>
14655 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
14656 a { ... }-style array creation invokes EmitStaticInitializers
14657 which is not good for reference-type arrays. String, decimal
14658 and now null constants (NullCast) are not counted toward
14659 static initializers.
14661 2004-03-05 Martin Baulig <martin@ximian.com>
14663 * location.cs (SourceFile.HasLineDirective): New public field;
14664 specifies whether the file contains or is referenced by a "#line"
14666 (Location.DefineSymbolDocuments): Ignore source files which
14667 either contain or are referenced by a "#line" directive.
14669 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
14671 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
14672 direct access to our parent, so check the method inline there.
14674 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
14676 * expression.cs (Invocation.EmitCall): Miguel's last commit
14677 caused a regression. If you had:
14682 In Foo the implict this would be null.
14684 2004-02-27 Miguel de Icaza <miguel@ximian.com>
14686 * expression.cs (Invocation.EmitCall): If the method is not
14687 virtual, do not emit a CallVirt to it, use Call.
14689 * typemanager.cs (GetFullNameSignature): Improve the method to
14690 cope with ".ctor" and replace it with the type name.
14692 * class.cs (ConstructorInitializer.Resolve): Now the method takes
14693 as an argument the ConstructorBuilder where it is being defined,
14694 to catch the recursive constructor invocations.
14696 2004-02-26 Miguel de Icaza <miguel@ximian.com>
14698 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
14699 routines to check if a type is an enumerable/enumerator allow
14700 classes that implement the IEnumerable or IEnumerator interfaces.
14702 * class.cs (Property, Operator): Implement IIteratorContainer, and
14703 implement SetYields.
14705 (Property.Define): Do the block swapping for get_methods in the
14706 context of iterators. We need to check if Properties also
14707 include indexers or not.
14709 (Operator): Assign the Block before invoking the
14710 OperatorMethod.Define, so we can trigger the Iterator code
14713 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
14714 Property and Operator classes are not created when we parse the
14715 declarator but until we have the block completed, so we use a
14716 singleton SimpleIteratorContainer.Simple to flag whether the
14717 SetYields has been invoked.
14719 We propagate this setting then to the Property or the Operator to
14720 allow the `yield' to function.
14722 2004-02-25 Marek Safar <marek.safar@seznam.cz>
14724 * codegen.cs: Implemented attribute support for modules.
14725 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
14726 Assembly/Module functionality.
14728 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
14729 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
14730 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
14732 2004-02-16 Marek Safar <marek.safar@seznam.cz>
14734 * interface.cs (FindMembers): The operation is performed on all base
14735 interfaces and not only on the first. It is required for future CLS Compliance patch.
14737 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
14739 * statement.cs, codegen.cs:
14740 This patch deals with patterns such as:
14742 public class List : IEnumerable {
14744 public MyEnumerator GetEnumerator () {
14745 return new MyEnumerator(this);
14748 IEnumerator IEnumerable.GetEnumerator () {
14752 public struct MyEnumerator : IEnumerator {
14757 Before, there were a few things we did wrong:
14758 1) we would emit callvirt on a struct, which is illegal
14759 2) we emited ldarg when we needed to emit ldarga
14760 3) we would mistakenly call the interface methods on an enumerator
14761 type that derived from IEnumerator and was in another assembly. For example:
14763 public class MyEnumerator : IEnumerator
14765 Would have the interface methods called, even if there were public impls of the
14766 method. In a struct, this lead to invalid IL code.
14768 2004-02-11 Marek Safar <marek.safar@seznam.cz>
14770 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
14773 * delegate.cs (Define): Fixed crash when delegate type is undefined.
14775 2004-02-11 Miguel de Icaza <miguel@ximian.com>
14777 * cs-parser.jay: Fix small regression: we were not testing V2
14778 compiler features correctly.
14780 * interface.cs: If the emit context is null, then create one
14782 2004-02-09 Marek Safar <marek.safar@seznam.cz>
14784 * decl.cs (GetSignatureForError): New virtual method to get full name
14785 for error messages.
14787 * attribute.cs (IAttributeSupport): New interface for attribute setting.
14788 Now it is possible to rewrite ApplyAttributes method to be less if/else.
14790 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
14791 Duplicated members and code in these classes has been removed.
14792 Better encapsulation in these classes.
14794 2004-02-07 Miguel de Icaza <miguel@ximian.com>
14796 * assign.cs (Assign.DoResolve): When dealing with compound
14797 assignments, there is a new rule in ECMA C# 2.4 (might have been
14798 there before, but it is documented here) that states that in:
14802 If b is of type int, and the `op' is a shift-operator, then the
14803 above is evaluated as:
14807 * expression.cs (Binary.ResolveOperator): Instead of testing for
14808 int/uint/long/ulong, try to implicitly convert to any of those
14809 types and use that in pointer arithmetic.
14811 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
14812 method to print information for from the type, not from the
14813 null-method we were given.
14815 2004-02-01 Duncan Mak <duncan@ximian.com>
14817 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
14818 parsing for cmd, fixes bug #53694.
14820 2004-02-04 Marek Safar <marek.safar@seznam.cz>
14822 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
14823 in the member name duplication tests. Property and operator name duplication
14824 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
14826 2004-02-03 Marek Safar <marek.safar@seznam.cz>
14828 * interface.cs (PopulateMethod): Fixed crash when interface method
14829 returns not existing type (error test cs0246-3.cs).
14831 2004-02-02 Ravi Pratap M <ravi@ximian.com>
14833 * cs-parser.jay (interface_accessors): Re-write actions to also
14834 store attributes attached to get and set methods. Fix spelling
14837 (inteface_property_declaration): Modify accordingly.
14839 (InterfaceAccessorInfo): New helper class to store information to pass
14840 around between rules that use interface_accessors.
14842 * interface.cs (Emit): Apply attributes on the get and set
14843 accessors of properties and indexers too.
14845 * attribute.cs (ApplyAttributes): Modify accordingly to use the
14846 right MethodBuilder when applying attributes to the get and set accessors.
14848 2004-01-31 Miguel de Icaza <miguel@ximian.com>
14850 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
14852 2004-01-26 Miguel de Icaza <miguel@ximian.com>
14854 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
14856 2004-01-25 Miguel de Icaza <miguel@ximian.com>
14858 * cs-parser.jay: Remove YIELD token, instead use the new grammar
14859 changes that treat `yield' specially when present before `break'
14860 or `return' tokens.
14862 * cs-tokenizer.cs: yield is no longer a keyword.
14864 2004-01-23 Marek Safar <marek.safar@seznam.cz>
14866 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
14867 setting for default constructors.
14868 For default constructors are almost every time set wrong Modifier. The
14869 generated IL code has been alright. But inside mcs this values was
14870 wrong and this was reason why several of my CLS Compliance tests
14873 2004-01-22 Martin Baulig <martin@ximian.com>
14875 * cs-parser.jay (namespace_or_type_name): Return an Expression,
14876 not a QualifiedIdentifier. This is what `type_name_expression'
14877 was previously doing.
14878 (type_name_expression): Removed; the code is now in
14879 `namespace_or_type_name'.
14880 (qualified_identifier): Removed, use `namespace_or_type_name'
14882 (QualifiedIdentifier): Removed this class.
14884 2004-01-22 Martin Baulig <martin@ximian.com>
14886 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
14887 not a string as alias name.
14889 2004-01-21 Miguel de Icaza <miguel@ximian.com>
14891 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
14892 #52730 bug, and instead compute correctly the need to use a
14893 temporary variable when requesting an address based on the
14894 static/instace modified of the field and the constructor.
14896 2004-01-21 Martin Baulig <martin@ximian.com>
14898 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
14899 class and namespace before looking up aliases. Fixes #52517.
14901 2004-01-21 Martin Baulig <martin@ximian.com>
14903 * flowanalysis.cs (UsageVector.Merge): Allow variables being
14904 assinged in a 'try'; fixes exception4.cs.
14906 2004-01-21 Marek Safar <marek.safar@seznam.cz>
14907 * class.cs : Implemented parameter-less constructor for TypeContainer
14909 * decl.cs: Attributes are now stored here. New property OptAttributes
14911 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
14913 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
14915 2004-01-21 Marek Safar <marek.safar@seznam.cz>
14917 * typemanager.cs (CSharpSignature): Now reports also inner class name.
14918 (CSharpSignature): New method for indexer and property signature.
14920 2004-01-21 Marek Safar <marek.safar@seznam.cz>
14922 * pending.cs (IsVirtualFilter): Faster implementation.
14924 2004-01-21 Marek Safar <marek.safar@seznam.cz>
14926 * typemanager.cs: Avoid inclusion of same assembly more than once.
14928 2004-01-21 Marek Safar <marek.safar@seznam.cz>
14930 * cs-parser.jay: Fixed problem where the last assembly attribute
14931 has been applied also to following declaration (class, struct, etc.)
14933 2004-01-21 Marek Safar <marek.safar@seznam.cz>
14935 * class.cs: Added error CS0538, CS0539 reporting.
14936 Fixed crash on Microsoft runtime when field type is void.
14938 * cs-parser.jay: Added error CS0537 reporting.
14940 * pending.cs: Added error CS0535 reporting.
14941 Improved error report for errors CS0536, CS0534.
14943 2004-01-20 Miguel de Icaza <miguel@ximian.com>
14945 Merge a few bits from the Anonymous Method MCS tree.
14947 * statement.cs (ToplevelBlock): New class for toplevel methods,
14948 will hold anonymous methods, lifted variables.
14950 * cs-parser.jay: Create toplevel blocks for delegates and for
14951 regular blocks of code.
14953 2004-01-20 Martin Baulig <martin@ximian.com>
14955 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
14956 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
14957 and `NeedExplicitReturn'; added `IsLastStatement'.
14958 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
14959 have a `ReturnLabel' or we're not unreachable.
14961 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
14962 child's reachability; don't just override ours with it. Fixes
14963 #58058 (lluis's example).
14964 (FlowBranching): Added public InTryOrCatch(), InCatch(),
14965 InFinally(), InLoop(), InSwitch() and
14966 BreakCrossesTryCatchBoundary() methods.
14968 * statement.cs (Return): Do all error checking in Resolve().
14969 Unless we are the last statement in a top-level block, always
14970 create a return label and jump to it.
14971 (Break, Continue): Do all error checking in Resolve(); also make
14972 sure we aren't leaving a `finally'.
14973 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
14974 statement in a top-level block.
14975 (Block.Flags): Added `IsDestructor'.
14976 (Block.IsDestructor): New public property.
14978 2004-01-20 Martin Baulig <martin@ximian.com>
14980 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
14982 2004-01-20 Martin Baulig <martin@ximian.com>
14984 * statement.cs (Statement.ResolveUnreachable): New public method.
14985 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
14986 (Block.Resolve): Resolve unreachable statements.
14988 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
14990 * expression.cs: We need to fix the case where we do
14991 not have a temp variable here.
14993 * assign.cs: Only expression compound assignments need
14994 temporary variables.
14996 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
14998 * flowanalysis.cs: Reduce memory allocation in a few ways:
14999 - A block with no variables should not allocate a bit
15001 - A method with no out parameters does not need any tracking
15002 for assignment of the parameters, so we need not allocate
15005 public readonly Type[] VariableTypes;
15006 public readonly string[] VariableNames;
15007 Are redundant. The data is already stored in the variable
15008 map, so we need not allocate another array for it.
15009 - We need to add alot of checks for if (params | locals) == null
15010 due to the first two changes.
15012 2004-01-18 Miguel de Icaza <miguel@ximian.com>
15014 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
15015 implement IMemoryLocation, we store a copy on a local variable and
15016 take the address of it. Patch from Benjamin Jemlich
15018 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
15019 to use a special "type_name_expression" rule which reduces the
15020 number of "QualifiedIdentifier" classes created, and instead
15021 directly creates MemberAccess expressions.
15023 2004-01-17 Miguel de Icaza <miguel@ximian.com>
15025 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
15026 that fixes #52853. Null literal assignment to ValueType
15028 * class.cs (MethodData.Emit): Instead of checking the name of the
15029 method to determine if its a destructor, create a new derived
15030 class from Method called Destructor, and test for that.
15032 * cs-parser.jay: Create a Destructor object instead of a Method.
15034 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
15038 2004-01-16 Miguel de Icaza <miguel@ximian.com>
15040 * expression.cs (Binary.ResolveOperator): Perform an implicit
15041 conversion from MethodGroups to their delegate types on the
15042 Addition operation.
15044 * delegate.cs: Introduce a new class DelegateCreation that is the
15045 base class for `NewDelegate' and `ImplicitDelegateCreation',
15046 factor some code in here.
15048 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
15049 conversion from MethodGroups to compatible delegate types.
15051 * ecore.cs (Expression.Resolve): Do not flag error 654
15052 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
15053 we allow conversions from MethodGroups to delegate types now.
15055 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
15056 assignments in v2 either.
15058 2004-01-10 Miguel de Icaza <miguel@ximian.com>
15060 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
15061 static read-only fields in ctors.
15063 Applied patch from Benjamin Jemlich
15065 * expression.cs (UnaryMutator): Avoid leaking local variables.
15067 2004-01-09 Miguel de Icaza <miguel@ximian.com>
15069 * cs-tokenizer.cs (IsCastToken): Allow the various native types
15070 here to return true, as they can be used like this:
15072 (XXX) int.MEMBER ()
15074 Fixed 49836 and all the other dups
15076 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
15078 * driver.cs: Implement /win32res and /win32icon.
15080 2004-01-08 Miguel de Icaza <miguel@ximian.com>
15082 * cs-parser.jay: Add a rule to improve error handling for the
15083 common mistake of placing modifiers after the type.
15085 2004-01-07 Miguel de Icaza <miguel@ximian.com>
15087 * cs-parser.jay (interface_event_declaration): Catch
15088 initialization of events on interfaces, and report cs0068
15090 * cs-parser.jay (interface_event_declaration): Catch
15091 initialization of events.
15093 * ecore.cs: Better report missing constructors.
15095 * expression.cs (Binary.ResolveOperator): My previous bug fix had
15096 the error reporting done in the wrong place. Fix.
15098 * expression.cs (Binary.ResolveOperator): Catch the
15099 operator + (E x, E y) error earlier, and later allow for implicit
15100 conversions in operator +/- (E e, U x) from U to the underlying
15103 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
15104 52596, if the container class is abstract, the default constructor
15105 is protected otherwise its public (before, we were always public).
15107 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
15110 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
15111 Jemlich that fixes bug #52597, MCS was generating invalid code for
15112 idisposable structs. Thanks to Ben for following up with this
15115 2004-01-06 Miguel de Icaza <miguel@ximian.com>
15117 * driver.cs: Allow assemblies without code to be generated, fixes
15120 2004-01-07 Nick Drochak <ndrochak@gol.com>
15122 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
15124 2004-01-05 Miguel de Icaza <miguel@ximian.com>
15126 * cs-parser.jay: Add rules to improve error reporting if fields or
15127 methods are declared at the namespace level (error 116)
15129 * Add rules to catch event add/remove
15131 2004-01-04 David Sheldon <dave-mono@earth.li>
15133 * expression.cs: Added matching ")" to error message for
15136 2004-01-03 Todd Berman <tberman@gentoo.org>
15138 * ecore.cs, attribute.cs:
15139 Applying fix from #52429.
15141 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
15143 * ecore.cs, expression.cs, statement.cs:
15144 Total rewrite of how we handle branching. We
15145 now handle complex boolean expressions with fewer
15146 jumps. As well if (x == 0) no longer emits a ceq.
15148 if (x is Foo) is much faster now, because we generate
15151 Overall, we get a pretty big improvement on our benchmark
15152 tests. The code we generate is smaller and more readable.
15154 I did a full two-stage bootstrap. The patch was reviewed
15155 by Martin and Miguel.
15157 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
15159 * cs-parser.jay: Make primary_expression not take a QI.
15160 we dont need this because the member_access rule covers
15161 us here. So we replace the rule with just IDENTIFIER.
15163 This has two good effects. First, we remove a s/r conflict.
15164 Second, we allocate many fewer QualifiedIdentifier objects.
15166 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
15168 * attribute.cs: Handle MarshalAs attributes as pseudo, and
15169 set the correct information via SRE. This prevents
15170 hanging on the MS runtime. Fixes #29374.
15172 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
15174 * convert.cs: correctly handle conversions to value types
15175 from Enum and ValueType as unboxing conversions.
15177 Fixes bug #52569. Patch by Benjamin Jemlich.
15179 2004-01-02 Ravi Pratap <ravi@ximian.com>
15181 * expression.cs (BetterConversion): Prefer int -> uint
15182 over int -> ulong (csc's behaviour). This fixed bug #52046.
15184 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
15186 * decl.cs (MemberCache.FindMembers): now returns a
15189 * typemanager.cs: In general, go with with ^^.
15190 (CopyNewMethods): take an IList.
15191 (RealMemberLookup): Only allocate an arraylist
15192 if we copy from two sets of methods.
15194 This change basically does two things:
15195 1) Fewer array lists allocated due to CopyNewMethods.
15196 2) the explicit cast in MemberList costed ALOT.
15198 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
15200 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
15201 a hashtable to avoid needless string allocations when an identifier is
15202 used more than once (the common case).
15204 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
15206 * pending.cs: MS's TypeBuilder.GetInterfaces ()
15207 is broken, it will not return anything. So, we
15208 have to use the information we have in mcs to
15211 * typemanager.cs: Add a cache for GetInterfaces,
15212 since this will now be used more often (due to ^^)
15214 (GetExplicitInterfaces) New method that gets the
15215 declared, not effective, interfaces on a type
15216 builder (eg, if you have interface IFoo, interface
15217 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
15220 This patch makes MCS able to bootstrap itself on
15223 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
15225 * expression.cs: Remove the Nop's that Miguel put
15228 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
15230 * report.cs, codegen.cs: Give the real stack trace to
15231 the error when an exception is thrown.
15233 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
15235 * decl.cs: only allocate hashtables for ifaces if
15238 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
15240 * expression.cs: fix the error from cs0121-2.cs
15241 (a parent interface has two child interfaces that
15242 have a function with the same name and 0 params
15243 and the function is called through the parent).
15245 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
15247 * class.cs, rootcontext.cs, typmanager.cs: do not
15250 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
15252 * codegen.cs: remove stack for the ec flow branching.
15253 It is already a linked list, so no need.
15255 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
15257 * Makefile: Allow custom profiler here.
15259 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
15261 * typemanager.cs (LookupType):
15262 - Use a static char [], because split takes
15263 a param array for args, so it was allocating
15265 - Do not store true in a hashtable, it boxes.
15267 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
15269 * flowanalysis.cs: bytify common enums.
15271 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
15273 * modifiers.cs: Add a new set of flags for the
15274 flags allowed on explicit interface impls.
15275 * cs-parser.jay: catch the use of modifiers in
15276 interfaces correctly.
15277 * class.cs: catch private void IFoo.Blah ().
15279 All related to bug #50572.
15281 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
15283 * decl.cs: Rewrite the consistant accessability checking.
15284 Accessability is not linear, it must be implemented in
15285 a tableish way. Fixes #49704.
15287 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
15289 * expression.cs: Handle negation in a checked context.
15290 We must use subtraction from zero. Fixes #38674.
15292 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
15294 * class.cs: Ignore static void main in DLLs.
15295 * rootcontext.cs: Handle the target type here,
15296 since we are have to access it from class.cs
15297 * driver.cs: account for the above.
15299 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
15301 * report.cs: Give line numbers and files if available.
15303 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
15305 * driver.cs: Implement /addmodule.
15307 * typemanager.cs: Change 'modules' field so it now contains Modules not
15310 2003-12-20 Martin Baulig <martin@ximian.com>
15312 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
15313 (FieldBase.IsAssigned): Removed this field.
15314 (FieldBase.SetAssigned): New public method.
15315 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
15317 2003-12-20 Martin Baulig <martin@ximian.com>
15319 * expression.cs (LocalVariableReference.DoResolve): Don't set
15320 `vi.Used' if we're called from DoResolveLValue().
15322 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
15323 returns the usage vector it just merged into the current one -
15324 pass this one to UsageWarning().
15325 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
15326 of the `EmitContext', don't call this recursively on our children.
15328 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
15330 * driver.cs: Implement /target:module.
15332 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
15334 * support.cs (CharArrayHashtable): New helper class.
15336 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
15337 char arrays, not strings, so we can avoid creating a string in
15338 consume_identifier if the identifier is a keyword.
15340 2003-12-16 Martin Baulig <martin@ximian.com>
15342 * statement.cs (LocalInfo.Assigned): Removed this property.
15343 (LocalInfo.Flags): Removed `Assigned'.
15344 (LocalInfo.IsAssigned): New public method; takes the EmitContext
15345 and uses flow analysis.
15346 (Block.UsageWarning): Made this method private.
15347 (Block.Resolve): Call UsageWarning() if appropriate.
15349 * expression.cs (LocalVariableReference.DoResolve): Always set
15350 LocalInfo.Used here.
15352 2003-12-13 Martin Baulig <martin@ximian.com>
15354 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
15355 any value here; we're now using flow analysis to figure out
15356 whether a statement/block returns a value.
15358 2003-12-13 Martin Baulig <martin@ximian.com>
15360 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
15362 (FlowBranching.MergeFinally): Don't call
15363 `branching.CheckOutParameters()' here, this is called in
15365 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
15366 when adding the `finally' vector.
15368 2003-12-13 Martin Baulig <martin@ximian.com>
15371 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
15372 actually work and also fix #48962.
15374 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
15376 * decl.cs: Do not check System.Object for nested types,
15377 since we know it does not have any. Big bang for buck:
15380 Run 1: 8.35 seconds
15381 Run 2: 8.32 seconds
15382 corlib: 17.99 seconds
15384 Run 1: 8.17 seconds
15385 Run 2: 8.17 seconds
15386 corlib: 17.39 seconds
15388 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
15390 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
15391 time we are returning 0 members, so we save alot here.
15393 2003-12-11 Martin Baulig <martin@ximian.com>
15395 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
15396 `MergeChild()', also just take the `FlowBranching' as argument;
15397 call Merge() on it and return the result.
15398 (FlowBranching.Merge): We don't need to do anything if we just
15401 2003-12-11 Martin Baulig <martin@ximian.com>
15403 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
15404 them in an `ArrayList' to reduce memory usage. Thanks to Ben
15405 Maurer for this idea.
15407 2003-12-11 Martin Baulig <martin@ximian.com>
15409 * flowanalysis.cs (MergeResult): This class is now gone; we now
15410 use the `UsageVector' for this. The reason for this is that if a
15411 branching just has one sibling, we don't need to "merge" them at
15412 all - that's the next step to do.
15413 (FlowBranching.Merge): We now return a `UsageVector' instead of a
15416 2003-12-11 Martin Baulig <martin@ximian.com>
15418 Reworked flow analyis and made it more precise and bug-free. The
15419 most important change is that we're now using a special `Reachability'
15420 class instead of having "magic" meanings of `FlowReturns'. I'll
15421 do some more cleanups and optimizations and also add some more
15422 documentation this week.
15424 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
15425 largely reworked this class.
15426 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
15427 the new `Reachability' class instead of having "magic" values here.
15428 (FlowBranching): We're now using an instance of `Reachability'
15429 instead of having separate `Returns', `Breaks' etc. fields.
15431 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
15432 based on flow analysis; ignore the return value of block.Emit ().
15434 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
15436 * driver.cs typemanager.cs: Find the mono extensions to corlib even
15437 if they are private.
15439 2003-12-09 Martin Baulig <martin@ximian.com>
15441 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
15442 call them directly on the UsageVector.
15444 2003-12-09 Martin Baulig <martin@ximian.com>
15446 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
15447 Changed return type from `FlowReturns' to `Reachability'.
15449 2003-12-09 Martin Baulig <martin@ximian.com>
15451 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
15452 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
15453 `Reachable' fields with a single `Reachability' one.
15455 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
15457 * class.cs (FindMembers): Remove foreach's.
15462 Run 1: 8.74 seconds
15463 Run 2: 8.71 seconds
15466 Run 1: 8.64 seconds
15467 Run 2: 8.58 seconds
15470 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
15475 This patch does a few things:
15476 1. EmptyStatement is now a singleton, so it is never reallocated.
15477 2. All blah is EmptyStatement constructs have been changed to
15478 blah == EmptyStatement.Value, which is much faster and valid
15479 now that EmptyStatement is a singleton.
15480 3. When resolving a block, rather than allocating a new array for
15481 the non-empty statements, empty statements are replaced with
15482 EmptyStatement.Value
15483 4. Some recursive functions have been made non-recursive.
15484 Mainly the performance impact is from (3), however (1) and (2) are needed for
15485 this to work. (4) does not make a big difference in normal situations, however
15486 it makes the profile look saner.
15491 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
15492 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
15493 Total memory allocated: 56397 KB
15496 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
15497 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
15498 Total memory allocated: 55666 KB
15500 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
15502 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
15503 than the hashtable in a hashtable version
15505 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
15506 we always end up concating a string. This results in a huge perf
15507 loss, because many strings have to be tracked by the GC. In this
15508 patch, we first use a hashtable that works with two keys, so that
15509 the strings do not need to be concat'ed.
15513 Run 1: 8.74 seconds
15514 Run 2: 8.71 seconds
15517 Run 1: 8.65 seconds
15518 Run 2: 8.56 seconds
15520 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
15522 * Makefile: Add a new target `do-time' that does a quick and simple
15523 profile, leaving easy to parse output.
15525 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
15527 * codegen.cs (Init): Create the dynamic assembly with
15528 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
15530 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
15532 * support.cs: Make the PtrHashtable use only one
15533 instance of its comparer.
15535 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
15537 * typemanager.cs: Fix lookup of GetNamespaces.
15539 2003-11-29 Miguel de Icaza <miguel@ximian.com>
15541 * expression.cs: Removed redundant line.
15543 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
15544 ArrayLists, use for loops with bounds.
15546 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
15549 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
15550 arraylists, use for loop with bounds.
15552 The above three changes give us a 0.071 second performance
15553 improvement out of 3.294 seconds down to 3.223. On my machine
15554 the above changes reduced the memory usage by 1,387 KB during
15555 compiler bootstrap.
15557 * cs-parser.jay (QualifiedIdentifier): New class used to represent
15558 QualifiedIdentifiers. Before we created a new string through
15559 concatenation, and mostly later on, the result would be
15560 manipulated by DecomposeQI through string manipulation.
15562 This reduced the compiler memory usage for bootstrapping from
15563 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
15564 compile times in 0.05 seconds.
15566 2003-11-28 Dick Porter <dick@ximian.com>
15568 * support.cs: Do string compares with the Invariant culture.
15576 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
15577 the comparison is done with the Invariant culture.
15579 2003-11-27 Miguel de Icaza <miguel@ximian.com>
15581 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
15582 GetEnumerator method.
15584 (ProbeCollectionType): Iterate starting at the most specific type
15585 upwards looking for a GetEnumerator
15587 * expression.cs: Shift count can be up to 31 for int/uint and 63
15590 2003-11-26 Miguel de Icaza <miguel@ximian.com>
15592 * statement.cs (Block.LookupLabel): Also look for the label on the
15593 children blocks. Use a hash table to keep track of visited
15596 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
15597 we actually did transform the other operand, otherwise fall back
15598 to the common codepath that casts to long.
15600 * cs-tokenizer.cs: Use the same code pattern as the int case.
15601 Maybe I should do the parsing myself, and avoid depending on the
15602 Parse routines to get this done.
15604 2003-11-25 Miguel de Icaza <miguel@ximian.com>
15606 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
15607 which fixes bug 51347. This time test it.
15609 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
15610 attributes for example can not tell the difference between these.
15611 The difference was only a syntax feature of the language.
15613 * attribute.cs: Apply attributes to delegates.
15615 * delegate.cs: Call the apply attributes method.
15617 2003-11-24 Miguel de Icaza <miguel@ximian.com>
15619 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
15620 comparing 0 vs Byte.MinValue, not the value
15622 (ImplicitConversionRequired): When reporting a conversion error,
15623 use error 31 to print out the constant error instead of the
15626 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
15627 which fixes bug 51347.
15629 2003-11-22 Miguel de Icaza <miguel@ximian.com>
15631 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
15632 which fixes the -warnaserror command line option.
15634 2003-11-21 Miguel de Icaza <miguel@ximian.com>
15636 * cfold.cs (DoNumericPromotions): During constant folding of
15637 additions on UIntConstant, special case intconstants with
15638 IntConstants like we do on the expression binary operator.
15640 2003-11-12 Miguel de Icaza <miguel@ximian.com>
15642 * convert.cs (ImplicitReferenceConversion): We were missing a case
15643 (System.Enum are not value types or class types, so we need to
15644 classify them separatedly).
15646 * driver.cs: We do not support error 2007.
15648 2003-11-12 Jackson Harper <jackson@ximian.com>
15650 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
15651 system directory. Also use the full file name so users can
15652 libraries names mscorlib-o-tron.dll in a non system dir.
15654 2003-11-10 Martin Baulig <martin@ximian.com>
15656 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
15657 (TypeManager.InitCoreTypes): Initialize them here, but instead of
15658 calling `ResolveType()' on them, directly assign their `Type'.
15660 2003-11-08 Martin Baulig <martin@ximian.com>
15662 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
15663 return value and the `out parent' parameter.
15664 (TypeContainer.DefineType): Moved the CS0644 check into
15665 GetClassBases(). Don't pass the interface types to the
15666 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
15667 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
15669 * ecore.cs (TypeExpr.IsAttribute): New property.
15670 (TypeExpr.GetInterfaces): New method.
15672 * interface.cs (Interface.GetInterfaceTypeByName): Return a
15673 TypeExpr instead of a Type.
15674 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
15675 (Interface.DefineType): Don't pass the interface types to the
15676 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
15677 them later and then call `TypeBulider.AddInterfaceImplementation()'.
15679 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
15680 instead of a `Type[]'.
15681 (TypeManager.RegisterBuilder): Likewise.
15682 (TypeManager.AddUserInterface): Likewise.
15683 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
15684 `Type[]' and also return a `TypeExpr[]'.
15685 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
15687 2003-11-08 Martin Baulig <martin@ximian.com>
15689 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
15692 2003-11-08 Martin Baulig <martin@ximian.com>
15694 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
15695 TypeManager.ResolveExpressionTypes().
15697 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
15698 instead of an Expression.
15699 (TypeExpr): This is now an abstract base class for `TypeExpression'.
15700 (TypeExpression): New public class; formerly known as `TypeExpr'.
15702 * expression.cs (ComposedCast): Derive from TypeExpr.
15704 * typemanager.cs (TypeManager.system_*_expr): These are now
15705 TypExpr's instead of Expression's.
15706 (TypeManager.ResolveExpressionTypes): New public static function;
15707 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
15710 2003-11-06 Miguel de Icaza <miguel@ximian.com>
15712 * expression.cs (New.DoResolve): Do not dereference value that
15713 might be a null return.
15715 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
15716 sure that the constant value has the right type. Fixes an
15717 unreported bug, similar to 50425.
15719 * const.cs (Const.LookupConstantValue): Call
15720 ImplicitStandardConversionExists before doing a conversion to
15721 avoid havng the TypeManager.ChangeType do conversions.
15723 Reduced the number of casts used
15725 (Const.ChangeType): New routine to enable reuse of the constant
15726 type changing code from statement.
15728 * typemanager.cs (ChangeType): Move common initialization to
15729 static global variables.
15733 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
15734 every value type to go through, even if it was void. Fix that.
15736 * cs-tokenizer.cs: Use is_identifier_start_character on the start
15737 character of the define, and the is_identifier_part_character for
15738 the rest of the string.
15740 2003-11-05 Miguel de Icaza <miguel@ximian.com>
15742 * expression.cs (UnaryMutator.EmitCode): When I updated
15743 LocalVariableReference.DoResolve, I overdid it, and dropped an
15744 optimization done on local variable references.
15746 2003-11-04 Miguel de Icaza <miguel@ximian.com>
15748 * ecore.cs: Convert the return from Ldlen into an int.
15750 2003-10-20 Miguel de Icaza <miguel@ximian.com>
15752 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
15753 the accessibility, this is a special case for toplevel non-public
15754 classes (internal for instance).
15756 2003-10-20 Nick Drochak <ndrochak@gol.com>
15758 * ecore.cs: Fix typo and build. Needed another right paren.
15760 2003-10-19 Miguel de Icaza <miguel@ximian.com>
15762 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
15763 `internal' case regular and protected, but not allowing protected
15764 to be evaluated later. Bug 49840
15766 2003-10-15 Miguel de Icaza <miguel@ximian.com>
15768 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
15769 to kb.Nlast, and not the kb.nFirst to isolate the switch
15772 Extract the underlying type, so enumerations of long/ulong are
15773 treated like long/ulong.
15775 2003-10-14 Miguel de Icaza <miguel@ximian.com>
15777 * expression.cs (New): Overload the meaning of RequestedType to
15778 track the possible creation of the NewDelegate type, since
15779 DoResolve is invoked more than once for new constructors on field
15782 See bugs: #48800 and #37014
15784 * cs-parser.jay (declare_local_constants): Take an arraylist
15785 instead of a single constant.
15787 (local_constant_declaration): It should take a
15788 constant_declarators, not a constant_declarator. Fixes 49487
15790 * convert.cs: Fix error report.
15792 2003-10-13 Jackson Harper <jackson@ximian.com>
15794 * typemanager.cs (TypeToCoreType): Add float and double this fixes
15797 2003-10-09 Martin Baulig <martin@ximian.com>
15799 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
15801 (MethodCore.DoDefineParameters): Removed the TypeContainer
15802 argument; use the DeclSpace which was passed to the .ctor instead.
15803 (MethodCore.CheckParameter): Take a DeclSpace instead of a
15804 TypeContainer; we only need a DeclSpace here.
15806 2003-10-09 Martin Baulig <martin@ximian.com>
15808 * class.cs (MethodData): Added additional `DeclSpace ds' argument
15810 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
15811 EmitContext's .ctor.
15813 2003-10-09 Martin Baulig <martin@ximian.com>
15815 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
15816 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
15817 AsAccessible(), moved them as well.
15819 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
15821 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
15823 * cs-parser.jay : Renamed yyName to yyNames related to jay.
15825 2003-10-07 Miguel de Icaza <miguel@ximian.com>
15827 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
15828 generation for >=, as spotted by Paolo, bug 48679.
15829 Patch from David Waite.
15831 * cs-tokenizer.cs: Add handling for #pragma.
15833 * cs-parser.jay: Allow for both yield and yield return in the
15834 syntax. The anti-cobolization of C# fight will go on!
15836 * class.cs (TypeBuilder.DefineType): Catch error condition here
15837 (Parent.DefineType erroring out and returning null).
15839 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
15840 coping with enumerations variables, we were mistakenly processing
15841 them as a regular value type instead of built-in types. Fixes the
15844 * typemanager.cs (IsBuiltinOrEnum): New method.
15846 2003-09-30 Miguel de Icaza <miguel@ximian.com>
15848 * cs-parser.jay: Upgrade: yield now needs the return clause.
15850 2003-09-19 Martin Baulig <martin@ximian.com>
15852 * decl.cs (MemberCache.SetupCacheForInterface): Take a
15853 `MemberCache parent' argument. Normally, an interface doesn't
15854 have a parent type except System.Object, but we use this in gmcs
15855 for generic type parameters.
15857 2003-09-18 Martin Baulig <martin@ximian.com>
15859 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
15860 on `type.IsInterface'; don't check whether the type has a parent
15861 to determine whether it's an interface.
15863 2003-09-15 Martin Baulig <martin@ximian.com>
15865 * class.cs (TypeContainer.DefineType): Added an error flag to
15866 avoid reporting duplicate CS0146's ("class definition is
15869 * driver.cs (Driver.MainDriver): Abort if
15870 RootContext.ResolveTree() reported any errors.
15872 2003-09-07 Martin Baulig <martin@ximian.com>
15874 * report.cs (Error, Warning): Added overloaded versions which take
15875 a `params object[] args' and call String.Format().
15877 2003-09-07 Martin Baulig <martin@ximian.com>
15879 * decl.cs (DeclSpace..ctor): Don't call
15880 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
15881 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
15882 (DeclSpace.RecordDecl): New method.
15884 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
15886 2003-09-02 Ravi Pratap <ravi@ximian.com>
15888 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
15889 value attributes to be applied to ParameterBuilders.
15891 * class.cs (MethodCore.LabelParameters): Make static and more
15892 generic so that it can be used from other places - like interface
15893 methods, for instance.
15895 * interface.cs (Interface.Emit): Call LabelParameters before
15896 emitting attributes on the InterfaceMethod.
15898 2003-08-26 Martin Baulig <martin@ximian.com>
15900 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
15901 resolving aliases; fixes #47927.
15903 2003-08-26 Martin Baulig <martin@ximian.com>
15905 * statement.cs (Using.DoResolve): This is internally emitting a
15906 try/finally clause, so we need to set ec.NeedExplicitReturn if we
15907 do not always return. Fixes #47681.
15909 2003-08-26 Martin Baulig <martin@ximian.com>
15911 * decl.cs (MemberCore): Moved WarningNotHiding(),
15912 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
15914 (AdditionResult): Make this nested in DeclSpace.
15915 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
15916 argument; call NamespaceEntry.Define() unless we're nested in a
15919 * namespace.cs (Namespace.DefineName): New public function. This
15920 is called from DeclSpace's .ctor to add
15921 (Namespace.Lookup): Include DeclSpaces in the lookup.
15923 * class.cs (Operator): Derive from MemberBase, not MemberCore.
15925 * const.cs (Const): Derive from MemberBase, not MemberCore.
15927 2003-08-25 Martin Baulig <martin@ximian.com>
15929 * convert.cs (Convert.ExplicitReferenceConversion): When
15930 converting from an interface type to a class, unbox if the target
15931 type is a struct type. Fixes #47822.
15933 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15935 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
15938 2003-08-22 Martin Baulig <martin@ximian.com>
15940 * class.cs (TypeManager.DefineType): When defining a nested type,
15941 call DefineType() on our parent; fixes #47801.
15943 2003-08-22 Martin Baulig <martin@ximian.com>
15945 * class.cs (MethodData.Define): While checking if a method is an
15946 interface implementation, improve the test a bit more to fix #47654.
15948 2003-08-22 Martin Baulig <martin@ximian.com>
15950 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
15951 correctly; fixes #47722.
15953 2003-08-22 Martin Baulig <martin@ximian.com>
15955 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
15956 LocalVariableReference, ensure it's not read-only. Fixes #47536.
15958 * statement.cs (Fixed.DoResolve): Make all variables read-only.
15960 2003-08-22 Martin Baulig <martin@ximian.com>
15962 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
15963 can only be assigned in static constructors. Fixes #47161.
15965 2003-08-22 Martin Baulig <martin@ximian.com>
15967 Rewrote and improved the flow analysis code.
15969 * flowbranching.cs (FlowBranching): Make this class abstract.
15970 (FlowBranching.CreateBranching): New static function to create a
15971 new flow branching.
15972 (FlowBranchingBlock, FlowBranchingException): New classes.
15973 (FlowBranching.UsageVector.Type): New public readonly field.
15974 (FlowBranching.UsageVector.Breaks): Removed the setter.
15975 (FlowBranching.UsageVector.Returns): Removed the setter.
15976 (FlowBranching.UsageVector): Added Break(), Return(),
15977 NeverReachable() and Throw() methods to modify the reachability.
15978 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
15979 done by FlowBranching.Merge().
15980 (FlowBranching.UsageVector.MergeChild): New method; merges the
15981 merge result into the current vector.
15982 (FlowBranching.Merge): New abstract method to merge a branching.
15984 2003-08-12 Martin Baulig <martin@ximian.com>
15986 * expression.cs (Indirection.CacheTemporaries): Create the
15987 LocalTemporary with the pointer type, not its element type.
15989 2003-08-10 Miguel de Icaza <miguel@ximian.com>
15991 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
15992 token was a keyword or not.
15994 Add `error' options where an IDENTIFIER was expected; Provide
15995 CheckToken and CheckIdentifierToken convenience error reporting
15998 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
16000 * decl.cs: Rename `NamespaceEntry Namespace' public field into
16001 NameSpaceEntry NameSpaceEntry.
16003 (LookupInterfaceOrClass): Avoid creating a full qualified name
16004 from namespace and name: avoid doing lookups when we know the
16005 namespace is non-existant. Use new Tree.LookupByNamespace which
16006 looks up DeclSpaces based on their namespace, name pair.
16008 * driver.cs: Provide a new `parser verbose' to display the
16009 exception thrown during parsing. This is turned off by default
16010 now, so the output of a failure from mcs is more graceful.
16012 * namespace.cs: Track all the namespaces defined in a hashtable
16015 (IsNamespace): New method
16017 2003-08-09 Miguel de Icaza <miguel@ximian.com>
16019 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
16020 we know that we need to concatenate (full typename can never be
16025 * statement.cs: Use a bitfield; Do not initialize to null things
16026 which are done by the constructor by default.
16028 * cs-parser.jay: bug fix, parameter was 4, not 3.
16030 * expression.cs: Just use the property;
16032 * statement.cs: No need for GetVariableInfo method.
16034 2003-08-08 Martin Baulig <martin@ximian.com>
16036 * flowanalysis.cs (FlowReturns): This is now nested in the
16037 `FlowBranching' class.
16038 (MyBitVector): Moved this here from statement.cs.
16039 (FlowBranching.SiblingType): New enum type.
16040 (FlowBranching.CreateSibling): Added `SiblingType' argument.
16042 2003-08-07 Martin Baulig <martin@ximian.com>
16044 * flowanalysis.cs (FlowBranchingType): This is now nested in the
16045 `FlowBranching' class and called `BranchingType'.
16047 2003-08-07 Martin Baulig <martin@ximian.com>
16049 * flowanalysis.cs: Moved all the control flow analysis code into
16052 2003-08-07 Martin Baulig <martin@ximian.com>
16054 * assign.cs (Assign.DoResolve): `target' must either be an
16055 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
16058 2003-08-07 Miguel de Icaza <miguel@ximian.com>
16060 * expression.cs (BinaryMethod): This kind of expression is created by the
16061 Binary class if it determines that the operator has to be handled
16064 (BinaryDelegate): This kind of expression is created if we are
16065 dealing with a + or - operator on delegates.
16067 (Binary): remove method, argumetns, and DelegateOperator: when
16068 dealing with methods,
16070 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
16072 * statement.cs (Block): use bitfields for the three extra booleans
16073 we had in use. Remove unused topblock parameter.
16075 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
16077 * assign.cs: Drop extra unneeded tests.
16079 2003-08-06 Miguel de Icaza <miguel@ximian.com>
16081 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
16083 * statement.cs (Foreach): Use VariableStorage instead of
16086 * codegen.cs (VariableStorage): New class used by clients that
16087 require a variable stored: locals or fields for variables that
16088 need to live across yield.
16090 Maybe provide a convenience api for EmitThis+EmitLoad?
16092 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
16095 2003-08-05 Miguel de Icaza <miguel@ximian.com>
16097 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
16098 RemapParameterLValue): New methods that are used to turn a
16099 precomputed FieldInfo into an expression like this:
16103 The idea is to use this instead of making LocalVariableReference
16104 have more than one meaning.
16106 * cs-parser.jay: Add error production to BASE.
16108 * ecore.cs: Deal with TypeManager.GetField returning null, which
16109 is now a valid return value.
16111 (FieldExprNoAddress): New expression for Fields whose address can
16114 * expression.cs (LocalVariableReference): During the resolve
16115 phases, create new expressions if we are in a remapping context.
16116 Remove code that dealt with remapping here.
16118 (ParameterReference): same.
16120 (ProxyInstance): New expression, like the `This' expression, but
16121 it is born fully resolved. We know what we are doing, so remove
16122 the errors that are targeted to user-provided uses of `this'.
16124 * statement.cs (Foreach): our variable is now stored as an
16125 Expression; During resolution, follow the protocol, dont just
16126 assume it will return this.
16128 2003-08-06 Martin Baulig <martin@ximian.com>
16130 * support.cs (SeekableStreamReader.cs): New public class.
16132 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
16133 SeekableStreamReader instead of the normal StreamReader.
16135 2003-08-04 Martin Baulig <martin@ximian.com>
16137 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
16138 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
16139 deambiguate casts and delegate invocations.
16140 (parenthesized_expression): Use the new tokens to ensure this is
16141 not a cast of method invocation.
16143 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
16144 when reading a `)' and Deambiguate_CloseParens () was previously
16147 * expression.cs (ParenthesizedExpression): New class. This is
16148 just used for the CS0075 test.
16149 (Binary.DoResolve): Check for CS0075.
16151 2003-07-29 Ravi Pratap <ravi@ximian.com>
16153 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
16154 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
16155 reference comparison.
16157 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
16158 examine the ReturnType for equality - this is necessary in the
16159 cases of implicit and explicit operators whose signature also
16160 includes the return type.
16162 2003-07-26 Miguel de Icaza <miguel@ximian.com>
16164 * namespace.cs: Cache the result of the namespace computation,
16165 instead of computing it every time.
16167 2003-07-24 Miguel de Icaza <miguel@ximian.com>
16169 * decl.cs: Use a global arraylist that we reuse over invocations
16170 to avoid excesive memory consumption. Reduces memory usage on an
16171 mcs compile by one meg (45 average).
16173 * typemanager.cs (LookupTypeReflection): In .NET pointers are
16174 private, work around that.
16176 2003-07-23 Miguel de Icaza <miguel@ximian.com>
16178 * literal.cs (IntLiteral): Define Zero and One static literals.
16180 * cs-parser.jay (integer_literal): use static literals to reduce
16181 memory usage for the most used literals (0, 1 and -1). 211kb
16182 reduced in memory usage.
16184 Replace all calls to `new ArrayList' with `new
16185 ArrayList(4)' which is a good average number for most allocations,
16186 and also requires only 16 bytes of memory for its buffer by
16189 This reduced MCS memory usage in seven megabytes for the RSS after
16192 2003-07-28 Ravi Pratap <ravi@ximian.com>
16194 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
16195 handle params methods the correct way by forming only one
16196 applicable set with params and normal methods in them. Earlier we
16197 were looking at params methods only if we found no normal methods
16198 which was not the correct thing to do.
16200 (Invocation.BetterFunction): Take separate arguments indicating
16201 when candidate and the best method are params methods in their
16204 This fixes bugs #43367 and #46199.
16206 * attribute.cs: Documentation updates.
16208 (CheckAttribute): Rename to CheckAttributeTarget.
16209 (GetValidPlaces): Rename to GetValidTargets.
16211 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
16212 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
16216 2003-07-28 Martin Baulig <martin@ximian.com>
16218 * class.cs (TypeContainer.DefineMembers): Use the base type's full
16219 name when looking up the base class of a nested class. Fixes #46977.
16221 2003-07-26 Martin Baulig <martin@ximian.com>
16223 * expression.cs (Indexers.Indexer): New nested struct; contains
16224 getter, setter and the indexer's type.
16225 (Indexers.Properties): This is now an ArrayList of
16226 Indexers.Indexer's.
16227 (IndexerAccess.DoResolveLValue): Correctly set the type if the
16228 indexer doesn't have any getters.
16230 * assign.cs (Assign.DoResolve): Also do the implicit conversions
16231 for embedded property and indexer assignments.
16233 2003-07-26 Martin Baulig <martin@ximian.com>
16235 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
16236 preprocessor directive is not the first non-whitespace character
16239 2003-07-26 Martin Baulig <martin@ximian.com>
16241 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
16242 namespace parsing, follow the spec more closely.
16244 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
16245 NamespaceEntry.Lookup().
16247 2003-07-25 Martin Baulig <martin@ximian.com>
16249 * MethodCore.cs (OverridesSomething): New public field; it's set
16250 from TypeContainer.DefineMembers if this method overrides
16251 something (which doesn't need to be a method). Fix #39462.
16253 2003-07-25 Ravi Pratap <ravi@ximian.com>
16255 * typemanager.cs (GetMembers): Ensure that the list of members is
16256 reversed. This keeps things in sync.
16258 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
16259 find an AttributeUsage attribute.
16261 * expression.cs (Invocation.OverloadResolve): Perform the check
16262 which disallows Invoke to be directly called on a Delegate.
16264 (Error_InvokeOnDelegate): Report error cs1533.
16266 2003-07-25 Martin Baulig <martin@ximian.com>
16268 * expression.cs (Indexers.GetIndexersForType): Only look in the
16269 interface hierarchy if the requested type is already an
16270 interface. Fixes #46788 while keeping #46502 fixed.
16272 2003-07-25 Martin Baulig <martin@ximian.com>
16274 * class.cs (TypeContainer.DefineMembers): Check whether all
16275 readonly fields have been assigned and report warning CS0649 if
16278 * statement.cs (LocalInfo.IsFixed): Always return true if this is
16281 2003-07-24 Ravi Pratap <ravi@ximian.com>
16283 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
16284 returned from GetMethods to make things consistent with the
16285 assumptions MCS makes about ordering of methods.
16287 This should comprehensively fix bug #45127 and it does :-)
16289 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
16290 ordering is actually reverse.
16292 * Clean up some debug messages I left lying around.
16294 * interface.cs (Populate*): Get rid of code which emits attributes
16295 since the stage in which we emit attributes is the 'Emit' stage,
16296 not the define stage.
16298 (Emit): Move attribute emission for interface members here.
16300 2003-07-22 Ravi Pratap <ravi@ximian.com>
16302 * expression.cs (Invocation.OverloadResolve): Follow the spec more
16303 closely: we eliminate methods in base types when we have an
16304 applicable method in a top-level type.
16306 Please see section 14.5.5.1 for an exact description of what goes
16309 This fixes bug #45127 and a host of other related to corlib compilation.
16311 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
16312 array is the method corresponding to the top-level type (this is
16313 because of the changes made to icall.c) so we change this
16316 (MethodGroupExpr.Name): This too.
16318 * typemanager.cs (GetElementType): New method which does the right
16319 thing when compiling corlib.
16321 * everywhere: Make use of the above in the relevant places.
16323 2003-07-22 Martin Baulig <martin@ximian.com>
16325 * cs-parser.jay (invocation_expression): Moved
16326 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
16327 `cast_expression', but create a InvocationOrCast which later
16328 resolves to either an Invocation or a Cast.
16330 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
16331 method; call this before EmitStatement() to make sure that this
16332 expression can be used as a statement.
16334 * expression.cs (InvocationOrCast): New class; resolves to either
16335 an Invocation or a Cast.
16337 * statement.cs (StatementExpression): Call ResolveStatement() on
16338 the ExpressionStatement before emitting it.
16340 2003-07-21 Martin Baulig <martin@ximian.com>
16342 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
16343 `ref' and `out' attributes match; fixes #46220.
16344 (MemberAccess.ResolveMemberAccess): You can't reference a type
16345 through an expression; fixes #33180.
16346 (Indexers.GetIndexersForType): Don't return the indexers from
16347 interfaces the class implements; fixes #46502.
16349 2003-07-21 Martin Baulig <martin@ximian.com>
16351 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
16352 CS0661 checks; fixes bug #30442.
16354 2003-07-21 Martin Baulig <martin@ximian.com>
16356 * decl.cs (AdditionResult): Added `Error'.
16358 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
16360 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
16361 makes cs0031.cs actually work.
16363 2003-07-20 Martin Baulig <martin@ximian.com>
16365 * namespace.cs: Fixed that bug which caused a crash when compiling
16366 the debugger's GUI.
16368 2003-07-20 Miguel de Icaza <miguel@ximian.com>
16370 * typemanager.cs (LookupTypeReflection): Never expose types which
16371 are NotPublic, NestedPrivate, NestedAssembly, or
16372 NestedFamANDAssem. We used to return these, and later do a check
16373 that would report a meaningful error, but the problem is that we
16374 would not get the real match, if there was a name override.
16376 2003-07-18 Miguel de Icaza <miguel@ximian.com>
16378 * namespace.cs (Namespace, Name): Do not compute the namespace
16379 name dynamically, compute it in the constructor. This reduced
16380 memory usage by 1697 KB.
16382 * driver.cs: Use --pause to pause at the end.
16384 2003-07-17 Peter Williams <peter@newton.cx>
16386 * Makefile: Change the name of the test target so that it doesn't
16387 conflict with the recursive test target.
16389 2003-07-17 Miguel de Icaza <miguel@ximian.com>
16391 * expression.cs (LocalVariableReference.Emit, EmitAssign,
16392 AddressOf): Do not use EmitThis, that was wrong, use the actual
16395 2003-07-15 Miguel de Icaza <miguel@ximian.com>
16397 * class.cs (MethodData.Define): While checking if a method is an
16398 interface implementation, improve the test: If we are not public
16399 (use new test here: use the computed MethodAttributes directly,
16400 instead of the parsed modifier flags) check if the `implementing'
16401 method comes from an interface or not.
16403 * pending.cs (VerifyPendingMethods): Slightly better error
16406 * makefile: add test target that does the mcs bootstrap.
16408 2003-07-16 Ravi Pratap <ravi@ximian.com>
16410 * interface.cs (Define): Do nothing here since there are no
16411 members to populate etc. Move the attribute emission out of here
16412 since this was just totally the wrong place to put it. Attribute
16413 application happens during the 'Emit' phase, not in the 'Define'
16416 (Emit): Add this method and move the attribute emission here
16418 * rootcontext.cs (EmitCode): Call the Emit method on interface
16421 2003-07-14 Ravi Pratap M <ravi@ximian.com>
16423 * expression.cs (OverloadResolve): Report error only if Location
16424 is not 'Null' which means that there was a probe going on.
16426 2003-07-14 Martin Baulig <martin@ximian.com>
16428 * expression.cs (ConditionalLogicalOperator): New public class to
16429 implement user defined conditional logical operators.
16430 This is section 14.11.2 in the spec and bug #40505.
16432 2003-07-14 Martin Baulig <martin@ximian.com>
16434 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
16436 2003-07-14 Martin Baulig <martin@ximian.com>
16438 * codegen.cs (EmitContext.InFixedInitializer): New public field.
16440 * ecore.cs (IVariable.VerifyFixed): New interface method.
16442 * expression.cs (Unary.ResolveOperator): When resolving the `&'
16443 operator, check whether the variable is actually fixed. Fixes bug
16444 #36055. Set a variable definitely assigned when taking its
16445 address as required by the spec.
16447 * statement.cs (LocalInfo.IsFixed): New field.
16448 (LocalInfo.MakePinned): Set `IsFixed' to true.
16450 2003-07-14 Ravi Pratap M <ravi@ximian.com>
16452 * attribute.cs (Attribute.Resolve): While doing a Member lookup
16453 for .ctors, ensure that we only ask for members declared in the
16454 attribute type (BindingFlags.DeclaredOnly).
16458 * expression.cs (Error_WrongNumArguments): Report error 1501
16459 correctly the way CSC does.
16461 2003-07-13 Martin Baulig <martin@ximian.com>
16463 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
16464 lookup on the fully qualified name, to make things like "X.X" work
16465 where "X.X" is a fully qualified type name, but we also have a
16466 namespace "X" in the using list. Fixes #41975.
16468 2003-07-13 Martin Baulig <martin@ximian.com>
16470 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
16471 function. If we're a CompoundAssign, we need to create an embedded
16472 CompoundAssign, not an embedded Assign.
16473 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
16476 2003-07-13 Martin Baulig <martin@ximian.com>
16478 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
16479 work to fix bug #46088.
16481 2003-07-13 Ravi Pratap <ravi@ximian.com>
16483 * class.cs (Operator.Emit): Do not emit attributes here - it is
16484 taken care of by the Method class that we delegate too. This takes
16485 care of bug #45876.
16487 2003-07-10 Martin Baulig <martin@ximian.com>
16489 * expression.cs (TypeOfVoid): New class.
16490 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
16492 2003-07-10 Martin Baulig <martin@ximian.com>
16494 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
16497 2003-07-10 Martin Baulig <martin@ximian.com>
16499 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
16500 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
16502 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
16504 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
16506 2003-07-10 Martin Baulig <martin@ximian.com>
16508 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
16509 of decimal. Fixes #42850.
16511 NOTE: I also fixed the created byte blob, but this doesn't work on
16512 the MS runtime and csc never produces any byte blobs for decimal
16515 2003-07-10 Martin Baulig <martin@ximian.com>
16517 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
16518 structs; fixes #32068.
16519 (Block.AddChildVariableNames): Fixed #44302.
16521 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16523 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
16525 2003-07-07 Miguel de Icaza <miguel@ximian.com>
16527 * attribute.cs: And this test is onger needed.
16529 2003-07-08 Martin Baulig <martin@ximian.com>
16531 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
16532 inaccessible types. Fixes #36313.
16534 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
16536 * namespace.cs (NamespaceEntry): Create implicit entries for all
16537 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
16538 implicit entries for N1.N2 and N1.
16540 2003-07-08 Martin Baulig <martin@ximian.com>
16542 Rewrote the handling of namespaces to fix a lot of the issues
16543 wrt. `using' aliases etc.
16545 * namespace.cs (Namespace): Splitted this class into a
16546 per-assembly `Namespace' and a per-file `NamespaceEntry'.
16548 * typemanager.cs (TypeManager.IsNamespace): Removed.
16549 (TypeManager.ComputeNamespaces): Only compute namespaces from
16550 loaded assemblies here, not the namespaces from the assembly we're
16551 currently compiling.
16553 2003-07-08 Martin Baulig <martin@ximian.com>
16555 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
16557 2003-07-07 Miguel de Icaza <miguel@ximian.com>
16559 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
16562 I thought about the memory savings here, but LookupTypeReflection
16563 is used under already very constrained scenarios. Compiling
16564 corlib or mcs only exposes one hit, so it would not really reduce
16565 any memory consumption.
16567 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16569 * typemanager.cs: fixes bug #45889 by only adding public types from
16570 other assemblies to the list of known types.
16572 2003-07-07 Miguel de Icaza <miguel@ximian.com>
16574 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
16575 on the type we resolved.
16577 2003-07-05 Martin Baulig <martin@ximian.com>
16579 * pending.cs (PendingImplementation.ParentImplements): Don't
16580 create the proxy if the parent is abstract.
16582 * class.cs (TypeContainer.DefineIndexers): Process explicit
16583 interface implementations first. Fixes #37714.
16585 2003-07-04 Miguel de Icaza <miguel@ximian.com>
16587 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
16588 defined recursively; but since we modify the input parameters
16589 (left is set to `this' temporarily), we reset this value if the
16590 left_is_explicit is false, which gives the original semantics to
16593 * literal.cs (NullPointer): new class used to represent a null
16594 literal in a pointer context.
16596 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
16597 type is a pointer, use a NullPointer object instead of a
16598 NullLiteral. Closes 43687
16600 (ExplicitConversion): Convert pointer values using
16601 the conv opcode to the proper type.
16603 * ecore.cs (New): change ValueTypeVariable property into a method,
16604 that returns whether the valuetype is suitable for being used.
16606 * expression.cs (Binary.DoNumericPromotions): Only return if we
16607 the int constant was a valid uint, and we can return both left and
16608 right as uints. If not, we continue processing, to trigger the
16609 type conversion. This fixes 39018.
16611 * statement.cs (Block.EmitMeta): During constant resolution, set
16612 the CurrentBlock property on the emitcontext, so that we resolve
16613 constants propertly.
16615 2003-07-02 Martin Baulig <martin@ximian.com>
16617 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
16618 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
16620 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
16621 than emitting it here.
16623 * statement.cs: Fixed some more flow analysis bugs.
16625 2003-07-02 Martin Baulig <martin@ximian.com>
16627 * class.cs (MethodData.Define): When implementing interface
16628 methods, set Final unless we're Virtual.
16630 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
16631 check work for interface methods.
16633 2003-07-01 Martin Baulig <martin@ximian.com>
16635 * ecore.cs (EmitContext.This): Replaced this property with a
16636 GetThis() method which takes a Location argument. This ensures
16637 that we get the correct error location for a CS0188.
16639 2003-07-01 Miguel de Icaza <miguel@ximian.com>
16641 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
16642 ImplicitStandardConversion.
16644 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
16646 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
16648 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
16651 2003-06-30 Miguel de Icaza <miguel@ximian.com>
16653 * class.cs (Constructor.Define): Turn off initlocals for unsafe
16656 (MethodData.Define): Turn off initlocals for unsafe methods.
16658 2003-06-29 Miguel de Icaza <miguel@ximian.com>
16660 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
16661 complete; Fixes #37521.
16663 * delegate.cs: Use Modifiers.TypeAttr to compute the
16664 TypeAttributes, instead of rolling our own. This makes the flags
16665 correct for the delegates.
16667 2003-06-28 Miguel de Icaza <miguel@ximian.com>
16669 * class.cs (Constructor.Define): Set the private flag for static
16670 constructors as well.
16672 * cs-parser.jay (statement_expression): Set the return value to
16673 null, to avoid a crash when we catch an error.
16675 2003-06-24 Miguel de Icaza <miguel@ximian.com>
16677 * cs-parser.jay: Applied patch from Jackson that adds support for
16678 extern and unsafe modifiers to destructor declarations.
16680 * expression.cs: Report error 21 if the user is trying to index a
16683 * driver.cs: Add an error message, suggested by the bug report.
16685 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
16686 if we do not have a ": this ()" constructor initializer. Fixes 45149
16688 2003-06-14 Miguel de Icaza <miguel@ximian.com>
16690 * namespace.cs: Add some information to reduce FAQs.
16692 2003-06-13 Miguel de Icaza <miguel@ximian.com>
16694 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
16695 underlying enumeration types. Fixes #43915.
16697 * expression.cs: Treat ushort/short as legal values to be used in
16698 bitwise operations.
16700 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
16702 * delegate.cs: transfer custom attributes for paramenters from
16703 the delegate declaration to Invoke and BeginInvoke.
16705 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
16707 * attribute.cs: handle custom marshalers and emit marshal info
16710 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
16712 * makefile.gnu: Added anonymous.cs to the compiler sources.
16714 2003-05-28 Miguel de Icaza <miguel@ximian.com>
16716 * iterators.cs: Change the name of the proxy class to include two
16719 * cs-parser.jay: Update grammar to include anonymous methods.
16721 * anonymous.cs: new file.
16723 2003-05-27 Miguel de Icaza <miguel@ximian.com>
16725 * class.cs (Field.Define): Add missing test for pointers and
16728 2003-05-27 Ravi Pratap <ravi@ximian.com>
16730 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
16731 we use the stobj opcode.
16733 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
16734 since it wasn't the correct fix.
16736 It still is puzzling that we are required to use stobj for IntPtr
16737 which seems to be a ValueType.
16739 2003-05-26 Miguel de Icaza <miguel@ximian.com>
16741 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
16742 during regular simple name resolution. Now, the trick is that
16743 instead of returning for processing the simplename, we do a
16744 TypeManager.LookupType (ie, a rooted lookup as opposed to a
16745 contextual lookup type). If a match is found, return that, if
16746 not, return for further composition.
16748 This fixes long-standing 30485.
16750 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
16751 using the address to initialize an object, do an Stobj instead of
16752 using the regular Stelem.
16754 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
16755 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
16756 Because if we are a BaseIndexerAccess that value will be true.
16759 * statement.cs (GotoCase.Resolve): Return after reporting an
16760 error, do not attempt to continue.
16762 * expression.cs (PointerArithmetic.Emit): If our operand is a
16763 long, convert our constants to match the operand before
16764 multiplying. Convert to I type before adding. Fixes 43670.
16766 2003-05-14 Ravi Pratap <ravi@ximian.com>
16768 * enum.cs (ImplicitConversionExists) : Rename to
16769 ImplicitEnumConversionExists to remove ambiguity.
16771 * ecore.cs (NullCast): New type of cast expression class which
16772 basically is very similar to EmptyCast with the difference being
16773 it still is a constant since it is used only to cast a null to
16775 (eg. (string) null)
16777 * convert.cs (ImplicitReferenceConversion): When casting a null
16778 literal, we return a NullCast.
16780 * literal.cs (NullLiteralTyped): Remove - I don't see why this
16781 should be around anymore.
16783 The renaming (reported was slightly wrong). Corrections:
16785 ConvertImplicitStandard -> ImplicitConversionStandard
16786 ConvertExplicitStandard -> ExplicitConversionStandard
16788 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
16789 before passing them in !
16791 * convert.cs (ImplicitConversionStandard): When comparing for
16792 equal expr and target types, ensure that expr is not a
16795 In general, we must not be checking (expr_type ==
16796 target_type) in the top level conversion methods
16797 (ImplicitConversion, ExplicitConversion etc). This checking is
16798 done in the methods that they delegate to.
16800 2003-05-20 Miguel de Icaza <miguel@ximian.com>
16802 * convert.cs: Move Error_CannotConvertType,
16803 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
16804 ImplicitNumericConversion, ImplicitConversionExists,
16805 ImplicitUserConversionExists, StandardConversionExists,
16806 FindMostEncompassedType, FindMostSpecificSource,
16807 FindMostSpecificTarget, ImplicitUserConversion,
16808 ExplicitUserConversion, GetConversionOperators,
16809 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
16810 TryImplicitIntConversion, Error_CannotConvertImplicit,
16811 ConvertImplicitRequired, ConvertNumericExplicit,
16812 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
16813 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
16816 Perform the following renames:
16818 StandardConversionExists -> ImplicitStandardConversionExists
16819 ConvertImplicit -> ImplicitConversion
16820 ConvertImplicitStandard -> ImplicitStandardConversion
16821 TryImplicitIntConversion -> ImplicitIntConversion
16822 ConvertImplicitRequired -> ImplicitConversionRequired
16823 ConvertNumericExplicit -> ExplicitNumericConversion
16824 ConvertReferenceExplicit -> ExplicitReferenceConversion
16825 ConvertExplicit -> ExplicitConversion
16826 ConvertExplicitStandard -> ExplicitStandardConversion
16828 2003-05-19 Martin Baulig <martin@ximian.com>
16830 * statement.cs (TypeInfo.StructInfo): Made this type protected.
16831 (TypeInfo): Added support for structs having structs as fields.
16833 * ecore.cs (FieldExpr): Implement IVariable.
16834 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
16835 VariableInfo for the field.
16837 2003-05-18 Martin Baulig <martin@ximian.com>
16839 * expression.cs (This.DoResolve): Report a CS0027 if we're
16840 emitting a field initializer.
16842 2003-05-18 Martin Baulig <martin@ximian.com>
16844 * expression.cs (This.ResolveBase): New public function.
16845 (This.DoResolve): Check for CS0188.
16847 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
16850 * ecore.cs (MethodGroupExpr.DoResolve): Set the
16851 `instance_expression' to null if we don't have any non-static
16854 2003-05-18 Martin Baulig <martin@ximian.com>
16856 Reworked the way how local variables and parameters are handled by
16857 the flow analysis code.
16859 * statement.cs (TypeInfo, VariableMap): New public classes.
16860 (VariableInfo): New public class. This is now responsible for
16861 checking whether a variable has been assigned. It is used for
16862 parameters and local variables.
16863 (Block.EmitMeta): Take the InternalParameters as argument; compute
16864 the layout of the flow vectors here.
16865 (Block.LocalMap, Block.ParameterMap): New public properties.
16866 (FlowBranching): The .ctor doesn't get the InternalParameters
16867 anymore since Block.EmitMeta() now computes the layout of the flow
16869 (MyStructInfo): This class is now known as `StructInfo' and nested
16870 in `TypeInfo'; we don't access this directly anymore.
16872 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
16873 property and removed IsAssigned(), IsFieldAssigned(),
16874 SetAssigned() and SetFieldAssigned(); we now call them on the
16875 VariableInfo so we don't need to duplicate this code everywhere.
16877 * expression.cs (ParameterReference): Added `Block block' argument
16879 (LocalVariableReference, ParameterReference, This): The new
16880 VariableInfo class is now responsible for all the definite
16883 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
16884 IsParameterAssigned, SetParameterAssigned): Removed.
16886 2003-05-18 Martin Baulig <martin@ximian.com>
16888 * typemanager.cs (InitCoreTypes): Try calling
16889 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
16890 the 3-args-version. Corlib now also needs our `void_type'.
16891 (GetMethod): Added overloaded version which takes an optional
16892 `bool report_errors' to allow lookups of optional methods.
16894 2003-05-12 Martin Baulig <martin@ximian.com>
16896 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
16897 only used for locals and not for parameters.
16899 2003-05-12 Miguel de Icaza <miguel@ximian.com>
16901 * support.cs (InternalParameters.ParameterType): Return the
16902 ExternalType of the parameter.
16904 * parameter.cs (Parameter.ExternalType): drop the two arguments,
16907 2003-05-11 Miguel de Icaza <miguel@ximian.com>
16909 * class.cs (MethodData.Define): Do not set the `newslot' on
16910 interface members, if they are also flagged as "override".
16912 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
16913 better code for ++i and i++. This only works for static fields
16914 and local variables.
16916 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
16917 want to pull the DeclSpace out of the builder_to_declspace instead
16918 of the TypeBuilder (like in TypeContainer.FindMembers).
16920 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
16921 instead of LookupTypeContainer. Fixes the crash on .NET for
16922 looking up interface members.
16924 * const.cs: Create our own emit context during the Definition
16925 stage, so that constants are evaluated in the proper context, when
16926 a recursive definition happens.
16928 2003-05-11 Martin Baulig <martin@ximian.com>
16930 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
16931 new block for a switch section.
16932 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
16933 the adding/lookup in the switch block. Fixes #39828.
16935 2003-05-09 Miguel de Icaza <miguel@ximian.com>
16937 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
16938 functionality: I needed to convert the data after I had performed
16939 the add/sub operation into the operands type size.
16941 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
16942 pass the type for the box operation, otherwise the resulting
16943 object would have been of type object.
16945 (BoxedCast): Add constructor to specify the type to box as.
16947 2003-05-07 Miguel de Icaza <miguel@ximian.com>
16949 * iterators.cs: I was reusing the `count' variable inadvertently,
16950 take steps to not allow this to happen.
16952 2003-05-06 Miguel de Icaza <miguel@ximian.com>
16954 * attribute.cs (Attribute.Resolve): Params attributes are encoded
16955 by creating an array at the point where the params starts and
16956 putting all those arguments there, then adjusting the size of the
16959 2003-05-05 Miguel de Icaza <miguel@ximian.com>
16961 * expression.cs (New.AddressOf): Implement interface
16962 IMemoryLocation. This is used when the `new' operator is used in
16963 the context of an invocation to a method on a value type.
16965 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
16968 * namespace.cs: Also check the using aliases here.
16970 * driver.cs: Move the test for using validity after the types have
16971 been entered, so we do a single pass that also includes the using
16974 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
16975 in the regular case. CreateSiblingForFinally is doing extra
16978 * attribute.cs (GetAttributeArgumentExpression): Store the result
16979 on an out value, and use the return value to indicate failure
16980 instead of using null (which is a valid return for Constant.GetValue).
16982 * statement.cs: Perform the analysis flow for the increment
16983 portion after the statement, because this will be the real flow of
16984 execution. Fixes #42385
16986 * codegen.cs (EmitContext.EmitArgument,
16987 EmitContext.EmitStoreArgument): New helper functions when the
16988 RemapToProxy flag is set.
16990 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
16993 Add support for remapping parameters.
16995 * iterators.cs: Propagate parameter values; Store parameter
16996 values in the proxy classes.
16998 2003-05-04 Miguel de Icaza <miguel@ximian.com>
17000 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
17001 need a proxy reference; I do not know what I was thinking
17003 * cs-parser.jay (constructor_initializer): catch another error,
17004 and display nice message.
17006 (field_declaration): catch void field declaration
17007 to flag a better error.
17009 * class.cs (MemberBase.CheckBase): Report an error instead of a
17010 warning if a new protected member is declared in a struct.
17011 (Field.Define): catch the error of readonly/volatile.
17013 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
17015 (FieldExpr.AddressOf): ditto. Catch error where the address of a
17016 volatile variable is taken
17018 2003-05-02 Miguel de Icaza <miguel@ximian.com>
17020 * statement.cs (Fixed.Resolve): Report an error if we are not in
17023 2003-05-01 Miguel de Icaza <miguel@ximian.com>
17025 * typemanager.cs: reuse the code that handles type clashes for
17026 delegates and enumerations.
17028 * class.cs (Report28): Always report.
17030 * expression.cs (EncodeAsAttribute): Allow nulls here.
17032 2003-04-28 Miguel de Icaza <miguel@ximian.com>
17034 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
17035 the functionality for testing whether an expression is valid for
17036 an attribute here. Also handle the case of arrays of elements
17039 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
17040 encoding a linear array into an array of objects that are suitable
17041 to be passed to an CustomAttributeBuilder.
17043 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
17045 * ecore.cs: (FieldExpr): Handle field remapping here.
17047 * iteratators.cs: Pass the instance variable (if the method is an
17048 instance method) to the constructors, so we can access the field
17049 variables on the class.
17051 TODO: Test this with structs. I think the THIS variable on
17052 structs might have to be a pointer, and not a refenrece
17054 2003-04-27 Miguel de Icaza <miguel@ximian.com>
17056 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
17057 local variables to fields in a proxy class.
17059 * iterators.cs (PopulateProxy): Rename our internal fields to
17061 Create a <THIS> field if we are an instance method, so we can
17062 reference our parent container variables.
17063 (MapVariable): Called back from the EmitContext code to enter a
17064 new variable to field mapping into the proxy class (we just create
17068 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
17069 for using the remapped locals to fields.
17071 I placed the code here, because that gives the same semantics to
17072 local variables, and only changes the Emit code.
17074 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
17075 statements inside iterators.
17076 (VariableInfo): Add a FieldBuilder for the cases when we are
17077 remapping local variables to fields in a proxy class
17079 * ecore.cs (SimpleNameResolve): Avoid testing two times for
17080 current_block != null.
17082 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
17083 not cope with strings, as it has been moved to the
17084 TableSwitchEmit. Fixed bug in switch generation.
17086 * expression.cs (New.DoResolve): Provide more context for the user
17087 when reporting an error.
17089 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
17092 * expression.cs (MemberAccess.DoResolve): When we get a type back,
17093 check the permissions for it. Note than in a type-resolution
17094 context the check was already present in DeclSpace.ResolveType,
17095 but was missing from the MemberAccess.
17097 (ArrayCreation.CheckIndices): warn if the user has
17098 more nested levels of expressions, but there are no more
17099 dimensions specified. Avoids crash on bug 41906.
17101 2003-04-26 Miguel de Icaza <miguel@ximian.com>
17103 * statement.cs (Block): replace Implicit bool, for a generic
17105 New flag: `Unchecked'. This is used during the EmitMeta phase
17106 (which is out-of-line with the regular Resolve/Emit process for a
17107 statement, as this is done ahead of time, but still gets a chance
17108 to call constant resolve).
17110 (Block.Flags): new enum for adding a new flag.
17112 (Block.EmitMeta): track the state of unchecked.
17114 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
17115 to enable constant resolution to work there as well.
17117 2003-04-22 Miguel de Icaza <miguel@ximian.com>
17119 * typemanager.cs (ienumerable_type): Also look up
17120 System.Collections.IEnumerable.
17122 2003-04-21 Miguel de Icaza <miguel@ximian.com>
17124 TODO: Test more than one conditional per method.
17126 * class.cs (Indexer.Define): Report the location where the user is
17127 referencing the unsupported feature.
17129 (MethodData): Overload the use of `conditionals' to
17130 minimize the creation of needless ArrayLists. This saves roughly
17131 212kb on my machine.
17133 (Method): Implement the new IIteratorContainer interface.
17134 (Method.SetYields): Implement the method by setting the ModFlags
17135 to contain METHOD_YIELDS.
17137 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
17138 which just got set to null.
17140 * iterators.cs: New file.
17142 (Yield, YieldBreak): New statements.
17144 * statement.cs (Return.Resolve): Flag an error if we are used in
17145 an iterator method.
17147 * codegen.cs (InIterator): New flag set if the code is being
17148 compiled in an iterator method.
17150 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
17151 internal modifier, and we just use it to avoid adding extra
17152 fields, as this is seldom used.
17154 * cs-parser.jay: Add yield_statement (yield and yield break).
17156 * driver.cs: New flag -v2 to turn on version 2 features.
17158 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
17159 hashtable when v2 is enabled.
17161 2003-04-20 Miguel de Icaza <miguel@ximian.com>
17163 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
17164 there is already a namespace defined with this name.
17166 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
17167 people upgraded their corlibs.
17169 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
17170 always use fully qualified types, no need to use the compiler
17173 (TypeManager.IsNamespace): Use binarysearch.
17175 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
17176 AddDelegate): I did not quite use the new IsValid API properly: I
17177 have to pass the short-name and the fullname. I was passing only
17178 the basename instead of the fullname sometimes.
17180 (TypeContainer.DefineType): call NamespaceClash.
17182 * interface.cs (Interface.DefineType): use NamespaceClash before
17185 * delegate.cs (Delegate.DefineType): use NamespaceClash before
17188 * enum.cs: (Enum.DefineType): use NamespaceClash before
17191 * typemanager.cs (: 3-line patch that gives us some tasty 11%
17192 speed increase. First, use the negative_hits cache when we get a
17193 negative. Second, add the type with its full original name
17194 instead of the new . and + encoded name (reflection uses + to
17195 separate type from a nested type). Use LookupTypeReflection
17196 directly which bypasses the type->name hashtable (that we already
17197 know does not contain the type.
17199 * decl.cs (DeclSpace.ResolveTypeExpr): track the
17200 location/container type.
17202 * driver.cs: When passing utf8, use directly the UTF8Encoding.
17204 2003-04-19 Miguel de Icaza <miguel@ximian.com>
17206 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
17208 * delegate.cs (NewDelegate.Resolve): Test whether an instance
17209 method is being referenced in the method group from a static
17210 context, and report error 120 if so.
17212 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
17215 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
17216 is created, we create the A namespace).
17218 * cs-parser.jay: A namespace also introduces a DeclarationFound.
17221 2003-04-18 Miguel de Icaza <miguel@ximian.com>
17223 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
17224 invocation to ModuleBuilder.GetType with the same values will
17225 return a new type instance, so we need to cache its return
17228 * expression.cs (Binary.ResolveOperator): Only allow the compare
17229 operators on enums if they are of the same type.
17231 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
17232 types of ValueType on their own case. Before we were giving them
17233 the same treatment as objects.
17235 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
17236 fullname. Short name is used to compare against container name.
17237 Fullname is used to check against defined namespace names.
17239 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
17240 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
17242 (Method.CheckBase): Call parent.
17243 (MemberBase.CheckBase): Check for protected members on sealed
17245 (PropertyBase.CheckBase): Call parent.
17246 (Field.Define): Call parent.
17248 * report.cs: Negative error codes are now mapped to 8000 - code,
17249 so that the display is render more nicely.
17251 * typemanager.cs: Do not use try/catch, instead report a regular
17254 (GetPointerType, GetReferenceType): These methods provide
17255 mechanisms to obtain the T* and T& from a T. We had the code
17256 previously scattered around the code base, and it also used
17257 TypeManager.LookupType that would go through plenty of caches.
17258 This one goes directly to the type source.
17260 In some places we did the Type.GetType followed by
17261 ModuleBuilder.GetType, but not in others, so this unifies the
17262 processing as well.
17264 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
17265 statements now that we have namespace information.
17267 * typemanager.cs (IsNamespace): New method, returns whether the
17268 string presented is a namespace or not.
17270 (ComputeNamespaces): New public entry point, computes the list of
17271 available namespaces, using the GetNamespaces API call in Mono, or
17272 the slower version in MS.NET.
17274 Now before we start the semantic analysis phase, we have a
17275 complete list of namespaces including everything that the user has
17278 Deleted old code to cache namespaces in .nsc files.
17280 2003-04-17 Miguel de Icaza <miguel@ximian.com>
17282 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
17283 class/struct location definition Location for the implicit
17284 constructor location.
17286 (Operator.Define): Use the location of the operator for the
17287 implicit Method definition.
17289 (Constructor.Emit): use the constructor location for the implicit
17290 base initializer constructor.
17292 * ecore.cs: Remove ITypeExpression. This interface is now gone,
17293 and the Expression class now contains two new methods:
17295 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
17296 isolate type lookup from the rest of the resolution process.
17298 Since we use Expressions to hold type definitions due to the way
17299 we parse the input we have historically overloaded Resolve to
17300 perform the Type lookups if a special flag is passed. Now this is
17301 eliminated and two methods take their place.
17303 The differences in the two methods between xStep and xTerminal is
17304 that xStep is involved in our current lookup system that uses
17305 SimpleNames to compose a name, while xTerminal is used just to
17306 catch the case where the simplename lookup failed.
17308 2003-04-16 Miguel de Icaza <miguel@ximian.com>
17310 * expression.cs (ResolveMemberAccess): Remove redundant code.
17311 TypeExpr expressions are always born fully resolved.
17313 * interface.cs (PopulateMethod): Do not lookup the types twice.
17314 We were doing it once during SemanticAnalysis and once during
17317 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
17318 in local variable type definitions, were being returned as a
17319 SimpleName (we decomposed everything into a string), that is
17320 because primary_expression was being used instead of a type in the
17321 grammar (reduce/reduce conflicts).
17323 The part that was wrong is that we converted the expression into a
17324 string (an oversimplification in one hand, compounded with primary
17325 expressions doing string concatenation).
17331 Would return "A.B.C[]" as a SimpleName. This stopped things like
17332 using clauses from working on this particular context. And a type
17333 was being matched directly against "A.B.C[]".
17335 We now use the correct approach, and allow for ComposedCast to be
17336 part of the unary expression. So the "A.B.C []" become a composed
17337 cast of "A.B.C" (as a nested group of MemberAccess with a
17338 SimpleName at the end) plus the rank composition "[]".
17342 2003-04-10 Miguel de Icaza <miguel@ximian.com>
17344 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
17345 for the access level checking.
17347 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
17348 `TypeContainer container', because I kept getting confused when I
17349 was debugging this code.
17351 * expression.cs (Indexers): Instead of tracking getters/setters,
17352 we now track them in parallel. We create one arraylist less, but
17353 most importantly it is possible now for the LValue code to find a
17354 matching get for a set.
17356 (IndexerAccess.DoResolveLValue): Update the code.
17357 GetIndexersForType has been modified already to extract all the
17358 indexers from a type. The code assumed it did not.
17360 Also make the code set the correct return type for the indexer.
17361 This was fixed a long time ago for properties, but was missing for
17362 indexers. It used to be void_type.
17364 (Binary.Emit): Test first for doubles instead of
17365 floats, as they are more common.
17367 (Binary.EmitBranchable): Use the .un version of the branch opcodes
17368 when dealing with floats and the <=, >= operators. This fixes bug
17371 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
17372 to load the array value by emitting a load on the foreach variable
17373 type. This was incorrect.
17375 We now emit the code to load an element using the the array
17376 variable type, and then we emit the conversion operator.
17380 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
17382 * attribute.cs: Avoid allocation of ArrayLists in the common case.
17384 2003-04-09 Miguel de Icaza <miguel@ximian.com>
17386 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
17387 test for protection before we test for signatures.
17389 (MethodSignature.ToString): implement.
17391 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
17392 to the case where we reduced into a LongConstant.
17394 * decl.cs (CheckAccessLevel): If the type is an array, we can not
17395 depend on whether the information is acurrate, because the
17396 Microsoft runtime will always claim that the array type is public,
17397 regardless of the real state.
17399 If the type is a pointer, another problem happens: the type is
17400 reported as non-public in Microsoft.
17402 In both cases we have to call CheckAccessLevel recursively with
17403 the underlying type as the argument to be tested.
17405 2003-04-08 Miguel de Icaza <miguel@ximian.com>
17407 * assign.cs (Assign.Emit): If we are dealing with a compound
17408 assignment expression, we should use the code path that stores the
17409 intermediate result in a temporary value. This fixes #40903.
17411 *expression.cs (Indirection.ToString): Provide ToString method for
17414 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
17416 * class.cs: Null out fields holding references to Block objects so
17417 they can be garbage collected.
17419 * expression.cs (OverloadResolve): Remove unused local.
17421 2003-04-07 Martin Baulig <martin@ximian.com>
17423 * codegen.cs (EmitContext.CurrentFile): New public field.
17424 (EmitContext.Mark): Use the CurrentFile to check whether the
17425 location is in the correct file.
17426 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
17428 2003-04-07 Martin Baulig <martin@ximian.com>
17430 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
17432 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
17433 location. [FIXME: The location argument which gets passed to this
17434 method is sometimes wrong!]
17436 2003-04-07 Nick Drochak <ndrochak@gol.com>
17438 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
17440 2003-04-07 Miguel de Icaza <miguel@ximian.com>
17442 * expression.cs (Indirection.EmitAssign): We were using the
17443 temporary, but returning immediately instead of continuing the
17446 2003-04-06 Martin Baulig <martin@ximian.com>
17448 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
17449 if it's a nested child, but also deriving from the outer class.
17452 * typemanager.cs (IsNestedChildOf): Make this work if it's a
17453 nested child, but also deriving from the outer class. See
17455 (FilterWithClosure): We may access private members of the outer
17456 class if we're a nested child and deriving from the outer class.
17457 (RealMemberLookup): Only set `closure_private_ok' if the
17458 `original_bf' contained BindingFlags.NonPublic.
17460 2003-04-05 Martin Baulig <martin@ximian.com>
17462 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
17464 2003-04-02 Miguel de Icaza <miguel@ximian.com>
17466 * class.cs (Event.Define): Do not allow abstract events to have
17469 2003-04-01 Miguel de Icaza <miguel@ximian.com>
17471 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
17472 block in event declarations.
17474 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
17475 value type, get its address.
17477 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
17478 leaving a class on the stack instead of a boolean value (int
17479 0/1). Change the code so we compare against null, and then the
17480 result against zero.
17482 * class.cs (TypeContainer.GetClassBases): We were checking for the
17483 parent class being sealed too late.
17485 * expression.cs (Binary.Emit): For <= and >= when dealing with
17486 floating point values, use cgt.un and clt.un instead of cgt and
17489 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
17491 * statement.cs: Apply the same optimization as MS: skip the
17492 GetEnumerator returning an IEnumerator, and use the one returning a
17493 CharEnumerator instead. This allows us to avoid the try-finally block
17496 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
17498 * cs-parser.jay: Attributes cannot be applied to
17499 namespaces. Fixes #40473
17501 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17504 (Add*): check if the name is valid using the full name for constants,
17505 fields, properties and events.
17507 2003-03-28 Miguel de Icaza <miguel@ximian.com>
17509 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
17510 char constants to be part of the enumeration.
17512 * expression.cs (Conditional.DoResolve): Add support for operator
17513 true. Implements the missing functionality from 14.12
17515 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
17516 operator true/false as required by the spec.
17518 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
17519 implicit conversion to boolean.
17521 * statement.cs (Statement.ResolveBoolean): A boolean expression is
17522 also one where the type implements `operator true'.
17524 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
17525 get an expression that will invoke operator true based on an
17528 (GetConversionOperators): Removed the hack that called op_True
17531 (Expression.ResolveBoolean): Move this from Statement.
17533 2003-03-17 Miguel de Icaza <miguel@ximian.com>
17535 * ecore.cs (FieldExpr): do not allow initialization of initonly
17536 fields on derived classes
17538 2003-03-13 Martin Baulig <martin@ximian.com>
17540 * statement.cs (Block.Emit): Call ig.BeginScope() and
17541 ig.EndScope() when compiling with debugging info; call
17542 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
17544 2003-03-08 Miguel de Icaza <miguel@ximian.com>
17546 * expression.cs (Indexers): Do not construct immediately, allow
17547 for new members to be appended as we go. Fixes 38143
17549 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17551 * expression.cs: save/restore context when resolving an unchecked
17554 2003-03-05 Miguel de Icaza <miguel@ximian.com>
17556 * cfold.cs: Catch division by zero in modulus operator during
17559 2003-03-03 Miguel de Icaza <miguel@ximian.com>
17561 * interface.cs (Interface.DefineMembers): Avoid defining members
17564 2003-02-27 Miguel de Icaza <miguel@ximian.com>
17566 * driver.cs: handle the +/- options for -noconfig
17568 * statement.cs (Unckeched.Resolve): Also track the state of
17569 unchecked in the Resolve phase.
17571 2003-02-27 Martin Baulig <martin@ximian.com>
17573 * ecore.cs (Expression.MemberLookup): Don't create a
17574 MethodGroupExpr for something which is not a method. Fixes #38291.
17576 2003-02-25 Miguel de Icaza <miguel@ximian.com>
17578 * class.cs (MemberBase.CheckParameters): Also check that the type
17579 is unmanaged if it is a pointer.
17581 * expression.cs (SizeOf.Resolve): Add location information.
17583 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
17584 a managed type is declared.
17586 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
17587 parameter modifiers as well. Fixes bug 38606
17589 * class.cs: Very sad. Am backing out the speed up changes
17590 introduced by the ArrayList -> Array in the TypeContainer, as they
17591 were not actually that much faster, and introduced a bug (no error
17592 reports on duplicated methods).
17594 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
17595 source first, this will guarantee that we have a valid expression
17596 before calling in lower levels functions that will require a
17597 resolved object. Then use this original_source in the
17598 target.ResolveLValue instead of the original source that was
17601 Another change. Use target.Resolve instead of LValueResolve.
17602 Although we are resolving for LValues, we will let the Assign code
17603 take care of that (it will be called again from Resolve). This
17604 basically allows code like this:
17606 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
17607 class Y { void A (X x) { x [0] += o; }
17609 The problem was that the indexer was trying to resolve for
17610 set_Item (idx, object o) and never finding one. The real set_Item
17611 was set_Item (idx, X). By delaying the process we get the right
17616 2003-02-23 Martin Baulig <martin@ximian.com>
17618 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
17619 while calling DoEmit ().
17621 * codegen.cs (EmitContext.Mark): Don't mark locations in other
17622 source files; if you use the #line directive inside a method, the
17623 compiler stops emitting line numbers for the debugger until it
17624 reaches the end of the method or another #line directive which
17625 restores the original file.
17627 2003-02-23 Martin Baulig <martin@ximian.com>
17629 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
17631 2003-02-23 Martin Baulig <martin@ximian.com>
17633 * statement.cs (Block.AddChildVariableNames): We need to call this
17634 recursively, not just for our immediate children.
17636 2003-02-23 Martin Baulig <martin@ximian.com>
17638 * class.cs (Event.Define): Always make the field private, like csc does.
17640 * typemanager.cs (TypeManager.RealMemberLookup): Make events
17641 actually work, fixes bug #37521.
17643 2003-02-23 Miguel de Icaza <miguel@ximian.com>
17645 * delegate.cs: When creating the various temporary "Parameters"
17646 classes, make sure that we call the ComputeAndDefineParameterTypes
17647 on those new parameters (just like we do with the formal ones), to
17648 allow them to be resolved in the context of the DeclSpace.
17650 This fixes the bug that Dick observed in Bugzilla #38530.
17652 2003-02-22 Miguel de Icaza <miguel@ximian.com>
17654 * expression.cs (ResolveMemberAccess): When resolving a constant,
17655 do not attempt to pull a constant if the value was not able to
17656 generate a valid constant.
17658 * const.cs (LookupConstantValue): Do not report more errors than required.
17660 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17662 * expression.cs: fixes bug #38328.
17664 2003-02-18 Miguel de Icaza <miguel@ximian.com>
17666 * class.cs: Changed all the various members that can be part of a
17667 class from being an ArrayList to be an Array of the right type.
17668 During the DefineType type_list, interface_list, delegate_list and
17669 enum_list are turned into types, interfaces, delegates and enums
17672 And during the member population, indexer_list, event_list,
17673 constant_list, field_list, instance_constructor_list, method_list,
17674 operator_list and property_list are turned into their real arrays.
17676 Although we could probably perform this operation earlier, for
17677 good error reporting we need to keep the lists and remove the
17678 lists for longer than required.
17680 This optimization was triggered by Paolo profiling the compiler
17681 speed on the output of `gen-sample-program.pl' perl script.
17683 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
17684 not crash in methods like MemberLookupFailed that use this field.
17686 This problem arises when the compiler fails to resolve a type
17687 during interface type definition for example.
17689 2003-02-18 Miguel de Icaza <miguel@ximian.com>
17691 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
17692 inherit from System.Object, so we have to stop at null, not only
17693 when reaching System.Object.
17695 2003-02-17 Miguel de Icaza <miguel@ximian.com>
17697 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
17698 DeclaredOnly because the parent indexer might have had a different
17699 name, but did not loop until the top of the hierarchy was reached.
17701 The problem this one fixes is 35492: when a class implemented an
17702 indexer from an interface, we were getting the interface method
17703 (which was abstract) and we were flagging an error (can not invoke
17706 This also keeps bug 33089 functioning, and test-148 functioning.
17708 * typemanager.cs (IsSpecialMethod): The correct way of figuring
17709 out if a method is special is to see if it is declared in a
17710 property or event, or whether it is one of the predefined operator
17711 names. This should fix correctly #36804.
17713 2003-02-15 Miguel de Icaza <miguel@ximian.com>
17715 The goal here is to remove the dependency on EmptyCast.Peel ().
17716 Killing it completely.
17718 The problem is that currently in a number of places where
17719 constants are expected, we have to "probe" for an EmptyCast, and
17720 Peel, which is not the correct thing to do, as this will be
17721 repetitive and will likely lead to errors.
17723 The idea is to remove any EmptyCasts that are used in casts that
17724 can be reduced to constants, so we only have to cope with
17727 This bug hunt was triggered by Bug 37363 and the desire to remove
17728 the duplicate pattern where we were "peeling" emptycasts to check
17729 whether they were constants. Now constants will always be
17732 * ecore.cs: Use an enumconstant here instead of wrapping with
17735 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
17736 throwing me off. By handling this we can get rid of a few hacks.
17738 * statement.cs (Switch): Removed Peel() code.
17740 2003-02-14 Miguel de Icaza <miguel@ximian.com>
17742 * class.cs: Location information for error 508
17744 * expression.cs (New.DoResolve): Add a guard against double
17745 resolution of an expression.
17747 The New DoResolve might be called twice when initializing field
17748 expressions (see EmitFieldInitializers, the call to
17749 GetInitializerExpression will perform a resolve on the expression,
17750 and later the assign will trigger another resolution
17752 This leads to bugs (#37014)
17754 * delegate.cs: The signature for EndInvoke should contain any ref
17755 or out parameters as well. We were not doing this in the past.
17757 * class.cs (Field.Define): Do not overwrite the type definition
17758 inside the `volatile' group. Turns out that volatile enumerations
17759 were changing the type here to perform a validity test, which
17762 2003-02-12 Miguel de Icaza <miguel@ximian.com>
17764 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
17765 and structs, we do not want to load the instance variable
17767 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
17768 enum_type has to be handled like an object reference (implicit
17769 conversions exists from this to object), but the regular IsClass
17770 and IsValueType tests will never return true for this one.
17772 Also we use TypeManager.IsValueType instead of type.IsValueType,
17773 just for consistency with the rest of the code (this is only
17774 needed if we ever use the construct exposed by test-180.cs inside
17775 corlib, which we dont today).
17777 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
17779 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
17782 2003-02-09 Martin Baulig <martin@ximian.com>
17784 * namespace.cs (Namespace..ctor): Added SourceFile argument.
17785 (Namespace.DefineNamespaces): New static public method; this is
17786 called when we're compiling with debugging to add all namespaces
17787 to the symbol file.
17789 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
17790 pass it to the Namespace's .ctor.
17792 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
17793 and MethodBase arguments; pass the namespace ID to the symwriter;
17794 pass the MethodBase instead of the token to the symwriter.
17795 (SymbolWriter.DefineNamespace): New method to add a namespace to
17798 2003-02-09 Martin Baulig <martin@ximian.com>
17800 * symbolwriter.cs: New file. This is a wrapper around
17801 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
17802 methods here in near future.
17804 2003-02-09 Martin Baulig <martin@ximian.com>
17806 * codegen.cs (EmitContext.Mark): Just pass the arguments to
17807 ILGenerator.MarkSequencePoint() which are actually used by the
17810 2003-02-09 Martin Baulig <martin@ximian.com>
17812 * location.cs (SourceFile): New public sealed class. This
17813 contains the name and an index which is used in the location's token.
17814 (Location): Reserve an appropriate number of bits in the token for
17815 the source file instead of walking over that list, this gives us a
17816 really huge performance improvement when compiling with debugging.
17818 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
17819 `SourceFile' argument instead of a string.
17820 (Driver.ProcessFile): Add all the files via Location.AddFile(),
17821 but don't parse/tokenize here, we need to generate the list of all
17822 source files before we do that.
17823 (Driver.ProcessFiles): New static function. Parses/tokenizes all
17826 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
17827 instead of a string.
17829 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
17832 2003-02-09 Martin Baulig <martin@ximian.com>
17834 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
17835 filename on `#line default'.
17837 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
17839 * statement.cs: don't clear the pinned var when the fixed statement
17840 returns from the method (fixes bug#37752).
17842 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
17844 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
17847 2003-02-07 Martin Baulig <martin@ximian.com>
17849 * driver.cs: Removed the `--debug-args' command line argument.
17851 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
17852 automatically by the AsssemblyBuilder.
17853 (CodeGen.InitializeSymbolWriter): We don't need to call any
17854 initialization function on the symbol writer anymore. This method
17855 doesn't take any arguments.
17857 2003-02-03 Miguel de Icaza <miguel@ximian.com>
17859 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
17860 from referenced assemblies as well.
17862 2003-02-02 Martin Baulig <martin@ximian.com>
17864 * class.cs (MethodData.Emit): Generate debugging info for external methods.
17866 2003-02-02 Martin Baulig <martin@ximian.com>
17868 * class.cs (Constructor.Emit): Open the symbol writer before
17869 emitting the constructor initializer.
17870 (ConstructorInitializer.Emit): Call ec.Mark() to allow
17871 single-stepping through constructor initializers.
17873 2003-01-30 Miguel de Icaza <miguel@ximian.com>
17875 * class.cs: Handle error 549: do not allow virtual methods in
17878 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
17880 * decl.cs: Check access levels when resolving types
17882 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
17884 * statement.cs: Add parameters and locals set in catch blocks that might
17885 return to set vector
17887 2003-01-29 Miguel de Icaza <miguel@ximian.com>
17889 * class.cs (Operator): Set the SpecialName flags for operators.
17891 * expression.cs (Invocation.DoResolve): Only block calls to
17892 accessors and operators on SpecialName methods.
17894 (Cast.TryReduce): Handle conversions from char constants.
17897 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
17899 * statement.cs: small memory and time optimization in FlowBranching.
17901 2003-01-28 Pedro Mart <yoros@wanadoo.es>
17903 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
17904 problem that the last fix but in the other sid (Set).
17906 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
17907 access when there is no indexer in the hierarchy.
17909 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
17911 * class.cs: Combine some if statements.
17913 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17915 * driver.cs: fixed bug #37187.
17917 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
17919 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
17920 any indexer, it's needed to build a list with all the indexers in the
17921 hierarchy (AllGetters), else we have problems. Fixes #35653.
17923 2003-01-23 Miguel de Icaza <miguel@ximian.com>
17925 * class.cs (MethodData.Define): It is wrong for an interface
17926 implementation to be static in both cases: explicit and implicit.
17927 We were only handling this in one case.
17929 Improve the if situation there to not have negations.
17931 * class.cs (Field.Define): Turns out that we do not need to check
17932 the unsafe bit on field definition, only on usage. Remove the test.
17934 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17936 * driver.cs: use assembly.Location instead of Codebase (the latest
17937 patch made mcs fail when using MS assemblies).
17939 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
17941 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
17942 get the path to *corlib.dll.
17944 2003-01-21 Nick Drochak <ndrochak@gol.com>
17948 * typemanager.cs: Remove compiler warnings
17950 2003-01-20 Duncan Mak <duncan@ximian.com>
17952 * AssemblyInfo.cs: Bump the version number to 0.19.
17954 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17956 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
17958 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
17960 * class.cs (Constructor::Emit): Emit debugging info for constructors.
17962 2003-01-17 Miguel de Icaza <miguel@ximian.com>
17964 * cs-parser.jay: Small fix: we were not comparing the constructor
17965 name correctly. Thanks to Zoltan for the initial pointer.
17967 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
17969 * cs-tokenizer.cs: Set file name when specified with #line
17971 2003-01-15 Miguel de Icaza <miguel@ximian.com>
17973 * cs-parser.jay: Only perform the constructor checks here if we
17974 are named like the class; This will help provider a better
17975 error. The constructor path is taken when a type definition is
17976 not found, but most likely the user forgot to add the type, so
17977 report that rather than the constructor error.
17979 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
17981 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
17984 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
17986 * cs-parser.jay: Add cleanup call.
17988 2003-01-13 Duncan Mak <duncan@ximian.com>
17990 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
17991 consistent with other methods.
17993 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
17995 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
17997 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
17999 * attribute.cs: only set GuidAttr to true when we have a
18002 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18006 * typemanager.cs: fixes to allow mcs compile corlib with the new
18007 Type.IsSubclassOf fix.
18009 2003-01-08 Miguel de Icaza <miguel@ximian.com>
18011 * expression.cs (LocalVariableReference.DoResolve): Classify a
18012 constant as a value, not as a variable. Also, set the type for
18015 * cs-parser.jay (fixed_statement): take a type instead of a
18016 pointer_type, so we can produce a better error message later.
18018 * statement.cs (Fixed.Resolve): Flag types that are not pointers
18021 (For.DoEmit): Make inifinite loops have a
18022 non-conditional branch back.
18024 (Fixed.DoEmit): First populate the pinned variables, then emit the
18025 statement, then clear the variables. Before I was emitting the
18026 code once for each fixed piece.
18029 2003-01-08 Martin Baulig <martin@ximian.com>
18031 * statement.cs (FlowBranching.MergeChild): A break in a
18032 SWITCH_SECTION does not leave a loop. Fixes #36155.
18034 2003-01-08 Martin Baulig <martin@ximian.com>
18036 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
18037 lives in the same number space than `param_map'. Fixes #36154.
18039 2003-01-07 Miguel de Icaza <miguel@ximian.com>
18041 * cs-parser.jay (constructor_declaration): Set the
18042 Constructor.ModFlags before probing for it. This makes the
18043 compiler report 514, 515 and 132 (the code was there, but got
18046 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
18047 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
18048 (GotoCase.Resolve): Set `Returns' to ALWAYS.
18050 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
18052 * enum.cs: create the enum static fields using the enum type.
18054 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
18056 * class.cs: don't try to create the ParamBuilder for the return
18057 type if it's not needed (and handle it breaking for the ms runtime
18060 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
18062 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
18064 2002-12-29 Miguel de Icaza <miguel@ximian.com>
18066 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
18067 the command. This showed up while compiling the JANET source
18068 code, which used \r as its only newline separator.
18070 2002-12-28 Miguel de Icaza <miguel@ximian.com>
18072 * class.cs (Method.Define): If we are an operator (because it
18073 reuses our code), then set the SpecialName and HideBySig. #36128
18075 2002-12-22 Miguel de Icaza <miguel@ximian.com>
18077 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
18078 exception, report error 120 `object reference required'.
18080 * driver.cs: Add --pause option, used during to measure the size
18081 of the process as it goes with --timestamp.
18083 * expression.cs (Invocation.DoResolve): Do not allow methods with
18084 SpecialName to be invoked.
18086 2002-12-21 Miguel de Icaza <miguel@ximian.com>
18088 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
18089 number before adding it.
18091 2002-12-21 Ravi Pratap <ravi@ximian.com>
18093 * ecore.cs (StandardImplicitConversion): When in an unsafe
18094 context, we allow conversion between void * to any other pointer
18095 type. This fixes bug #35973.
18097 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
18099 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
18100 is not thrown when extensionless outputs are used
18102 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18104 * rootcontext.cs: fixed compilation of corlib.
18106 2002-12-19 Miguel de Icaza <miguel@ximian.com>
18108 * attribute.cs (Attributes.Contains): Add new method.
18110 * class.cs (MethodCore.LabelParameters): if the parameter is an
18111 `out' parameter, check that no attribute `[In]' has been passed.
18113 * enum.cs: Handle the `value__' name in an enumeration.
18115 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
18117 * decl.cs: Added special case to allow overrides on "protected
18120 2002-12-18 Ravi Pratap <ravi@ximian.com>
18122 * attribute.cs (Attributes.AddAttributeSection): Rename to this
18123 since it makes much more sense.
18125 (Attributes.ctor): Don't require a Location parameter.
18127 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
18129 * attribute.cs (ApplyAttributes): Remove extra Location parameters
18130 since we already have that information per attribute.
18132 * everywhere : make appropriate changes.
18134 * class.cs (LabelParameters): Write the code which actually
18135 applies attributes to the return type. We can't do this on the MS
18136 .NET runtime so we flag a warning in the case an exception is
18139 2002-12-18 Miguel de Icaza <miguel@ximian.com>
18141 * const.cs: Handle implicit null conversions here too.
18143 2002-12-17 Ravi Pratap <ravi@ximian.com>
18145 * class.cs (MethodCore.LabelParameters): Remove the extra
18146 Type [] parameter since it is completely unnecessary. Instead
18147 pass in the method's attributes so that we can extract
18148 the "return" attribute.
18150 2002-12-17 Miguel de Icaza <miguel@ximian.com>
18152 * cs-parser.jay (parse): Use Report.Error to flag errors instead
18153 of ignoring it and letting the compile continue.
18155 * typemanager.cs (ChangeType): use an extra argument to return an
18156 error condition instead of throwing an exception.
18158 2002-12-15 Miguel de Icaza <miguel@ximian.com>
18160 * expression.cs (Unary.TryReduce): mimic the code for the regular
18161 code path. Perform an implicit cast in the cases where we can
18162 implicitly convert to one of the integral types, and then reduce
18163 based on that constant. This fixes bug #35483.
18165 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18167 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
18169 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18171 * namespace.cs: fixed bug #35489.
18173 2002-12-12 Miguel de Icaza <miguel@ximian.com>
18175 * class.cs: Remove some dead code.
18177 * cs-parser.jay: Estimate the number of methods needed
18178 (RootContext.MethodCount);
18180 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
18181 numbers instead of StringBuilders.
18183 * support.cs (PtrHashtable): Add constructor with initial size;
18184 We can now reduce reallocations of the method table.
18186 2002-12-10 Ravi Pratap <ravi@ximian.com>
18188 * attribute.cs (ApplyAttributes): Keep track of the emitted
18189 attributes on a per-target basis. This fixes bug #35413.
18191 2002-12-10 Miguel de Icaza <miguel@ximian.com>
18193 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
18194 default to the Windows 1252 encoding.
18196 (UnixParseOption): Support version, thanks to Alp for the missing
18199 * AssemblyInfo.cs: Add nice assembly information.
18201 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
18204 * cs-parser.jay: Allow a trailing comma before the close bracked
18205 in the attribute_section production.
18207 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
18208 address of the instance was being taken, I will take this out,
18209 because we take the address of the object immediately here.
18211 2002-12-09 Ravi Pratap <ravi@ximian.com>
18213 * typemanager.cs (AreMultipleAllowed): Take care of the most
18214 obvious case where attribute type is not in the current assembly -
18217 2002-12-08 Miguel de Icaza <miguel@ximian.com>
18219 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
18220 definitions, instead of doing that afterwards.
18222 Also we use a nice little hack, depending on the constructor, we
18223 know if we are a "composed" name or a simple name. Hence, we
18224 avoid the IndexOf test, and we avoid
18226 * codegen.cs: Add code to assist in a bug reporter to track down
18227 the source of a compiler crash.
18229 2002-12-07 Ravi Pratap <ravi@ximian.com>
18231 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
18232 types have been emitted for a given element and flag an error
18233 if something which does not have AllowMultiple set is used more
18236 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
18237 attribute types and their corresponding AllowMultiple properties
18239 (AreMultipleAllowed): Check the property for a given type.
18241 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
18242 property in the case we have a TypeContainer.
18244 (Attributes.AddAttribute): Detect duplicates and just skip on
18245 adding them. This trivial fix catches a pretty gross error in our
18246 attribute emission - global attributes were being emitted twice!
18248 Bugzilla bug #33187 is now fixed.
18250 2002-12-06 Miguel de Icaza <miguel@ximian.com>
18252 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
18253 instead of pp_and).
18255 * expression.cs (Binary.ResolveOperator): I can only use the
18256 Concat (string, string, string) and Concat (string, string,
18257 string, string) if the child is actually a concatenation of
18260 2002-12-04 Miguel de Icaza <miguel@ximian.com>
18262 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
18263 context where we need a 2-character lookahead.
18265 * pending.cs (PendingImplementation): Rework so we can keep track
18266 of interface types all the time, and flag those which were
18267 implemented by parents as optional.
18269 2002-12-03 Miguel de Icaza <miguel@ximian.com>
18271 * expression.cs (Binary.ResolveOperator): Use
18272 String.Concat(string,string,string) or
18273 String.Concat(string,string,string,string) when possible.
18275 * typemanager: More helper methods.
18278 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
18280 * pending.cs: remove the bogus return from GetMissingInterfaces()
18281 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
18283 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18285 * namespace.cs: avoid duplicated 'using xxx' being added to
18286 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
18287 when we get more than one 'using' statement for the same namespace.
18288 Report a CS0105 warning for it.
18290 2002-11-30 Miguel de Icaza <miguel@ximian.com>
18292 * cs-tokenizer.cs (consume_identifier): use read directly, instead
18293 of calling getChar/putback, uses internal knowledge of it.
18295 (xtoken): Reorder tokenizer so most common patterns are checked
18296 first. This reduces the compilation time in another 5% (from 8.11s
18297 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
18299 The parsing time is 22% of the compilation in mcs, and from that
18300 64% is spent on the tokenization process.
18302 I tried using a binary search for keywords, but this is slower
18303 than the hashtable. Another option would be to do a couple of
18306 * Not use a StringBuilder, instead use an array of chars,
18307 with a set value. Notice that this way we could catch
18308 the 645 error without having to do it *afterwards*.
18310 * We could write a hand-parser to avoid the hashtable
18311 compares altogether.
18313 The identifier consumption process takes 37% of the tokenization
18314 time. Another 15% is spent on is_number. 56% of the time spent
18315 on is_number is spent on Int64.Parse:
18317 * We could probably choose based on the string length to
18318 use Int32.Parse or Int64.Parse and avoid all the 64-bit
18321 Another 3% is spend on wrapping `xtoken' in the `token' function.
18323 Handle 0xa0 as whitespace (#34752)
18325 2002-11-26 Miguel de Icaza <miguel@ximian.com>
18327 * typemanager.cs (IsCLRType): New routine to tell whether a type
18328 is one of the builtin types.
18330 Maybe it needs to use TypeCodes to be faster. Maybe we could use
18331 typecode in more places instead of doing pointer comparissions.
18332 We could leverage some knowledge about the way the typecodes are
18335 New code to cache namespaces in assemblies, it is currently not
18336 invoked, to be used soon.
18338 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
18340 * expression.cs (Binary.ResolveOperator): specially handle
18341 strings, and do not perform user-defined operator overloading for
18344 2002-11-24 Miguel de Icaza <miguel@ximian.com>
18346 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
18347 internalcall as it is a pretty simple operation; Avoid whenever
18348 possible to call Char.IsLetter.
18350 (consume_identifier): Cut by half the number of
18351 hashtable calls by merging the is_keyword and GetKeyword behavior.
18353 Do not short-circuit, because if we do, we
18354 report errors (ie, #if false && true would produce an invalid
18358 2002-11-24 Martin Baulig <martin@ximian.com>
18360 * expression.cs (Cast.TryReduce): If we're in checked syntax,
18361 check constant ranges and report a CS0221. Fixes #33186.
18363 2002-11-24 Martin Baulig <martin@ximian.com>
18365 * cs-parser.jay: Make this work for uninitialized variable
18366 declarations in the `for' initializer. Fixes #32416.
18368 2002-11-24 Martin Baulig <martin@ximian.com>
18370 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
18371 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
18373 2002-11-24 Martin Baulig <martin@ximian.com>
18375 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
18376 argument; if true, we also check for user-defined conversions.
18377 This is only needed if both arguments are of a user-defined type.
18378 Fixes #30443, added test-175.cs.
18379 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
18381 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
18383 2002-11-24 Martin Baulig <martin@ximian.com>
18385 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
18386 function to get the store opcode.
18387 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
18388 only emit the Ldelema if the store opcode is Stobj. You must run
18389 both test-34 and test-167 to test this. Fixes #34529.
18391 2002-11-23 Martin Baulig <martin@ximian.com>
18393 * ecore.cs (Expression.MemberLookup): Added additional
18394 `qualifier_type' argument which is used when we're being called
18395 from MemberAccess.DoResolve() and null if we're called from a
18397 (Expression.MemberLookupFailed): New method to report errors; this
18398 does the CS1540 check and reports the correct error message.
18400 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
18401 argument for the CS1540 check and redone the way how we're dealing
18402 with private members. See the comment in the source code for details.
18403 (FilterWithClosure): Reverted this back to revision 1.197; renamed
18404 `closure_start_type' to `closure_qualifier_type' and check whether
18405 it's not null. It was not this filter being broken, it was just
18406 being called with the wrong arguments.
18408 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
18409 and pass it the correct `qualifier_type'; this also does the error
18412 2002-11-22 Miguel de Icaza <miguel@ximian.com>
18414 * expression.cs (Invocation.EmitParams): If the we are dealing
18415 with a non-built-in value type, load its address as well.
18417 (ArrayCreation): Use a a pretty constant instead
18418 of the hardcoded value 2. Use 6 instead of 2 for the number of
18419 static initializers.
18421 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
18422 because they are not really value types, just glorified integers.
18424 * driver.cs: Do not append .exe, the CSC compiler does not do it.
18426 * ecore.cs: Remove redundant code for enumerations, make them use
18427 the same code path as everything else, fixes the casting issue
18428 with enumerations in Windows.Forms.
18430 * attribute.cs: Do only cast to string if it is a string, the
18431 validation happens later.
18433 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
18434 people upgrade their corlibs.
18436 * ecore.cs: Oops, enumerations were not following the entire code path
18438 2002-11-21 Miguel de Icaza <miguel@ximian.com>
18440 * typemanager.cs (FilterWithClosure): Commented out the test for
18441 1540 in typemanager.cs, as it has problems when accessing
18442 protected methods from a parent class (see test-174.cs).
18444 * attribute.cs (Attribute.ValidateGuid): new method.
18445 (Attribute.Resolve): Use above.
18447 2002-11-19 Miguel de Icaza <miguel@ximian.com>
18449 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
18451 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
18452 handling for enumerations, as we only needed the TypeContainer
18453 functionality to begin with (this is required for the fix below to
18454 work for enums that reference constants in a container class for
18457 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
18459 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
18460 a valid TypeBuilder to perform lookups on.o
18462 * class.cs (InheritableMemberSignatureCompare): Use true in the
18463 call to GetGetMethod and GetSetMethod, because we are comparing
18464 the signature, and we need to get the methods *even* if they are
18467 (PropertyBase.CheckBase): ditto.
18469 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
18470 GotoCase.Resolve): Use Peel on EmpytCasts.
18472 * ecore.cs (EmptyCast): drop child, add Peel method.
18474 2002-11-17 Martin Baulig <martin@ximian.com>
18476 * ecore.cs (EmptyCast.Child): New public property.
18478 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
18479 label resolved to an EmptyCast. Fixes #34162.
18480 (GotoCase.Resolve): Likewise.
18481 (Block.EmitMeta): Likewise.
18483 2002-11-17 Martin Baulig <martin@ximian.com>
18485 * expression.cs (Invocation.BetterConversion): Prefer int over
18486 uint; short over ushort; long over ulong for integer literals.
18487 Use ImplicitConversionExists instead of StandardConversionExists
18488 since we also need to check for user-defined implicit conversions.
18489 Fixes #34165. Added test-173.cs.
18491 2002-11-16 Martin Baulig <martin@ximian.com>
18493 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
18494 with the `true' and `false' literals. Fixes #33151.
18496 2002-11-16 Martin Baulig <martin@ximian.com>
18498 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
18499 October 22nd; don't do the cs1540 check for static members.
18501 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
18502 now using our own filter here and doing the cs1540 check again.
18504 2002-11-16 Martin Baulig <martin@ximian.com>
18506 * support.cs (InternalParameters): Don't crash if we don't have
18507 any fixed parameters. Fixes #33532.
18509 2002-11-16 Martin Baulig <martin@ximian.com>
18511 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
18512 when looking up static methods to make this work on Windows.
18515 2002-11-16 Martin Baulig <martin@ximian.com>
18517 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
18518 a setter rather than using PropertyInfo.CanWrite.
18520 2002-11-15 Nick Drochak <ndrochak@gol.com>
18522 * class.cs: Allow acces to block member by subclasses. Fixes build
18525 2002-11-14 Martin Baulig <martin@ximian.com>
18527 * class.cs (Constructor.Emit): Added the extern/block check.
18530 2002-11-14 Martin Baulig <martin@ximian.com>
18532 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
18533 iteration while looking for indexers, this is needed because the
18534 indexer may have a different name in our base classes. Fixed the
18535 error reporting (no indexers at all, not get accessor, no
18536 overloaded match). Fixes bug #33089.
18537 (IndexerAccess.DoResolveLValue): Likewise.
18539 2002-11-14 Martin Baulig <martin@ximian.com>
18541 * class.cs (PropertyBase.CheckBase): Make this work for multiple
18542 indexers. Fixes the first part of bug #33089.
18543 (MethodSignature.InheritableMemberSignatureCompare): Added support
18546 2002-11-13 Ravi Pratap <ravi@ximian.com>
18548 * attribute.cs (Attribute.Resolve): Catch the
18549 NullReferenceException and report it since it isn't supposed to
18552 2002-11-12 Miguel de Icaza <miguel@ximian.com>
18554 * expression.cs (Binary.EmitBranchable): Also handle the cases for
18555 LogicalOr and LogicalAnd that can benefit from recursively
18556 handling EmitBranchable. The code now should be nice for Paolo.
18558 2002-11-08 Miguel de Icaza <miguel@ximian.com>
18560 * typemanager.cs (LookupType): Added a negative-hit hashtable for
18561 the Type lookups, as we perform quite a number of lookups on
18562 non-Types. This can be removed once we can deterministically tell
18563 whether we have a type or a namespace in advance.
18565 But this might require special hacks from our corlib.
18569 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
18570 and double which avoids a conversion from an integer to a double.
18572 * expression.cs: tiny optimization, avoid calling IsConstant,
18573 because it effectively performs the lookup twice.
18575 2002-11-06 Miguel de Icaza <miguel@ximian.com>
18577 But a bogus return here to keep the semantics of the old code
18578 until the Mono runtime is fixed.
18580 * pending.cs (GetMissingInterfaces): New method used to remove all
18581 the interfaces that are already implemented by our parent
18582 classes from the list of pending methods.
18584 * interface.cs: Add checks for calls after ResolveTypeExpr.
18586 2002-11-05 Miguel de Icaza <miguel@ximian.com>
18588 * class.cs (Class.Emit): Report warning 67: event not used if the
18589 warning level is beyond 3.
18591 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
18592 being a NullLiteral.
18594 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
18597 * class.cs (TypeContainer.GetClassBases): Cover a missing code
18598 path that might fail if a type can not be resolved.
18600 * expression.cs (Binary.Emit): Emit unsigned versions of the
18603 * driver.cs: use error 5.
18605 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
18607 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
18609 2002-11-01 Miguel de Icaza <miguel@ximian.com>
18611 * cs-parser.jay (switch_section): A beautiful patch from Martin
18612 Baulig that fixed 33094.
18614 2002-10-31 Miguel de Icaza <miguel@ximian.com>
18616 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
18617 Check whether the base is abstract and report an error if so.
18619 * expression.cs (IndexerAccess.DoResolveLValue,
18620 IndexerAccess.DoResolve): ditto.
18622 (Invocation.DoResolve): ditto.
18624 (Invocation.FullMethodDesc): Improve the report string.
18626 * statement.cs (Block): Eliminate IsVariableDefined as it is
18627 basically just a wrapper for GetVariableInfo.
18629 * ecore.cs (SimpleName): Use new
18631 * support.cs (ReflectionParamter.ParameterType): We unwrap the
18632 type, as we return the actual parameter ref/unref state on a
18635 2002-10-30 Miguel de Icaza <miguel@ximian.com>
18637 * support.cs: Return proper flags REF/OUT fixing the previous
18640 * expression.cs: Reverted last patch, that was wrong. Is_ref is
18641 not used to mean `ref' but `ref or out' in ParameterReference
18643 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
18644 full type signature instead of calling TypeManger.CSharpName
18647 * support.cs (InternalParameters.ParameterDesc): Do not compare
18648 directly to the modflags, because REF/OUT will actually be bitsets
18651 * delegate.cs (VerifyMethod): Check also the modifiers.
18653 * cs-tokenizer.cs: Fix bug where floating point values with an
18654 exponent where a sign was missing was ignored.
18656 * driver.cs: Allow multiple assemblies to be specified in a single
18659 2002-10-28 Miguel de Icaza <miguel@ximian.com>
18661 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
18662 because identifiers after a parenthesis would end up in this kind
18663 of production, and we needed to desamiguate it for having casts
18666 (UserDefinedType *) xxx
18668 2002-10-24 Miguel de Icaza <miguel@ximian.com>
18670 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
18671 we should set on the Bindingflags.NonPublic, but not turn on
18672 private_ok. private_ok controls whether a Private member is
18673 returned (this is chekced on the filter routine), while the
18674 BindingFlags.NonPublic just controls whether private/protected
18675 will be allowed. This fixes the problem part of the problem of
18676 private properties being allowed to be used in derived classes.
18678 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
18679 so we can call the children DoResolveLValue method (this will
18680 properly signal errors on lvalue assignments to base properties)
18682 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
18683 getter are null, and we have a property info, we know that this
18684 happened because the lookup failed, so we report an error 122 for
18685 protection level violation.
18687 We also silently return if setter and getter are null in the
18688 resolve functions, this condition only happens if we have flagged
18689 the error before. This is the other half of the problem.
18691 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
18692 not have accessibility information, that is why we were returning
18693 true in the filter function in typemanager.cs.
18695 To properly report 122 (property is inaccessible because of its
18696 protection level) correctly, we report this error in ResolveAccess
18697 by failing if both the setter and the getter are lacking (ie, the
18700 DoResolve and DoLResolve have been modified to check for both
18701 setter/getter being null and returning silently, the reason being
18702 that I did not want to put the knowledge about this error in upper
18705 int old = Report.Errors;
18706 x = new PropertyExpr (...);
18707 if (old != Report.Errors)
18712 So the property expr is returned, but it is invalid, so the error
18713 will be flagged during the resolve process.
18715 * class.cs: Remove InheritablePropertySignatureCompare from the
18716 class, as we no longer depend on the property signature to compute
18717 whether it is possible to implement a method or not.
18719 The reason is that calling PropertyInfo.GetGetMethod will return
18720 null (in .NET, in Mono it works, and we should change this), in
18721 cases where the Get Method does not exist in that particular
18726 class X { public virtual int A { get { return 1; } } }
18728 class Z : Y { public override int A { get { return 2; } } }
18730 Would fail in Z because the parent (Y) would not have the property
18731 defined. So we avoid this completely now (because the alternative
18732 fix was ugly and slow), and we now depend exclusively on the
18735 (PropertyBase.CheckBase): Use a method-base mechanism to find our
18736 reference method, instead of using the property.
18738 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
18739 routines are gone now.
18741 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
18742 names, they were incorrectly named.
18744 * cs-tokenizer.cs: Return are more gentle token on failure.
18746 * pending.cs (PendingImplementation.InterfaceMethod): This routine
18747 had an out-of-sync index variable, which caused it to remove from
18748 the list of pending methods the wrong method sometimes.
18750 2002-10-22 Miguel de Icaza <miguel@ximian.com>
18752 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
18753 CanWrite, because those refer to this particular instance of the
18754 property, and do not take into account the fact that we can
18755 override single members of a property.
18757 Constructor requires an EmitContext. The resolution process does
18758 not happen here, but we need to compute the accessors before,
18759 because the resolution does not always happen for properties.
18761 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
18762 subclass, before we did not update this flag, but we did update
18765 (GetAccessors): Drop this routine, as it did not work in the
18766 presence of partially overwritten set/get methods.
18768 Notice that this broke the cs1540 detection, but that will require
18771 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18775 * driver.cs: issue a warning instead of an error if we don't support
18776 debugging for the platform. Also ignore a couple of errors that may
18777 arise when trying to write the symbols. Undo my previous patch.
18779 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18781 * driver.cs: ignore /debug switch except for Unix platforms.
18783 2002-10-23 Nick Drochak <ndrochak@gol.com>
18785 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
18787 2002-10-21 Miguel de Icaza <miguel@ximian.com>
18789 * driver.cs: Do not make mcs-debug conditional, so we do not break
18790 builds that use it.
18792 * statement.cs (UsageVector.MergeChildren): I would like Martin to
18793 review this patch. But basically after all the children variables
18794 have been merged, the value of "Breaks" was not being set to
18795 new_breaks for Switch blocks. I think that it should be set after
18796 it has executed. Currently I set this to the value of new_breaks,
18797 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
18798 conservative, but I do not understand this code very well.
18800 I did not break anything in the build, so that is good ;-)
18802 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
18804 2002-10-20 Mark Crichton <crichton@gimp.org>
18806 * cfold.cs: Fixed compile blocker. Really fixed it this time.
18808 2002-10-20 Nick Drochak <ndrochak@gol.com>
18810 * cfold.cs: Fixed compile blocker.
18812 2002-10-20 Miguel de Icaza <miguel@ximian.com>
18814 * driver.cs: I was chekcing the key, not the file.
18816 2002-10-19 Ravi Pratap <ravi@ximian.com>
18818 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
18819 message that we were generating - we just need to silently return
18822 2002-10-19 Miguel de Icaza <miguel@ximian.com>
18824 * class.cs (Event.Define): Change my previous commit, as this
18825 breaks the debugger. This is a temporary hack, as it seems like
18826 the compiler is generating events incorrectly to begin with.
18828 * expression.cs (Binary.ResolveOperator): Added support for
18829 "U operator - (E x, E y)"
18831 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
18834 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
18835 init-only variables, but this path did not take into account that
18836 there might be also instance readonly variables. Correct this
18839 This fixes bug 32253
18841 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
18844 * driver.cs: Change the extension for modules to `netmodule'
18846 * cs-parser.jay: Improved slightly the location tracking for
18847 the debugger symbols.
18849 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
18850 modifiers that were specified instead of the hardcoded value
18851 (FamAndAssem). This was basically ignoring the static modifier,
18852 and others. Fixes 32429.
18854 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
18855 fixed a bug in the process (32476)
18857 * expression.cs (ArrayAccess.EmitAssign): Patch from
18858 hwang_rob@yahoo.ca that fixes bug 31834.3
18860 2002-10-18 Miguel de Icaza <miguel@ximian.com>
18862 * driver.cs: Make the module extension .netmodule.
18864 2002-10-16 Miguel de Icaza <miguel@ximian.com>
18866 * driver.cs: Report an error if the resource file is not found
18867 instead of crashing.
18869 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
18870 false, like Emit does.
18872 2002-10-16 Nick Drochak <ndrochak@gol.com>
18874 * typemanager.cs: Remove unused private member. Also reported mcs
18875 bug to report this as a warning like csc.
18877 2002-10-15 Martin Baulig <martin@gnome.org>
18879 * statement.cs (Statement.Emit): Made this a virtual method; emits
18880 the line number info and calls DoEmit().
18881 (Statement.DoEmit): New protected abstract method, formerly knows
18882 as Statement.Emit().
18884 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
18886 2002-10-11 Miguel de Icaza <miguel@ximian.com>
18888 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
18889 have fixed a remaining problem: not every AddXXXX was adding a
18890 fully qualified name.
18892 Now everyone registers a fully qualified name in the DeclSpace as
18893 being defined instead of the partial name.
18895 Downsides: we are slower than we need to be due to the excess
18896 copies and the names being registered this way.
18898 The reason for this is that we currently depend (on the corlib
18899 bootstrap for instance) that types are fully qualified, because
18900 we dump all the types in the namespace, and we should really have
18901 types inserted into the proper namespace, so we can only store the
18902 basenames in the defined_names array.
18904 2002-10-10 Martin Baulig <martin@gnome.org>
18906 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
18907 from bug #31834, see the bug report for a testcase which is
18910 2002-10-10 Martin Baulig <martin@gnome.org>
18912 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
18913 flow analysis code for this.
18915 * statement.cs (Do, While, For): Tell the flow analysis code about
18917 (FlowBranching.UsageVector): Added support for infinite loops.
18918 (Block.Resolve): Moved the dead code elimination here and use flow
18921 2002-10-09 Miguel de Icaza <miguel@ximian.com>
18923 * class.cs (Field.Define): Catch cycles on struct type
18926 * typemanager.cs (IsUnmanagedtype): Do not recursively check
18927 fields if the fields are static. We only need to check instance
18930 * expression.cs (As.DoResolve): Test for reference type.
18932 * statement.cs (Using.ResolveExpression): Use
18933 ConvertImplicitRequired, not ConvertImplicit which reports an
18935 (Using.ResolveLocalVariableDecls): ditto.
18937 * expression.cs (Binary.ResolveOperator): Report errors in a few
18938 places where we had to.
18940 * typemanager.cs (IsUnmanagedtype): Finish implementation.
18942 2002-10-08 Miguel de Icaza <miguel@ximian.com>
18944 * expression.cs: Use StoreFromPtr instead of extracting the type
18945 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
18947 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
18948 an enumeration value to a System.Enum, but System.Enum is not a
18949 value type, but an class type, so we need to box.
18951 (Expression.ConvertExplicit): One codepath could return
18952 errors but not flag them. Fix this. Fixes #31853
18954 * parameter.cs (Resolve): Do not allow void as a parameter type.
18956 2002-10-06 Martin Baulig <martin@gnome.org>
18958 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
18959 if it's a class type and not a struct. Fixes #31815.
18961 2002-10-06 Martin Baulig <martin@gnome.org>
18963 * statement.cs: Reworked the flow analysis code a bit to make it
18964 usable for dead code elimination.
18966 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18968 * cs-parser.jay: allow empty source files. Fixes bug #31781.
18970 2002-10-04 Miguel de Icaza <miguel@ximian.com>
18972 * expression.cs (ComposedCast.DoResolveType): A quick workaround
18973 to fix the test 165, will investigate deeper.
18975 2002-10-04 Martin Baulig <martin@gnome.org>
18977 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
18978 finally blocks actually work.
18979 (Try.Resolve): We don't need to create a sibling for `finally' if
18980 there is no finally block.
18982 2002-10-04 Martin Baulig <martin@gnome.org>
18984 * class.cs (Constructor.Define): The default accessibility for a
18985 non-default constructor is private, not public.
18987 2002-10-04 Miguel de Icaza <miguel@ximian.com>
18989 * class.cs (Constructor): Make AllowedModifiers public, add
18992 * cs-parser.jay: Perform the modifiers test here, as the
18993 constructor for the Constructor class usually receives a zero
18994 because of the way we create it (first we create, later we
18995 customize, and we were never checking the modifiers).
18997 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
18998 is a version of LookupTypeReflection that includes the type-name
18999 cache. This can be used as a fast path for functions that know
19000 the fully qualified name and are only calling into *.GetType() to
19001 obtain a composed type.
19003 This is also used by TypeManager.LookupType during its type
19006 (LookupType): We now also track the real type name, as sometimes
19007 we can get a quey for the real type name from things like
19008 ComposedCast. This fixes bug 31422.
19010 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
19011 complete type fullname, it does not have to go through the type
19012 resolution system to obtain the composed version of the type (for
19013 obtaining arrays or pointers).
19015 (Conditional.Emit): Use the EmitBoolExpression to
19016 generate nicer code, as requested by Paolo.
19018 (ArrayCreation.CheckIndices): Use the patch from
19019 hwang_rob@yahoo.ca to validate the array initializers.
19021 2002-10-03 Miguel de Icaza <miguel@ximian.com>
19023 * class.cs (ConstructorInitializer.Emit): simplify code by using
19024 Invocation.EmitCall, and at the same time, fix the bugs in calling
19025 parent constructors that took variable arguments.
19027 * ecore.cs (Expression.ConvertNumericExplicit,
19028 Expression.ImplicitNumericConversion): Remove the code that
19029 manually wrapped decimal (InternalTypeConstructor call is now gone
19032 * expression.cs (Cast.TryReduce): Also handle decimal types when
19033 trying to perform a constant fold on the type.
19035 * typemanager.cs (IsUnmanagedtype): Partially implemented.
19037 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
19038 that only turned off an error report, and did nothing else.
19040 2002-10-02 Miguel de Icaza <miguel@ximian.com>
19042 * driver.cs: Handle and ignore /fullpaths
19044 2002-10-01 Miguel de Icaza <miguel@ximian.com>
19046 * expression.cs (Binary.ResolveOperator): Catch the case where
19047 DoNumericPromotions returns true,
19049 (Binary.DoNumericPromotions): Simplify the code, and the tests.
19051 2002-09-27 Miguel de Icaza <miguel@ximian.com>
19053 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
19056 2002-09-26 Miguel de Icaza <miguel@ximian.com>
19058 * ecore.cs (ConvertNumericExplicit): It is not enough that the
19059 conversion exists, but it is also required that the conversion be
19060 performed. This manifested in "(Type64Enum) 2".
19062 * class.cs (TypeManager.AddMethod): The fix is not to change
19063 AddEnum, because that one was using a fully qualified name (every
19064 DeclSpace derivative does), but to change the AddMethod routine
19065 that was using an un-namespaced name. This now correctly reports
19066 the duplicated name.
19068 Revert patch until I can properly fix it. The issue
19069 is that we have a shared Type space across all namespaces
19070 currently, which is wrong.
19072 Options include making the Namespace a DeclSpace, and merge
19073 current_namespace/current_container in the parser.
19075 2002-09-25 Miguel de Icaza <miguel@ximian.com>
19077 * cs-parser.jay: Improve error reporting when we get a different
19078 kind of expression in local_variable_type and
19079 local_variable_pointer_type.
19081 Propagate this to avoid missleading errors being reported.
19083 * ecore.cs (ImplicitReferenceConversion): treat
19084 TypeManager.value_type as a target just like object_type. As
19089 Is valid, and needs to result in the int 1 being boxed before it
19090 is assigned to the value type v.
19092 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
19093 to validate the enumeration name.
19095 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
19096 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
19097 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
19099 * ecore.cs (TryImplicitIntConversion): When doing an
19100 implicit-enumeration-conversion, check if the type is 64-bits and
19101 perform a conversion before passing to EnumConstant.
19103 2002-09-23 Miguel de Icaza <miguel@ximian.com>
19105 * decl.cs (Error_AmbiguousTypeReference); New routine used to
19106 report ambiguous type references. Unlike the MS version, we
19107 report what the ambiguity is. Innovation at work ;-)
19109 (DeclSpace.FindType): Require a location argument to
19110 display when we display an ambiguous error.
19112 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
19114 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
19116 * expression.cs (EmitDynamicInitializers): Apply patch from
19117 hwang_rob@yahoo.ca that fixes the order in which we emit our
19120 2002-09-21 Martin Baulig <martin@gnome.org>
19122 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
19123 delegate takes no arguments.
19125 2002-09-20 Miguel de Icaza <miguel@ximian.com>
19127 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
19130 * expression.cs: Extract the underlying type.
19132 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
19134 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
19136 2002-09-19 Miguel de Icaza <miguel@ximian.com>
19138 * class.cs (TypeContainer.DefineType): We can not use the nice
19139 PackingSize with the size set to 1 DefineType method, because it
19140 will not allow us to define the interfaces that the struct
19143 This completes the fixing of bug 27287
19145 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
19146 means also structs. This fixes part of the problem.
19147 (Expresion.ImplicitReferenceConversionExists): ditto.
19149 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
19150 error if there were no errors reported during the type lookup
19151 process, to avoid duplicates or redundant errors. Without this
19152 you would get an ambiguous errors plus a type not found. We have
19153 beaten the user enough with the first error.
19155 (DeclSparce.FindType): Emit a warning if we have an ambiguous
19158 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
19159 during the resolution process, stop the lookup, this avoids
19160 repeated error reports (same error twice).
19162 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
19164 * typemanager.cs (LookupType): Redo the type lookup code to match
19165 the needs of System.Reflection.
19167 The issue is that System.Reflection requires references to nested
19168 types to begin with a "+" sign instead of a dot. So toplevel
19169 types look like: "NameSpace.TopLevelClass", and nested ones look
19170 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
19173 2002-09-19 Martin Baulig <martin@gnome.org>
19175 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
19176 says that a method always returns or always throws an exception,
19177 don't report the CS0161.
19179 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
19180 set `Returns = new_returns'.
19182 2002-09-19 Martin Baulig <martin@gnome.org>
19184 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
19185 to an enum constant, check for a CS0176.
19187 2002-09-18 Miguel de Icaza <miguel@ximian.com>
19189 * class.cs (TypeContainer.CheckPairedOperators): Now we check
19190 for operators that must be in pairs and report errors.
19192 * ecore.cs (SimpleName.DoResolveType): During the initial type
19193 resolution process, when we define types recursively, we must
19194 check first for types in our current scope before we perform
19195 lookups in the enclosing scopes.
19197 * expression.cs (MakeByteBlob): Handle Decimal blobs.
19199 (Invocation.VerifyArgumentsCompat): Call
19200 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
19201 I thought we were supposed to always call this, but there are a
19202 few places in the code where we dont do it.
19204 2002-09-17 Miguel de Icaza <miguel@ximian.com>
19206 * driver.cs: Add support in -linkres and -resource to specify the
19207 name of the identifier.
19209 2002-09-16 Miguel de Icaza <miguel@ximian.com>
19211 * ecore.cs (StandardConversionExists): Sync with the conversion
19212 code: allow anything-* to void* conversions.
19214 (FindMostSpecificSource): Use an Expression argument
19215 instead of a Type, because we might be handed over a Literal which
19216 gets a few more implicit conversions that plain types do not. So
19217 this information was being lost.
19219 Also, we drop the temporary type-holder expression when not
19222 2002-09-17 Martin Baulig <martin@gnome.org>
19224 * class.cs (PropertyBase.CheckBase): Don't check the base class if
19225 this is an explicit interface implementation.
19227 2002-09-17 Martin Baulig <martin@gnome.org>
19229 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
19230 different `IndexerName' attributes.
19232 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
19233 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
19234 virtual CommonResolve().
19236 2002-09-16 Miguel de Icaza <miguel@ximian.com>
19238 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
19239 and convert that to the UnderlyingType.
19241 * statement.cs (Foreach.Resolve): Indexers are just like variables
19242 or PropertyAccesses.
19244 * cs-tokenizer.cs (consume_string): Track line numbers and columns
19245 inside quoted strings, we were not doing this before.
19247 2002-09-16 Martin Baulig <martin@gnome.org>
19249 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
19250 resolve it. This is needed for the definite assignment check of the
19251 instance expression, fixes bug #29846.
19252 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
19254 2002-09-16 Nick Drochak <ndrochak@gol.com>
19256 * parameter.cs: Fix compile error. Cannot reference static member
19257 from an instance object. Is this an mcs bug?
19259 2002-09-14 Martin Baulig <martin@gnome.org>
19261 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
19262 multiple times. Fixes bug #30295, added test-166.cs.
19264 2002-09-14 Martin Baulig <martin@gnome.org>
19266 * statement.cs (Block.Emit): Don't emit unreachable code.
19267 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
19268 `break' statements.
19269 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
19271 2002-09-14 Martin Baulig <martin@gnome.org>
19273 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
19276 2002-09-14 Martin Baulig <martin@gnome.org>
19278 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
19279 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
19280 be false on the ms runtime.
19282 2002-09-13 Martin Baulig <martin@gnome.org>
19284 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
19285 the CS0038 error message.
19287 2002-09-12 Miguel de Icaza <miguel@ximian.com>
19289 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
19290 constant inside, return it.
19292 2002-09-12 Martin Baulig <martin@gnome.org>
19294 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
19295 implicit conversion can be done between enum types.
19297 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
19298 check whether an implicit conversion to the current enum's UnderlyingType
19299 exists and report an error if not.
19301 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
19302 without debugging support.
19304 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
19305 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
19307 2002-09-12 Martin Baulig <martin@gnome.org>
19309 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
19311 * ecore.cs (IMemberExpr.DeclaringType): New property.
19312 (SimpleName.SimpleNameResolve): Check whether we're accessing a
19313 nonstatic member of an outer type (CS0038).
19315 2002-09-11 Miguel de Icaza <miguel@ximian.com>
19317 * driver.cs: Activate the using-error detector at warning level
19318 4 (at least for MS-compatible APIs).
19320 * namespace.cs (VerifyUsing): Small buglett fix.
19322 * pending.cs (PendingImplementation): pass the container pointer.
19324 * interface.cs (GetMethods): Allow for recursive definition. Long
19325 term, I would like to move every type to support recursive
19326 definitions, not the current ordering mechanism that we have right
19329 The situation is this: Attributes are handled before interfaces,
19330 so we can apply attributes to interfaces. But some attributes
19331 implement interfaces, we will now handle the simple cases
19332 (recursive definitions will just get an error).
19334 * parameter.cs: Only invalidate types at the end if we fail to
19337 2002-09-09 Martin Baulig <martin@gnome.org>
19339 * ecore.cs (PropertyExpr.Emit): Also check for
19340 TypeManager.system_int_array_get_length so this'll also work when
19341 compiling corlib. Fixes #30003.
19343 2002-09-09 Martin Baulig <martin@gnome.org>
19345 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
19346 and throw an exception if we can't get the type's size. Fixed #30040,
19349 2002-09-09 Martin Baulig <martin@gnome.org>
19351 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
19353 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
19354 context. Fixes bug #30027.
19356 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
19357 virtual functions. Fixes bug #30043, added test-164.cs.
19359 2002-09-08 Ravi Pratap <ravi@ximian.com>
19361 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
19363 2002-09-08 Nick Drochak <ndrochak@gol.com>
19365 * driver.cs: Use an object to get the windows codepage since it's not a
19368 2002-09-08 Miguel de Icaza <miguel@ximian.com>
19370 * statement.cs (For.Emit): for infinite loops (test == null)
19371 return whether there is a break inside, not always "true".
19373 * namespace.cs (UsingEntry): New struct to hold the name of the
19374 using definition, the location where it is defined, and whether it
19375 has been used in a successful type lookup.
19377 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
19382 2002-09-06 Ravi Pratap <ravi@ximian.com>
19384 * attribute.cs : Fix incorrect code which relied on catching
19385 a NullReferenceException to detect a null being passed in
19386 where an object was expected.
19388 2002-09-06 Miguel de Icaza <miguel@ximian.com>
19390 * statement.cs (Try): flag the catch variable as assigned
19392 * expression.cs (Cast): Simplified by using ResolveType instead of
19393 manually resolving.
19395 * statement.cs (Catch): Fix bug by using ResolveType.
19397 2002-09-06 Ravi Pratap <ravi@ximian.com>
19399 * expression.cs (BetterConversion): Special case for when we have
19400 a NullLiteral as the argument and we have to choose between string
19401 and object types - we choose string the way csc does.
19403 * attribute.cs (Attribute.Resolve): Catch the
19404 NullReferenceException and report error #182 since the Mono
19405 runtime no more has the bug and having this exception raised means
19406 we tried to select a constructor which takes an object and is
19409 2002-09-05 Ravi Pratap <ravi@ximian.com>
19411 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
19412 message (1502, 1503) when we can't locate a method after overload
19413 resolution. This is much more informative and closes the bug
19416 * interface.cs (PopulateMethod): Return if there are no argument
19417 types. Fixes a NullReferenceException bug.
19419 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
19420 expressions too. Previously we were checking only in one place for
19421 positional arguments leaving out named arguments.
19423 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
19424 type to the enum type is not allowed. Remove code corresponding to
19427 (ConvertNumericExplicit): Allow explicit conversions from
19428 the underlying type to enum type. This precisely follows the spec
19429 and closes a bug filed by Gonzalo.
19431 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19434 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
19436 2002-09-03 Miguel de Icaza <miguel@ximian.com>
19438 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
19439 it was important that we stored the right value after the
19440 reduction in `converted'.
19442 2002-09-04 Martin Baulig <martin@gnome.org>
19444 * location.cs (Location.SymbolDocument): Use full pathnames for the
19447 2002-08-30 Miguel de Icaza <miguel@ximian.com>
19449 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
19450 of the expression resolve mechanism, because that will catch the
19451 SimpleName error failures.
19453 (Conditional): If we can not resolve the
19454 expression, return, do not crash.
19456 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19459 (location): display token name instead of its number.
19461 2002-08-28 Martin Baulig <martin@gnome.org>
19463 * expression.cs (Binary.ResolveOperator): Don't silently return
19464 but return an error if an operator cannot be applied between two
19467 2002-08-28 Martin Baulig <martin@gnome.org>
19469 * class.cs (Constructor.Define): Set the permission attributes
19470 correctly instead of making all constructors public.
19472 2002-08-28 Martin Baulig <martin@gnome.org>
19474 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
19475 for private members before reporting a CS0103; if we find anything,
19478 2002-08-28 Martin Baulig <martin@gnome.org>
19480 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
19481 to check whether `closure_start_type == closure_invocation_type',
19482 we also need to check whether `m.DeclaringType == closure_invocation_type'
19483 before bypassing the permission checks. We might be accessing
19484 protected/private members from the base class.
19485 (TypeManager.RealMemberLookup): Only set private_ok if private
19486 members were requested via BindingFlags.NonPublic.
19488 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
19490 * expression.cs (MemberAccess.ResolveMemberAccess): Set
19491 MethodGroupExpr.IsExplicitImpl if appropriate.
19492 (Invocation.DoResolve): Don't report the CS0120 for explicit
19493 interface implementations.
19495 2002-08-27 Martin Baulig <martin@gnome.org>
19497 * expression.cs (Invocation.DoResolve): If this is a static
19498 method and we don't have an InstanceExpression, we must report
19501 2002-08-25 Martin Baulig <martin@gnome.org>
19503 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
19504 `==' between a valuetype and an object.
19506 2002-08-25 Miguel de Icaza <miguel@ximian.com>
19508 * ecore.cs (TypeExpr): Provide a ToString method.
19510 2002-08-24 Martin Baulig <martin@gnome.org>
19512 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
19513 now called proggie.dbg and it's a binary file.
19515 2002-08-23 Martin Baulig <martin@gnome.org>
19517 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
19519 2002-08-23 Martin Baulig <martin@gnome.org>
19521 * struct.cs (MyStructInfo.ctor): Make this work with empty
19522 structs; it's not allowed to use foreach() on null.
19524 2002-08-23 Martin Baulig <martin@gnome.org>
19526 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
19527 writer the full pathname of the generated assembly.
19529 2002-08-23 Martin Baulig <martin@gnome.org>
19531 * statements.cs (FlowBranching.UsageVector.MergeChildren):
19532 A `finally' block never returns or breaks; improved handling of
19535 2002-08-23 Martin Baulig <martin@gnome.org>
19537 * statement.cs (Throw.Resolve): Allow `throw null'.
19539 2002-08-23 Martin Baulig <martin@gnome.org>
19541 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
19542 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
19543 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
19544 MemberLookup would return a wrong event if this is an explicit
19545 interface implementation and the class has an event with the same
19548 2002-08-23 Martin Baulig <martin@gnome.org>
19550 * statement.cs (Block.AddChildVariableNames): New public method.
19551 (Block.AddChildVariableName): Likewise.
19552 (Block.IsVariableNameUsedInChildBlock): Likewise.
19553 (Block.AddVariable): Check whether a variable name has already
19554 been used in a child block.
19556 * cs-parser.jay (declare_local_variables): Mark all variable names
19557 from the current block as being used in a child block in the
19560 2002-08-23 Martin Baulig <martin@gnome.org>
19562 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
19563 find the symbol writer.
19565 * driver.cs: csc also allows the arguments to /define being
19566 separated by commas, not only by semicolons.
19568 2002-08-23 Martin Baulig <martin@gnome.org>
19570 * interface.cs (Interface.GetMembers): Added static check for events.
19572 2002-08-15 Martin Baulig <martin@gnome.org>
19574 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
19575 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
19577 * ecore.cs (Expression.MemberLookup): Added documentation and explained
19578 why the MethodData.EmitDestructor() change was necessary.
19580 2002-08-20 Martin Baulig <martin@gnome.org>
19582 * class.cs (TypeContainer.FindMembers): Added static check for events.
19584 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
19586 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
19587 use Type.GetEvents(), not Type.FindMembers().
19589 2002-08-20 Martin Baulig <martin@gnome.org>
19591 * decl.cs (MemberCache): Added a special method cache which will
19592 be used for method-only searched. This ensures that a method
19593 search will return a MethodInfo with the correct ReflectedType for
19596 2002-08-20 Martin Baulig <martin@gnome.org>
19598 * decl.cs (DeclSpace.FindMembers): Made this public.
19600 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19602 * delegate.cs: fixed build on windows.
19603 [FIXME: Filed as bug #29150: MCS must report these errors.]
19605 2002-08-19 Ravi Pratap <ravi@ximian.com>
19607 * ecore.cs (StandardConversionExists): Return a false
19608 if we are trying to convert the void type to anything else
19609 since that is not allowed.
19611 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
19612 we flag error 70 in the event an event is trying to be accessed
19613 directly from outside the declaring type.
19615 2002-08-20 Martin Baulig <martin@gnome.org>
19617 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
19618 MemberCache from typemanager.cs to decl.cs.
19620 2002-08-19 Martin Baulig <martin@gnome.org>
19622 * class.cs (TypeContainer): Implement IMemberContainer.
19623 (TypeContainer.DefineMembers): Create the MemberCache.
19624 (TypeContainer.FindMembers): Do better BindingFlags checking; only
19625 return public members if BindingFlags.Public was given, check
19626 whether members are static.
19628 2002-08-16 Martin Baulig <martin@gnome.org>
19630 * decl.cs (DeclSpace.Define): Splitted this in Define and
19631 DefineMembers. DefineMembers is called first and initializes the
19634 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
19635 DefineMembers() on all our DeclSpaces.
19637 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
19638 but call DefineMembers() on all nested interfaces. We call their
19639 Define() in our new Define() function.
19641 * interface.cs (Interface): Implement IMemberContainer.
19642 (Interface.Define): Moved all code except the attribute stuf to
19644 (Interface.DefineMembers): Initialize the member cache.
19646 * typemanager.cs (IMemberFinder): Removed this interface, we don't
19647 need this anymore since we can use MemberCache.FindMembers directly.
19649 2002-08-19 Martin Baulig <martin@gnome.org>
19651 * typemanager.cs (MemberCache): When creating the cache for an
19652 interface type, add all inherited members.
19653 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
19654 to `out bool used_cache' and documented it.
19655 (TypeManager.MemberLookup): If we already used the cache in the first
19656 iteration, we don't need to do the interfaces check.
19658 2002-08-19 Martin Baulig <martin@gnome.org>
19660 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
19661 here from IMemberFinder and don't implement this interface anymore.
19662 (DeclSpace.MemberCache): Moved here from IMemberFinder.
19664 * typemanager.cs (IMemberFinder): This interface is now only used by
19665 classes which actually support the member cache.
19666 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
19667 since we only put DeclSpaces into this Hashtable.
19668 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
19669 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
19671 2002-08-16 Martin Baulig <martin@gnome.org>
19673 * typemanager.cs (ICachingMemberFinder): Removed.
19674 (IMemberFinder.MemberCache): New property.
19675 (TypeManager.FindMembers): Merged this with RealFindMembers().
19676 This function will never be called from TypeManager.MemberLookup()
19677 so we can't use the cache here, just the IMemberFinder.
19678 (TypeManager.MemberLookup_FindMembers): Check whether the
19679 IMemberFinder has a MemberCache and call the cache's FindMembers
19681 (MemberCache): Rewrote larger parts of this yet another time and
19682 cleaned it up a bit.
19684 2002-08-15 Miguel de Icaza <miguel@ximian.com>
19686 * driver.cs (LoadArgs): Support quoting.
19688 (Usage): Show the CSC-like command line arguments.
19690 Improved a few error messages.
19692 2002-08-15 Martin Baulig <martin@gnome.org>
19694 * typemanager.cs (IMemberContainer.Type): New property.
19695 (IMemberContainer.IsInterface): New property.
19697 The following changes are conditional to BROKEN_RUNTIME, which is
19698 defined at the top of the file.
19700 * typemanager.cs (MemberCache.MemberCache): Don't add the base
19701 class'es members, but add all members from TypeHandle.ObjectType
19702 if we're an interface.
19703 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
19704 is the current type.
19705 (MemberCache.CacheEntry.Container): Removed this field.
19706 (TypeHandle.GetMembers): Include inherited members.
19708 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19710 * typemanager.cs: fixed compilation and added a comment on a field that
19713 2002-08-15 Martin Baulig <martin@gnome.org>
19715 * class.cs (ConstructorInitializer.Resolve): In the
19716 Expression.MemberLookup call, use the queried_type as
19719 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
19720 declared' attribute, it's always true.
19721 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
19722 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
19723 temporary wrapper for FindMembers which tells MemberLookup whether
19724 members from the base classes are included in the return value.
19725 This will go away soon.
19726 (TypeManager.MemberLookup): Use this temporary hack here; once the
19727 new MemberCache is completed, we don't need to do the DeclaredOnly
19728 looping here anymore since the MemberCache will take care of this.
19729 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
19730 (MemberCache): When creating the MemberCache for a class, get
19731 members from the current class and all its base classes.
19732 (MemberCache.CacheEntry.Container): New field. This is a
19733 temporary hack until the Mono runtime is fixed to distinguish
19734 between ReflectedType and DeclaringType. It allows us to use MCS
19735 with both the MS runtime and the unfixed Mono runtime without
19736 problems and without accecting performance.
19737 (MemberCache.SearchMembers): The DeclaredOnly looping from
19738 TypeManager.MemberLookup is now done here.
19740 2002-08-14 Martin Baulig <martin@gnome.org>
19742 * statement.cs (MyStructInfo.MyStructInfo): Don't call
19743 Type.GetFields on dynamic types but get the fields from the
19744 corresponding TypeContainer.
19745 (MyStructInfo.GetStructInfo): Added check for enum types.
19747 * typemanager.cs (MemberList.IsSynchronized): Implemented.
19748 (MemberList.SyncRoot): Implemented.
19749 (TypeManager.FilterWithClosure): No need to check permissions if
19750 closure_start_type == closure_invocation_type, don't crash if
19751 closure_invocation_type is null.
19753 2002-08-13 Martin Baulig <martin@gnome.org>
19755 Rewrote TypeContainer.FindMembers to use a member cache. This
19756 gives us a speed increase of about 35% for the self-hosting MCS
19757 build and of about 15-20% for the class libs (both on GNU/Linux).
19759 * report.cs (Timer): New class to get enhanced profiling. This
19760 whole class is "TIMER" conditional since it remarkably slows down
19763 * class.cs (MemberList): New class. This is an IList wrapper
19764 which we're now using instead of passing MemberInfo[]'s around to
19765 avoid copying this array unnecessarily.
19766 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
19767 (ICachingMemberFinder, IMemberContainer): New interface.
19768 (TypeManager.FilterWithClosure): If `criteria' is null, the name
19769 has already been checked, otherwise use it for the name comparision.
19770 (TypeManager.FindMembers): Renamed to RealMemberFinder and
19771 provided wrapper which tries to use ICachingMemberFinder.FindMembers
19772 if possible. Returns a MemberList, not a MemberInfo [].
19773 (TypeHandle): New class, implements IMemberContainer. We create
19774 one instance of this class per type, it contains a MemberCache
19775 which is used to do the member lookups.
19776 (MemberCache): New class. Each instance of this class contains
19777 all members of a type and a name-based hash table.
19778 (MemberCache.FindMembers): This is our new member lookup
19779 function. First, it looks up all members of the requested name in
19780 the hash table. Then, it walks this list and sorts out all
19781 applicable members and returns them.
19783 2002-08-13 Martin Baulig <martin@gnome.org>
19785 In addition to a nice code cleanup, this gives us a performance
19786 increase of about 1.4% on GNU/Linux - not much, but it's already
19787 half a second for the self-hosting MCS compilation.
19789 * typemanager.cs (IMemberFinder): New interface. It is used by
19790 TypeManager.FindMembers to call FindMembers on a TypeContainer,
19791 Enum, Delegate or Interface.
19792 (TypeManager.finder_to_member_finder): New PtrHashtable.
19793 (TypeManager.finder_to_container): Removed.
19794 (TypeManager.finder_to_delegate): Removed.
19795 (TypeManager.finder_to_interface): Removed.
19796 (TypeManager.finder_to_enum): Removed.
19798 * interface.cs (Interface): Implement IMemberFinder.
19800 * delegate.cs (Delegate): Implement IMemberFinder.
19802 * enum.cs (Enum): Implement IMemberFinder.
19804 * class.cs (TypeContainer): Implement IMemberFinder.
19806 2002-08-12 Martin Baulig <martin@gnome.org>
19808 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
19810 2002-08-12 Martin Baulig <martin@gnome.org>
19812 * ecore.cs (ITypeExpression): New interface for expressions which
19814 (TypeExpression): Renamed to TypeLookupExpression.
19815 (Expression.DoResolve): If we're doing a types-only lookup, the
19816 expression must implement the ITypeExpression interface and we
19817 call DoResolveType() on it.
19818 (SimpleName): Implement the new ITypeExpression interface.
19819 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
19820 hack, the situation that we're only looking up types can't happen
19821 anymore when this method is called. Moved the type lookup code to
19822 DoResolveType() and call it.
19823 (SimpleName.DoResolveType): This ITypeExpression interface method
19824 is now doing the types-only lookup.
19825 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
19826 (ResolveFlags): Added MaskExprClass.
19828 * expression.cs (MemberAccess): Implement the ITypeExpression
19830 (MemberAccess.DoResolve): Added support for a types-only lookup
19831 when we're called via ITypeExpression.DoResolveType().
19832 (ComposedCast): Implement the ITypeExpression interface.
19834 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
19835 Expression.Resolve() with ResolveFlags.Type instead.
19837 2002-08-12 Martin Baulig <martin@gnome.org>
19839 * interface.cs (Interface.Define): Apply attributes.
19841 * attribute.cs (Attribute.ApplyAttributes): Added support for
19842 interface attributes.
19844 2002-08-11 Martin Baulig <martin@gnome.org>
19846 * statement.cs (Block.Emit): Only check the "this" variable if we
19847 do not always throw an exception.
19849 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
19850 whether the property has a set accessor.
19852 2002-08-11 Martin Baulig <martin@gnome.org>
19854 Added control flow analysis support for structs.
19856 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
19857 with control flow analysis turned off.
19858 (IVariable): New interface.
19859 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
19860 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
19861 (FieldExpr.DoResolve): Resolve the instance expression with flow
19862 analysis turned off and do the definite assignment check after the
19863 resolving when we know what the expression will resolve to.
19865 * expression.cs (LocalVariableReference, ParameterReference):
19866 Implement the new IVariable interface, only call the flow analysis
19867 code if ec.DoFlowAnalysis is true.
19868 (This): Added constructor which takes a Block argument. Implement
19869 the new IVariable interface.
19870 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
19871 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
19872 This does the definite assignment checks for struct members.
19874 * class.cs (Constructor.Emit): If this is a non-static `struct'
19875 constructor which doesn't have any initializer, call
19876 Block.AddThisVariable() to tell the flow analysis code that all
19877 struct elements must be initialized before control returns from
19880 * statement.cs (MyStructInfo): New public class.
19881 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
19882 argument to this indexer. If non-zero, check an individual struct
19883 member, not the whole struct.
19884 (FlowBranching.CheckOutParameters): Check struct members.
19885 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
19886 overloaded versions of these methods which take an additional
19887 `int field_idx' argument to check struct members.
19888 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
19889 overloaded versions of these methods which take an additional
19890 `string field_name' argument to check struct member.s
19891 (VariableInfo): Implement the IVariable interface.
19892 (VariableInfo.StructInfo): New public property. Returns the
19893 MyStructInfo instance of the variable if it's a struct or null.
19894 (Block.AddThisVariable): New public method. This is called from
19895 Constructor.Emit() for non-static `struct' constructor which do
19896 not have any initializer. It creates a special variable for the
19897 "this" instance variable which will be checked by the flow
19898 analysis code to ensure that all of the struct's fields are
19899 initialized before control returns from the constructor.
19900 (UsageVector): Added support for struct members. If a
19901 variable/parameter is a struct with N members, we reserve a slot
19902 in the usage vector for each member. A struct is considered fully
19903 initialized if either the struct itself (slot 0) or all its
19904 members are initialized.
19906 2002-08-08 Martin Baulig <martin@gnome.org>
19908 * driver.cs (Driver.MainDriver): Only report an error CS5001
19909 if there were no compilation errors.
19911 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
19912 `UnsafeContext' property to determine whether the parent is in
19913 unsafe context rather than checking the parent's ModFlags:
19914 classes nested in an unsafe class are unsafe as well.
19916 2002-08-08 Martin Baulig <martin@gnome.org>
19918 * statement.cs (UsageVector.MergeChildren): Distinguish between
19919 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
19920 we return. Added test17() and test18() to test-154.cs.
19922 2002-08-08 Martin Baulig <martin@gnome.org>
19924 * typemanager.cs (TypeManager.FilterWithClosure): If we have
19925 Family access, make sure the invoking type isn't a subclass of the
19926 queried type (that'd be a CS1540).
19928 * ecore.cs (Expression.MemberLookup): Added overloaded version of
19929 this method which takes an additional `Type invocation_type'.
19931 * expression.cs (BaseAccess.DoResolve): Use the base type as
19932 invocation and query type.
19933 (MemberAccess.DoResolve): If the lookup failed and we're about to
19934 report a CS0122, try a lookup with the ec.ContainerType - if this
19935 succeeds, we must report a CS1540.
19937 2002-08-08 Martin Baulig <martin@gnome.org>
19939 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
19940 (MethodGroupExpr): Implement the IMemberExpr interface.
19942 * expression (MemberAccess.ResolveMemberAccess): No need to have
19943 any special code for MethodGroupExprs anymore, they're now
19946 2002-08-08 Martin Baulig <martin@gnome.org>
19948 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
19949 Family, FamANDAssem and FamORAssem permissions.
19950 (TypeManager.IsSubclassOrNestedChildOf): New public method.
19952 2002-08-08 Martin Baulig <martin@gnome.org>
19954 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
19955 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
19958 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
19960 * driver.cs: implemented /resource option to embed managed resources.
19962 2002-08-07 Martin Baulig <martin@gnome.org>
19964 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
19965 (FieldBase.HasFieldInitializer): New public property.
19966 (FieldBase.GetInitializerExpression): New public method. Resolves and
19967 returns the field initializer and makes sure it is only resolved once.
19968 (TypeContainer.EmitFieldInitializers): Call
19969 FieldBase.GetInitializerExpression to get the initializer, this ensures
19970 that it isn't resolved multiple times.
19972 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
19973 the resolving process (SimpleName/MemberLookup) that we're currently
19974 emitting a field initializer (which must not access any instance members,
19975 this is an error CS0236).
19977 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
19978 argument, if the `IsFieldInitializer' flag is set, we must report and
19979 error CS0236 and not an error CS0120.
19981 2002-08-07 Martin Baulig <martin@gnome.org>
19983 * ecore.cs (IMemberExpr): New public interface.
19984 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
19985 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
19986 if the expression is an IMemberExpr.
19988 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
19989 to be null, implicitly default to `this' if we're non-static in
19990 this case. Simplified the code a lot by using the new IMemberExpr
19991 interface. Also fixed bug #28176 here.
19993 2002-08-06 Martin Baulig <martin@gnome.org>
19995 * cs-parser.jay (SimpleLookup): Removed. We need to create
19996 ParameterReferences during semantic analysis so that we can do a
19997 type-only search when resolving Cast, TypeOf and SizeOf.
19998 (block): Pass the `current_local_parameters' to the Block's
20001 * class.cs (ConstructorInitializer): Added `Parameters parameters'
20002 argument to the constructor.
20003 (ConstructorInitializer.Resolve): Create a temporary implicit
20004 block with the parameters.
20006 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
20007 references here if we aren't doing a type-only search.
20009 * statement.cs (Block): Added constructor which takes a
20010 `Parameters parameters' argument.
20011 (Block.Parameters): New public property.
20013 * support.cs (InternalParameters.Parameters): Renamed `parameters'
20014 to `Parameters' and made it public readonly.
20016 2002-08-06 Martin Baulig <martin@gnome.org>
20018 * ecore.cs (Expression.Warning): Made this public as well.
20020 * report.cs (Report.Debug): Print the contents of collections.
20022 2002-08-06 Martin Baulig <martin@gnome.org>
20024 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
20025 used to tell Resolve() which kinds of expressions it may return.
20026 (Expression.Resolve): Added overloaded version of this method which
20027 takes a `ResolveFlags flags' argument. This can be used to tell
20028 Resolve() which kinds of expressions it may return. Reports a
20030 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
20031 ResolveFlags.SimpleName.
20032 (Expression.Error118): Added overloaded version of this method which
20033 takes a `ResolveFlags flags' argument. It uses the flags to determine
20034 which kinds of expressions are allowed.
20036 * expression.cs (Argument.ResolveMethodGroup): New public method.
20037 Resolves an argument, but allows a MethodGroup to be returned.
20038 This is used when invoking a delegate.
20040 * TODO: Updated a bit.
20042 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20044 Fixed compilation with csc.
20046 * ecore.cs: Expression.Error made public. Is this correct? Should
20047 Warning be made public too?
20049 * expression.cs: use ea.Location instead of ea.loc.
20050 [FIXME: Filed as bug #28607: MCS must report these errors.]
20052 2002-08-06 Martin Baulig <martin@gnome.org>
20054 * ecore.cs (Expression.loc): Moved the location here instead of
20055 duplicating it in all derived classes.
20056 (Expression.Location): New public property.
20057 (Expression.Error, Expression.Warning): Made them non-static and
20058 removed the location argument.
20059 (Expression.Warning): Added overloaded version which takes an
20060 `int level' argument.
20061 (Expression.Error118): Make this non-static and removed the
20062 expression and location arguments.
20063 (TypeExpr): Added location argument to the constructor.
20065 * expression.cs (StaticCallExpr): Added location argument to
20067 (Indirection, PointerArithmetic): Likewise.
20068 (CheckedExpr, UnCheckedExpr): Likewise.
20069 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
20070 (StringPtr): Likewise.
20073 2002-08-05 Martin Baulig <martin@gnome.org>
20075 * expression.cs (BaseAccess.DoResolve): Actually report errors.
20077 * assign.cs (Assign.DoResolve): Check whether the source
20078 expression is a value or variable.
20080 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
20081 while resolving the corresponding blocks.
20083 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
20084 an error, don't silently return null.
20086 * statement.cs (Block.AddVariable): Do the error reporting here
20087 and distinguish between CS0128 and CS0136.
20088 (Block.DoResolve): Report all unused labels (warning CS0164).
20089 (LabeledStatement): Pass the location to the constructor.
20090 (LabeledStatement.HasBeenReferenced): New property.
20091 (LabeledStatement.Resolve): Set it to true here.
20093 * statement.cs (Return.Emit): Return success even after reporting
20094 a type mismatch error (CS0126 or CS0127), this is what csc does and
20095 it avoids confusing the users with any consecutive errors.
20097 2002-08-05 Martin Baulig <martin@gnome.org>
20099 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
20101 * const.cs (Const.LookupConstantValue): Catch circular definitions.
20103 * expression.cs (MemberAccess.DoResolve): Silently return if an
20104 error has already been reported.
20106 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
20107 error has already been reported.
20109 2002-08-05 Martin Baulig <martin@gnome.org>
20111 * statement.cs (UsageVector): Only initialize the `parameters'
20112 vector if we actually have any "out" parameters.
20114 2002-08-05 Martin Baulig <martin@gnome.org>
20116 * expression.cs (Binary.ResolveOperator): When combining delegates,
20117 they must have the same type.
20119 2002-08-05 Martin Baulig <martin@gnome.org>
20121 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
20122 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
20123 work with the ms runtime and we also don't need it: if we're a
20124 PropertyBuilder and not in the `indexer_arguments' hash, then we
20125 are a property and not an indexer.
20127 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
20128 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
20129 since the latter one doesn't work with the ms runtime.
20131 2002-08-03 Martin Baulig <martin@gnome.org>
20133 Fixed bugs #27998 and #22735.
20135 * class.cs (Method.IsOperator): New public field.
20136 (Method.CheckBase): Report CS0111 if there's already a method
20137 with the same parameters in the current class. Report CS0508 when
20138 attempting to change the return type of an inherited method.
20139 (MethodData.Emit): Report CS0179 if a method doesn't have a body
20140 and it's not marked abstract or extern.
20141 (PropertyBase): New abstract base class for Property and Indexer.
20142 (PropertyBase.CheckBase): Moved here from Property and made it work
20144 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
20145 the same so we can reuse it there.
20146 (Property, Indexer): Derive from PropertyBase.
20147 (MethodSignature.inheritable_property_signature_filter): New delegate
20148 to find properties and indexers.
20150 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
20151 argument and improved error reporting.
20153 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
20154 EmptyReadOnlyParameters and made it a property.
20156 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
20157 version of this method which takes a `PropertyInfo indexer'.
20158 (TypeManager.RegisterIndexer): New method.
20160 * class.cs: Added myself as author of this file :-)
20162 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20164 * class.cs: fixed compilation on windoze.
20166 2002-08-03 Martin Baulig <martin@gnome.org>
20168 * interface.cs (Interface.GetInterfaceBases): Check whether all
20169 base interfaces are at least as accessible than the current one.
20171 * class.cs (TypeContainer.GetClassBases): Check whether base types
20172 are at least as accessible than the current type.
20173 (TypeContainer.AsAccessible): Implemented and made non-static.
20174 (MemberBase.CheckParameters): Report errors if the accessibility
20177 * delegate.cs (Delegate.Delegate): The default visibility is
20178 internal for top-level types and private for nested types.
20179 (Delegate.Define): Report errors if the accessibility checks fail.
20181 * enum.cs (Enum.Enum): The default visibility is internal for
20182 top-level types and private for nested types.
20183 (Enum.DefineType): Compute the correct visibility.
20185 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
20186 function which takes a `bool is_toplevel' instead of a TypeContainer.
20188 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
20191 2002-08-02 Martin Baulig <martin@gnome.org>
20193 * expression.cs (LocalVariableReferenc): Added constructor which
20194 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
20195 (LocalVariableReference.IsReadOnly): New property.
20196 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
20197 variable is readonly, use our own readonly flag to do this; you can
20198 use the new constructor to get a writable reference to a read-only
20201 * cs-parser.jay (foreach_statement, using_statement): Get a writable
20202 reference to the local variable.
20204 2002-08-01 Miguel de Icaza <miguel@ximian.com>
20206 * rootcontext.cs (ResolveCore): Also include System.Exception
20208 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
20209 we reach an EmptyStatement.
20211 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
20214 * expression.cs (Binary.ResolveOperator): Check error result in
20217 use brtrue/brfalse directly and avoid compares to null.
20219 2002-08-02 Martin Baulig <martin@gnome.org>
20221 * class.cs (TypeContainer.Define): Define all nested interfaces here.
20222 Fixes bug #28407, added test-155.cs.
20224 2002-08-01 Martin Baulig <martin@gnome.org>
20226 * class.cs (Event.EmitDefaultMethod): Make this work with static
20227 events. Fixes #28311, added verify-3.cs.
20229 2002-08-01 Martin Baulig <martin@gnome.org>
20231 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
20232 `is_disposable' fields.
20233 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
20234 `hm.is_disposable' if we're using the collection pattern.
20235 (Foreach.EmitCollectionForeach): Use the correct type for the
20236 enumerator's local variable, only emit the try/finally block if
20237 necessary (fixes #27713).
20239 2002-08-01 Martin Baulig <martin@gnome.org>
20241 * ecore.cs (Expression.report118): Renamed to Error118 and made
20244 * statement.cs (Throw.Resolve): Check whether the expression is of
20245 the correct type (CS0118) and whether the type derives from
20246 System.Exception (CS0155).
20247 (Catch.Resolve): New method. Do the type lookup here and check
20248 whether it derives from System.Exception (CS0155).
20249 (Catch.CatchType, Catch.IsGeneral): New public properties.
20251 * typemanager.cs (TypeManager.exception_type): Added.
20253 2002-07-31 Miguel de Icaza <miguel@ximian.com>
20255 * driver.cs: Updated About function.
20257 2002-07-31 Martin Baulig <martin@gnome.org>
20259 Implemented Control Flow Analysis.
20261 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
20262 (EmitContext.CurrentBranching): Added.
20263 (EmitContext.StartFlowBranching): Added.
20264 (EmitContext.EndFlowBranching): Added.
20265 (EmitContext.KillFlowBranching): Added.
20266 (EmitContext.IsVariableAssigned): Added.
20267 (EmitContext.SetVariableAssigned): Added.
20268 (EmitContext.IsParameterAssigned): Added.
20269 (EmitContext.SetParameterAssigned): Added.
20270 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
20271 Added control flow analysis stuff here.
20273 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
20274 resolve the expression as lvalue.
20275 (LocalVariableReference.DoResolve): Check whether the variable has
20276 already been assigned.
20277 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
20278 the parameter as assigned here.
20279 (ParameterReference.DoResolve): Check whether the parameter has already
20281 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
20282 expression as lvalue.
20284 * statement.cs (FlowBranching): New class for the flow analysis code.
20285 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
20286 (LabeledStatement.IsDefined): New public property.
20287 (LabeledStatement.AddUsageVector): New public method to tell flow
20288 analyis that the label may be reached via a forward jump.
20289 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
20291 (VariableInfo.Number): New public field. This is used by flow analysis
20292 to number all locals of a block.
20293 (Block.CountVariables): New public property. This is the number of
20294 local variables in this block (including the locals from all parent
20296 (Block.EmitMeta): Number all the variables.
20298 * statement.cs: Added flow analysis support to all classes.
20300 2002-07-31 Martin Baulig <martin@gnome.org>
20302 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
20303 To get debugging messages, compile mcs with /define:MCS_DEBUG and
20304 then use this argument.
20306 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
20308 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
20309 use this to specify /define options.
20311 2002-07-29 Martin Baulig <martin@gnome.org>
20313 * statement.cs (Fixed): Moved all code that does variable lookups
20314 and resolvings from Emit to Resolve.
20316 * statement.cs (For): Moved all code that does variable lookups
20317 and resolvings from Emit to Resolve.
20319 * statement.cs (Using): Moved all code that does variable lookups
20320 and resolvings from Emit to Resolve.
20322 2002-07-29 Martin Baulig <martin@gnome.org>
20324 * attribute.cs (Attribute.Resolve): Explicitly catch a
20325 System.NullReferenceException when creating the
20326 CustromAttributeBuilder and report a different warning message.
20328 2002-07-29 Martin Baulig <martin@gnome.org>
20330 * support.cs (ParameterData.ParameterName): Added method to
20331 get the name of a parameter.
20333 * typemanager.cs (TypeManager.IsValueType): New public method.
20335 2002-07-29 Martin Baulig <martin@gnome.org>
20337 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
20338 is a flag which specifies that it's either ref or out.
20339 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
20340 the out parameter to `out Parameter.Modifier mod', also set the
20341 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
20343 * support.cs (InternalParameters.ParameterModifier): Distinguish
20344 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
20345 Parameter.Modifier.ISBYREF flag if it's either ref or out.
20347 * expression.cs (Argument.GetParameterModifier): Distinguish
20348 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
20349 Parameter.Modifier.ISBYREF flag if it's either ref or out.
20351 2002-07-29 Martin Baulig <martin@gnome.org>
20353 * expression.cs (ParameterReference.ParameterReference): Added
20354 `Location loc' argument to the constructor.
20356 * cs-parser.jay: Pass location to ParameterReference.
20358 2002-07-28 Miguel de Icaza <miguel@ximian.com>
20360 * statement.cs (Try): Initialize the location.
20362 * cs-parser.jay: pass location to Try.
20364 * expression.cs (Unary.Reduce): Change the prototype to return
20365 whether a constant fold could be performed or not. The result is
20366 returned in an out parameters. In the case of Indirection and
20367 AddressOf, we want to perform the full tests.
20369 2002-07-26 Miguel de Icaza <miguel@ximian.com>
20371 * statement.cs (Statement.Emit): Flag dead code.
20373 2002-07-27 Andrew Birkett <andy@nobugs.org>
20375 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
20377 2002-07-27 Martin Baulig <martin@gnome.org>
20379 * class.cs (MethodData.Define): Put back call to
20380 TypeManager.AddMethod(), accidentally commented this out.
20382 * report.cs (Debug): New public method to print debugging information,
20383 this is `[Conditional ("DEBUG")]'.
20385 2002-07-26 Martin Baulig <martin@gnome.org>
20387 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
20388 (switch_statement): Push the current_block to the switch_stack and
20389 pop it again when we're done with the switch.
20390 (switch_section): The new block is a child of the current_block.
20391 Fixes bug #24007, added test-152.cs.
20393 2002-07-27 Martin Baulig <martin@gnome.org>
20395 * expression.cs (Invocation.EmitArguments): When calling a varargs
20396 function with only its fixed arguments, we need to pass an empty
20399 2002-07-27 Martin Baulig <martin@gnome.org>
20401 Mono 0.13 has been released.
20403 2002-07-25 Miguel de Icaza <miguel@ximian.com>
20405 * driver.cs: Rename --resource to --linkres, because that is what
20406 we do currently, we dont support --resource yet.
20408 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
20410 2002-07-25 Martin Baulig <martin@gnome.org>
20412 * class.cs (MethodData): New public class. This is a `method builder'
20413 class for a method or one accessor of a Property/Indexer/Event.
20414 (MethodData.GetMethodFlags): Moved here from MemberBase.
20415 (MethodData.ApplyAttributes): Likewise.
20416 (MethodData.ApplyObsoleteAttribute): Likewise.
20417 (MethodData.ApplyConditionalAttribute): Likewise.
20418 (MethodData.ApplyDllImportAttribute): Likewise.
20419 (MethodData.CheckAbstractAndExternal): Likewise.
20420 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
20421 (MethodData.Emit): Formerly known as Method.Emit().
20422 (MemberBase): Moved everything which was specific to a single
20423 accessor/method to MethodData.
20424 (Method): Create a new MethodData and call Define() and Emit() on it.
20425 (Property, Indexer, Event): Create a new MethodData objects for each
20426 accessor and call Define() and Emit() on them.
20428 2002-07-25 Martin Baulig <martin@gnome.org>
20430 Made MethodCore derive from MemberBase to reuse the code from there.
20431 MemberBase now also checks for attributes.
20433 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
20434 (MemberBase.GetMethodFlags): Moved here from class Method and marked
20436 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
20437 `CallingConventions cc' and `Attributes opt_attrs' arguments.
20438 (MemberBase.ApplyAttributes): New virtual method; applies the
20439 attributes to a method or accessor.
20440 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
20441 (MemberBase.ApplyConditionalAttribute): Likewise.
20442 (MemberBase.ApplyDllImportAttribute): Likewise.
20443 (MemberBase.CheckAbstractAndExternal): Likewise.
20444 (MethodCore.ParameterTypes): This is now a property instead of a
20445 method, it's initialized from DoDefineParameters().
20446 (MethodCore.ParameterInfo): Removed the set accessor.
20447 (MethodCore.DoDefineParameters): New protected virtual method to
20448 initialize ParameterTypes and ParameterInfo.
20449 (Method.GetReturnType): We can now simply return the MemberType.
20450 (Method.GetMethodFlags): Override the MemberBase version and add
20451 the conditional flags.
20452 (Method.CheckBase): Moved some code from Define() here, call
20453 DoDefineParameters() here.
20454 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
20455 here to avoid some larger code duplication.
20456 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
20457 ensure that abstract and external accessors don't declare a body.
20459 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
20460 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
20461 lookup in the attribute's parent classes, so we need to abort as soon
20462 as we found the first match.
20463 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
20464 the attribute has no arguments.
20466 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
20469 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20471 * cs-parser.jay: reverted previous patch.
20473 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20475 * cs-parser.jay: fixed bug #22119.
20477 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20479 * attribute.cs: fixed compilation. The error was:
20480 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
20481 be assigned to before control leaves the current method."
20482 [FIXME: Filed as bug #28186: MCS must report this error.]
20484 2002-07-25 Martin Baulig <martin@gnome.org>
20486 * attribute.cs (Attribute.Conditional_GetConditionName): New static
20487 method to pull the condition name ouf of a Conditional attribute.
20488 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
20489 the obsolete message and error flag out of an Obsolete attribute.
20491 * class.cs (Method.GetMethodFlags): New public method to get the
20492 TypeManager.MethodFlags for this method.
20493 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
20495 (Method.Define): Get and apply the Obsolete and Conditional attributes;
20496 if we're overriding a virtual function, set the new private variable
20497 `parent_method'; call the new TypeManager.AddMethod().
20499 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
20500 the MethodBuilder and the Method in a PtrHashtable.
20501 (TypeManager.builder_to_method): Added for this purpose.
20502 (TypeManager.MethodFlags): Added IsObsoleteError.
20503 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
20504 Obsolete and Conditional arguments in MethodBuilders. If we discover
20505 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
20506 the message from the attribute.
20508 2002-07-24 Martin Baulig <martin@gnome.org>
20510 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
20511 preprocessor directives, ensure that the argument to #define/#undef is
20512 exactly one identifier and that it's actually an identifier.
20514 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
20517 2002-07-24 Martin Baulig <martin@gnome.org>
20519 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
20520 initialize it to TypeManager.object_type in the constructor.
20521 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
20522 of the `hm.get_current' method if we're using the collection pattern.
20523 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
20524 for the explicit conversion to make it work when we're using the collection
20525 pattern and the `Current' property has a different return type than `object'.
20528 2002-07-24 Martin Baulig <martin@gnome.org>
20530 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
20531 does not match, but don't report any errors. This method is called in
20532 order for all methods in a MethodGroupExpr until a matching method is
20533 found, so we don't want to bail out if the first method doesn't match.
20534 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
20535 matches, report the 123. Fixes #28070.
20537 2002-07-24 Martin Baulig <martin@gnome.org>
20539 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
20540 TypeManager.TypeToCoreType() to the top of the method so the
20541 following equality checks will work. Fixes #28107.
20543 2002-07-24 Martin Baulig <martin@gnome.org>
20545 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
20546 operand is of type uint, and the other operand is of type sbyte,
20547 short or int, the operands are converted to type long." -
20548 Actually do what this comment already told us. Fixes bug #28106,
20551 2002-07-24 Martin Baulig <martin@gnome.org>
20553 * class.cs (MethodBase): New abstract class. This is now a base
20554 class for Property, Indexer and Event to avoid some code duplication
20555 in their Define() and DefineMethods() methods.
20556 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
20557 generic methods for Define() and DefineMethods().
20558 (FieldBase): Derive from MemberBase, not MemberCore.
20559 (Property): Derive from MemberBase, not MemberCore.
20560 (Property.DefineMethod): Moved all the code from this method to the
20561 new MethodBase.DefineAccessor(), just call it with appropriate
20563 (Property.Define): Call the new Property.DoDefine(), this does some
20564 sanity checks and we don't need to duplicate the code everywhere.
20565 (Event): Derive from MemberBase, not MemberCore.
20566 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
20567 accessors, this will also make them work with interface events.
20568 (Indexer): Derive from MemberBase, not MemberCore.
20569 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
20570 (Indexer.Define): Use the new MethodBase functions.
20572 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
20573 argument to the constructor.
20574 (Interface.FindMembers): Added support for interface events.
20575 (Interface.PopluateEvent): Implemented.
20577 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
20579 2002-07-22 Miguel de Icaza <miguel@ximian.com>
20581 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
20582 but this is required to check for a method name being the same as
20583 the containing class.
20587 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20589 * interface.cs: initialize variable.
20591 2002-07-23 Martin Baulig <martin@gnome.org>
20593 Implemented the IndexerName attribute in interfaces.
20595 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
20596 name if this is an explicit interface implementation.
20597 (Indexer.InterfaceIndexerName): New public variable. If we're
20598 implementing an interface indexer, this is the IndexerName in that
20599 interface. Otherwise, it's the IndexerName.
20600 (Indexer.DefineMethod): If we're implementing interface indexer,
20601 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
20602 and Pending.ImplementIndexer methods.
20603 (Indexer.Define): Also define the PropertyBuilder if we're
20604 implementing an interface indexer and this is neither an explicit
20605 interface implementation nor do the IndexerName match the one in
20608 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
20609 If a method is defined here, then we always need to create a proxy
20610 for it. This is used when implementing interface indexers.
20611 (Pending.IsInterfaceIndexer): New public method.
20612 (Pending.ImplementIndexer): New public method.
20613 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
20614 This is used when implementing interface indexers to define a proxy
20616 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
20617 define a proxy if necessary.
20619 * interface.cs (Interface.IndexerName): New public variable.
20620 (Interface.PopulateIndexer): Set the IndexerName.
20621 (Interface.DefineIndexers): New private method. Populate all the
20622 indexers and make sure their IndexerNames match.
20624 * typemanager.cs (IndexerPropertyName): Added support for interface
20627 2002-07-22 Martin Baulig <martin@gnome.org>
20629 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
20630 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
20631 ret if HasReturnLabel.
20632 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
20635 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
20636 and set the ec.LoopBeginTryCatchLevel.
20637 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
20638 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
20639 the current ec.TryCatchLevel, the branch goes out of an exception
20640 block. In this case, we need to use Leave and not Br.
20642 2002-07-22 Martin Baulig <martin@gnome.org>
20644 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
20645 block unless the block does not always return or it is contained in
20646 another try { ... } catch { ... } block. Fixes bug #26506.
20647 Added verify-1.cs to the test suite.
20649 2002-07-22 Martin Baulig <martin@gnome.org>
20651 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
20652 then we do not always return. Fixes bug #24985.
20654 2002-07-22 Martin Baulig <martin@gnome.org>
20656 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
20657 lookup on a per-class level; ie. walk up the class hierarchy until we
20658 found at least one applicable method, then choose the best among them.
20659 Fixes bug #24463 and test-29.cs.
20661 2002-07-22 Martin Baulig <martin@gnome.org>
20663 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
20664 return types of the methods. The return type is not part of the
20665 signature and we must not check it to make the `new' modifier work.
20666 Fixes bug #27999, also added test-147.cs.
20667 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
20669 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
20670 on the method's return type.
20672 2002-07-21 Martin Baulig <martin@gnome.org>
20674 * assign.cs: Make this work if the rightmost source is a constant and
20675 we need to do an implicit type conversion. Also adding a few more tests
20676 to test-38.cs which should have caught this.
20678 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
20679 target in the makefile for this. The makefile.gnu is primarily intended
20680 for end-users who don't want to debug the compiler.
20682 2002-07-21 Martin Baulig <martin@gnome.org>
20684 * assign.cs: Improved the Assign class so it can now handle embedded
20685 assignments (X = Y = Z = something). As a side-effect this'll now also
20686 consume less local variables. test-38.cs now passes with MCS, added
20687 a few new test cases to that test.
20689 2002-07-20 Martin Baulig <martin@gnome.org>
20691 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
20692 instructions. Fixes bug #27977, also added test-146.cs.
20694 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20696 * cs-tokenizer.cs: fixed getHex ().
20698 2002-07-19 Martin Baulig <martin@gnome.org>
20700 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
20701 not Type.GetType() to lookup the array type. This is needed when
20702 we're constructing an array of a user-defined type.
20703 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
20704 single-dimensional arrays, but also for single-dimensial arrays of
20707 2002-07-19 Martin Baulig <martin@gnome.org>
20709 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
20710 this function is called, it's not allowed to share LocalBuilders
20711 among ILGenerators.
20713 2002-07-19 Martin Baulig <martin@gnome.org>
20715 * expression.cs (Argument.Resolve): Report an error 118 when trying
20716 to pass a type as argument.
20718 2002-07-18 Martin Baulig <martin@gnome.org>
20720 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
20721 Conv_R_Un for the signed `long' type.
20723 2002-07-15 Miguel de Icaza <miguel@ximian.com>
20725 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
20726 `expr' for the temporary result, as that will fail if we do
20727 multiple resolves on the same expression.
20729 2002-07-05 Miguel de Icaza <miguel@ximian.com>
20731 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
20732 ec.TypeContainer for looking up aliases.
20734 * class.cs (TypeContainer): Remove LookupAlias from here.
20736 * decl.cs (DeclSpace); Move here.
20738 2002-07-01 Miguel de Icaza <miguel@ximian.com>
20740 * class.cs (FindMembers): Only call filter if the constructor
20741 bulider is not null.
20743 Also handle delegates in `NestedTypes' now. Now we will perform
20744 type lookups using the standard resolution process. This also
20747 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
20748 This uses Expressions (the limited kind that can be parsed by the
20749 tree) instead of strings.
20751 * expression.cs (ComposedCast.ToString): Implement, used to flag
20752 errors since now we have to render expressions.
20754 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
20757 * ecore.cs (SimpleName.ToString): ditto.
20759 * cs-parser.jay: Instead of using strings to assemble types, use
20760 Expressions to assemble the type (using SimpleName, ComposedCast,
20761 MemberAccess). This should fix the type lookups in declarations,
20762 because we were using a different code path for this.
20764 * statement.cs (Block.Resolve): Continue processing statements
20765 even when there is an error.
20767 2002-07-17 Miguel de Icaza <miguel@ximian.com>
20769 * class.cs (Event.Define): Also remove the `remove' method from
20770 the list of pending items.
20772 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
20773 generate more compact code.
20775 2002-07-17 Martin Baulig <martin@gnome.org>
20777 * const.cs (Const.LookupConstantValue): Add support for constant
20778 `unchecked' and `checked' expressions.
20779 Also adding test case test-140.cs for this.
20781 2002-07-17 Martin Baulig <martin@gnome.org>
20783 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
20784 check whether mi.ReturnType implements the IEnumerator interface; the
20785 `==' and the IsAssignableFrom() will fail in this situation.
20787 2002-07-16 Ravi Pratap <ravi@ximian.com>
20789 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
20792 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20794 * expression.cs: fixed bug #27811.
20796 2002-07-14 Miguel de Icaza <miguel@ximian.com>
20798 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
20799 Molaro: when we are a ref, the value already contains a pointer
20800 value, do not take the address of it.
20802 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
20803 * removed mb-parser.jay and mb-tokenizer.cs
20805 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
20807 * expression.cs: check against the building corlib void type.
20809 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
20811 * ecore.cs: fix for valuetype static readonly fields: when
20812 initializing them, we need their address, not the address of a copy.
20814 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
20816 * typemanager.cs: register also enum_type in corlib.
20818 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
20820 * class.cs: allow calling this (but not base) initializers in structs.
20822 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
20824 * ecore.cs: make sure we compare against the building base types
20827 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
20829 * typemanager.cs: fix TypeToCoreType() to handle void and object
20830 (corlib gets no more typerefs after this change).
20832 2002-07-12 Miguel de Icaza <miguel@ximian.com>
20834 * expression.cs (ArrayCreation.EmitArrayArguments): use
20835 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
20837 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
20838 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
20839 array indexes, the runtime actually forbids them.
20841 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
20842 for array arguments here.
20844 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
20845 instead of the default for ValueTypes.
20847 (New.DoEmit): Use IsValueType instead of
20848 IsSubclassOf (value_type)
20849 (New.DoResolve): ditto.
20850 (Invocation.EmitCall): ditto.
20852 * assign.cs (Assign): ditto.
20854 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
20855 Statements *are* currently doing part of their resolution during
20858 Expressions do always resolve during resolve, but statements are
20859 only required to propagate resolution to their children.
20861 2002-07-11 Miguel de Icaza <miguel@ximian.com>
20863 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
20865 (LoadAssembly): Do not add the dll if it is already specified
20867 (MainDriver): Add the System directory to the link path at the end,
20868 after all the other -L arguments.
20870 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
20871 wrong opcode for loading bytes and bools (ldelem.i1 instead of
20872 ldelem.u1) and using the opposite for sbytes.
20874 This fixes Digger, and we can finally run it.
20876 * driver.cs (UnixParseOption): Move the option parsing here.
20877 (CSCParseOption): Implement CSC-like parsing of options.
20879 We now support both modes of operation, the old Unix way, and the
20880 new CSC-like way. This should help those who wanted to make cross
20881 platform makefiles.
20883 The only thing broken is that /r:, /reference: and /lib: are not
20884 implemented, because I want to make those have the same semantics
20885 as the CSC compiler has, and kill once and for all the confussion
20886 around this. Will be doing this tomorrow.
20888 * statement.cs (Unsafe.Resolve): The state is checked during
20889 resolve, not emit, so we have to set the flags for IsUnsfe here.
20891 2002-07-10 Miguel de Icaza <miguel@ximian.com>
20893 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
20894 not catch the Error_ObjectRefRequired in SimpleName (as it is
20895 possible to have a class/instance variable name that later gets
20896 deambiguated), we have to check this here.
20898 2002-07-10 Ravi Pratap <ravi@ximian.com>
20900 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
20901 make static and put into Expression.
20903 (Event.Define): Register the private field of the event with the
20904 TypeManager so that GetFieldFromEvent can get at it.
20906 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
20907 keep track of the private field associated with an event which
20910 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
20913 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
20915 2002-07-10 Miguel de Icaza <miguel@ximian.com>
20917 * expression.cs (Binary.EmitBranchable): this routine emits the
20918 Binary expression in a branchable context. This basically means:
20919 we need to branch somewhere, not just get the value on the stack.
20921 This works together with Statement.EmitBoolExpression.
20923 * statement.cs (Statement.EmitBoolExpression): Use
20926 2002-07-09 Miguel de Icaza <miguel@ximian.com>
20928 * statement.cs (For): Reduce the number of jumps in loops.
20930 (For): Implement loop inversion for the For statement.
20932 (Break): We can be breaking out of a Try/Catch controlled section
20933 (foreach might have an implicit try/catch clause), so we need to
20934 use Leave instead of Br.
20936 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
20937 now). If the instace expression supports IMemoryLocation, we use
20938 the AddressOf method from the IMemoryLocation to extract the
20939 address instead of emitting the instance.
20941 This showed up with `This', as we were emitting the instance
20942 always (Emit) instead of the Address of This. Particularly
20943 interesting when This is a value type, as we dont want the Emit
20944 effect (which was to load the object).
20946 2002-07-08 Miguel de Icaza <miguel@ximian.com>
20948 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
20950 * statement.cs (Checked): Set the CheckedState during the resolve
20951 process too, as the ConvCast operations track the checked state on
20952 the resolve process, and not emit.
20954 * cs-parser.jay (namespace_member_declaration): Flag that we have
20955 found a declaration when we do. This is used to flag error 1529
20957 * driver.cs: Report ok when we display the help only.
20959 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
20961 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
20963 2002-07-04 Miguel de Icaza <miguel@ximian.com>
20965 * cs-tokenizer.cs (define): We also have to track locally the
20966 defines. AllDefines is just used for the Conditional Attribute,
20967 but we also need the local defines for the current source code.
20969 2002-07-03 Miguel de Icaza <miguel@ximian.com>
20971 * statement.cs (While, For, Do): These loops can exit through a
20972 Break statement, use this information to tell whether the
20973 statement is the last piece of code.
20975 (Break): Flag that we break.
20977 * codegen.cs (EmitContexts): New `Breaks' state variable.
20979 2002-07-03 Martin Baulig <martin@gnome.org>
20981 * class.cs (TypeContainer.MethodModifiersValid): Allow override
20982 modifiers in method declarations in structs. Otherwise, you won't
20983 be able to override things like Object.Equals().
20985 2002-07-02 Miguel de Icaza <miguel@ximian.com>
20987 * class.cs (Method, Property, Indexer): Do not allow the public
20988 modifier to be used in explicit interface implementations.
20990 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
20991 override modifiers in method declarations in structs
20993 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
20995 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
20996 integer or real overflow, report an error
20998 2002-07-02 Martin Baulig <martin@gnome.org>
21000 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
21001 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
21002 to tell the runtime about our newly created System.Object and
21003 System.ValueType types.
21005 2002-07-02 Miguel de Icaza <miguel@ximian.com>
21007 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
21008 struct instead of Ldarg/Starg.
21010 2002-07-02 Martin Baulig <martin@gnome.org>
21012 * expression.cs (Indirection.Indirection): Call
21013 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
21015 2002-07-02 Martin Baulig <martin@gnome.org>
21017 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
21018 ValueType, call TypeManager.TypeToCoreType() on it.
21019 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
21020 the OpCodes.Newarr argument.
21022 2002-07-02 Martin Baulig <martin@gnome.org>
21024 * expression.cs (Invocation.EmitCall): When compiling corlib,
21025 replace all calls to the system's System.Array type to calls to
21026 the newly created one.
21028 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
21029 System.Array methods.
21030 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
21031 from the system's System.Array type which must be replaced.
21033 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
21035 * typemanager.cs: load unverifiable_code_ctor so we can build
21036 corlib using the correct type. Avoid using GetTypeCode() with
21038 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
21039 TypeManager.object_type to allow building corlib.
21041 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
21043 * ecore.cs: handle System.Enum separately in LoadFromPtr().
21045 2002-07-01 Martin Baulig <martin@gnome.org>
21047 * class.cs: Make the last change actually work, we need to check
21048 whether `ifaces != null' to avoid a crash.
21050 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
21052 * class.cs: when we build structs without fields that implement
21053 interfaces, we need to add the interfaces separately, since there is
21054 no API to both set the size and add the interfaces at type creation
21057 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
21059 * expression.cs: the dimension arguments to the array constructors
21060 need to be converted if they are a long.
21062 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
21064 * class.cs: don't emit ldarg.0 if there is no parent constructor
21065 (fixes showstopper for corlib).
21067 2002-06-29 Martin Baulig <martin@gnome.org>
21069 MCS now compiles corlib on GNU/Linux :-)
21071 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
21072 ie. check for MethodImplOptions.InternalCall.
21074 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
21075 and TypeManager.attribute_type are null, so we must explicitly check
21076 whether parent is not null to find out whether it's an attribute type.
21077 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
21078 and SetBuilder, not only if the property is neither abstract nor external.
21079 This is necessary to set the MethodImplOptions on the accessor methods.
21080 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
21081 SetBuilder, see Property.Emit().
21083 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
21084 populate "System.Object", "System.ValueType" and "System.Attribute" since
21085 they've already been populated from BootCorlib_PopulateCoreTypes().
21087 2002-06-29 Martin Baulig <martin@gnome.org>
21089 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
21090 is the NullLiteral, we also need to make sure that target_type is not
21093 2002-06-29 Martin Baulig <martin@gnome.org>
21095 * rootcontext.cs (RootContext.ResolveCore): We must initialize
21096 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
21097 before calling BootstrapCorlib_ResolveDelegate ().
21099 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21101 * statement.cs: fixed build-breaker. All tests passed ok.
21103 2002-06-27 Martin Baulig <martin@gnome.org>
21105 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
21106 for System.Decimal when compiling corlib.
21108 2002-06-27 Martin Baulig <martin@gnome.org>
21110 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
21111 switch blocks which contain nothing but a default clause.
21113 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
21115 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
21117 2002-06-27 Martin Baulig <martin@gnome.org>
21119 * ecore.cs (PropertyExpr.PropertyExpr): Call
21120 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
21122 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
21123 is already a TypeBuilder.
21125 2002-06-27 Martin Baulig <martin@gnome.org>
21127 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
21128 `target_type == TypeManager.array_type', not IsAssignableFrom() in
21129 the "from an array-type to System.Array" case. This makes it work
21130 when compiling corlib.
21132 2002-06-27 Martin Baulig <martin@gnome.org>
21134 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
21135 non-static PropertyExpr, set its InstanceExpression. This makes
21136 the `ICollection.Count' property work in System/Array.cs.
21138 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
21140 * driver.cs: Made error handling more consistent. Errors now
21141 tracked by Report class, so many methods which used to return int
21142 now return void. Main() now prints success/failure and
21143 errors/warnings message.
21145 Renamed '--probe' compiler argument to '--expect-error'. Removed
21146 the magic number return values (123 and 124). Now, if the
21147 expected error occurs, the compiler exits with success (exit value
21148 0). If the compilation completes without seeing that particular
21149 error, the compiler exits with failure (exit value 1). The
21150 makefile in mcs/errors has been changed to handle the new behaviour.
21152 * report.cs: Made 'expected error' number a property and renamed
21153 it from 'Probe' to 'ExpectedError'.
21155 * genericparser.cs: Removed error handling support, since it is
21156 now all done by Report class.
21158 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
21159 class, so parse() no longer returns an int.
21161 * namespace.cs: Use Report.Error instead of GenericParser.error
21163 2002-06-22 Miguel de Icaza <miguel@ximian.com>
21165 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
21166 TypeContainer.AddOperator): At the front of the list put the
21167 explicit implementations, so they get resolved/defined first.
21169 2002-06-21 Miguel de Icaza <miguel@ximian.com>
21171 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
21172 interface type is implemented by this TypeContainer. Used during
21173 explicit interface implementation.
21175 (Property.Define, Indexer.Define, Method.Define): Validate that
21176 the given interface in the explicit implementation is one of the
21177 base classes for the containing type.
21179 Also if we are explicitly implementing an interface, but there is
21180 no match in the pending implementation table, report an error.
21182 (Property.Define): Only define the property if we are
21183 not explicitly implementing a property from an interface. Use the
21184 correct name also for those properties (the same CSC uses,
21185 although that is really not needed).
21187 (Property.Emit): Do not emit attributes for explicitly implemented
21188 properties, as there is no TypeBuilder.
21190 (Indexer.Emit): ditto.
21192 Hiding then means that we do not really *implement* a pending
21193 implementation, which makes code fail.
21195 2002-06-22 Martin Baulig <martin@gnome.org>
21197 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
21198 the return value of Object.GetType(). [FIXME: we need to do this whenever
21199 we get a type back from the reflection library].
21201 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
21203 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
21205 2002-06-20 Miguel de Icaza <miguel@ximian.com>
21207 * attribute.cs: Return null if we can not look up the type.
21209 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
21210 the interface types found.
21212 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
21213 interface types found.
21215 * typemanager.cs (GetInterfaces): Make this routine returns alll
21216 the interfaces and work around the lame differences between
21217 System.Type and System.Reflection.Emit.TypeBuilder in the results
21218 result for GetInterfaces.
21220 (ExpandInterfaces): Given an array of interface types, expand and
21221 eliminate repeated ocurrences of an interface. This expands in
21222 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
21225 2002-06-21 Martin Baulig <martin@gnome.org>
21227 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
21230 2002-06-21 Martin Baulig <martin@gnome.org>
21232 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
21233 and called with one of the core types, return the corresponding typebuilder for
21236 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
21239 2002-06-21 Martin Baulig <martin@gnome.org>
21241 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
21242 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
21243 (Expression.ConvertReferenceExplicit): Likewise.
21245 * expression.cs (ElementAccess.DoResolve): Likewise.
21246 (ElementAccess.DoResolveLValue): Likewise.
21248 2002-06-10 Martin Baulig <martin@gnome.org>
21250 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
21251 add the "value" parameter to the parameter list.
21253 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
21256 2002-06-19 Miguel de Icaza <miguel@ximian.com>
21258 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
21259 the argument to an int, uint, long or ulong, per the spec. Also
21260 catch negative constants in array creation.
21262 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
21264 * class.cs: do not allow the same interface to appear twice in
21265 the definition list.
21267 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
21269 * ecore.cs: don't use ldlen with System.Array.
21271 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
21273 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
21275 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
21277 * modifiers.cs: produce correct field attributes for protected
21278 internal. Easy fix so miguel can work on ther harder stuff:-)
21280 2002-06-18 Miguel de Icaza <miguel@ximian.com>
21282 * pending.cs: New file. Move the code from class.cs here.
21283 Support clearning the pending flag for all methods (when not doing
21284 explicit interface implementation).
21286 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
21288 * rootcontext.cs: added a couple more types needed to bootstrap.
21290 2002-06-17 Miguel de Icaza <miguel@ximian.com>
21292 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
21293 constructor in the type, instead of any constructor in the type
21294 hierarchy. Thanks to Paolo for finding this bug (it showed up as
21295 a bug in the Mono runtime when applying the params attribute).
21297 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
21298 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
21300 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
21302 * expression.cs (Unary.ResolveOperator): Use TypeManager
21303 to resolve the type.
21305 2002-06-13 Ravi Pratap <ravi@ximian.com>
21307 * cs-parser.jay (enum_member_declaration): Pass in the attributes
21310 * enum.cs (AddEnumMember): Add support to store the attributes associated
21311 with each member too.
21313 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
21314 field builders too - this takes care of the enum member case.
21316 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
21318 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
21319 address-of operator on both value types and pointers.
21321 2002-06-10 Martin Baulig <martin@gnome.org>
21323 * interface.cs (Interface.PopulateIndexer): Add the indexer's
21324 PropertyBuilder to the `property_builders' list.
21326 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
21327 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
21328 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
21329 find any indexers which are inherited from an interface.
21331 2002-06-09 Martin Baulig <martin@gnome.org>
21333 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
21334 the same type as the constant if necessary. There's also a test-130.cs
21337 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
21339 * typemanager.cs (TypeManager.ChangeType): Previously known as
21340 Enum.ChangeEnumType().
21342 2002-06-09 Martin Baulig <martin@gnome.org>
21344 * expression.cs (Cast.TryReduce): Added support for consts.
21346 2002-06-08 Ravi Pratap <ravi@ximian.com>
21348 * class.cs (Accessor): Hold attributes information so we can pass
21351 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
21352 Modify to pass in attributes attached to the methods.
21354 (add_accessor_declaration, remove_accessor_declaration): Ditto.
21356 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
21357 to handle the Accessor kind :-)
21359 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
21361 2002-06-08 Martin Baulig <martin@gnome.org>
21363 * expression.cs (Unary.TryReduceNegative): Added support for
21366 2002-06-08 Martin Baulig <martin@gnome.org>
21368 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
21369 name can't be found in the `defined_names' - the caller will do a
21370 MemberLookup in this case and thus find methods in System.Enum
21371 such as Enum.IsDefined().
21373 2002-06-08 Martin Baulig <martin@gnome.org>
21375 * enum.cs (Enum.ChangeEnumType): This is a custom version of
21376 Convert.ChangeType() which works with TypeBuilder created types.
21377 (Enum.LookupEnumValue, Enum.Define): Use it here.
21379 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
21380 `TypeBuilder.BaseType != null' check.
21381 (TypeContainer.FindMembers): Only lookup parent members if we
21382 actually have a parent.
21383 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
21384 (ConstructorInitializer.Resolve): Likewise.
21386 * interface.cs (Interface.FindMembers): Added
21387 `TypeBuilder.BaseType != null' check.
21389 * rootcontext.cs (RootContext.ResolveCore): Added
21390 "System.Runtime.CompilerServices.IndexerNameAttribute" to
21391 classes_second_stage.
21393 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
21394 debug_type and trace_type when compiling with --nostdlib.
21396 2002-06-07 Martin Baulig <martin@gnome.org>
21398 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
21399 (AddField): Set it to true when adding a non-static field.
21400 (DefineType): Use `have_nonstatic_fields' to find out whether we
21401 have non-static fields, not `Fields != null'.
21403 2002-06-02 Miguel de Icaza <miguel@ximian.com>
21405 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
21406 dereferencing a null on the static-field code path)
21408 2002-05-30 Martin Baulig <martin@gnome.org>
21410 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
21411 to take command line arguments. Use reflection to call the new
21412 custom `Initialize' function on the symbol writer and pass it the
21413 command line arguments.
21415 * driver.cs (--debug-args): New command line argument to pass command
21416 line arguments to the symbol writer.
21418 2002-05-28 Miguel de Icaza <miguel@ximian.com>
21420 * assign.cs (DoResolve): Forgot to do the implicit conversion to
21421 the target type for indexers and properties. Thanks to Joe for
21424 2002-05-27 Miguel de Icaza <miguel@ximian.com>
21426 * typemanager.cs (MethodFlags): returns the method flags
21427 (Obsolete/ShouldIgnore) that control warning emission and whether
21428 the invocation should be made, or ignored.
21430 * expression.cs (Invocation.Emit): Remove previous hack, we should
21431 not do this on matching a base type, we should do this based on an attribute
21433 Only emit calls to System.Diagnostics.Debug and
21434 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
21435 on the command line.
21437 * rootcontext.cs: Global settings for tracing and debugging.
21439 * cs-tokenizer.cs (define): New utility function to track
21440 defines. Set the global settings for TRACE and DEBUG if found.
21442 2002-05-25 Ravi Pratap <ravi@ximian.com>
21444 * interface.cs (Populate*): Pass in the TypeContainer as well as
21445 the DeclSpace as parameters so that we can create EmitContexts and
21446 then use that to apply attributes etc.
21448 (PopulateMethod, PopulateEvent, PopulateProperty)
21449 (PopulateIndexer): Apply attributes everywhere.
21451 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
21454 (ApplyAttributes): Update accordingly.
21456 We now apply interface attributes for all members too.
21458 2002-05-26 Miguel de Icaza <miguel@ximian.com>
21460 * class.cs (Indexer.Define); Correctly check if we are explicit
21461 implementation (instead of checking the Name for a ".", we
21462 directly look up if the InterfaceType was specified).
21464 Delay the creation of the PropertyBuilder.
21466 Only create the PropertyBuilder if we are not an explicit
21467 interface implementation. This means that explicit interface
21468 implementation members do not participate in regular function
21469 lookups, and hence fixes another major ambiguity problem in
21470 overload resolution (that was the visible effect).
21472 (DefineMethod): Return whether we are doing an interface
21475 * typemanager.cs: Temporary hack until we get attributes in
21476 interfaces (Ravi is working on that) and we get IndexerName
21477 support in interfaces.
21479 * interface.cs: Register the indexers as properties.
21481 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
21482 warning, I have verified that this is a bug in the .NET runtime
21483 (JavaScript suffers of the same problem).
21485 * typemanager.cs (MemberLookup): When looking up members for
21486 interfaces, the parent of an interface is the implicit
21487 System.Object (so we succeed in searches of Object methods in an
21488 interface method invocation. Example: IEnumerable x; x.ToString
21491 2002-05-25 Miguel de Icaza <miguel@ximian.com>
21493 * class.cs (Event): Events should also register if they do
21494 implement the methods that an interface requires.
21496 * typemanager.cs (MemberLookup); use the new GetInterfaces
21499 (GetInterfaces): The code used to lookup interfaces for a type is
21500 used in more than one place, factor it here.
21502 * driver.cs: Track the errors at the bottom of the file, we kept
21505 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
21506 instance if the method we are calling is static!
21508 2002-05-24 Miguel de Icaza <miguel@ximian.com>
21510 * attribute.cs (ApplyAttributes): Make this function filter out
21511 the IndexerName attribute (as that attribute in reality is never
21512 applied) and return the string constant for the IndexerName
21515 * class.cs (TypeContainer.Emit): Validate that all the indexers
21516 have the same IndexerName attribute, and if so, set the
21517 DefaultName attribute on the class.
21519 * typemanager.cs: The return value might contain other stuff (not
21520 only methods). For instance, consider a method with an "Item"
21521 property and an Item method.
21523 * class.cs: If there is a problem with the parameter types,
21526 2002-05-24 Ravi Pratap <ravi@ximian.com>
21528 * ecore.cs (ImplicitConversionExists): Wrapper function which also
21529 looks at user defined conversion after making a call to
21530 StandardConversionExists - we need this for overload resolution.
21532 * expression.cs : Update accordingly the various method calls.
21534 This fixes 2 bugs filed against implicit user defined conversions
21536 2002-05-22 Miguel de Icaza <miguel@ximian.com>
21538 * statement.cs: Track the result of the assignment.
21540 2002-05-21 Miguel de Icaza <miguel@ximian.com>
21542 * expression.cs (MemberAccess): Improved error reporting for
21543 inaccessible members.
21545 2002-05-22 Martin Baulig <martin@gnome.org>
21547 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
21548 itself with debugging support.
21550 2002-05-22 Martin Baulig <martin@gnome.org>
21552 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
21553 Removed, this isn't needed anymore.
21555 2002-05-20 Martin Baulig <martin@gnome.org>
21557 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
21558 be underlying type for an enum.
21560 2002-05-20 Miguel de Icaza <miguel@ximian.com>
21562 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
21563 that splits out the loading of just the core types.
21565 * rootcontext.cs (ResolveCore): Split the struct resolution in
21566 two, so we can load the enumeration underlying types before any
21569 * expression.cs (Is): Bandaid until we fix properly Switch (see
21570 bug #24985 for details).
21572 * typemanager.cs (ImplementsInterface): The hashtable will contain
21573 a null if there are no interfaces implemented.
21575 2002-05-18 Miguel de Icaza <miguel@ximian.com>
21577 * cs-parser.jay (indexer_declarator): It is fine to have array
21580 2002-05-17 Miguel de Icaza <miguel@ximian.com>
21582 * typemanager.cs: (RegisterBuilder): New function used to register
21583 TypeBuilders that implement interfaces. Since
21584 TypeBuilder.GetInterfaces (as usual) does not work with lame
21586 (AddUserType): register interfaces.
21588 (ImplementsInterface): Use the builder_to_ifaces hash if we are
21589 dealing with TypeBuilder. Also, arrays are showing up as
21590 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
21591 methods can not be invoked on them!
21593 * ecore.cs (ExplicitReferenceConversionExists): Made public.
21594 (ImplicitReferenceConversionExists): Split out from
21595 StandardConversionExists.
21597 * expression.cs (As): We were only implementing one of the three
21598 cases for the as operator. We now implement them all.
21599 (Is): Implement the various other cases for Is as well.
21601 * typemanager.cs (CACHE): New define used to control if we want or
21602 not the FindMembers cache. Seems to have a negative impact on
21603 performance currently
21605 (MemberLookup): Nested types have full acess to
21606 enclosing type members
21608 Remove code that coped with instance/static returns for events, we
21609 now catch this in RealFindMembers.
21611 (RealFindMembers): only perform static lookup if the instance
21612 lookup did not return a type or an event.
21614 2002-05-17 Miguel de Icaza <miguel@ximian.com>
21616 * assign.cs (CompoundAssign): We pass more semantic information
21617 now to Compound Assignments than we did before: now we have all
21618 the information at hand, and now we resolve the target *before* we
21619 do the expression expansion, which allows the "CacheValue" method
21620 to have the effect we intended (before, a [x] += 1 would generate
21621 two differen ArrayAccess expressions from the ElementAccess,
21622 during the resolution process).
21624 (CompoundAssign.DoResolve): Resolve target and original_source here.
21626 2002-05-16 Miguel de Icaza <miguel@ximian.com>
21628 * expression.cs (ArrayAccess): dropped debugging information.
21630 * typemanager.cs: Small bug fix: I was always returning i_members,
21631 instead of one of i_members or s_members (depending on which had
21634 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
21635 method is invoked before any code generation takes place, and it
21636 is a mechanism to inform that the expression will be invoked more
21637 than once, and that the method should use temporary values to
21638 avoid having side effects
21640 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
21642 * ecore.cs (Expression.CacheTemporaries): Provide empty default
21645 * expression.cs (Indirection, ArrayAccess): Add support for
21646 CacheTemporaries in these two bad boys.
21648 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
21649 ldobj or ldind_ref.
21650 (StoreFromPtr): Handle stobj as well.
21652 * expression.cs (UnaryMutator): Share more code.
21654 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
21655 down: I was not tracking the Filter function as well, which
21656 was affecting the results of the cache.
21658 2002-05-15 Miguel de Icaza <miguel@ximian.com>
21660 * attribute.cs: Remove the hack to handle the CharSet property on
21663 2002-05-14 Miguel de Icaza <miguel@ximian.com>
21665 * attribute.cs (DoResolve): More uglyness, we now only try to
21666 resolve the attribute partially, to extract the CharSet
21667 information (only if we are a StructLayout attribute). Otherwise
21669 (GetExtraTypeInfo): Add some code to conditionally kill in the
21670 future this. I am more and more convinced that the .NET
21671 framework has special code to handle the attribute setting on
21674 * expression.cs (IsParamsMethodApplicable): Revert my previous
21675 foreach change here, it was wrong.
21677 2002-05-13 Miguel de Icaza <miguel@ximian.com>
21679 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
21680 (pp_expr): do not abort on unknown input, just return.
21681 (eval): abort if there are pending chars.
21683 * attribute.cs (Attribute.Resolve): Positional parameters are
21684 optional. Deal with that case.
21686 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
21687 the Ansi/Unicode/Auto information for the type.
21689 (TypeContainer.DefineType): instantiate the EmitContext here, as
21690 we will be using it during the type definition (to resolve
21691 attributes) and during the emit phase.
21693 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
21694 to pull type information out of the attributes
21696 (Attribute.Resolve): track the constructor builder, and allow for
21697 multiple invocations (structs and classes will use this).
21699 * ecore.cs (MemberLookupFinal): new version with all the
21700 parameters customizable.
21702 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
21703 constructors. Return if the result value is null (as the error
21704 would have been flagged already by MemberLookupFinal)
21706 Do not allow instances of abstract classes or interfaces to be
21709 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
21710 We have to compare the assembly property here when dealing with
21711 FamANDAssem and Assembly access modifiers, because we might be
21712 creating an assembly from *modules* (that means that we are not
21713 getting TypeBuilders for types defined in other modules that are
21714 part of this assembly).
21716 (Method.Emit): If the method is marked abstract and has a body,
21719 (TypeContainer.DefineMembers): If both the defined member and the
21720 parent name match are methods, then do not emit any warnings: let
21721 the Method.Define routine take care of flagging warnings. But if
21722 there is a mismatch (method overrides something else, or method is
21723 overriwritten by something, then emit warning).
21725 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
21726 set to null, this means `do not check for the return type on the
21729 (Method.Define): set the return type for the method signature to
21730 null, so that we get methods with the same name and parameters and
21731 different return types. This is used to flag warning 114 (you are
21732 hiding a method, and you probably want to use the new/override
21735 * typemanager.cs (MemberLookup): Implemented proper access
21736 control, closing a long standing set of bug reports. The problem
21737 was that the Framework only has two bits: Public and NonPublic,
21738 and NonPublic includes private and protected methods, but we need
21739 to enforce the FamANDAssem, FamOrAssem and Family.
21741 2002-05-11 Miguel de Icaza <miguel@ximian.com>
21743 * statement.cs (GotoCase): Return true: Ammounts to giving up
21744 knowledge on whether we return or not, and letting the other case
21745 be responsible for it.
21747 2002-05-10 Miguel de Icaza <miguel@ximian.com>
21749 * driver.cs: Do not load directories for each file processed, only
21750 do it if there is a pattern.
21752 * ecore.cs: Report readonly assigns here as well, as we might have
21753 been resolved only by MemberAccess.
21755 (SimpleName.SimpleNameResolve): Also be useful for LValue
21756 resolution. We need this to propagate assign to local readonly variables
21758 * typemanager.cs: Use a ptrhashtable for the criteria, because we
21759 do not want to reuse potential criteria memory.
21761 * class.cs (MyEventBuilder): Set reflected_type;
21763 * ecore.cs (Constantify): Added support for constifying bools.
21765 (RootContext.LookupType): Added a cache for values looked up in
21766 the declaration space.
21768 * typemanager.cs (FindMembers): Now is a front-end to
21769 RealFindMembers, and provides a two-level hashtable-based cache to
21772 15% performance improvement: from 22.5 to 19.2 seconds.
21774 * expression.cs (IsParamsMethodApplicable): use foreach.
21775 (Invocation.DoResolve): ditto.
21776 (New.DoResolve): ditto.
21777 (ArrayCreation.DoResolve): ditto.
21779 * ecore.cs (FindMostEncompassingType): use foreach.
21781 * delegate.cs (NewDelegate.DoResolve): Use foreach
21783 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
21784 (RemoveMethods): use foreach.
21786 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
21787 nested foreach statements instead of for, and also break out of
21788 the inner loop once a match is found.
21790 (Invocation.OverloadResolve): Use foreach, simplify the code.
21792 2002-05-08 Miguel de Icaza <miguel@ximian.com>
21794 * cfold.cs (BinaryFold): During an enumeration evaluation context,
21795 we actually unwrap the expression to allow for extra information
21798 * expression.cs: Use Shr_Un on unsigned operations.
21800 2002-05-08 Ravi Pratap <ravi@ximian.com>
21802 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
21803 applicable operators was not being considered correctly. This closes
21804 the bug Miguel reported.
21806 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
21808 * attribute.cs: check that the type derives from System.Attribute
21809 and report the correct error in that case (moved the duplicate code to
21810 its own method, too).
21812 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
21814 * attribute.cs: lookup attribute type name as the spec says: first the
21815 bare attribute name and then name + "Attribute" (nant compiles with
21816 mcs after this fix).
21818 2002-05-07 Miguel de Icaza <miguel@ximian.com>
21820 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
21821 Because of the way we parse things, we should try to see if a
21822 UIntConstant can fit in an integer.
21824 2002-05-07 Ravi Pratap <ravi@ximian.com>
21826 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
21827 when we are in an explicit context.
21829 (ConvertReferenceExplicit): When converting from Iface type S to Class
21830 T make sure the rules are implemented as an OR.
21832 * parameter.cs (ParameterType): Make it a property for now although the
21833 purpose really isn't anything immediate.
21835 * expression.cs (Is*Applicable): Do better checking on the parameter type
21836 of a ref/out parameter. The ones from the system assemblies are already
21837 marked with the correct type so we don't need to do any correction.
21839 * ecore.cs (StandardConversionExists): Conversion from Interface types to
21840 the object type is standard too so include that.
21842 2002-05-06 Miguel de Icaza <miguel@ximian.com>
21844 * ecore.cs (StandardConversionExists): Augment with missing code:
21845 deal with IntConstant, LongConstants and Enumerations.
21847 * assign.cs: Report the error, instead of failing silently
21849 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
21850 typecontainer that they are declared, because the
21851 typecontainer/namespace will have the list of using clauses that
21852 need to be applied.
21854 Assembly Attributes were escaping the normal registration
21857 (EmitCode): Apply attributes within an EmitContext that represents
21858 the container they were declared on.
21860 * cs-parser.jay: Track bases for structs. How did I get this wrong?
21862 2002-05-06 Ravi Pratap <ravi@ximian.com>
21864 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
21865 Revamp completely - make much cleaner as we now operate only
21868 (FindMostSpecificSource, FindMostSpecificTarget): New methods
21869 to implement the logic detailed in the spec more correctly.
21871 (UserDefinedConversion): Update accordingly.
21873 2002-05-06 Miguel de Icaza <miguel@ximian.com>
21875 * statement.cs: Return flow analysis information up.
21877 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
21880 (token): Do not consume an extra character before calling
21883 2002-05-06 Piers Haken <piersh@friskit.com>
21885 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
21887 2002-05-06 Miguel de Icaza <miguel@ximian.com>
21889 * class.cs (Constructor.Emit): Set the IsStatic flag in the
21890 EmitContext during the instance constructor initializer
21891 resolution, to stop access to instance variables.
21893 This is mandated by the spec, last paragraph of the `constructor
21894 initializers' section.
21896 2002-05-05 Miguel de Icaza <miguel@ximian.com>
21898 * cs-parser.jay, class.cs (Accessor): new class used to represent
21899 an accessor (get or set). In the past we used `null' to represent
21900 a missing accessor. But this is ambiguous because there was no
21901 way to tell in abstract indexers/properties if one of them was
21904 Now there is a way of addressing that.
21906 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
21907 instead of FindMembers.
21909 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
21910 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
21912 * attribute.cs: Treat indexers and properties as the same in terms
21913 of applying attributes
21915 * ecore.cs (FindMostEncompassedType): Use statically initialized
21916 EmptyExpressions()s like we do elsewhere to avoid creating useless
21917 objects (and we take this out of the tight loop).
21919 (GetConversionOperators): Move the code to extract the actual
21920 operators to a separate routine to clean things up.
21922 2002-05-04 Miguel de Icaza <miguel@ximian.com>
21924 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
21925 events are always registered FieldBuilders.
21927 * class.cs (FieldBase): New class shared by Fields
21929 * delegate.cs: If we are a toplevel delegate, use our full name.
21930 If we are a nested delegate, then only use our tail name.
21932 2002-05-02 Ravi Pratap <ravi@ximian.com>
21934 * expression.cs (IsApplicable): Ensure that we add the "&" to
21935 ref/out types before comparing it with the type of the argument.
21937 (IsParamsMethodApplicable): Ditto.
21939 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
21942 * delegate.cs : Handle the case when we have more than one applicable
21943 method. Flag an error only when we finish checking all.
21945 2002-05-02 Miguel de Icaza <miguel@ximian.com>
21947 * expression.cs: Add support for boolean static initializers.
21949 2002-05-01 Miguel de Icaza <miguel@ximian.com>
21951 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
21953 * parameter.cs (ComputeParameterTypes,
21954 ComputeAndDefineParameterTypes): Better error handling: now we
21955 clear the `types' cache if we fail during any of the type lookups.
21956 We also return the status code correctly to our caller
21958 * delegate.cs: If we fail to define a delegate, abort the extra
21961 * expression.cs (Binary.ResolveOperator): for
21962 operator==(object,object) and operator !=(object, object) we also
21963 have to verify that there is an implicit conversion from one to
21966 (ArrayAccess.DoResolve): Array Access can operate on
21969 2002-04-30 Miguel de Icaza <miguel@ximian.com>
21971 * assign.cs (CompoundAssign): A new class used as a "flag" that
21972 the assignment actually is happening as part of a compound
21973 assignment operator.
21975 During compound assignment, a few new rules exist to enable things
21982 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
21983 to the type of x) if y is implicitly convertible to the type of x,
21984 and the operator is a builtin operator and the return type of the
21985 operator is explicitly convertible to the type of x.
21987 * rootcontext.cs: Reset warning level to 2. 4 catches various
21988 "interesting" features in mcs, we must clean this up at some
21989 point, but currently am trying to kill other bugs ;-)
21991 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
21992 in container classes as well.
21994 * expression.cs (Binary.ResolveOperator): Handle string case
21995 before anything else (as operator overloading does emit an error
21996 before doing anything else).
21998 This code could go away when we move to a table driven model, but
21999 i could not come up with a good plan last night.
22001 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
22003 * typemanager.cs (CSharpName): reimplementation using regex.
22004 * class.cs: added null check for fields in Emit
22005 * rootcontext.cs: set warninglevel to 4
22007 2002-04-29 Miguel de Icaza <miguel@ximian.com>
22009 * typemanager.cs (CSharpName): reimplemented with Lupus
22012 2002-04-28 Miguel de Icaza <miguel@ximian.com>
22014 * statement.cs (If): correclty implement Resolve, because we were
22015 not catching sem errors in there. The same process is needed
22017 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
22020 (Statement.Warning_DeadCodeFound): Factorize code.
22021 (While): Report dead code here too.
22023 (Statement): Added Resolve virtual method to allow
22024 for resolution split from the emit code.
22026 2002-04-26 Miguel de Icaza <miguel@ximian.com>
22028 * statement.cs (EmitBoolExpression): No longer try to resolve the
22030 (MakeBoolean): New utility function that resolve, implicitly
22031 converts to boolean and tags the expression.
22034 (If, Do): Implement dead code elimination.
22035 (While): Implement loop inversion
22037 (Do, While, For, If): Resolve the expression prior to calling our
22040 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
22043 - added method Report28 (warning: program has more than one entry point)
22044 - added method IsEntryPoint, implements paragraph 10.1 of the spec
22045 - modified method Method.Define, the part at the end of the method
22047 * rootcontext.cs: added static public Location EntryPointLocation;
22049 * ../errors/cs0028.cs : Add test case for the above warning.
22052 - modified method CSharpName to allow arrays of primitive type to
22053 be printed nicely (e.g. instead of System.Int32[][] it now prints
22055 - added method CSharpSignature: returns the signature of a method
22056 in string format to be used in reporting errors, warnings, etc.
22058 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
22061 2002-04-26 Ravi Pratap <ravi@ximian.com>
22063 * delegate.cs (Define): Fix extremely silly bug where I was
22064 setting the type of the 'object' parameter of the BeginInvoke
22065 method to System.IAsyncResult instead of System.Object ;-)
22067 2002-04-26 Miguel de Icaza <miguel@ximian.com>
22069 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
22072 (Constructor.Emit): return if we fail to initialize the
22073 constructor. Another door closed!
22075 * expression.cs (New.DoResolve): Improve error message (from -6 to
22076 1501). Use DeclaredOnly lookup to find the exact constructor.
22078 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
22079 loop. This is useful.
22081 * cs-parser.jay: Adjust the default parameters so that destructors
22082 have the proper signature.
22084 2002-04-26 Martin Baulig <martin@gnome.org>
22086 * driver.cs (LoadAssembly): If `assembly' contains any characters
22087 which are only valid in path names and not in assembly names
22088 (currently slash, backslash and point), use Assembly.LoadFrom ()
22089 instead of Assembly.Load () on the `assembly' (before iteration
22090 over the link_paths).
22092 2002-04-26 Martin Baulig <martin@gnome.org>
22094 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
22096 2002-04-25 Miguel de Icaza <miguel@ximian.com>
22098 * class.cs (Property): use the new typemanager.MemberLookup
22100 (TypeContainer.MemberLookup): Implement using the
22101 TypeManager.MemberLookup now.
22103 * typemanager.cs: Make MemberLookup a function of the TypeManager,
22104 and return MemberInfos, so that these can be used without an
22105 EmitContext (what we had before).
22107 2002-04-24 Miguel de Icaza <miguel@ximian.com>
22109 * expression.cs: Fix the case where the argument to params if the
22110 type of the params. I omitted handling this before. Fixed
22112 2002-04-22 Miguel de Icaza <miguel@ximian.com>
22114 * driver.cs: Call BootCorlib_PopulateCoreType
22116 * class.cs (Property.CheckBase): Check for properties only, not
22119 * interface.cs: Temporary hack: try/catch around the
22120 CustomAttributeBuilder, because I am getting an exception that I
22123 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
22124 types whose definitions are required to be there (attributes are
22125 defined before standard types).
22127 Compute definitions as we boot the various types, as they are used
22128 immediately (value_type class will need object_type, but if we do
22129 not initialize object_type, we will pass a null, which will let
22130 the runtime pick the System.Object from the existing corlib, which
22131 is not what we want).
22133 2002-04-22 Patrik Torstensson <totte@labs2.com>
22135 * cs-tokenizer.cs: fixed a number of trim() issues.
22137 2002-04-22 Ravi Pratap <ravi@ximian.com>
22139 * expression.cs (Argument.Type): Ensure that we return the correct
22140 type when we have out or ref parameters [in which case we
22143 2002-04-22 Miguel de Icaza <miguel@ximian.com>
22145 * class.cs (Property, Indexer): Allow extern modifier in there.
22147 * typemanager.cs (InitBaseTypes): Initializes object_type and
22148 value_type, since those will be used early on during the bootstrap
22149 process to compile corlib.
22151 (InitCoreTypes): Move code from here to InitBaseTypes.
22153 2002-04-21 Miguel de Icaza <miguel@ximian.com>
22155 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
22156 single-dimension arrays as using the ldlen opcode.
22158 Daniel Lewis discovered this optimization.
22160 * typemanager.cs: Add signature for System.Array::get_Length
22162 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22164 * statement.cs: report the error when the foreach does not apply to an
22165 array nor a collection.
22167 2002-04-19 Miguel de Icaza <miguel@ximian.com>
22169 * expression.cs: Add implicit conversions to the operator ~.
22171 * constant.cs (DecimalConstant.Emit): Emit decimal value.
22173 * typemanager.cs: Locate the decimal constructor.
22175 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22177 * attribute.cs: use the new property of TypeOf.
22178 * expression.cs: added 'get' property around typearg.
22180 These changes fix a build breaker reported by NickD. Is this the
22181 correct way to fix? If not, please, revert my changes and make it
22184 2002-04-17 Miguel de Icaza <miguel@ximian.com>
22186 * attribute.cs: Add support for typeof in attribute invocations.
22187 I am not sure that this is right though.
22189 2002-04-14 Duncan Mak <duncan@ximian.com>
22191 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
22192 Binary.Operator.Division case.
22194 2002-04-13 Ravi Pratap <ravi@ximian.com>
22196 * class.cs (DefineType): Ensure that we do a proper check on
22197 attribute types and also register it with the TypeManager.
22199 (TypeContainer.Targets): The default for attribute types is
22200 AttributeTargets.All.
22202 * attribute.cs (ApplyAttributes): Registering the attribute type
22203 is done elsewhere, not when we discover we have a Usage attribute.
22205 2002-04-12 Ravi Pratap <ravi@ximian.com>
22207 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
22208 and get rid of is_delegate parameter.
22210 * everywhere : update.
22212 2002-04-12 Ravi Pratap <ravi@ximian.com>
22214 * cs-parser.jay (compilation_unit): Revamp completely to use
22215 some new ideas that I got from Rhys' grammar to solve the problems
22216 with assembly level attributes.
22218 (outer_declaration): New grammar production.
22220 (attribute_sections): Add.
22222 (opt_attributes): Base on attribute_sections
22224 (namespace_declaration): Allow opt_attributes to tackle the case
22225 when we have assembly level attributes - we are clever in this
22228 * attribute.cs (ApplyAttributes): Do not worry about assembly
22229 attributes in the non-global context.
22231 * rootcontext.cs (AddGlobalAttributes): Go back to using this
22232 instead of SetGlobalAttributes.
22234 * class.cs, rootcontext.cs : Ensure we define and generate
22235 attribute types before anything else.
22237 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
22238 and flag the new error -20 for the case when the attribute type
22239 does not have valid targets specified. csc does not catch this.
22241 * ../errors/errors.txt : update for error # -20
22243 2002-04-11 Ravi Pratap <ravi@ximian.com>
22245 * support.cs (InternalParameters.ParameterModifier): Do some null
22246 checking and return sane values.
22248 * class.cs (Method.Define): If we are a PInvoke method, ensure
22249 that we are static and extern. Report error # 601
22251 * ../errors/cs0601.cs : Add test case for the above error.
22253 2002-04-07 Ravi Pratap <ravi@ximian.com>
22255 * rootcontext.cs (attribute_types): We need to keep type of
22256 all attribute types separately and emit code for them first.
22258 (RegisterAttribute) : Implement.
22260 * class.cs (DefineType): Check if the current Type is a custom
22261 attribute type and register it accordingly.
22263 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
22264 adding the first attribute twice and rename to
22266 (SetGlobalAttributes): this.
22268 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
22271 * attribute.cs (ApplyAttributes): Take an additional argument telling us
22272 if we are processing global arguments. Hmm, I am unsure of this.
22274 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22276 * expression.cs: added static array of strings to avoid calling
22277 Enum.ToString () for Operator in Binary. Significant recover of
22280 2002-04-10 Miguel de Icaza <miguel@ximian.com>
22282 * class.cs (FindMembers): Allow the Builders of the various
22283 members to be null. If they are skip them. This only happens
22284 during the PInvoke declaration.
22286 2002-04-09 Miguel de Icaza <miguel@ximian.com>
22288 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
22289 failure, so we do not keep going afterwards.
22291 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
22292 wanted to pass `false' as the `is_delegate' argument. If this is
22293 the case, why not use delegate_type == null to mean `is_delegate =
22294 false' and anything else as is_delegate = true.
22296 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
22298 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
22299 code for the section, not the beginning of the tests.
22301 2002-04-08 Miguel de Icaza <miguel@ximian.com>
22303 * cfold.cs: Handle operator + (Enum x, Underlying x)
22305 * expression.cs (Binary): same. Warn about errors where we have
22306 Enum/Enum in operator + as well.
22308 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
22311 - added support for switch(bool)
22312 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
22313 - add TableSwitchEmit() to handle table-based switch statements
22315 2002-04-05 Ravi Pratap <ravi@ximian.com>
22317 * expression.cs (Invocation.OverloadResolve): Factor out code which
22318 does parameter compatibility checking with arguments so that we can
22319 re-use the code even from Delegate.VerifyApplicability
22321 (VerifyArgumentsCompat): Move above code here.
22323 * delegate.cs (VerifyApplicability): Get rid of duplicate code
22324 and instead make a call to the above method.
22326 2002-03-31 Ravi Pratap <ravi@ximian.com>
22328 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
22329 We use it to keep track of classes which are attribute types.
22331 2002-04-02 Miguel de Icaza <miguel@ximian.com>
22333 * delegate.cs (Delegate.Define): Correctly define the types in the
22334 presence of fixed and array parameters.
22336 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
22339 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
22340 include NonPublic after the first iteration.
22342 * class.cs (Indexer.CheckBase): Only check if both parents are
22345 * cs-parser.jay (accessor_body): If empty, set to null.
22347 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
22348 same code path here to resolve constants names that we did have in
22349 MemberAccess.DoResolve. There is too much code duplicated here.
22351 2002-04-01 Miguel de Icaza <miguel@ximian.com>
22353 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
22355 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
22358 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
22359 tokens, numbers and strings.
22361 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
22364 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
22365 asyncronous parameters and the regular parameters.
22367 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
22368 specify the target directory.
22370 * expression.cs: (This.DoResolve): Simplify
22371 (As.Emit): Optimize, do not generate IsInst if the expression is
22372 always of the given type.
22374 (Is.DoResolve): Bug fix, we were reporting both always/never for
22377 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
22378 creating too many unnecessary arrays.
22380 2002-03-31 Miguel de Icaza <miguel@ximian.com>
22382 * class.cs (EmitFieldInitializer): Use Assign expression to assign
22383 fields instead of rolling our own initializer. Takes care of all
22384 implicit conversions, and drops unnecessary static checks/argument.
22386 2002-03-31 Dick Porter <dick@ximian.com>
22388 * driver.cs: use the GetDirectories() return values properly, and
22389 use "/" as path separator.
22391 2002-03-30 Miguel de Icaza <miguel@ximian.com>
22393 * expression.cs (Unary): Optimize - - expr into expr.
22394 (Binary): Optimize a + (-b) into a -b.
22396 * codegen.cs (CodeGen): Made all methods static.
22398 2002-03-29 Miguel de Icaza <miguel@ximian.com>
22402 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
22403 TypeBuilder property.
22405 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
22408 * tree.cs: Removed the various RecordXXXX, and replaced with a
22409 single RecordDecl. Removed all the accessor methods, and just
22410 left a single access point Type
22412 * enum.cs: Rename DefineEnum to DefineType.
22414 * decl.cs: New abstract method `DefineType' used to unify the
22415 Defines for Enumerations, Interfaces, TypeContainers and
22418 (FindType): Moved LookupInterfaceOrClass here. Moved the
22419 LookupBaseClasses method that used to live in class.cs and
22420 interface.cs here, and renamed to FindType.
22422 * delegate.cs: Implement DefineType. Take advantage of the
22423 refactored pattern for locating the parent builder without taking
22424 the parent_builder argument (which we know does not work if we are
22425 nested, and triggering a toplevel definition).
22427 2002-03-28 Miguel de Icaza <miguel@ximian.com>
22429 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
22430 accessibility of a member has changed during override and report
22433 * class.cs (Method.Define, Property.Define): Only complain on
22434 overrides if the method is private, any other accessibility is
22435 fine (and since we just checked the permission is the same, we are
22438 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
22439 and elif are processed always. The other pre-processing
22440 directives are only processed if we are "taking" the path
22442 2002-03-29 Martin Baulig <martin@gnome.org>
22444 * class.cs (Method.Emit): Only emit symbolic debugging info if the
22445 current location is not Null.
22447 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
22448 a separate method so we can profile it.
22450 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
22451 `span.Seconds' are just seconds, but no minutes or hours.
22452 (MainDriver): Profile the CodeGen.SaveSymbols calls.
22454 2002-03-28 Miguel de Icaza <miguel@ximian.com>
22456 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
22457 Remove the gratuitous set of Final:
22459 // If an interface implementation, then we can set Final.
22460 if (((flags & MethodAttributes.Abstract) == 0) &&
22461 implementing.DeclaringType.IsInterface)
22462 flags |= MethodAttributes.Final;
22464 I do not know what I was smoking when I used that.
22467 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
22468 step into fixing the name resolution issues for delegates and
22469 unifying the toplevel name resolution.
22471 2002-03-28 Martin Baulig <martin@gnome.org>
22473 * class.cs (Method.Emit): If we have a symbol writer, call its
22474 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
22475 tell it about the current method.
22477 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
22478 writer that we're going to emit the first byte of IL code for a new
22479 statement (a new source line).
22480 (EmitContext.EmitTopBlock): If we have a symbol writer, call
22481 EmitContext.Mark() before emitting any code.
22483 * location.cs (SymbolDocument): Return null when we're Null.
22485 * statement.cs (Statement): Moved the `Location loc' variable here.
22486 (Statement.EmitBoolExpression): If we have a symbol writer, call
22487 ec.Mark() before emitting any code to tell it that we're at the
22488 beginning of a new statement.
22489 (StatementExpression): Added `Location' argument to the constructor.
22490 (Block): Added public readonly variable `StartLocation' and public
22491 variable `EndLocation'. The latter is to be set using SetEndLocation().
22492 (Block): Added constructor which takes a start and end location.
22493 (Block.SetEndLocation): New method. This sets the end location.
22494 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
22495 local variables we create.
22496 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
22497 each statement and do also mark the begin and end of the block.
22499 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
22500 tell it the current lexer.Location, use Location.Null for the end of the
22502 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
22503 current block, set its end location using SetEndLocation().
22504 (statement_expression): StatementExpression constructor now takes the
22505 lexer.Location as additional argument.
22506 (for_statement, declare_local_variables): Likewise.
22507 (declare_local_variables): When creating a new implicit block, use the
22508 new Block constructor and pass it the lexer.Location.
22510 2002-03-28 Miguel de Icaza <miguel@ximian.com>
22512 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
22513 members also on the parent interfaces recursively.
22515 2002-03-27 Miguel de Icaza <miguel@ximian.com>
22517 * report.cs: Use new formats, since Gonzalo finished the missing
22520 * expression.cs (Binary.ResolveOperator): added missing operator|
22521 operator& and operator^ for bool/bool.
22523 * cs-parser.jay: CheckDef now takes a Location argument that is
22524 used to report errors more precisly (instead of reporting the end
22525 of a definition, we try to track something which is a lot closer
22526 to the source of the problem).
22528 * cs-tokenizer.cs: Track global token use, so we can properly flag
22529 the use of #define/#undef after the first token has been seen.
22531 Also, rename the reportXXXX to Error_DescriptiveName
22533 * decl.cs (DeclSpace.IsTopLevel): Move property here from
22534 TypeContainer, so that Enum and Interface can use this too.
22536 * class.cs (TypeContainer.LookupInterfaceOrClass,
22537 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
22538 `builder' argument. Typically this was used to pass the parent
22539 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
22542 The problem is that a nested class could trigger the definition of
22543 a toplevel class, and the builder would be obviously wrong in that
22546 So we drop this argument, and we compute dynamically the
22547 TypeBuilder/ModuleBuilder (the correct information was available
22548 to us anyways from DeclSpace.Parent)
22550 * interface.cs (Interface.DefineInterface): Drop builder
22551 parameter cleanup like class.cs
22553 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
22556 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
22559 (Try.Emit): Propagate the returns value from the statement.
22561 (Return.Emit): Even if we are leavning
22563 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
22565 * modifiers.cs: Fix the computation of MethodAttributes flags.
22567 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
22569 * driver.cs: allow compilation of files that start with '/'.
22570 Add a default case when checking the argument of --target.
22572 2002-03-25 Miguel de Icaza <miguel@ximian.com>
22574 * interface.cs: Implement the same search algorithm for types in
22575 the interface code.
22577 * delegate.cs: Do not allow multiple definition.
22579 * Recovered ChangeLog that got accidentally amputated
22581 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
22583 * rootcontext.cs: Load manually enum to allow core classes to
22584 contain enumerations.
22586 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
22587 Update to new static methods in TypeManager.
22589 * typemanager.cs (GetMethod, GetConstructor): Use our
22590 implementation of FindMembers to find the members, since during
22591 corlib compilation, the types are TypeBuilders and GetMethod and
22592 GetConstructor do not work.
22594 Make all methods in TypeManager static.
22596 (InitCodeHelpers): Split the functionality from
22597 the InitCodeTypes function.
22599 * driver.cs: Call InitCodeHelpers after we have populated the
22602 * cs-parser.jay (delegate_declaration): we did not used to compute
22603 the delegate name correctly for void delegates.
22605 2002-03-24 Miguel de Icaza <miguel@ximian.com>
22607 * rootcontext.cs (RootContext): Init the interface_resolve_order
22608 and type_container_resolve_order always.
22610 (ResolveCore, BootstrapCorlib_ResolveClass,
22611 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
22612 compiler when compiling with --nostdlib
22614 * class.cs (TypeContainer.DefineType): Check that our parent is
22615 not null. This test is most important when we are bootstraping
22618 * codegen.cs: Split out the symbol writing code.
22620 2002-03-25 Martin Baulig <martin@gnome.org>
22622 * driver.cs (-g): Made -g an alias for --debug.
22624 2002-03-24 Martin Baulig <martin@gnome.org>
22626 * codegen.cs (SymbolWriter): New public variable. Returns the
22627 current symbol writer.
22628 (CodeGen): Added `bool want_debugging_support' argument to the
22629 constructor. If true, tell the ModuleBuild that we want debugging
22630 support and ask it for the ISymbolWriter.
22631 (Save): If we have a symbol writer, call it's Close() method after
22632 saving the assembly.
22634 * driver.c (--debug): New command line argument to create a
22635 debugger information file.
22637 * location.cs (SymbolDocument): New public property. Returns an
22638 ISymbolDocumentWriter object for the current source file or null
22639 if we don't have a symbol writer.
22641 2002-03-21 Miguel de Icaza <miguel@ximian.com>
22643 * driver.cs (LoadAssembly): Correctly return when all the paths
22644 have been tried and not before.
22646 * statement.cs (Switch.Emit): return the actual coverage for this
22647 statement (returns/not-returns)
22649 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
22650 switch of the statement if we are the last switch section. That
22651 kills two problems: try/catch problems (we used to emit an empty
22652 nop at the end) and switch statements where all branches would
22655 2002-03-19 Miguel de Icaza <miguel@ximian.com>
22657 * driver.cs: Add default assemblies (the equivalent to the
22658 Microsoft CSC.RSP file)
22660 * cs-tokenizer.cs: When updating `cols and setting it to zero,
22661 also update tokens_seen and set it to false.
22663 * driver.cs: Implement --recurse for Mike.
22665 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
22666 correctly splitting out the paths.
22668 2002-03-18 Miguel de Icaza <miguel@ximian.com>
22670 * interface.cs (Interface.PopulateProperty): Instead of using
22671 `parent' as the declaration space for the set parameters, use
22674 * support.cs (InternalParameters): InternalParameters constructor
22675 takes a DeclSpace instead of a TypeContainer.
22677 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
22678 types are being initialized, load the address of it before calling
22681 (New): Provide a mechanism to disable the generation of local
22682 value type temporaries when the caller will be providing us with
22683 an address to store it.
22685 (ArrayCreation.EmitDynamicInitializers): Use it.
22687 2002-03-17 Miguel de Icaza <miguel@ximian.com>
22689 * expression.cs (Invocation.EmitArguments): Only probe for array
22690 property if there is more than one argument. Sorry about that.
22692 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
22693 empty param arrays.
22695 * class.cs (Method.LabelParameters): Fix incorrect code path that
22696 prevented the `ParamArrayAttribute' from being applied to the
22699 2002-03-16 Miguel de Icaza <miguel@ximian.com>
22701 * support.cs (ReflectionParameters): Correctly compute whether the
22702 last argument is a params array. Fixes the problem with
22705 * typemanager.cs: Make the assemblies array always be non-null
22706 (empty, but non-null)
22708 * tree.cs (RecordDecl): New function that abstracts the recording
22709 of names. This reports error 101, and provides a pointer to the
22710 previous declaration. Fixes a crash in the compiler.
22712 * cs-parser.jay (constructor_declaration): Update to new grammar,
22713 and provide a constructor_body that can be empty.
22715 2002-03-15 Miguel de Icaza <miguel@ximian.com>
22717 * driver.cs: Add support for --resources.
22719 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
22720 Make all types for the various array helper methods be integer.
22722 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
22723 CheckState to ConvCast.
22725 (ConvCast): Now it takes a `checked' state argument, to avoid
22726 depending on the emit context for the conversion, and just using
22727 the resolve time setting.
22729 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
22730 instead of Invocation.EmitArguments. We do not emit the original
22731 arguments, instead we emit those which have been converted to
22732 unsigned int expressions.
22734 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
22736 * codegen.cs: ditto.
22738 * expression.cs (LocalVariableReference): Drop the use of the
22739 Store function that depended on the variable index.
22741 * statement.cs (VariableInfo): Drop the `Idx' property from this
22742 class, as this is not taking into account the indexes for
22743 temporaries tat we generate during the execution, getting the
22746 * class.cs: First emit class initializers, then call the parent
22749 * expression.cs (Binary): Fix opcode emision.
22750 (UnaryMutator.EmitCode): Support checked code generation
22752 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
22753 matches for events for both the Static and Instance scans,
22754 pointing to the same element. Fix that.
22756 2002-03-14 Miguel de Icaza <miguel@ximian.com>
22758 * rootcontext.cs (ResolveTree): Always set the
22759 interface_resolve_order, because nested interfaces will be calling
22762 * class.cs (GetInterfaceOrClass): Track the same resolution
22763 process used by TypeManager.LookupType. This fixes the nested
22764 type lookups in class declarations (separate path from
22767 (TypeContainer.DefineType): Also define nested interfaces.
22768 (TypeContainer.RegisterOrder): New public function used to
22769 register the order in which child interfaces need to be closed.
22771 Nested interfaces need to be closed after their parents have been
22774 * interface.cs (InterfaceAttr): Put all the logic for computing
22775 the interface attribute here.
22777 (DefineInterface): Register our interface order with the
22778 RootContext or with the TypeContainer depending on the case.
22780 2002-03-12 Miguel de Icaza <miguel@ximian.com>
22782 * cs-parser.jay: rework foreach statement to work with the new
22783 changes to the policy on SimpleNames.
22785 * report.cs: support Stacktrace on warnings as well.
22787 * makefile: drop --unsafe and /unsafe from the compile.
22789 2002-03-13 Ravi Pratap <ravi@ximian.com>
22791 * ecore.cs (StandardConversionExists): Modify to take an Expression
22792 as the first parameter. Ensure we do null -> reference type conversion
22795 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
22796 temporary Expression objects.
22798 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
22800 * interface.cs: workaround bug in method overloading resolution
22801 (there is already a bugzilla bug for it).
22803 2002-03-12 Miguel de Icaza <miguel@ximian.com>
22805 We could also solve this problem by having a separate path for
22806 performing type lookups, instead of DoResolve, we could have a
22807 ResolveType entry point, and only participating pieces of the
22808 production (simplename, deref, array) would implement this.
22810 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
22811 signal SimpleName to only resolve type names and not attempt to
22812 resolve anything else.
22814 * expression.cs (Cast): Set the flag.
22816 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
22818 * class.cs: Only report 108 if there is no `new' modifier.
22820 * cs-parser.jay: rework foreach statement to work with the new
22821 changes to the policy on SimpleNames.
22823 * report.cs: support Stacktrace on warnings as well.
22825 * makefile: drop --unsafe and /unsafe from the compile.
22827 2002-03-11 Miguel de Icaza <miguel@ximian.com>
22829 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
22830 lookups here, instead of doing that at parse time. This means
22831 that our grammar will not introduce `LocalVariableReferences' as
22832 expressions at this point. That solves the problem of code like
22836 static void Main ()
22840 This is only half the fix. The full fix requires parameters to
22841 also be handled in this way.
22843 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
22844 makes the use more obvious of the DeclSpace. The
22845 ec.TypeContainer.TypeBuilder is now only used to pull the
22846 TypeBuilder for it.
22848 My theory is that I can get rid of the TypeBuilder completely from
22849 the EmitContext, and have typecasts where it is used (from
22850 DeclSpace to where it matters).
22852 The only pending problem is that the code that implements Aliases
22853 is on TypeContainer, and probably should go in DeclSpace.
22855 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
22856 lookups here, instead of doing that at parse time. This means
22857 that our grammar will not introduce `LocalVariableReferences' as
22858 expressions at this point. That solves the problem of code like
22862 static void Main ()
22866 This is only half the fix. The full fix requires parameters to
22867 also be handled in this way.
22869 * class.cs (Property.DefineMethod): When implementing an interface
22870 method, set newslot, when implementing an abstract method, do not
22871 set the flag (before we tried never setting it, or always setting
22872 it, which is the difference).
22873 (Indexer.DefineMethod): same.
22874 (Method.DefineMethod): same.
22876 * ecore.cs: Only set the status used flag if we get back a Field.
22878 * attribute.cs: Temporary hack, so Paolo can keep working.
22880 2002-03-08 Ravi Pratap <ravi@ximian.com>
22882 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
22883 the unmanaged type in the case we have a MarshalAs attribute.
22885 (Resolve): Handle the case when we are parsing the special MarshalAs
22886 attribute [we need to store the unmanaged type to use later]
22888 * typemanager.cs (marshal_as_attr_type): Built in type for the
22889 MarshalAs Attribute.
22891 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
22892 on parameters and accordingly set the marshalling info.
22894 2002-03-09 Miguel de Icaza <miguel@ximian.com>
22896 * class.cs: Optimizing slightly by removing redundant code after
22897 we switched to the `NoTypes' return value.
22898 (Property.DefineMethod): use NoTypes here too.
22900 This fixes the bug I introduced in my last batch of changes.
22902 2002-03-05 Ravi Pratap <ravi@ximian.com>
22904 * tree.cs (RecordEnum): Add. We now keep track of enums too.
22906 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
22907 Enums since those are types too.
22909 * cs-parser.jay (enum_declaration): Record enums as we parse them.
22911 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
22912 thanks to a call during the lookup process.
22914 2002-03-07 Miguel de Icaza <miguel@ximian.com>
22916 * statement.cs (Foreach): Lots of work to accomodate a particular
22917 kind of foreach statement that I had not kept in mind. It is
22918 possible to have foreachs on classes that provide a GetEnumerator
22919 method that return objects that implement the "pattern" for using
22920 a foreach, there is no need to support GetEnumerator
22923 This is needed to compile nant.
22925 * decl.cs: Only report 114 if the member is not `Finalize' and if
22926 the warning level is at least 2.
22928 * class.cs: Moved the compare function from Method to
22931 (MethodSignature.InheritableMemberSignatureCompare): Add new
22932 filter function that is used to extract inheritable methods from a
22935 (Method.Define): Use the new `inheritable_method_signature_filter'
22938 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
22941 2002-03-06 Miguel de Icaza <miguel@ximian.com>
22943 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
22945 * cs-parser.jay: Add opt_semicolon to the interface declaration.
22947 * expression.cs: Pass location information to
22948 ConvertImplicitStandard.
22950 * class.cs: Added debugging code to track return values from
22953 2002-03-05 Miguel de Icaza <miguel@ximian.com>
22955 * expression.cs (Is.DoResolve): If either side of the `is' is an
22956 interface, do not flag the warning.
22958 * ecore.cs (ImplicitReferenceConversion): We need a separate test
22961 * report.cs: Allow for --fatal to be used with --probe.
22963 * typemanager.cs (NoTypes): Move the definition for the empty Type
22966 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
22968 (TypeContainer.DefineProxy): New function used to proxy to parent
22969 implementations when implementing interfaces.
22970 (TypeContainer.ParentImplements): used to lookup if our parent
22971 implements a public function that is required by an interface.
22972 (TypeContainer.VerifyPendingMethods): Hook this up.
22974 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
22975 `modules' and `assemblies' arraylists into arrays. We only grow
22976 these are the very early start up of the program, so this improves
22977 the speedof LookupType (nicely measured).
22979 * expression.cs (MakeByteBlob): Replaced unsafe code with
22980 BitConverter, as suggested by Paolo.
22982 * cfold.cs (ConstantFold.Binary): Special case: perform constant
22983 folding of string concatenation, but if either side is a string,
22984 and the other is not, then return null, and let the runtime use
22985 the concatenation on the string plus the object (using
22986 `Object.ToString').
22988 2002-03-04 Miguel de Icaza <miguel@ximian.com>
22990 Constant Folding has been implemented now.
22992 * expression.cs (Unary.Reduce): Do not throw an exception, catch
22993 the error instead on types that are not supported in one's
22996 * constant.cs (Constant and all children): New set of functions to
22997 perform implict and explicit conversions.
22999 * ecore.cs (EnumConstant): Implement the new functions to perform
23000 conversion by proxying to the child expression.
23002 * codegen.cs: (ConstantCheckState): Constant evaluation has its
23003 own separate setting that can not be turned off from the command
23004 line using --unchecked or --checked and is only controlled using
23005 the checked/unchecked statements and expressions. This setting is
23006 used by the constant folder to flag errors.
23008 * expression.cs (CheckedExpr, UncheckedExpr): Set the
23009 ConstantCheckState as well.
23011 During Resolve, they also have to flag the state, because the
23012 constant folder runs completely in the Resolve phase.
23014 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
23017 2002-03-01 Miguel de Icaza <miguel@ximian.com>
23019 * cfold.cs: New file, this file contains the constant folder.
23021 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
23022 argument to track whether we are using the resulting address to
23023 load or store a value and provide better error messages.
23025 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
23026 new AddressOf arguments.
23028 * statement.cs (Foreach.EmitCollectionForeach): Update
23030 * expression.cs (Argument.Emit): Call AddressOf with proper
23031 arguments to track usage.
23033 (New.DoEmit): Call AddressOf with new arguments.
23035 (Unary.Emit): Adjust AddressOf call.
23037 2002-03-01 Ravi Pratap <ravi@ximian.com>
23039 * cs-parser.jay (member_access): Change the case for pre-defined types
23040 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
23043 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
23046 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
23047 essentially like methods and apply attributes like MethodImplOptions to them too.
23049 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
23052 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
23053 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
23056 * Update code everywhere accordingly.
23058 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
23060 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
23062 2002-02-28 Ravi Pratap <ravi@ximian.com>
23064 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
23065 try performing lookups against those instead of jumping straight into using
23066 the 'using' clauses.
23068 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
23070 (LookupType): Perform lookups in implicit parents too.
23072 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
23073 sequence as RootContext.LookupType.
23075 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
23076 the various cases of namespace lookups into this method.
23078 2002-03-01 Miguel de Icaza <miguel@ximian.com>
23080 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
23081 in positional arguments)
23083 * class.cs (Operator): Update the AllowedModifiers to contain
23086 * cs-parser.jay: Update operator declaration to allow for the
23087 operator body to be empty.
23089 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
23092 2002-02-27 Miguel de Icaza <miguel@ximian.com>
23094 * class.cs (Method.Emit): Label parameters.
23096 * driver.cs: Return 1 or 0 as the program exit code.
23098 2002-02-26 Miguel de Icaza <miguel@ximian.com>
23100 * expression.cs: Special case the `null' object when trying to
23101 auto-compute the type, as anything can be explicitly converted to
23104 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
23105 spotting this Paolo.
23107 (Expression.ImplicitNumericConversion): Perform comparissions of
23108 the type using the underlying type in the case of an enumeration
23109 rather than using the enumeration type for the compare.
23111 Cope with the underlying == type case, which is not possible to
23114 (Expression.ConvertNumericExplicit): Perform comparissions of
23115 the type using the underlying type in the case of an enumeration
23116 rather than using the enumeration type for the compare.
23118 * driver.cs: If the user does not supply an extension, assume .exe
23120 * cs-parser.jay (if_statement): Rewrote so that we can track the
23121 location for the if statement.
23123 * expression.cs (Binary.ConstantFold): Only concat strings when
23124 the operation is "+", not everything ;-)
23126 * statement.cs (Statement.EmitBoolExpression): Take a location
23128 (If, While, Do): Track location.
23130 * expression.cs (Binary.ResolveOperator): In the object + string
23131 case, I was missing a call to ConvertImplicit
23133 2002-02-25 Ravi Pratap <ravi@ximian.com>
23135 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
23136 Location arguments. Ensure we use RootContext.LookupType to do our work
23137 and not try to do a direct Type.GetType and ModuleBuilder.GetType
23139 * interface.cs (PopulateMethod): Handle the type of the parameter being
23142 * expression.cs (Invocation.BetterFunction): Handle the case when we
23143 have a params method with no fixed arguments and a call is made with no
23146 2002-02-25 Miguel de Icaza <miguel@ximian.com>
23148 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
23149 the verbatim-string-literal
23151 * support.cs (InternalParameters.ParameterModifier): handle null
23153 (InternalParameters.ParameterType): ditto.
23155 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
23156 duplicating the name of the variable parameter.
23157 (GetParameterByName): Fix bug where we were not looking up array
23158 paramters if they were the only present (thanks Paolo!).
23159 (GetParameterInfo): We only have an empty set of types if both
23160 fixed and array are set to null.
23161 (GetParameterInfo-idx): Handle FixedParameter == null
23163 * cs-parser.jay: Handle the case where there is no catch
23164 statements (missing null test).
23166 2002-02-22 Miguel de Icaza <miguel@ximian.com>
23168 * driver.cs (MainDriver): Be conservative on our command line
23171 Catch DirectoryNotFoundException when calling GetFiles.
23173 (SplitPathAndPattern): Used to split the input specification into
23174 a path and a pattern that we can feed to Directory.GetFiles.
23176 2002-02-21 Miguel de Icaza <miguel@ximian.com>
23178 * statement.cs (Fixed): Implement the last case of the Fixed
23179 statement (string handling).
23181 * expression.cs (StringPtr): New class used to return a char * to
23182 a string; Used by the Fixed statement.
23184 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
23186 * expression.cs (Binary.ResolveOperator): Remove redundant
23187 MemberLookup pn parent type.
23188 Optimize union call, we do not need a union if the types are the same.
23189 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
23192 Specialize the use of MemberLookup everywhere, instead of using
23193 the default settings.
23195 (StackAlloc): Implement stackalloc keyword.
23197 * cs-parser.jay: Add rule to parse stackalloc.
23199 * driver.cs: Handle /h, /help, /?
23201 * expression.cs (MakeByteBlob): Removed the hacks we had in place
23202 before we supported unsafe code.
23204 * makefile: add --unsafe to the self compilation of mcs.
23206 2002-02-20 Miguel de Icaza <miguel@ximian.com>
23208 * expression.cs (PointerArithmetic): New class that is used to
23209 perform pointer arithmetic.
23210 (Binary.Resolve): Handle pointer arithmetic
23211 Handle pointer comparission.
23212 (ArrayPtr): Utility expression class that is used to take the
23213 address of an array.
23215 (ElementAccess): Implement array access for pointers
23217 * statement.cs (Fixed): Implement fixed statement for arrays, we
23218 are missing one more case before we are done.
23220 * expression.cs (Indirection): Implement EmitAssign and set the
23221 ExprClass to Variable. This allows pointer dereferences to be
23222 treated as variables, and to have values assigned to them.
23224 * ecore.cs (Expression.StoreFromPtr): New utility function to
23225 store values dereferencing.
23227 2002-02-20 Ravi Pratap <ravi@ximian.com>
23229 * expression.cs (Binary.ResolveOperator): Ensure that we are
23230 not trying to operate on a void type - this fixes the reported
23233 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
23234 the parent implementation is sealed.
23236 * ../errors/cs0239.cs : Add.
23238 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
23240 * typemanager.cs (unverifiable_code_type): Corresponds to
23241 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
23242 which have unsafe code in them.
23244 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
23247 2002-02-19 Miguel de Icaza <miguel@ximian.com>
23249 * cs-tokenizer.cs: Add support for @"litreal strings"
23251 Make tokenizer accept pre-processor directives
23252 on any column (remove the old C-like limitation).
23254 * rootcontext.cs (EmitCode): Emit any global attributes.
23255 (AddGlobalAttributes): Used to keep track of assembly attributes.
23257 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
23259 * cs-parser.jay: Add support for global attributes.
23261 2002-02-17 Miguel de Icaza <miguel@ximian.com>
23263 * expression.cs (Indirection): New helper class. Unary will
23264 create Indirection classes to be able to implement the
23265 IMemoryLocation interface on it.
23267 2002-02-16 Miguel de Icaza <miguel@ximian.com>
23269 * cs-parser.jay (fixed_statement): reference the right statement.
23271 * statement.cs (Fixed.Emit): Finish implementing the fixed
23272 statement for the &x case.
23274 2002-02-14 Miguel de Icaza <miguel@ximian.com>
23276 * class.cs (Property.Define, Method.Define): Remove newslot when
23279 * modifiers.cs: My use of NewSlot when `Abstract' was set was
23280 wrong. NewSlot should only be used if the `new' keyword is present.
23282 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
23283 locating our system dir. Sorry about this.
23285 2002-02-13 Miguel de Icaza <miguel@ximian.com>
23287 * driver.cs (GetSystemDir): Compute correctly the location of our
23288 system assemblies. I was using the compiler directory instead of
23289 the library directory.
23291 2002-02-13 Ravi Pratap <ravi@ximian.com>
23293 * expression.cs (BetterFunction): Put back in what Miguel commented out
23294 since it is the correct fix. The problem is elsewhere ;-)
23296 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
23297 parameters of the parms method are themselves compatible or not !
23299 (StandardConversionExists): Fix very dangerous bug where we were forgetting
23300 to check that a class implements an interface before saying that an implicit
23301 conversion was allowed. Use ImplementsInterface to do the checking.
23303 2002-02-13 Miguel de Icaza <miguel@ximian.com>
23305 * class.cs (Method.Define): Track whether we are an explicit
23306 implementation or not. And only call DefineMethodOverride if we
23307 are an explicit implementation.
23309 (Property.DefineMethod): Ditto.
23311 2002-02-11 Ravi Pratap <ravi@ximian.com>
23313 * expression.cs (BetterFunction): Catch hideous bug which was
23314 preventing us from detecting ambiguous calls due to implicit casts i.e
23317 2002-01-29 Miguel de Icaza <miguel@ximian.com>
23319 * support.cs (Pair): Remove un-needed method. I figured why I was
23320 getting the error in cs-parser.jay, the variable in a foreach loop
23321 is readonly, and the compiler does not really treat this as a variable.
23323 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
23324 instead of EQUALS in grammar.
23326 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
23328 * expression.cs (Unary.DoResolve): Check whether the argument is
23331 2002-01-28 Miguel de Icaza <miguel@ximian.com>
23333 * support.cs: Api for Pair to set a value. Despite the fact that
23334 the variables are public the MS C# compiler refuses to compile
23335 code that accesses the field if the variable is part of a foreach
23338 * statement.cs (Fixed): Begin implementation of the fixed
23341 (Block.AddVariable): Return the VariableInfo on success and null
23342 on failure instead of true/false.
23344 * cs-parser.jay (foreach): Catch errors on variables already
23345 defined (we were ignoring this value before) and properly unwind
23346 the block hierarchy
23348 (fixed_statement): grammar for the fixed statement.
23350 2002-01-25 Miguel de Icaza <miguel@ximian.com>
23352 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
23353 pointer types to be incretemented.
23355 (SizeOf): Implement.
23357 * cs-parser.jay (pointer_member_access): Implement
23358 expr->IDENTIFIER production.
23360 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
23361 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
23364 (Unary): Implement indirection.
23366 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
23367 use in non-unsafe context).
23369 (SimpleName.DoResolve): Check for pointers in field access on safe
23372 (Expression.LoadFromPtr): Factor the load-indirect code in this
23373 function. This was duplicated in UnboxCast and ParameterReference
23375 2002-01-24 Miguel de Icaza <miguel@ximian.com>
23377 * expression.cs (ComposedCast): report an error if a pointer cast
23378 is used in a safe region.
23380 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
23381 pointer type casts in unsafe context.
23383 * codegen.cs (EmitContext): Set up IsUnsafe.
23385 * cs-parser.jay (non_expression_type): Add productions for pointer
23388 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
23389 code. We should not use force into static mode if the method is
23390 not virtual. Fixes bug in MIS
23392 * statement.cs (Do.Emit, While.Emit, For.Emit,
23393 Statement.EmitBoolExpression): Add support to Do and While to
23394 propagate infinite loop as `I do return' semantics.
23396 Improve the For case to also test for boolean constants.
23398 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
23399 to the list of attributes we can add.
23401 Remove `EmitContext' argument.
23403 * class.cs (Method.Define): Apply parameter attributes.
23404 (Constructor.Define): Apply parameter attributes.
23405 (MethodCore.LabelParameters): Move here the core of labeling
23408 * support.cs (ReflectionParameters.ParameterModifier,
23409 InternalParameters.ParameterModifier): Use IsByRef on the type and
23410 only return the OUT bit for these parameters instead of in/out/ref
23413 This is because I miss-understood things. The ParameterInfo.IsIn
23414 and IsOut represent whether the parameter has the [In] and [Out]
23417 2002-01-22 Miguel de Icaza <miguel@ximian.com>
23419 * ecore.cs (FieldExpr.Emit): Release temporaries.
23421 * assign.cs (LocalTemporary.Release): new function.
23423 * codegen.cs (EmitContext.GetTemporaryStorage,
23424 EmitContext.FreeTemporaryStorage): Rework the way we deal with
23425 temporary storage. Now we can "put back" localbuilders when we
23428 2002-01-21 Miguel de Icaza <miguel@ximian.com>
23430 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
23431 need to make a copy of the variable to generate verifiable code.
23433 2002-01-19 Miguel de Icaza <miguel@ximian.com>
23435 * driver.cs: Compute dynamically the system directory.
23437 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
23438 Slower, but more generally useful. Used by the abstract
23439 registering implementation.
23441 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
23442 the rules for the special rule on Type/instances. First check if
23443 we have the same name, and if so, try that special static path
23444 rather than the instance path.
23446 2002-01-18 Miguel de Icaza <miguel@ximian.com>
23448 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
23451 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
23452 Enum, ValueType, Delegate or Array for non-corlib compiles.
23454 * cs-tokenizer.cs: Catch long identifiers (645)
23456 * typemanager.cs (IndexerPropetyName): Ravi never tested this
23459 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
23460 fix, we were returning too early, so we were not registering
23461 pending methods from abstract classes.
23463 Do not register pending methods if the class is abstract.
23465 * expression.cs (Conditional.DoResolve): Report circular implicit
23466 conversions when we neecd to compute it for conditional
23469 (Is.DoResolve): If the expression is always of the provided type,
23470 flag warning 183. If the expression can not ever be of the
23471 provided type flag warning 184.
23473 * class.cs: Catch 169 as well.
23475 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
23478 2002-01-18 Nick Drochak <ndrochak@gol.com>
23480 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
23482 2002-01-17 Miguel de Icaza <miguel@ximian.com>
23484 * interface.cs: (PopulateMethod): Check for pointers being defined
23485 only if the unsafe context is active.
23486 (PopulateProperty): ditto.
23487 (PopulateIndexer): ditto.
23489 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
23490 specified. If pointers are present, make sure that they are
23491 present in an unsafe context.
23492 (Constructor, Constructor.Define): ditto.
23493 (Field, Field.Define): ditto.
23494 (Property, Property.Define): ditto.
23495 (Event, Event.Define): ditto.
23497 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
23498 hashtable if there are classes or structs defined.
23500 * expression.cs (LocalVariableReference.DoResolve): Simplify this
23501 code, as the constant resolution moved.
23503 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
23504 the metadata, so we can flag error 133.
23506 * decl.cs (MemberCore.UnsafeOK): New function to test that a
23507 pointer is being declared in an unsafe context.
23509 2002-01-16 Miguel de Icaza <miguel@ximian.com>
23511 * modifiers.cs (Modifiers.Check): Require a Location argument.
23512 Report error 227 for Unsafe use.
23514 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
23516 * statement.cs (For.Emit): If the test is null, then report that
23517 we do `return', as we wont reach anything afterwards.
23519 (Switch.SwitchGoverningType): Track the expression that matched
23522 * driver.cs: Allow negative numbers as an error code to flag.
23524 * cs-parser.jay: Handle 1551.
23526 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
23528 2002-01-15 Miguel de Icaza <miguel@ximian.com>
23530 * cs-parser.jay: Report 1518 (type declaration can only contain
23531 class, struct, interface, enum or delegate)
23533 (switch_label): Report 1523 (keywords `case' or `default' must
23536 (opt_switch_sections): Report 1522 (empty switch)
23538 * driver.cs: Report 1515 (response file specified multiple times)
23539 Report 1516 (Source file specified multiple times).
23541 * expression.cs (Argument.Resolve): Signal 1510
23543 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
23544 access not allowed in static code)
23546 2002-01-11 Ravi Pratap <ravi@ximian.com>
23548 * typemanager.cs (IsPointerType): Utility method which we are going
23551 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
23552 the object type, so we take care of that.
23554 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
23556 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
23557 added to non-params parameters :-)
23559 * typemanager.cs (CSharpName): Include 'void' type too.
23561 (void_ptr_type): Include in the set of core types.
23563 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
23566 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
23569 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
23570 completely forgotten about it.
23572 2002-01-10 Ravi Pratap <ravi@ximian.com>
23574 * cs-parser.jay (pointer_type): Add. This begins our implementation
23575 of parsing rules for unsafe code.
23577 (unsafe_statement): Implement.
23579 (embedded_statement): Modify to include the above.
23581 * statement.cs (Unsafe): Implement new class for unsafe blocks.
23583 * codegen.cs (EmitContext.InUnsafe): Add. This determines
23584 if the current context is an unsafe one.
23586 * cs-parser.jay (local_variable_pointer_type): Since local variable types
23587 are handled differently, we need separate rules for them.
23589 (local_variable_declaration): Update to use local_variable_pointer_type
23590 to allow variable declarations of unmanaged pointer types.
23592 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
23593 in unsafe contexts.
23595 * ../errors/cs0214.cs : Add.
23597 2002-01-16 Nick Drochak <ndrochak@gol.com>
23599 * makefile: remove 'response' file when cleaning.
23601 2002-01-15 Miguel de Icaza <miguel@ximian.com>
23603 * cs-parser.jay: Report 1524.
23605 2002-01-14 Miguel de Icaza <miguel@ximian.com>
23607 * typemanager.cs (RegisterMethod): drop checking if we have
23608 registered this from here
23610 2002-01-12 Miguel de Icaza <miguel@ximian.com>
23612 * class.cs (Method.EmitDestructor): Implement calling our base
23615 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
23616 value of InFinally.
23618 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
23619 this routine and will wrap the call in a try/catch block. Deal
23622 2002-01-11 Miguel de Icaza <miguel@ximian.com>
23624 * ecore.cs (Expression.MemberLookup): instead of taking a
23625 parameter `same_type' that was used to tell whether we could
23626 access private members we compute our containing type from the
23629 (FieldExpr): Added partial support for volatile fields. This does
23630 not work for volatile fields exposed from assemblies, as I can not
23631 figure out how to extract the modreq from it.
23633 Updated all the source files to use this.
23635 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
23636 because it is referenced by MemberLookup very often.
23638 2002-01-09 Ravi Pratap <ravi@ximian.com>
23640 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
23641 TypeBuilder.GetCustomAttributes to retrieve what we need.
23643 Get rid of redundant default_member_attr_type as this is the same as
23644 default_member_type which already exists.
23646 * interface.cs, attribute.cs : Update accordingly.
23648 2002-01-08 Miguel de Icaza <miguel@ximian.com>
23650 * typemanager.cs: Enable IndexerPropertyName again. It does not
23651 work for TYpeBuilders though. Ravi, can you please fix this?
23653 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
23655 * expression.cs (Argument.Emit): Handle the case of ref objects
23656 being passed to ref functions;
23658 (ParameterReference.EmitLoad): Loads the content of the pointer
23659 without dereferencing.
23661 2002-01-07 Miguel de Icaza <miguel@ximian.com>
23663 * cs-tokenizer.cs: Implemented the pre-processing expressions.
23665 2002-01-08 Ravi Pratap <ravi@ximian.com>
23667 * class.cs (Indexer.DefineMethod): Incorporate the interface
23668 type in the name of the method if we are doing explicit interface
23671 * expression.cs (ConversionExists): Remove as it is completely obsolete.
23673 (BetterConversion): Fix extremely trivial bug where we were referring to
23674 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
23677 * ../errors/bug16.cs : Add although we have fixed it.
23679 2002-01-07 Miguel de Icaza <miguel@ximian.com>
23681 * expression.cs (BaseIndexer): Begin implementation.
23683 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
23685 * cs-parser.jay (indexer_declarator): Use qualified_identifier
23686 production directly to remove a shift/reduce, and implement
23687 explicit interface implementation.
23689 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
23690 after a floating point suffix.
23692 * expression.cs (DoNumericPromotions): Improved the conversion for
23693 uint/uint. If we have a constant, we avoid doing a typecast to a
23696 * class.cs (Indexer): Implement explicit interface implementation
23699 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
23701 * class.cs: make the default instance constructor public and hidebysig.
23703 2001-01-03 Ravi Pratap <ravi@ximian.com>
23705 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
23706 so we can call it from elsewhere.
23708 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
23709 we emit it internally if the class has a defined indexer; otherwise the user
23710 emits it by decorating the class definition with the DefaultMemberAttribute.
23712 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
23713 attribute is not used on a type which defines an indexer.
23715 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
23716 character when we skip whitespace.
23718 * ../errors/cs0646.cs : Add.
23720 2002-01-03 Miguel de Icaza <miguel@ximian.com>
23722 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
23725 * makefile: Add practical target `mcs3.exe' which builds the third
23726 generation compiler.
23728 * expression.cs (New): Fix structures constructor calling.
23730 * class.cs (Property, Method, Indexer): Emit Final flag on the
23731 method if we are an interface implementation and we are not
23734 * ecore.cs (PropertyExpr): New public field `IsBase', tells
23735 whether this property is referencing a `base' method.
23737 * expression.cs (Invocation.EmitCall): take an extra argument:
23738 is_base, this is used to determine whether the `call' or
23739 `callvirt' opcode should be used.
23742 * delegate.cs: update EmitCall.
23744 * class.cs (Method.Define): Set NewSlot for the cases where we are
23745 not implementing an interface method.
23747 (Property.Define): ditto.
23749 2002-01-02 Miguel de Icaza <miguel@ximian.com>
23751 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
23752 'r'. Allows mcs to parse itself fully.
23754 2002-01-02 Ravi Pratap <ravi@ximian.com>
23756 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
23757 of the number of initializers that require the InitializeArray method.
23759 (CheckIndices): Store the Expression in all cases - not the plain value. Also
23760 update the above field where necessary.
23762 (MakeByteBlob): Update accordingly.
23764 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
23767 (EmitDynamicInitializers): Update in accordance with the new optimization.
23769 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
23770 same OpCode applies.
23772 * cs-parser.jay : Fix some glaring errors I introduced.
23774 2002-01-01 Ravi Pratap <ravi@ximian.com>
23776 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
23777 so that we can check for name clashes there too.
23779 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
23780 for interface indexers.
23782 * interfaces.cs (Define): Emit the default member attribute.
23784 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
23785 variable was being referred to while setting the value ;-)
23787 2002-01-01 Miguel de Icaza <miguel@ximian.com>
23789 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
23790 byte-by-byte information when we know the data is zero.
23792 Make the block always a multiple of 4, because
23793 DefineInitializedData has a bug.
23795 * assign.cs: Fix, we should assign from the temporary, not from
23798 * expression.cs (MakeByteBlob): Fix my incorrect code.
23800 2001-12-31 Miguel de Icaza <miguel@ximian.com>
23802 * typemanager.cs (EnumToUnderlying): This function is used to get
23803 the underlying type from an enumeration, because it does not
23806 * constant.cs: Use the I4_S form for values between -128 and 127.
23808 * statement.cs (Block.LookupLabel): Looks up a label.
23809 (Block): Drop support for labeled blocks.
23811 (LabeledStatement): New kind of statement that represents a label
23814 (Goto): Finally implement this bad boy.
23816 * cs-parser.jay: Update to reflect new mechanism to implement
23819 2001-12-30 Miguel de Icaza <miguel@ximian.com>
23821 * codegen.cs (EmitContext.This): a codegen property that keeps the
23822 a single instance of this instead of creating many different this
23825 * delegate.cs (Delegate.DoResolve): Update to use the property;
23827 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
23829 * expression.cs (BaseAccess.DoResolve): Ditto.
23831 2001-12-29 Ravi Pratap <ravi@ximian.com>
23833 * typemanager.cs (methodimpl_attr_type): Add to hold the type
23834 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
23836 (InitCoreTypes): Update accordingly.
23838 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
23839 so we can quickly store the state.
23841 (ApplyAttributes): Set the correct implementation flags
23842 for InternalCall methods.
23844 2001-12-29 Miguel de Icaza <miguel@ximian.com>
23846 * expression.cs (EmitCall): if a method is not virtual, then do
23847 not use callvirt on it.
23849 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
23850 user defined stuff) requires the use of stobj, which takes an
23851 address on the stack instead of an array and an index. So emit
23852 the Ldelema operation for it.
23854 (EmitStoreOpcode): Use stobj for valuetypes.
23856 (UnaryMutator.EmitCode): Use the right 1 value depending on
23857 whether we are dealing with int64/uint64, float or doubles.
23859 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
23860 constructors that I implemented last night.
23862 (Constructor.IsDefault): Fix to work properly for static
23865 * cs-parser.jay (CheckDef): report method signature errors.
23866 Update error number 103 to be 132.
23868 * decl.cs: New AdditionResult enumeration value: MethodExists.
23869 Although we do this check for methods later on in the semantic
23870 analysis, catching repeated default constructors is so easy that
23871 we catch these here.
23873 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
23876 (ParameterReference.EmitAssign, Emit): handle
23879 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
23880 (ArrayAccess.EmitStoreOpcode): ditto.
23882 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
23884 * expression.cs (MakeByteBlob): Complete all the missing types
23885 (uint, short, ushort, byte, sbyte)
23887 * class.cs: Only init instance field initializers on instance
23890 Rename `constructors' to instance_constructors.
23892 (TypeContainer.AddConstructor): Only add constructors to the list
23893 if it is not static.
23895 Make sure that we handle default_static_constructor independently
23896 everywhere where we handle instance_constructors
23898 2001-12-28 Miguel de Icaza <miguel@ximian.com>
23900 * class.cs: Do not lookup or create a base initializer for a
23901 static constructor.
23903 (ConstructorInitializer.Resolve): use the proper type to lookup
23906 * cs-parser.jay: Report error 1585 (modifiers between type and name).
23908 * enum.cs, interface.cs: Remove CloseType, this is taken care by
23911 * decl.cs: CloseType is now an virtual method, the default
23912 implementation just closes this type.
23914 2001-12-28 Ravi Pratap <ravi@ximian.com>
23916 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
23917 to PreserveSig by default. Also emit HideBySig on such methods.
23919 Basically, set the defaults to standard values.
23921 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
23922 argument, if candidate is better, it can't be worse than the best !
23924 (Invocation): Re-write bits to differentiate between methods being
23925 applicable in their expanded form and their normal form - for params
23928 Get rid of use_standard everywhere as only standard conversions are allowed
23929 in overload resolution.
23931 More spec conformance.
23933 2001-12-27 Miguel de Icaza <miguel@ximian.com>
23935 * driver.cs: Add --timestamp, to see where the compiler spends
23938 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
23939 `this' in static code.
23941 (SimpleName.DoResolve): Implement in terms of a helper function
23942 that allows static-references to be passed upstream to
23945 (Expression.ResolveWithSimpleName): Resolve specially simple
23946 names when called by MemberAccess to implement the special
23949 (Expression.ImplicitReferenceConversion): Handle conversions from
23950 Null to reference types before others, as Null's type is
23953 * expression.cs (Invocation.EmitCall): Handle the special case of
23954 calling methods declared on a reference type from a ValueType
23955 (Base classes System.Object and System.Enum)
23957 (MemberAccess.Resolve): Only perform lookups on Enumerations if
23958 the left hand side is a TypeExpr, not on every enumeration.
23960 (Binary.Resolve): If types are reference types, then do a cast to
23961 object on operators != and == of both arguments.
23963 * typemanager.cs (FindMembers): Extract instance and static
23964 members if requested.
23966 * interface.cs (PopulateProperty): Use void_type instead of null
23967 as the return type for the setter method.
23969 (PopulateIndexer): ditto.
23971 2001-12-27 Ravi Pratap <ravi@ximian.com>
23973 * support.cs (ReflectionParameters): Fix minor bug where we
23974 were examining the wrong parameter for the ParamArray attribute.
23976 Cope with requests for the type of the parameter at position
23977 greater than the params parameter's. We now return the element
23978 type of the params array as that makes more sense.
23980 * expression.cs (Invocation.IsParamsMethodApplicable): Update
23981 accordingly as we no longer have to extract the element type
23984 (Invocation.OverloadResolve): Update.
23986 2001-12-27 Miguel de Icaza <miguel@ximian.com>
23988 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
23989 against IEnumerator, test whether the return value is a descendant
23990 of the IEnumerator interface.
23992 * class.cs (Indexer.Define): Use an auxiliary method to implement
23993 the other bits of the method definition. Begin support for
23994 explicit interface implementation.
23996 (Property.DefineMethod): Use TypeManager.void_type instead of null
23997 for an empty return value.
23999 2001-12-26 Miguel de Icaza <miguel@ximian.com>
24001 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
24002 dealing with a FieldExpr which is composed of a FieldBuilder, in
24003 the code path we did extract the constant, but we should have
24004 obtained the underlying value to be able to cast it (otherwise we
24005 end up in an infinite loop, this is what Ravi was running into).
24007 (ArrayCreation.UpdateIndices): Arrays might be empty.
24009 (MemberAccess.ResolveMemberAccess): Add support for section
24010 14.5.4.1 that deals with the special case of E.I when E is a type
24011 and something else, that I can be a reference to a static member.
24013 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
24014 handle a particular array type to create byte blobs, it is just
24015 something we dont generate byteblobs for.
24017 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
24020 * location.cs (Push): remove the key from the hashtable that we
24021 are about to add. This happens for empty files.
24023 * driver.cs: Dispose files after we have parsed them.
24025 (tokenize): new function that only runs the tokenizer on its
24026 input, for speed testing.
24028 2001-12-26 Ravi Pratap <ravi@ximian.com>
24030 * class.cs (Event.Define): Define the private field only if there
24031 are no accessors defined.
24033 * expression.cs (ResolveMemberAccess): If there is no associated
24034 field with the event, that means we have an event defined with its
24035 own accessors and we should flag error cs0070 since transforming
24036 ourselves into a field is not valid in that case.
24038 * ecore.cs (SimpleName.DoResolve): Same as above.
24040 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
24041 and charset to sane values.
24043 2001-12-25 Ravi Pratap <ravi@ximian.com>
24045 * assign.cs (DoResolve): Perform check on events only if they
24046 are being accessed outside the declaring type.
24048 * cs-parser.jay (event_declarations): Update rules to correctly
24049 set the type of the implicit parameter etc.
24051 (add_accessor, remove_accessor): Set current local parameters.
24053 * expression.cs (Binary): For delegate addition and subtraction,
24054 cast the return value from the method into the appropriate delegate
24057 2001-12-24 Ravi Pratap <ravi@ximian.com>
24059 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
24060 of these as the workaround is unnecessary.
24062 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
24063 delegate data - none of that is needed at all.
24065 Re-write bits to extract the instance expression and the delegate method
24068 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
24071 * attribute.cs (ApplyAttributes): New method to take care of common tasks
24072 of attaching attributes instead of duplicating code everywhere.
24074 * everywhere : Update code to do attribute emission using the above method.
24076 2001-12-23 Miguel de Icaza <miguel@ximian.com>
24078 * expression.cs (IsParamsMethodApplicable): if there are not
24079 parameters, return immediately.
24081 * ecore.cs: The 0 literal can be implicity converted to an enum
24084 (SimpleName.DoResolve): First lookup the type, then lookup the
24087 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
24088 want to get its address. If the InstanceExpression is not
24089 addressable, store the result in a temporary variable, then get
24092 * codegen.cs: Only display 219 errors on warning level or above.
24094 * expression.cs (ArrayAccess): Make it implement the
24095 IMemoryLocation interface.
24097 (Binary.DoResolve): handle the operator == (object a, object b)
24098 and operator != (object a, object b) without incurring into a
24099 BoxedCast (because 5 != o should never be performed).
24101 Handle binary enumerator operators.
24103 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
24104 value type, otherwise use Ldelem_ref.
24106 Use precomputed names;
24108 (AddressOf): Implement address of
24110 * cs-parser.jay (labeled_statement): Fix recursive block
24111 addition by reworking the production.
24113 * expression.cs (New.DoEmit): New has a special case:
24115 If we are dealing with a ValueType, we have a few
24116 situations to deal with:
24118 * The target of New is a ValueType variable, that is
24119 easy, we just pass this as the variable reference
24121 * The target of New is being passed as an argument,
24122 to a boxing operation or a function that takes a
24125 In this case, we need to create a temporary variable
24126 that is the argument of New.
24129 2001-12-23 Ravi Pratap <ravi@ximian.com>
24131 * rootcontext.cs (LookupType): Check that current_type is not null before
24132 going about looking at nested types.
24134 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
24135 not implement the IAssignMethod interface any more.
24137 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
24138 where we tranform them into FieldExprs if they are being resolved from within
24139 the declaring type.
24141 * ecore.cs (SimpleName.DoResolve): Do the same here.
24143 * assign.cs (DoResolve, Emit): Clean up code considerably.
24145 * ../errors/bug10.cs : Add.
24147 * ../errors/cs0070.cs : Add.
24149 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
24151 * assign.cs : Get rid of EventIsLocal everywhere.
24153 2001-12-23 Miguel de Icaza <miguel@ximian.com>
24155 * ecore.cs (ConvertIntLiteral): finished the implementation.
24157 * statement.cs (SwitchLabel): Convert the value we are using as a
24158 key before looking up the table.
24160 2001-12-22 Miguel de Icaza <miguel@ximian.com>
24162 * codegen.cs (EmitTopBlock): Require a Location argument now.
24164 * cs-parser.jay (constructor_declarator): We need to setup
24165 current_local_parameters before we parse the
24166 opt_constructor_initializer, to allow the variables to be bound
24167 to the constructor arguments.
24169 * rootcontext.cs (LookupType): First lookup nested classes in our
24170 class and our parents before we go looking outside our class.
24172 * expression.cs (ConstantFold): Extract/debox the values at the
24175 * rootcontext.cs (EmitCode): Resolve the constants first before we
24176 resolve the types. This is not really needed, but it helps debugging.
24178 * statement.cs: report location.
24180 * cs-parser.jay: pass location to throw statement.
24182 * driver.cs: Small bug fix.
24184 * report.cs: Updated format to be 4-zero filled digits.
24186 2001-12-22 Ravi Pratap <ravi@ximian.com>
24188 * expression.cs (CheckIndices): Fix minor bug where the wrong
24189 variable was being referred to ;-)
24191 (DoEmit): Do not call EmitStaticInitializers when the
24192 underlying type is System.Object.
24194 2001-12-21 Ravi Pratap <ravi@ximian.com>
24196 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
24197 and do the usual workaround for SRE.
24199 * class.cs (MyEventBuilder.EventType): New member to get at the type
24200 of the event, quickly.
24202 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
24204 * assign.cs (Assign.DoResolve): Handle the case when the target
24205 is an EventExpr and perform the necessary checks.
24207 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
24210 (SimpleName.MemberStaticCheck): Include check for EventExpr.
24212 (EventExpr): Set the type in the constructor itself since we
24213 are meant to be born fully resolved.
24215 (EventExpr.Define): Revert code I wrote earlier.
24217 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
24218 instance expression is null. The instance expression is a This in that case
24219 or a null, depending on whether it is a static method or not.
24221 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
24222 refers to more than one method.
24224 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
24225 and accordingly flag errors.
24227 2001-12-21 Miguel de Icaza <miguel@ximian.com>
24229 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
24231 2001-12-22 Miguel de Icaza <miguel@ximian.com>
24233 * location.cs (ToString): Provide useful rutine.
24235 2001-12-21 Miguel de Icaza <miguel@ximian.com>
24237 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
24238 objects, return the actual integral boxed.
24240 * statement.cs (SwitchLabel): define an ILLabel for each
24243 (Switch.CheckSwitch): If the value is a Literal, extract
24244 the underlying literal.
24246 Also in the unused hashtable we had, add the SwitchLabel so we can
24247 quickly look this value up.
24249 * constant.cs: Implement a bunch of new constants. Rewrite
24250 Literal based on this. Made changes everywhere to adapt to this.
24252 * expression.cs (Expression.MakeByteBlob): Optimize routine by
24253 dereferencing array only once, and also copes with enumrations.
24255 bytes are two bytes wide, not one.
24257 (Cast): Perform constant conversions.
24259 * ecore.cs (TryImplicitIntConversion): Return literals instead of
24260 wrappers to the literals here.
24262 * expression.cs (DoNumericPromotions): long literals can converted
24263 to ulong implicity (this is taken care of elsewhere, but I was
24264 missing this spot).
24266 * ecore.cs (Expression.Literalize): Make the return type Literal,
24267 to improve type checking.
24269 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
24271 2001-12-20 Miguel de Icaza <miguel@ximian.com>
24273 * literal.cs: Revert code from ravi that checked the bounds. The
24274 bounds are sane by the definition of the type itself.
24276 * typemanager.cs: Fix implementation of ImplementsInterface. We
24277 need to actually look up in our parent hierarchy for interfaces
24280 * const.cs: Use the underlying type for enumerations
24282 * delegate.cs: Compute the basename for the delegate creation,
24283 that should fix the delegate test case, and restore the correct
24284 Type Lookup semantics in rootcontext
24286 * rootcontext.cs: Revert Ravi's last patch. The correct way of
24287 referencing a nested type with the Reflection API is using the "+"
24290 * cs-parser.jay: Do not require EOF token at the end.
24292 2001-12-20 Ravi Pratap <ravi@ximian.com>
24294 * rootcontext.cs (LookupType): Concatenate type names with
24295 a '.' instead of a '+' The test suite passes again.
24297 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
24298 field of the enumeration.
24300 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
24301 the case when the member is an EventExpr.
24303 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
24304 static has an associated instance expression.
24306 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
24308 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
24310 * class.cs (Event.Define): Register event and perform appropriate checks
24313 We define the Add and Remove methods even if the use provides none because
24314 in that case, we provide default implementations ourselves.
24316 Define a private field of the type of the event. This is done by the CSC compiler
24317 and we should be doing it too ;-)
24319 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
24320 More methods we use in code we generate.
24322 (multicast_delegate_type, delegate_type): Two separate types since the distinction
24325 (InitCoreTypes): Update accordingly for the above.
24327 * class.cs (Event.Emit): Generate code for default accessors that we provide
24329 (EmitDefaultMethod): Do the job in the above.
24331 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
24334 2001-12-20 Miguel de Icaza <miguel@ximian.com>
24336 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
24337 builders even if we were missing one.
24339 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
24340 pass the Basename as our class name instead of the Name. The
24341 basename will be correctly composed for us.
24343 * parameter.cs (Paramters): Now takes a Location argument.
24345 * decl.cs (DeclSpace.LookupType): Removed convenience function and
24346 make all the code call directly LookupType in RootContext and take
24347 this chance to pass the Location information everywhere.
24349 * Everywhere: pass Location information.
24351 2001-12-19 Miguel de Icaza <miguel@ximian.com>
24353 * class.cs (Constructor.Define): Updated way of detecting the
24354 length of the parameters.
24356 (TypeContainer.DefineType): Use basename as the type name for
24359 (TypeContainer.Define): Do not recursively define types here, as
24360 definition is taken care in order by the RootContext.
24362 * tree.cs: Keep track of namespaces in a per-file basis.
24364 * parameter.cs (Parameter.ComputeSignature): Update to use
24367 (Parameters.GetSignature): ditto.
24369 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
24370 instead of a TypeContainer.
24372 (Interface.SemanticAnalysis): Use `this' instead of our parent to
24373 resolve names. Because we need to be resolve in our context, not
24376 * driver.cs: Implement response files.
24378 * class.cs (TypeContainer.DefineType): If we are defined, do not
24379 redefine ourselves.
24381 (Event.Emit): Emit the code for add/remove handlers.
24382 (Event.Define): Save the MethodBuilders for add/remove.
24384 * typemanager.cs: Use pair here too.
24386 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
24387 DictionaryEntry requires the first argument to be non-null.
24389 (enum_declaration): Compute full name for registering the
24392 (delegate_declaration): Instead of using
24393 formal_parameter_list, use opt_formal_parameter_list as the list
24396 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
24397 (EventParsing): New property that controls whether `add' and
24398 `remove' are returned as tokens or identifiers (for events);
24400 2001-12-19 Ravi Pratap <ravi@ximian.com>
24402 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
24403 use MyEventBuilder only and let it wrap the real builder for us.
24405 (MyEventBuilder): Revamp constructor etc.
24407 Implement all operations that we perform on EventBuilder in precisely the same
24410 (FindMembers): Update to use the EventBuilder member.
24412 (Event.Emit): Update accordingly.
24414 2001-12-18 Ravi Pratap <ravi@ximian.com>
24416 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
24417 by calling the appropriate methods.
24419 (GetCustomAttributes): Make stubs as they cannot possibly do anything
24422 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
24424 2001-12-17 Ravi Pratap <ravi@ximian.com>
24426 * delegate.cs (Delegate.Populate): Check that the return type
24427 and various parameters types are indeed accessible.
24429 * class.cs (Constructor.Define): Same here.
24431 (Field.Define): Ditto.
24433 (Event.Define): Ditto.
24435 (Operator.Define): Check that the underlying Method defined itself
24436 correctly - so it's MethodBuilder should not be null.
24438 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
24439 expression happens to be null.
24441 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
24442 members but as of now we don't seem to be able to do anything really useful with it.
24444 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
24445 not the EventBuilder.
24447 2001-12-18 Miguel de Icaza <miguel@ximian.com>
24449 * cs-tokenizer.cs: Add support for defines.
24450 Add support for #if, #elif, #else, #endif
24452 (eval_var): evaluates a variable.
24453 (eval): stubbed for evaluating functions.
24455 * cs-parser.jay: Pass the defines information
24457 * driver.cs: Add --define command line option.
24459 * decl.cs: Move MemberCore here.
24461 Make it the base class for DeclSpace. This allows us to catch and
24462 report 108 and 109 for everything now.
24464 * class.cs (TypeContainer.Define): Extract all the members
24465 before populating and emit the warning 108 (new keyword required
24466 to override) instead of having each member implement this.
24468 (MemberCore.Define): New abstract method, we will be using this in
24469 the warning reporting engine in Populate.
24471 (Operator.Define): Adjust to new MemberCore protocol.
24473 * const.cs (Const): This does not derive from Expression, it is a
24474 temporary object we use to create fields, it is a MemberCore.
24476 * class.cs (Method.Define): Allow the entry point to be in a
24479 * driver.cs: Rewrite the argument handler to clean it up a bit.
24481 * rootcontext.cs: Made it just an auxiliary namespace feature by
24482 making everything static.
24484 * driver.cs: Adapt code to use RootContext type name instead of
24487 * delegate.cs: Remove RootContext argument.
24489 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
24492 * class.cs (Event.Define): The lookup can fail.
24494 * cs-tokenizer.cs: Begin implementation of pre-procesor.
24496 * expression.cs: Resolve the this instance before invoking the code.
24498 2001-12-17 Miguel de Icaza <miguel@ximian.com>
24500 * cs-parser.jay: Add a production in element_access that allows
24501 the thing to become a "type" reference. This way we can parse
24502 things like "(string [])" as a type.
24504 Note that this still does not handle the more complex rules of
24508 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
24510 * ecore.cs: (CopyNewMethods): new utility function used to
24511 assemble the list of methods from running FindMembers.
24513 (MemberLookup): Rework FindMembers so that
24515 2001-12-16 Miguel de Icaza <miguel@ximian.com>
24517 * class.cs (TypeContainer): Remove Delegates who fail to be
24520 * delegate.cs (Populate): Verify that we dont get null return
24521 values. TODO: Check for AsAccessible.
24523 * cs-parser.jay: Use basename to emit error 574 (destructor should
24524 have the same name as container class), not the full name.
24526 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
24527 possible representation.
24529 Also implements integer type suffixes U and L.
24531 2001-12-15 Miguel de Icaza <miguel@ximian.com>
24533 * expression.cs (ArrayCreation.DoResolve): We need to do the
24534 argument resolution *always*.
24536 * decl.cs: Make this hold the namespace. Hold the root context as
24538 (LookupType): Move here.
24540 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
24542 * location.cs (Row, Name): Fixed the code, it was always returning
24543 references to the first file.
24545 * interface.cs: Register properties defined through interfaces.
24547 * driver.cs: Add support for globbing on the command line
24549 * class.cs (Field): Make it derive from MemberCore as well.
24552 2001-12-15 Ravi Pratap <ravi@ximian.com>
24554 * class.cs (Event::Define): Check that the type of the event is a delegate
24555 type else flag error #66.
24557 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
24560 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
24561 values of EntryPoint, CharSet etc etc.
24563 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
24565 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
24566 be null and we should ignore this. I am not sure if this is really clean. Apparently,
24567 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
24568 which needs this to do its work.
24570 * ../errors/cs0066.cs : Add.
24572 2001-12-14 Miguel de Icaza <miguel@ximian.com>
24574 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
24577 * class.cs: (MethodSignature.MethodSignature): Removed hack that
24578 clears out the parameters field.
24579 (MemberSignatureCompare): Cleanup
24581 (MemberCore): New base class used to share code between MethodCore
24584 (RegisterRequiredImplementations) BindingFlags.Public requires
24585 either BindingFlags.Instace or Static. Use instance here.
24587 (Property): Refactored code to cope better with the full spec.
24589 * parameter.cs (GetParameterInfo): Return an empty array instead
24592 * class.cs (Property): Abstract or extern properties have no bodies.
24594 * parameter.cs (GetParameterInfo): return a zero-sized array.
24596 * class.cs (TypeContainer.MethodModifiersValid): Move all the
24597 method modifier validation to the typecontainer so we can reuse
24598 this on properties.
24600 (MethodCore.ParameterTypes): return an empty sized array of types.
24602 (Property.Define): Test property modifier validity.
24604 Add tests for sealed/override too.
24606 (Method.Emit): abstract or extern methods have no bodies.
24608 2001-12-14 Ravi Pratap <ravi@ximian.com>
24610 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
24613 (Method::Define, ::Emit): Modify accordingly.
24615 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
24617 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
24619 * makefile: Pass in /unsafe.
24621 2001-12-13 Miguel de Icaza <miguel@ximian.com>
24623 * class.cs (MakeKey): Kill routine.
24625 * class.cs (TypeContainer.Define): Correctly define explicit
24626 method implementations (they require the full interface name plus
24629 * typemanager.cs: Deply the PtrHashtable here and stop using the
24630 lame keys. Things work so much better.
24632 This of course broke everyone who depended on `RegisterMethod' to
24633 do the `test for existance' test. This has to be done elsewhere.
24635 * support.cs (PtrHashtable): A hashtable that avoid comparing with
24636 the object stupid Equals method (because, that like fails all over
24637 the place). We still do not use it.
24639 * class.cs (TypeContainer.SetRequiredInterface,
24640 TypeContainer.RequireMethods): Killed these two routines and moved
24641 all the functionality to RegisterRequiredImplementations.
24643 (TypeContainer.RegisterRequiredImplementations): This routine now
24644 registers all the implementations required in an array for the
24645 interfaces and abstract methods. We use an array of structures
24646 which can be computed ahead of time to reduce memory usage and we
24647 also assume that lookups are cheap as most classes will not
24648 implement too many interfaces.
24650 We also avoid creating too many MethodSignatures.
24652 (TypeContainer.IsInterfaceMethod): Update and optionally does not
24653 clear the "pending" bit if we find that there are problems with
24656 (TypeContainer.VerifyPendingMethods): Update to report errors of
24657 methods that look like implementations but are not.
24659 (TypeContainer.Define): Add support for explicit interface method
24662 2001-12-12 Miguel de Icaza <miguel@ximian.com>
24664 * typemanager.cs: Keep track of the parameters here instead of
24665 being a feature of the TypeContainer.
24667 * class.cs: Drop the registration of parameters here, as
24668 InterfaceMethods are also interface declarations.
24670 * delegate.cs: Register methods with the TypeManager not only with
24671 the TypeContainer. This code was buggy.
24673 * interface.cs: Full registation here.
24675 2001-12-11 Miguel de Icaza <miguel@ximian.com>
24677 * expression.cs: Remove reducer for binary expressions, it can not
24680 * const.cs: Put here the code that used to go into constant.cs
24682 * constant.cs: Put here the code for constants, this is a new base
24683 class for Literals.
24685 * literal.cs: Make Literal derive from Constant.
24687 2001-12-09 Miguel de Icaza <miguel@ximian.com>
24689 * statement.cs (Return.Emit): Report error 157 if the user
24690 attempts to return from a finally block.
24692 (Return.Emit): Instead of emitting a return, jump to the end of
24695 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
24696 LocalBuilder to store the result of the function. ReturnLabel is
24697 the target where we jump.
24700 2001-12-09 Radek Doulik <rodo@ximian.com>
24702 * cs-parser.jay: remember alias in current namespace
24704 * ecore.cs (SimpleName::DoResolve): use aliases for types or
24707 * class.cs (LookupAlias): lookup alias in my_namespace
24709 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
24711 (LookupAlias): lookup alias in this and if needed in parent
24714 2001-12-08 Miguel de Icaza <miguel@ximian.com>
24718 * rootcontext.cs: (ModuleBuilder) Made static, first step into
24719 making things static. I need this to avoid passing the
24720 TypeContainer when calling ParameterType.
24722 * support.cs (InternalParameters.ParameterType): Remove ugly hack
24723 that did string manipulation to compute the type and then call
24724 GetType. Use Parameter.ParameterType instead.
24726 * cs-tokenizer.cs: Consume the suffix for floating values.
24728 * expression.cs (ParameterReference): figure out whether this is a
24729 reference parameter or not. Kill an extra variable by computing
24730 the arg_idx during emission.
24732 * parameter.cs (Parameters.GetParameterInfo): New overloaded
24733 function that returns whether a parameter is an out/ref value or not.
24735 (Parameter.ParameterType): The type of the parameter (base,
24736 without ref/out applied).
24738 (Parameter.Resolve): Perform resolution here.
24739 (Parameter.ExternalType): The full type (with ref/out applied).
24741 * statement.cs (Using.Emit, Using.EmitExpression): Implement
24742 support for expressions on the using statement.
24744 2001-12-07 Miguel de Icaza <miguel@ximian.com>
24746 * statement.cs (Using.EmitLocalVariableDecls): Split the
24747 localvariable handling of the using statement.
24749 (Block.EmitMeta): Keep track of variable count across blocks. We
24750 were reusing slots on separate branches of blocks.
24752 (Try.Emit): Emit the general code block, we were not emitting it.
24754 Check the type of the declaration to be an IDisposable or
24755 something that can be implicity converted to it.
24757 Emit conversions if required.
24759 * ecore.cs (EmptyExpression): New utility class.
24760 (Expression.ImplicitConversionExists): New utility function.
24762 2001-12-06 Miguel de Icaza <miguel@ximian.com>
24764 * statement.cs (Using): Implement.
24766 * expression.cs (LocalVariableReference): Support read only variables.
24768 * statement.cs: Remove the explicit emit for the Leave opcode.
24769 (VariableInfo): Add a readonly field.
24771 2001-12-05 Miguel de Icaza <miguel@ximian.com>
24773 * ecore.cs (ConvCast): new class used to encapsulate the various
24774 explicit integer conversions that works in both checked and
24775 unchecked contexts.
24777 (Expression.ConvertNumericExplicit): Use new ConvCast class to
24778 properly generate the overflow opcodes.
24780 2001-12-04 Miguel de Icaza <miguel@ximian.com>
24782 * statement.cs: The correct type for the EmptyExpression is the
24783 element_type, not the variable type. Ravi pointed this out.
24785 2001-12-04 Ravi Pratap <ravi@ximian.com>
24787 * class.cs (Method::Define): Handle PInvoke methods specially
24788 by using DefinePInvokeMethod instead of the usual one.
24790 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
24791 above to do the task of extracting information and defining the method.
24793 2001-12-04 Ravi Pratap <ravi@ximian.com>
24795 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
24796 of the condition for string type.
24798 (Emit): Move that here.
24800 (ArrayCreation::CheckIndices): Keep string literals in their expression
24803 (EmitDynamicInitializers): Handle strings appropriately.
24805 2001-12-04 Miguel de Icaza <miguel@ximian.com>
24807 * codegen.cs (EmitContext): Replace multiple variables with a
24808 single pointer to the current Switch statement.
24810 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
24813 2001-12-03 Miguel de Icaza <miguel@ximian.com>
24817 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
24820 (Foreach.Emit): Foreach on arrays was not setting
24821 up the loop variables (for break/continue).
24823 (GotoCase): Semi-implented.
24825 2001-12-03 Ravi Pratap <ravi@ximian.com>
24827 * attribute.cs (CheckAttribute): Handle system attributes by using
24828 Attribute.GetAttributes to examine information we need.
24830 (GetValidPlaces): Same here.
24832 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
24834 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
24836 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
24838 (Method::Define): Set appropriate flags if we have a DllImport attribute.
24840 (Method::Emit): Handle the case when we are a PInvoke method.
24842 2001-12-03 Miguel de Icaza <miguel@ximian.com>
24844 * expression.cs: Use ResolveWithSimpleName on compound names.
24846 2001-12-02 Ravi Pratap <ravi@ximian.com>
24848 * constant.cs (EmitConstant): Make sure we resolve the associated expression
24849 before trying to reduce it.
24851 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
24853 * constant.cs (LookupConstantValue): Implement.
24855 (EmitConstant): Use the above in emitting the constant.
24857 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
24858 that are user-defined by doing a LookupConstantValue on them.
24860 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
24863 2001-11-29 Miguel de Icaza <miguel@ximian.com>
24865 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
24867 (BaseAccess.DoResolve): Implement.
24869 (MemberAccess.DoResolve): Split this routine into a
24870 ResolveMemberAccess routine that can be used independently
24872 2001-11-28 Miguel de Icaza <miguel@ximian.com>
24874 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
24875 As that share bits of the implementation. Is returns a boolean,
24876 while As returns the Type that is being probed.
24878 2001-12-01 Ravi Pratap <ravi@ximian.com>
24880 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
24881 instead of a Literal - much easier.
24883 (EnumInTransit): Remove - utterly useless :-)
24885 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
24887 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
24889 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
24890 chain when we have no associated expression.
24892 2001-11-30 Ravi Pratap <ravi@ximian.com>
24894 * constant.cs (Define): Use Location while reporting the errror.
24896 Also emit a warning when 'new' is used and there is no inherited
24899 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
24902 (LookupEnumValue): Implement to lookup an enum member's value and define it
24905 (Populate): Re-write accordingly to use the above routine.
24907 2001-11-27 Miguel de Icaza <miguel@ximian.com>
24909 * expression.cs (This): Fix prototype for DoResolveLValue to
24910 override the base class DoResolveLValue.
24912 * cs-parser.cs: Report errors cs574 and cs575 (destructor
24915 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
24916 (we need to load the address of the field here). This fixes
24919 (FieldExpr.DoResolveLValue): Call the DoResolve
24920 function to initialize the Instance expression.
24922 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
24923 correctly the GetEnumerator operation on a value type.
24925 * cs-parser.jay: Add more simple parsing error catches.
24927 * statement.cs (Switch): Add support for string switches.
24928 Handle null specially.
24930 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
24932 2001-11-28 Ravi Pratap <ravi@ximian.com>
24934 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
24936 (declare_local_constant): New helper function.
24938 * statement.cs (AddConstant): Keep a separate record of constants
24940 (IsConstant): Implement to determine if a variable is a constant.
24942 (GetConstantExpression): Implement.
24944 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
24946 * statement.cs (IsVariableDefined): Re-write.
24948 2001-11-27 Ravi Pratap <ravi@ximian.com>
24950 * class.cs (TypeContainer::FindMembers): Look for constants
24951 in the case when we are looking for MemberTypes.Field
24953 * expression.cs (MemberAccess::DoResolve): Check that in the
24954 case we are a FieldExpr and a Literal, we are not being accessed
24955 by an instance reference.
24957 * cs-parser.jay (local_constant_declaration): Implement.
24959 (declaration_statement): Implement for constant declarations.
24961 2001-11-26 Miguel de Icaza <miguel@ximian.com>
24963 * statement.cs (Switch): Catch double defaults.
24965 (Switch): More work on the switch() statement
24966 implementation. It works for integral values now, need to finish
24970 2001-11-24 Miguel de Icaza <miguel@ximian.com>
24972 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
24973 integer literals into other integer literals. To be used by
24976 2001-11-24 Ravi Pratap <ravi@ximian.com>
24978 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
24981 (EmitDynamicInitializers): Cope with the above since we extract data
24982 directly from ArrayData now.
24984 (ExpectInitializers): Keep track of whether initializers are mandatory
24987 (Bounds): Make it a hashtable to prevent the same dimension being
24988 recorded for every element in that dimension.
24990 (EmitDynamicInitializers): Fix bug which prevented the Set array method
24993 Also fix bug which was causing the indices to be emitted in the reverse
24996 2001-11-24 Miguel de Icaza <miguel@ximian.com>
24998 * expression.cs (ArrayCreation): Implement the bits that Ravi left
24999 unfinished. They do not work, because the underlying code is
25002 2001-11-22 Miguel de Icaza <miguel@ximian.com>
25004 * cs-parser.jay: Remove bogus fixme.
25006 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
25007 on Switch statement.
25009 2001-11-23 Ravi Pratap <ravi@ximian.com>
25011 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
25014 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
25015 parameter. Apparently, any expression is allowed.
25017 (ValidateInitializers): Update accordingly.
25019 (CheckIndices): Fix some tricky bugs thanks to recursion.
25021 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
25022 I was being completely brain-dead.
25024 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
25025 and re-write acordingly.
25027 (DelegateInvocation): Re-write accordingly.
25029 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
25031 (MakeByteBlob): Handle types more correctly.
25033 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
25034 initialization from expressions but it is incomplete because I am a complete
25037 2001-11-22 Miguel de Icaza <miguel@ximian.com>
25039 * statement.cs (If.Emit): Fix a bug that generated incorrect code
25040 on If. Basically, we have to return `true' (ie, we do return to
25041 our caller) only if both branches of the if return.
25043 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
25044 short-circuit operators, handle them as short circuit operators.
25046 (Cast.DoResolve): Resolve type.
25047 (Cast.Cast): Take an expression as the target type.
25049 * cs-parser.jay (cast_expression): Remove old hack that only
25050 allowed a limited set of types to be handled. Now we take a
25051 unary_expression and we resolve to a type during semantic
25054 Use the grammar productions from Rhys to handle casts (this is
25055 not complete like Rhys syntax yet, we fail to handle that corner
25056 case that C# has regarding (-x), but we will get there.
25058 2001-11-22 Ravi Pratap <ravi@ximian.com>
25060 * class.cs (EmitFieldInitializer): Take care of the case when we have a
25061 field which is an array type.
25063 * cs-parser.jay (declare_local_variables): Support array initialization too.
25065 * typemanager.cs (MakeKey): Implement.
25067 (everywhere): Use the above appropriately.
25069 * cs-parser.jay (for_statement): Update for array initialization while
25070 declaring variables.
25072 * ecore.cs : The error message was correct, it's the variable's names that
25073 were misleading ;-) Make the code more readable.
25075 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
25076 the correct type etc.
25078 (ConvertExplicit): Handle Enum types by examining the underlying type.
25080 2001-11-21 Ravi Pratap <ravi@ximian.com>
25082 * parameter.cs (GetCallingConvention): Always return
25083 CallingConventions.Standard for now.
25085 2001-11-22 Miguel de Icaza <miguel@ximian.com>
25087 * expression.cs (Binary.ResolveOperator): Update the values of `l'
25088 and `r' after calling DoNumericPromotions.
25090 * ecore.cs: Fix error message (the types were in the wrong order).
25092 * statement.cs (Foreach.ProbeCollectionType): Need to pass
25093 BindingFlags.Instance as well
25095 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
25096 implicit int literal conversion in an empty cast so that we
25097 propagate the right type upstream.
25099 (UnboxCast): new class used to unbox value types.
25100 (Expression.ConvertExplicit): Add explicit type conversions done
25103 (Expression.ImplicitNumericConversion): Oops, forgot to test for
25104 the target type before applying the implicit LongLiterals to ULong
25107 2001-11-21 Miguel de Icaza <miguel@ximian.com>
25109 * cs-parser.jay (for_statement): Reworked the way For works: now
25110 we declare manually any variables that are introduced in
25111 for_initializer to solve the problem of having out-of-band code
25112 emition (that is what got for broken).
25114 (declaration_statement): Perform the actual variable declaration
25115 that used to be done in local_variable_declaration here.
25117 (local_variable_declaration): Do not declare anything, just pass
25118 the information on a DictionaryEntry
25120 2001-11-20 Ravi Pratap <ravi@ximian.com>
25122 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
25123 re-write of the logic to now make it recursive.
25125 (UpdateIndices): Re-write accordingly.
25127 Store element data in a separate ArrayData list in the above methods.
25129 (MakeByteBlob): Implement to dump the array data into a byte array.
25131 2001-11-19 Ravi Pratap <ravi@ximian.com>
25133 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
25136 * constant.cs (Define): Implement.
25138 (EmitConstant): Re-write fully.
25140 Pass in location info.
25142 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
25145 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
25146 DictionaryEntry since we need location info too.
25148 (constant_declaration): Update accordingly.
25150 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
25151 code into another method : UpdateIndices.
25153 2001-11-18 Ravi Pratap <ravi@ximian.com>
25155 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
25156 some type checking etc.
25158 2001-11-17 Ravi Pratap <ravi@ximian.com>
25160 * expression.cs (ArrayCreation::ValidateInitializers): Implement
25161 bits to provide dimension info if the user skips doing that.
25163 Update second constructor to store the rank correctly.
25165 2001-11-16 Ravi Pratap <ravi@ximian.com>
25167 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
25168 and try to implement.
25170 * ../errors/cs0150.cs : Add.
25172 * ../errors/cs0178.cs : Add.
25174 2001-11-16 Miguel de Icaza <miguel@ximian.com>
25176 * statement.cs: Implement foreach on multi-dimensional arrays.
25178 * parameter.cs (Parameters.GetParameterByName): Also lookup the
25179 name of the params argument.
25181 * expression.cs: Use EmitStoreOpcode to get the right opcode while
25182 initializing the array.
25184 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
25185 we can use this elsewhere.
25187 * statement.cs: Finish implementation of foreach for single
25190 * cs-parser.jay: Use an out-of-band stack to pass information
25191 around, I wonder why I need this.
25193 foreach_block: Make the new foreach_block the current_block.
25195 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
25196 function used to return a static Parameters structure. Used for
25197 empty parameters, as those are created very frequently.
25199 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
25201 2001-11-15 Ravi Pratap <ravi@ximian.com>
25203 * interface.cs : Default modifier is private, not public. The
25204 make verify test passes again.
25206 2001-11-15 Ravi Pratap <ravi@ximian.com>
25208 * support.cs (ReflectionParameters): Fix logic to determine
25209 whether the last parameter is a params one. Test 9 passes again.
25211 * delegate.cs (Populate): Register the builders we define with
25212 RegisterParameterForBuilder. Test 19 passes again.
25214 * cs-parser.jay (property_declaration): Reference $6 instead
25215 of $$ to get at the location.
25217 (indexer_declaration): Similar stuff.
25219 (attribute): Ditto.
25221 * class.cs (Property): Register parameters for the Get and Set methods
25222 if they exist. Test 23 passes again.
25224 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
25225 call to EmitArguments as we are sure there aren't any params arguments.
25226 Test 32 passes again.
25228 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
25229 IndexOutOfRangeException.
25231 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
25232 Test 33 now passes again.
25234 2001-11-15 Miguel de Icaza <miguel@ximian.com>
25236 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
25237 broke a bunch of things. Will have to come up with a better way
25238 of tracking locations.
25240 * statement.cs: Implemented foreach for single dimension arrays.
25242 2001-11-09 Miguel de Icaza <miguel@ximian.com>
25244 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
25245 an error. This removes the lookup from the critical path.
25247 * cs-parser.jay: Removed use of temporary_loc, which is completely
25250 2001-11-14 Miguel de Icaza <miguel@ximian.com>
25252 * support.cs (ReflectionParameters.ParameterModifier): Report
25253 whether the argument is a PARAMS argument or not.
25255 * class.cs: Set the attribute `ParamArrayAttribute' on the
25256 parameter argument.
25258 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
25259 and cons_param_array_attribute (ConstructorInfo for
25260 ParamArrayAttribute).,
25262 * codegen.cs: Emit the return using the `Return' statement, that
25263 way we can report the error correctly for missing return values.
25265 * class.cs (Method.Emit): Clean up.
25267 * expression.cs (Argument.Resolve): Take another argument: the
25268 location where this argument is used. Notice that this is not
25269 part of the "Argument" class as to reduce the size of the
25270 structure (we know the approximate location anyways).
25272 Test if the argument is a variable-reference, if not, then
25273 complain with a 206.
25275 (Argument.Emit): Emit addresses of variables.
25277 (Argument.FullDesc): Simplify.
25279 (Invocation.DoResolve): Update for Argument.Resolve.
25281 (ElementAccess.DoResolve): ditto.
25283 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
25284 method should be virtual, as this method is always virtual.
25286 (NewDelegate.DoResolve): Update for Argument.Resolve.
25288 * class.cs (ConstructorInitializer.DoResolve): ditto.
25290 * attribute.cs (Attribute.Resolve): ditto.
25292 2001-11-13 Miguel de Icaza <miguel@ximian.com>
25294 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
25296 * expression.cs (ParameterReference): Drop IStackStorage and implement
25297 IAssignMethod instead.
25299 (LocalVariableReference): ditto.
25301 * ecore.cs (FieldExpr): Drop IStackStorage and implement
25302 IAssignMethod instead.
25304 2001-11-13 Miguel de Icaza <miguel@ximian.com>
25306 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
25307 enumerations that are used in heavily used structures derive from
25308 byte in a laughable and pathetic attempt to reduce memory usage.
25309 This is the kind of pre-optimzations that you should not do at
25310 home without adult supervision.
25312 * expression.cs (UnaryMutator): New class, used to handle ++ and
25313 -- separatedly from the other unary operators. Cleans up the
25314 code, and kills the ExpressionStatement dependency in Unary.
25316 (Unary): Removed `method' and `Arguments' from this class, making
25317 it smaller, and moving it all to SimpleCall, so I can reuse this
25318 code in other locations and avoid creating a lot of transient data
25319 strucutres when not required.
25321 * cs-parser.jay: Adjust for new changes.
25323 2001-11-11 Miguel de Icaza <miguel@ximian.com>
25325 * enum.cs (Enum.Populate): If there is a failure during
25328 * cs-parser.jay (opt_enum_base): we used to catch type errors
25329 here, but this is really incorrect. The type error should be
25330 catched during semantic analysis.
25332 2001-12-11 Ravi Pratap <ravi@ximian.com>
25334 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
25335 current_local_parameters as expected since I, in my stupidity, had forgotten
25338 * attribute.cs (GetValidPlaces): Fix stupid bug.
25340 * class.cs (Method::Emit): Perform check on applicability of attributes.
25342 (Constructor::Emit): Ditto.
25344 (Field::Emit): Ditto.
25346 (Field.Location): Store location information.
25348 (Property, Event, Indexer, Operator): Ditto.
25350 * cs-parser.jay (field_declaration): Pass in location for each field.
25352 * ../errors/cs0592.cs : Add.
25354 2001-11-12 Ravi Pratap <ravi@ximian.com>
25356 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
25358 (InitCoreTypes): Update accordingly.
25360 (RegisterAttrType, LookupAttr): Implement.
25362 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
25363 info about the same.
25365 (Resolve): Update to populate the above as necessary.
25367 (Error592): Helper.
25369 (GetValidPlaces): Helper to the above.
25371 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
25373 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
25375 2001-11-12 Ravi Pratap <ravi@ximian.com>
25377 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
25379 * ../errors/cs0617.cs : Add.
25381 2001-11-11 Ravi Pratap <ravi@ximian.com>
25383 * enum.cs (Emit): Rename to Populate to be more consistent with what
25384 we expect it to do and when exactly it is called.
25386 * class.cs, rootcontext.cs : Update accordingly.
25388 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
25389 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
25391 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
25393 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
25394 of a fieldinfo using the above, when dealing with a FieldBuilder.
25396 2001-11-10 Ravi Pratap <ravi@ximian.com>
25398 * ../errors/cs0031.cs : Add.
25400 * ../errors/cs1008.cs : Add.
25402 * ../errrors/cs0543.cs : Add.
25404 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
25407 (FindMembers): Implement.
25409 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
25410 enums and delegates too.
25412 (enum_types): Rename to builder_to_enum.
25414 (delegate_types): Rename to builder_to_delegate.
25416 * delegate.cs (FindMembers): Implement.
25418 2001-11-09 Ravi Pratap <ravi@ximian.com>
25420 * typemanager.cs (IsEnumType): Implement.
25422 * enum.cs (Emit): Re-write parts to account for the underlying type
25423 better and perform checking etc.
25425 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
25426 of the underlying type.
25428 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
25431 * enum.cs (error31): Helper to report error #31.
25433 * cs-parser.jay (enum_declaration): Store location of each member too.
25435 * enum.cs (member_to_location): New hashtable.
25437 (AddEnumMember): Update location hashtable.
25439 (Emit): Use the location of each member while reporting errors.
25441 2001-11-09 Miguel de Icaza <miguel@ximian.com>
25443 * cs-parser.jay: A for_initializer if is a
25444 local_variable_declaration really ammount to have an implicit
25445 block with the variable declaration and no initializer for for.
25447 * statement.cs (For.Emit): Cope with null initializers.
25449 This fixes the infinite loop on for initializers.
25451 2001-11-08 Miguel de Icaza <miguel@ximian.com>
25453 * enum.cs: More cleanup.
25455 * ecore.cs: Remove dead code.
25457 * class.cs (Property.Emit): More simplification.
25458 (Event.Emit): ditto.
25460 Reworked to have less levels of indentation.
25462 2001-11-08 Ravi Pratap <ravi@ximian.com>
25464 * class.cs (Property): Emit attributes.
25474 * enum.cs (Emit): Ditto.
25476 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
25479 * class.cs (Field, Event, etc.): Move attribute generation into the
25480 Emit method everywhere.
25482 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
25483 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
25484 as we had no way of defining nested enums !
25486 * rootcontext.cs : Adjust code accordingly.
25488 * typemanager.cs (AddEnumType): To keep track of enum types separately.
25490 2001-11-07 Ravi Pratap <ravi@ximian.com>
25492 * expression.cs (EvalConstantExpression): Move into ecore.cs
25494 * enum.cs (Enum): Rename some members and make them public and readonly
25495 according to our convention.
25497 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
25500 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
25502 (Enum::Emit): Write a simple version for now which doesn't try to compute
25503 expressions. I shall modify this to be more robust in just a while.
25505 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
25507 (TypeContainer::CloseType): Create the Enum types too.
25509 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
25511 * expression.cs (EvalConstantExpression): Get rid of completely.
25513 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
25514 user-defined values and other cases.
25516 (IsValidEnumLiteral): Helper function.
25518 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
25519 out there in the case we had a literal FieldExpr.
25521 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
25523 (Literalize): Revamp a bit to take two arguments.
25525 (EnumLiteral): New class which derives from Literal to wrap enum literals.
25527 2001-11-06 Ravi Pratap <ravi@ximian.com>
25529 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
25531 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
25533 (Resolve): Use the above to ensure we have proper initializers.
25535 2001-11-05 Ravi Pratap <ravi@ximian.com>
25537 * expression.cs (Expression::EvalConstantExpression): New method to
25538 evaluate constant expressions.
25540 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
25542 2001-11-07 Miguel de Icaza <miguel@ximian.com>
25544 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
25547 (Binary.ResolveOperator): Handle operator != (object a, object b)
25548 and operator == (object a, object b);
25550 (Binary.DoNumericPromotions): Indicate whether the numeric
25551 promotion was possible.
25553 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
25556 Made the ArrayAccess implement interface IAssignMethod instead of
25557 IStackStore as the order in which arguments are passed reflects
25560 * assign.cs: Instead of using expr.ExprClass to select the way of
25561 assinging, probe for the IStackStore/IAssignMethod interfaces.
25563 * typemanager.cs: Load InitializeArray definition.
25565 * rootcontext.cs (RootContext.MakeStaticData): Used to define
25566 static data that can be used to initialize arrays.
25568 2001-11-05 Miguel de Icaza <miguel@ximian.com>
25570 * expression.cs: Handle operator== and operator!= for booleans.
25572 (Conditioal.Reduce): Implement reducer for the ?: operator.
25574 (Conditional.Resolve): Implement dead code elimination.
25576 (Binary.Resolve): Catch string literals and return a new
25577 concatenated string.
25579 (Unary.Reduce): Implement reduction of unary expressions.
25581 * ecore.cs: Split out the expression core handling here.
25583 (Expression.Reduce): New method used to perform constant folding
25584 and CSE. This is needed to support constant-expressions.
25586 * statement.cs (Statement.EmitBoolExpression): Pass true and false
25587 targets, and optimize for !x.
25589 2001-11-04 Ravi Pratap <ravi@ximian.com>
25591 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
25592 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
25593 set custom atttributes.
25595 * literal.cs (Literal::GetValue): New abstract method to return the actual
25596 value of the literal, cast as an object.
25598 (*Literal): Implement GetValue method.
25600 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
25601 expressions to the arraylist but objects of type Argument.
25603 * class.cs (TypeContainer::Emit): Emit our attributes too.
25605 (Method::Emit, Constructor::Emit): Ditto.
25607 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
25608 to be ignoring earlier.
25610 2001-11-03 Ravi Pratap <ravi@ximian.com>
25612 * attribute.cs (AttributeSection::Define): Implement to do the business
25613 of constructing a CustomAttributeBuilder.
25615 (Attribute): New trivial class. Increases readability of code.
25617 * cs-parser.jay : Update accordingly.
25619 (positional_argument_list, named_argument_list, named_argument): New rules
25621 (attribute_arguments): Use the above so that we are more correct.
25623 2001-11-02 Ravi Pratap <ravi@ximian.com>
25625 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
25626 to perform all checks for a method with a params parameter.
25628 (Invocation::OverloadResolve): Update to use the above method and therefore
25629 cope correctly with params method invocations.
25631 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
25634 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
25635 constructors in our parent too because we can't afford to miss out on
25638 * attribute.cs (AttributeSection): New name for the class Attribute
25640 Other trivial changes to improve readability.
25642 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
25643 use the new class names.
25645 2001-11-01 Ravi Pratap <ravi@ximian.com>
25647 * class.cs (Method::Define): Complete definition for params types too
25649 (Indexer::Define): Ditto.
25651 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
25652 Cope everywhere with a request for info about the array parameter.
25654 2001-11-01 Ravi Pratap <ravi@ximian.com>
25656 * tree.cs (RecordNamespace): Fix up to check for the correct key.
25658 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
25659 local_variable_type to extract the string corresponding to the type.
25661 (local_variable_type): Fixup the action to use the new helper method.
25663 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
25666 * expression.cs : Clean out code which uses the above.
25668 2001-10-31 Ravi Pratap <ravi@ximian.com>
25670 * typemanager.cs (RegisterMethod): Check if we already have an existing key
25671 and bale out if necessary by returning a false.
25673 (RegisterProperty): Ditto.
25675 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
25676 and print out appropriate error messages.
25678 * interface.cs (everywhere): Ditto.
25680 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
25681 location to constructor.
25683 * class.cs (Property, Event, Indexer): Update accordingly.
25685 * ../errors/cs111.cs : Added.
25687 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
25688 of a method, as laid down by the spec.
25690 (Invocation::OverloadResolve): Use the above method.
25692 2001-10-31 Ravi Pratap <ravi@ximian.com>
25694 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
25695 now take a TypeContainer and a Parameters object.
25697 (ParameterData): Modify return type of ParameterModifier method to be
25698 Parameter.Modifier and not a string.
25700 (ReflectionParameters, InternalParameters): Update accordingly.
25702 * expression.cs (Argument::GetParameterModifier): Same here.
25704 * support.cs (InternalParameters::ParameterType): Find a better way of determining
25705 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
25706 symbol in it at all so maybe this is only for now.
25708 2001-10-30 Ravi Pratap <ravi@ximian.com>
25710 * support.cs (InternalParameters): Constructor now takes an extra argument
25711 which is the actual Parameters class.
25713 (ParameterDesc): Update to provide info on ref/out modifiers.
25715 * class.cs (everywhere): Update call to InternalParameters to pass in
25716 the second argument too.
25718 * support.cs (ParameterData): Add ParameterModifier, which is a method
25719 to return the modifier info [ref/out etc]
25721 (InternalParameters, ReflectionParameters): Implement the above.
25723 * expression.cs (Argument::ParameterModifier): Similar function to return
25724 info about the argument's modifiers.
25726 (Invocation::OverloadResolve): Update to take into account matching modifiers
25729 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
25730 a new SetFormalParameters object which we pass to InternalParameters.
25732 2001-10-30 Ravi Pratap <ravi@ximian.com>
25734 * expression.cs (NewArray): Merge into the ArrayCreation class.
25736 2001-10-29 Ravi Pratap <ravi@ximian.com>
25738 * expression.cs (NewArray): Merge classes NewBuiltinArray and
25739 NewUserdefinedArray into one as there wasn't much of a use in having
25742 * expression.cs (Argument): Change field's name to ArgType from Type.
25744 (Type): New readonly property which returns the proper type, taking into
25745 account ref/out modifiers.
25747 (everywhere): Adjust code accordingly for the above.
25749 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
25750 whether we are emitting for a ref or out parameter.
25752 * expression.cs (Argument::Emit): Use the above field to set the state.
25754 (LocalVariableReference::Emit): Update to honour the flag and emit the
25757 * parameter.cs (Attributes): Set the correct flags for ref parameters.
25759 * expression.cs (Argument::FullDesc): New function to provide a full desc.
25761 * support.cs (ParameterData): Add method ParameterDesc to the interface.
25763 (ReflectionParameters, InternalParameters): Implement the above method.
25765 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
25768 (Invocation::FullMethodDesc): Ditto.
25770 2001-10-29 Miguel de Icaza <miguel@ximian.com>
25772 * cs-parser.jay: Add extra production for the second form of array
25775 * expression.cs (ArrayCreation): Update to reflect the above
25778 * Small changes to prepare for Array initialization.
25780 2001-10-28 Miguel de Icaza <miguel@ximian.com>
25782 * typemanager.cs (ImplementsInterface): interface might be null;
25783 Deal with this problem;
25785 Also, we do store negative hits on the cache (null values), so use
25786 this instead of calling t.GetInterfaces on the type everytime.
25788 2001-10-28 Ravi Pratap <ravi@ximian.com>
25790 * typemanager.cs (IsBuiltinType): New method to help determine the same.
25792 * expression.cs (New::DoResolve): Get rid of array creation code and instead
25793 split functionality out into different classes.
25795 (New::FormArrayType): Move into NewBuiltinArray.
25797 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
25800 (NewBuiltinArray): New class to handle creation of built-in arrays.
25802 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
25803 account creation of one-dimensional arrays.
25805 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
25807 (NewUserdefinedArray::DoResolve): Implement.
25809 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
25811 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
25812 we maintain inside the TypeManager. This is necessary to perform lookups on the
25815 (LookupType): Update to perform GetType on the module builders too.
25817 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
25819 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
25821 2001-10-23 Ravi Pratap <ravi@ximian.com>
25823 * expression.cs (New::DoResolve): Implement guts of array creation.
25825 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
25827 2001-10-27 Miguel de Icaza <miguel@ximian.com>
25829 * expression.cs: Fix bug I introduced lsat night that broke
25832 (Expression.Resolve): Report a 246 error (can not resolve name)
25833 if we find a SimpleName in the stream.
25835 (Expression.ResolveLValue): Ditto.
25837 (Expression.ResolveWithSimpleName): This function is a variant of
25838 ResolveName, this one allows SimpleNames to be returned without a
25839 warning. The only consumer of SimpleNames is MemberAccess
25841 2001-10-26 Miguel de Icaza <miguel@ximian.com>
25843 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
25844 might arrive here. I have my doubts that this is correct.
25846 * statement.cs (Lock): Implement lock statement.
25848 * cs-parser.jay: Small fixes to support `lock' and `using'
25850 * cs-tokenizer.cs: Remove extra space
25852 * driver.cs: New flag --checked, allows to turn on integer math
25855 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
25856 Threading.Monitor.Exit
25858 2001-10-23 Miguel de Icaza <miguel@ximian.com>
25860 * expression.cs (IndexerAccess::DoResolveLValue): Set the
25861 Expression Class to be IndexerAccess.
25863 Notice that Indexer::DoResolve sets the eclass to Value.
25865 2001-10-22 Miguel de Icaza <miguel@ximian.com>
25867 * class.cs (TypeContainer::Emit): Emit code for indexers.
25869 * assign.cs (IAssignMethod): New interface implemented by Indexers
25870 and Properties for handling assignment.
25872 (Assign::Emit): Simplify and reuse code.
25874 * expression.cs (IndexerAccess, PropertyExpr): Implement
25875 IAssignMethod, clean up old code.
25877 2001-10-22 Ravi Pratap <ravi@ximian.com>
25879 * typemanager.cs (ImplementsInterface): New method to determine if a type
25880 implements a given interface. Provides a nice cache too.
25882 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
25885 (ConvertReferenceExplicit): Ditto.
25887 * delegate.cs (Delegate::Populate): Update to define the parameters on the
25888 various methods, with correct names etc.
25890 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
25891 Operator.UnaryNegation.
25893 * cs-parser.jay (operator_declarator): Be a little clever in the case where
25894 we have a unary plus or minus operator.
25896 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
25899 * everywhere : update accordingly.
25901 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
25904 * class.cs (Method::Define): For the case where we are implementing a method
25905 inherited from an interface, we need to set the MethodAttributes.Final flag too.
25906 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
25908 2001-10-21 Ravi Pratap <ravi@ximian.com>
25910 * interface.cs (FindMembers): Implement to work around S.R.E
25913 * typemanager.cs (IsInterfaceType): Implement.
25915 (FindMembers): Update to handle interface types too.
25917 * expression.cs (ImplicitReferenceConversion): Re-write bits which
25918 use IsAssignableFrom as that is not correct - it doesn't work.
25920 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
25921 and accordingly override EmitStatement.
25923 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
25924 using the correct logic :-)
25926 2001-10-19 Ravi Pratap <ravi@ximian.com>
25928 * ../errors/cs-11.cs : Add to demonstrate error -11
25930 2001-10-17 Miguel de Icaza <miguel@ximian.com>
25932 * assign.cs (Assign::Resolve): Resolve right hand side first, and
25933 then pass this as a hint to ResolveLValue.
25935 * expression.cs (FieldExpr): Add Location information
25937 (FieldExpr::LValueResolve): Report assignment to readonly
25940 (Expression::ExprClassFromMemberInfo): Pass location information.
25942 (Expression::ResolveLValue): Add new method that resolves an
25945 (Expression::DoResolveLValue): Default invocation calls
25948 (Indexers): New class used to keep track of indexers in a given
25951 (IStackStore): Renamed from LValue, as it did not really describe
25952 what this did. Also ResolveLValue is gone from this interface and
25953 now is part of Expression.
25955 (ElementAccess): Depending on the element access type
25957 * typemanager.cs: Add `indexer_name_type' as a Core type
25958 (System.Runtime.CompilerServices.IndexerNameAttribute)
25960 * statement.cs (Goto): Take a location.
25962 2001-10-18 Ravi Pratap <ravi@ximian.com>
25964 * delegate.cs (Delegate::VerifyDelegate): New method to verify
25965 if two delegates are compatible.
25967 (NewDelegate::DoResolve): Update to take care of the case when
25968 we instantiate a delegate from another delegate.
25970 * typemanager.cs (FindMembers): Don't even try to look up members
25971 of Delegate types for now.
25973 2001-10-18 Ravi Pratap <ravi@ximian.com>
25975 * delegate.cs (NewDelegate): New class to take care of delegate
25978 * expression.cs (New): Split the delegate related code out into
25979 the NewDelegate class.
25981 * delegate.cs (DelegateInvocation): New class to handle delegate
25984 * expression.cs (Invocation): Split out delegate related code into
25985 the DelegateInvocation class.
25987 2001-10-17 Ravi Pratap <ravi@ximian.com>
25989 * expression.cs (New::DoResolve): Implement delegate creation fully
25990 and according to the spec.
25992 (New::DoEmit): Update to handle delegates differently.
25994 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
25995 because of which we were printing out arguments in reverse order !
25997 * delegate.cs (VerifyMethod): Implement to check if the given method
25998 matches the delegate.
26000 (FullDelegateDesc): Implement.
26002 (VerifyApplicability): Implement.
26004 * expression.cs (Invocation::DoResolve): Update to accordingly handle
26005 delegate invocations too.
26007 (Invocation::Emit): Ditto.
26009 * ../errors/cs1593.cs : Added.
26011 * ../errors/cs1594.cs : Added.
26013 * delegate.cs (InstanceExpression, TargetMethod): New properties.
26015 2001-10-16 Ravi Pratap <ravi@ximian.com>
26017 * typemanager.cs (intptr_type): Core type for System.IntPtr
26019 (InitCoreTypes): Update for the same.
26021 (iasyncresult_type, asynccallback_type): Ditto.
26023 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
26026 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
26029 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
26030 the builders for the 4 members of a delegate type :-)
26032 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
26035 * expression.cs (New::DoResolve): Implement guts for delegate creation.
26037 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
26039 2001-10-15 Miguel de Icaza <miguel@ximian.com>
26041 * statement.cs (Break::Emit): Implement.
26042 (Continue::Emit): Implement.
26044 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
26045 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
26046 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
26047 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
26050 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
26051 properties that track the label for the current loop (begin of the
26052 loop and end of the loop).
26054 2001-10-15 Ravi Pratap <ravi@ximian.com>
26056 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
26057 use of emitting anything at all.
26059 * class.cs, rootcontext.cs : Get rid of calls to the same.
26061 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
26063 (Populate): Define the constructor correctly and set the implementation
26066 * typemanager.cs (delegate_types): New hashtable to hold delegates that
26069 (AddDelegateType): Implement.
26071 (IsDelegateType): Implement helper method.
26073 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
26075 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
26076 and accordingly handle it.
26078 * delegate.cs (Populate): Take TypeContainer argument.
26079 Implement bits to define the Invoke method. However, I still haven't figured out
26080 how to take care of the native int bit :-(
26082 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
26083 Qualify the name of the delegate, not its return type !
26085 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
26088 (StandardConversionExists): Checking for array types turns out to be recursive.
26090 (ConvertReferenceExplicit): Implement array conversion.
26092 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
26094 2001-10-12 Ravi Pratap <ravi@ximian.com>
26096 * cs-parser.jay (delegate_declaration): Store the fully qualified
26097 name as it is a type declaration.
26099 * delegate.cs (ReturnType, Name): Rename members to these. Make them
26102 (DefineDelegate): Renamed from Define. Does the same thing essentially,
26103 as TypeContainer::DefineType.
26105 (Populate): Method in which all the definition of the various methods (Invoke)
26108 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
26111 (CloseDelegate): Finally creates the delegate.
26113 * class.cs (TypeContainer::DefineType): Update to define delegates.
26114 (Populate, Emit and CloseType): Do the same thing here too.
26116 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
26117 delegates in all these operations.
26119 2001-10-14 Miguel de Icaza <miguel@ximian.com>
26121 * expression.cs: LocalTemporary: a new expression used to
26122 reference a temporary that has been created.
26124 * assign.cs: Handle PropertyAccess back here, so that we can
26125 provide the proper semantic access to properties.
26127 * expression.cs (Expression::ConvertReferenceExplicit): Implement
26128 a few more explicit conversions.
26130 * modifiers.cs: `NEW' modifier maps to HideBySig.
26132 * expression.cs (PropertyExpr): Make this into an
26133 ExpressionStatement, and support the EmitStatement code path.
26135 Perform get/set error checking, clean up the interface.
26137 * assign.cs: recognize PropertyExprs as targets, and if so, turn
26138 them into toplevel access objects.
26140 2001-10-12 Miguel de Icaza <miguel@ximian.com>
26142 * expression.cs: PropertyExpr::PropertyExpr: use work around the
26145 * typemanager.cs: Keep track here of our PropertyBuilders again to
26146 work around lameness in SRE.
26148 2001-10-11 Miguel de Icaza <miguel@ximian.com>
26150 * expression.cs (LValue::LValueResolve): New method in the
26151 interface, used to perform a second resolution pass for LValues.
26153 (This::DoResolve): Catch the use of this in static methods.
26155 (This::LValueResolve): Implement.
26157 (This::Store): Remove warning, assigning to `this' in structures
26160 (Invocation::Emit): Deal with invocation of
26161 methods on value types. We need to pass the address to structure
26162 methods rather than the object itself. (The equivalent code to
26163 emit "this" for structures leaves the entire structure on the
26164 stack instead of a pointer to it).
26166 (ParameterReference::DoResolve): Compute the real index for the
26167 argument based on whether the method takes or not a `this' pointer
26168 (ie, the method is static).
26170 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
26171 value types returned from functions when we need to invoke a
26172 method on the sturcture.
26175 2001-10-11 Ravi Pratap <ravi@ximian.com>
26177 * class.cs (TypeContainer::DefineType): Method to actually do the business of
26178 defining the type in the Modulebuilder or Typebuilder. This is to take
26179 care of nested types which need to be defined on the TypeBuilder using
26180 DefineNestedMethod.
26182 (TypeContainer::GetClassBases): Implement. Essentially the code from the
26183 methods in RootContext, only ported to be part of TypeContainer.
26185 (TypeContainer::GetInterfaceOrClass): Ditto.
26187 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
26189 * interface.cs (Interface::DefineInterface): New method. Does exactly
26190 what RootContext.CreateInterface did earlier, only it takes care of nested types
26193 (Interface::GetInterfaces): Move from RootContext here and port.
26195 (Interface::GetInterfaceByName): Same here.
26197 * rootcontext.cs (ResolveTree): Re-write.
26199 (PopulateTypes): Re-write.
26201 * class.cs (TypeContainer::Populate): Populate nested types too.
26202 (TypeContainer::Emit): Emit nested members too.
26204 * typemanager.cs (AddUserType): Do not make use of the FullName property,
26205 instead just use the name argument passed in as it is already fully
26208 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
26209 to TypeContainer mapping to see if a type is user-defined.
26211 * class.cs (TypeContainer::CloseType): Implement.
26213 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
26214 the default constructor.
26216 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
26219 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
26221 * interface.cs (CloseType): Create the type here.
26223 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
26226 Remove all the methods which are now in TypeContainer.
26228 2001-10-10 Ravi Pratap <ravi@ximian.com>
26230 * delegate.cs (Define): Re-write bits to define the delegate
26233 2001-10-10 Miguel de Icaza <miguel@ximian.com>
26235 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
26237 * expression.cs (ImplicitReferenceConversion): handle null as well
26238 as a source to convert to any reference type.
26240 * statement.cs (Return): Perform any implicit conversions to
26241 expected return type.
26243 Validate use of return statement.
26245 * codegen.cs (EmitContext): Pass the expected return type here.
26247 * class.cs (Method, Constructor, Property): Pass expected return
26248 type to EmitContext.
26250 2001-10-09 Miguel de Icaza <miguel@ximian.com>
26252 * expression.cs: Make DoResolve take an EmitContext instead of a
26255 Replaced `l' and `location' for `loc', for consistency.
26257 (Error, Warning): Remove unneeded Tc argument.
26259 * assign.cs, literal.cs, constant.cs: Update to new calling
26262 * codegen.cs: EmitContext now contains a flag indicating whether
26263 code is being generated in a static method or not.
26265 * cs-parser.jay: DecomposeQI, new function that replaces the old
26266 QualifiedIdentifier. Now we always decompose the assembled
26267 strings from qualified_identifier productions into a group of
26270 2001-10-08 Miguel de Icaza <miguel@ximian.com>
26272 * rootcontext.cs: Deal with field-less struct types correctly now
26273 by passing the size option to Define Type.
26275 * class.cs: Removed hack that created one static field.
26277 2001-10-07 Miguel de Icaza <miguel@ximian.com>
26279 * statement.cs: Moved most of the code generation here.
26281 2001-10-09 Ravi Pratap <ravi@ximian.com>
26283 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
26286 (ElementAccess): Remove useless bits for now - keep checks as the spec
26289 2001-10-08 Ravi Pratap <ravi@ximian.com>
26291 * expression.cs (ElementAccess::DoResolve): Remove my crap code
26292 and start performing checks according to the spec.
26294 2001-10-07 Ravi Pratap <ravi@ximian.com>
26296 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
26297 rank_specifiers instead.
26299 (rank_specifiers): Change the order in which the rank specifiers are stored
26301 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
26303 * expression.cs (ElementAccess): Implement the LValue interface too.
26305 2001-10-06 Ravi Pratap <ravi@ximian.com>
26307 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
26308 except that user defined conversions are not included.
26310 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
26311 perform the conversion of the return type, if necessary.
26313 (New::DoResolve): Check whether we are creating an array or an object
26314 and accordingly do the needful.
26316 (New::Emit): Same here.
26318 (New::DoResolve): Implement guts of array creation.
26320 (New::FormLookupType): Helper function.
26322 2001-10-07 Miguel de Icaza <miguel@ximian.com>
26324 * codegen.cs: Removed most of the code generation here, and move the
26325 corresponding code generation bits to the statement classes.
26327 Added support for try/catch/finalize and throw.
26329 * cs-parser.jay: Added support for try/catch/finalize.
26331 * class.cs: Catch static methods having the flags override,
26332 virtual or abstract.
26334 * expression.cs (UserCast): This user cast was not really doing
26335 what it was supposed to do. Which is to be born in fully resolved
26336 state. Parts of the resolution were being performed at Emit time!
26340 2001-10-05 Miguel de Icaza <miguel@ximian.com>
26342 * expression.cs: Implicity convert the result from UserCast.
26344 2001-10-05 Ravi Pratap <ravi@ximian.com>
26346 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
26347 prevented it from working correctly.
26349 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
26350 merely ConvertImplicit.
26352 2001-10-05 Miguel de Icaza <miguel@ximian.com>
26354 * typemanager.cs: Make the LookupTypeContainer function static,
26355 and not per-instance.
26357 * class.cs: Make static FindMembers (the one that takes a Type
26360 * codegen.cs: Add EmitForeach here.
26362 * cs-parser.jay: Make foreach a toplevel object instead of the
26363 inline expansion, as we need to perform semantic analysis on it.
26365 2001-10-05 Ravi Pratap <ravi@ximian.com>
26367 * expression.cs (Expression::ImplicitUserConversion): Rename to
26368 UserDefinedConversion.
26370 (Expression::UserDefinedConversion): Take an extra argument specifying
26371 whether we look for explicit user conversions too.
26373 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
26375 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
26377 (ExplicitUserConversion): Make it a call to UserDefinedConversion
26378 with the appropriate arguments.
26380 * cs-parser.jay (cast_expression): Record location too.
26382 * expression.cs (Cast): Record location info.
26384 (Expression::ConvertExplicit): Take location argument.
26386 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
26387 to determine if we are doing explicit conversions.
26389 (UserCast::Emit): Update accordingly.
26391 (Expression::ConvertExplicit): Report an error if everything fails.
26393 * ../errors/cs0030.cs : Add.
26395 2001-10-04 Miguel de Icaza <miguel@ximian.com>
26397 * modifiers.cs: If the ABSTRACT keyword is present, also set the
26398 virtual and newslot bits.
26400 * class.cs (TypeContainer::RegisterRequiredImplementations):
26401 Record methods we need.
26403 (TypeContainer::MakeKey): Helper function to make keys for
26404 MethodBases, since the Methodbase key is useless.
26406 (TypeContainer::Populate): Call RegisterRequiredImplementations
26407 before defining the methods.
26409 Create a mapping for method_builders_to_methods ahead of time
26410 instead of inside a tight loop.
26412 (::RequireMethods): Accept an object as the data to set into the
26413 hashtable so we can report interface vs abstract method mismatch.
26415 2001-10-03 Miguel de Icaza <miguel@ximian.com>
26417 * report.cs: Make all of it static.
26419 * rootcontext.cs: Drop object_type and value_type computations, as
26420 we have those in the TypeManager anyways.
26422 Drop report instance variable too, now it is a global.
26424 * driver.cs: Use try/catch on command line handling.
26426 Add --probe option to debug the error reporting system with a test
26429 * report.cs: Add support for exiting program when a probe
26430 condition is reached.
26432 2001-10-03 Ravi Pratap <ravi@ximian.com>
26434 * expression.cs (Binary::DoNumericPromotions): Fix the case when
26435 we do a forcible conversion regardless of type, to check if
26436 ForceConversion returns a null.
26438 (Binary::error19): Use location to report error.
26440 (Unary::error23): Use location here too.
26442 * ../errors/cs0019.cs : Check in.
26444 * ../errors/cs0023.cs : Check in.
26446 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
26447 case of a non-null MethodInfo object with a length of 0 !
26449 (Binary::ResolveOperator): Flag error if overload resolution fails to find
26450 an applicable member - according to the spec :-)
26451 Also fix logic to find members in base types.
26453 (Unary::ResolveOperator): Same here.
26455 (Unary::report23): Change name to error23 and make first argument a TypeContainer
26456 as I was getting thoroughly confused between this and error19 :-)
26458 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
26459 (::FindMostEncompassedType): Implement.
26460 (::FindMostEncompassingType): Implement.
26461 (::StandardConversionExists): Implement.
26463 (UserImplicitCast): Re-vamp. We now need info about most specific
26464 source and target types so that we can do the necessary conversions.
26466 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
26467 mathematical union with no duplicates.
26469 2001-10-03 Miguel de Icaza <miguel@ximian.com>
26471 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
26472 in order from base classes to child classes, so that we can in
26473 child classes look up in our parent for method names and
26474 attributes (required for handling abstract, virtual, new, override
26475 constructs: we need to instrospect our base class, and if we dont
26476 populate the classes in order, the introspection might be
26477 incorrect. For example, a method could query its parent before
26478 the parent has any methods and would determine that the parent has
26479 no abstract methods (while it could have had them)).
26481 (RootContext::CreateType): Record the order in which we define the
26484 2001-10-02 Miguel de Icaza <miguel@ximian.com>
26486 * class.cs (TypeContainer::Populate): Also method definitions can
26487 fail now, keep track of this.
26489 (TypeContainer::FindMembers): Implement support for
26490 DeclaredOnly/noDeclaredOnly flag.
26492 (Constructor::Emit) Return the ConstructorBuilder.
26494 (Method::Emit) Return the MethodBuilder.
26495 Check for abstract or virtual methods to be public.
26497 * rootcontext.cs (RootContext::CreateType): Register all the
26498 abstract methods required for the class to be complete and the
26499 interface methods that must be implemented.
26501 * cs-parser.jay: Report error 501 (method requires body if it is
26502 not marked abstract or extern).
26504 * expression.cs (TypeOf::Emit): Implement.
26506 * typemanager.cs: runtime_handle_type, new global type.
26508 * class.cs (Property::Emit): Generate code for properties.
26510 2001-10-02 Ravi Pratap <ravi@ximian.com>
26512 * expression.cs (Unary::ResolveOperator): Find operators on base type
26513 too - we now conform exactly to the spec.
26515 (Binary::ResolveOperator): Same here.
26517 * class.cs (Operator::Define): Fix minor quirk in the tests.
26519 * ../errors/cs0215.cs : Added.
26521 * ../errors/cs0556.cs : Added.
26523 * ../errors/cs0555.cs : Added.
26525 2001-10-01 Miguel de Icaza <miguel@ximian.com>
26527 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
26528 single integer which is really efficient
26530 2001-10-01 Ravi Pratap <ravi@ximian.com>
26532 * expression.cs (Expression::ImplicitUserConversion): Use location
26533 even in the case when we are examining True operators.
26535 * class.cs (Operator::Define): Perform extensive checks to conform
26536 with the rules for operator overloading in the spec.
26538 * expression.cs (Expression::ImplicitReferenceConversion): Implement
26539 some of the other conversions mentioned in the spec.
26541 * typemanager.cs (array_type): New static member for the System.Array built-in
26544 (cloneable_interface): For System.ICloneable interface.
26546 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
26547 we start resolving the tree and populating types.
26549 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
26551 2001-10-01 Miguel de Icaza <miguel@ximian.com>
26553 * expression.cs (Expression::ExprClassFromMemberInfo,
26554 Expression::Literalize): Create literal expressions from
26555 FieldInfos which are literals.
26557 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
26558 type casts, because they were wrong. The test suite in tests
26561 (ImplicitNumericConversion): ushort to ulong requires a widening
26564 Int32 constant to long requires widening cast as well.
26566 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
26567 for integers because the type on the stack is not i4.
26569 2001-09-30 Miguel de Icaza <miguel@ximian.com>
26571 * expression.cs (report118): require location argument.
26573 * parameter.cs: Do not dereference potential null value.
26575 * class.cs: Catch methods that lack the `new' keyword when
26576 overriding a name. Report warnings when `new' is used without
26577 anything being there to override.
26579 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
26581 * class.cs: Only add constructor to hashtable if it is non-null
26582 (as now constructors can fail on define).
26584 (TypeManager, Class, Struct): Take location arguments.
26586 Catch field instance initialization in structs as errors.
26588 accepting_filter: a new filter for FindMembers that is static so
26589 that we dont create an instance per invocation.
26591 (Constructor::Define): Catch errors where a struct constructor is
26594 * cs-parser.jay: Pass location information for various new
26597 * delegate.cs (Delegate): take a location argument.
26599 * driver.cs: Do not call EmitCode if there were problesm in the
26600 Definition of the types, as many Builders wont be there.
26602 * decl.cs (Decl::Decl): Require a location argument.
26604 * cs-tokenizer.cs: Handle properly hex constants that can not fit
26605 into integers, and find the most appropiate integer for it.
26607 * literal.cs: Implement ULongLiteral.
26609 * rootcontext.cs: Provide better information about the location of
26610 failure when CreateType fails.
26612 2001-09-29 Miguel de Icaza <miguel@ximian.com>
26614 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
26617 * expression.cs (Binary::CheckShiftArguments): Add missing type
26619 (Binary::ResolveOperator): Add type to the logical and and logical
26620 or, Bitwise And/Or and Exclusive Or code paths, it was missing
26623 (Binary::DoNumericPromotions): In the case where either argument
26624 is ulong (and most signed types combined with ulong cause an
26625 error) perform implicit integer constant conversions as well.
26627 2001-09-28 Miguel de Icaza <miguel@ximian.com>
26629 * expression.cs (UserImplicitCast): Method should always be
26631 (Invocation::BetterConversion): Simplified test for IntLiteral.
26633 (Expression::ImplicitNumericConversion): Split this routine out.
26634 Put the code that performs implicit constant integer conversions
26637 (Expression::Resolve): Become a wrapper around DoResolve so we can
26638 check eclass and type being set after resolve.
26640 (Invocation::Badness): Remove this dead function
26642 (Binary::ResolveOperator): Do not compute the expensive argumnets
26643 unless we have a union for it.
26645 (Probe::Emit): Is needs to do an isinst and then
26646 compare against null.
26648 (::CanConvert): Added Location argument. If the Location argument
26649 is null (Location.Null), then we do not report errors. This is
26650 used by the `probe' mechanism of the Explicit conversion. We do
26651 not want to generate an error for something that the user
26652 explicitly requested to be casted. But the pipeline for an
26653 explicit cast first tests for potential implicit casts.
26655 So for now, if the Location is null, it means `Probe only' to
26656 avoid adding another argument. Might have to revise this
26659 (ClassCast): New class used to type cast objects into arbitrary
26660 classes (used in Explicit Reference Conversions).
26662 Implement `as' as well.
26664 Reverted all the patches from Ravi below: they were broken:
26666 * The use of `level' as a mechanism to stop recursive
26667 invocations is wrong. That was there just to catch the
26668 bug with a strack trace but not as a way of addressing
26671 To fix the problem we have to *understand* what is going
26672 on and the interactions and come up with a plan, not
26673 just get things going.
26675 * The use of the type conversion cache that I proposed
26676 last night had an open topic: How does this work across
26677 protection domains. A user defined conversion might not
26678 be public in the location where we are applying the
26679 conversion, a different conversion might be selected
26680 (ie, private A->B (better) but public B->A (worse),
26681 inside A, A->B applies, but outside it, B->A will
26684 * On top of that (ie, even if the above is solved),
26685 conversions in a cache need to be abstract. Ie, `To
26686 convert from an Int to a Short use an OpcodeCast', not
26687 `To convert from an Int to a Short use the OpcodeCast on
26688 the variable 5' (which is what this patch was doing).
26690 2001-09-28 Ravi Pratap <ravi@ximian.com>
26692 * expression.cs (Invocation::ConversionExists): Re-write to use
26693 the conversion cache
26695 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
26696 cache all conversions done, not just user-defined ones.
26698 (Invocation::BetterConversion): The real culprit. Use ConversionExists
26699 to determine if a conversion exists instead of acutually trying to
26700 perform the conversion. It's faster too.
26702 (Expression::ConvertExplicit): Modify to use ConversionExists to check
26703 and only then attempt the implicit conversion.
26705 2001-09-28 Ravi Pratap <ravi@ximian.com>
26707 * expression.cs (ConvertImplicit): Use a cache for conversions
26708 already found. Check level of recursion and bail out if necessary.
26710 2001-09-28 Miguel de Icaza <miguel@ximian.com>
26712 * typemanager.cs (string_concat_string_string, string_concat_object_object):
26713 Export standard methods that we expect for string operations.
26715 * statement.cs (Block::UsageWarning): Track usage of variables and
26716 report the errors for not used variables.
26718 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
26721 2001-09-27 Miguel de Icaza <miguel@ximian.com>
26723 * codegen.cs: remove unnneded code
26725 * expression.cs: Removed BuiltinTypeAccess class
26727 Fix the order in which implicit conversions are
26730 The previous fixed dropped support for boxed conversions (adding a
26731 test to the test suite now)
26733 (UserImplicitCast::CanConvert): Remove test for source being null,
26734 that code is broken. We should not feed a null to begin with, if
26735 we do, then we should track the bug where the problem originates
26736 and not try to cover it up here.
26738 Return a resolved expression of type UserImplicitCast on success
26739 rather than true/false. Ravi: this is what I was talking about,
26740 the pattern is to use a static method as a "constructor" for
26743 Also, do not create arguments until the very last minute,
26744 otherwise we always create the arguments even for lookups that
26745 will never be performed.
26747 (UserImplicitCast::Resolve): Eliminate, objects of type
26748 UserImplicitCast are born in a fully resolved state.
26750 * typemanager.cs (InitCoreTypes): Init also value_type
26751 (System.ValueType).
26753 * expression.cs (Cast::Resolve): First resolve the child expression.
26755 (LValue): Add new method AddressOf to be used by
26758 Change the argument of Store to take an EmitContext instead of an
26759 ILGenerator, because things like FieldExpr need to be able to call
26760 their children expression to generate the instance code.
26762 (Expression::Error, Expression::Warning): Sugar functions for
26765 (Expression::MemberLookup): Accept a TypeContainer instead of a
26766 Report as the first argument.
26768 (Expression::ResolvePrimary): Killed. I still want to improve
26769 this as currently the code is just not right.
26771 (Expression::ResolveMemberAccess): Simplify, but it is still
26774 (Unary::Resolve): Catch errors in AddressOf operators.
26776 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
26777 index to a byte for the short-version, or the compiler will choose
26778 the wrong Emit call, which generates the wrong data.
26780 (ParameterReference::Emit, ::Store): same.
26782 (FieldExpr::AddressOf): Implement.
26784 * typemanager.cs: TypeManager: made public variable instead of
26787 * driver.cs: document --fatal.
26789 * report.cs (ErrorMessage, WarningMessage): new names for the old
26790 Error and Warning classes.
26792 * cs-parser.jay (member_access): Turn built-in access to types
26793 into a normal simplename
26795 2001-09-27 Ravi Pratap <ravi@ximian.com>
26797 * expression.cs (Invocation::BetterConversion): Fix to cope
26798 with q being null, since this was introducing a bug.
26800 * expression.cs (ConvertImplicit): Do built-in conversions first.
26802 2001-09-27 Ravi Pratap <ravi@ximian.com>
26804 * expression.cs (UserImplicitCast::Resolve): Fix bug.
26806 2001-09-27 Ravi Pratap <ravi@ximian.com>
26808 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
26809 I had introduced long ago (what's new ?).
26811 * expression.cs (UserImplicitCast::CanConvert): Static method to do
26812 the work of all the checking.
26813 (ConvertImplicit): Call CanConvert and only then create object if necessary.
26814 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
26816 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
26817 that is the right way.
26819 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
26820 overloading resolution. Use everywhere instead of cutting and pasting code.
26822 (Binary::ResolveOperator): Use MakeUnionSet.
26824 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
26825 we have to convert to bool types. Not complete yet.
26827 2001-09-27 Miguel de Icaza <miguel@ximian.com>
26829 * typemanager.cs (TypeManager::CSharpName): support ushort.
26831 * expression.cs (Expression::TryImplicitIntConversion): Attempts
26832 to provide an expression that performsn an implicit constant int
26833 conversion (section 6.1.6).
26834 (Expression::ConvertImplicitRequired): Reworked to include
26835 implicit constant expression conversions.
26837 (Expression::ConvertNumericExplicit): Finished.
26839 (Invocation::Emit): If InstanceExpression is null, then it means
26840 that we perform a call on this.
26842 2001-09-26 Miguel de Icaza <miguel@ximian.com>
26844 * expression.cs (Unary::Emit): Remove some dead code.
26845 (Probe): Implement Resolve and Emit for `is'.
26846 (Expression::ConvertImplicitRequired): Attempt to do constant
26847 expression conversions here. Maybe should be moved to
26848 ConvertImplicit, but I am not sure.
26849 (Expression::ImplicitLongConstantConversionPossible,
26850 Expression::ImplicitIntConstantConversionPossible): New functions
26851 that tell whether is it possible to apply an implicit constant
26852 expression conversion.
26854 (ConvertNumericExplicit): Started work on explicit numeric
26857 * cs-parser.jay: Update operator constants.
26859 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
26860 (Parameters::GetSignature): Hook up VerifyArgs here.
26861 (Parameters::VerifyArgs): Verifies that no two arguments have the
26864 * class.cs (Operator): Update the operator names to reflect the
26865 ones that the spec expects (as we are just stringizing the
26868 * expression.cs (Unary::ResolveOperator): Fix bug: Use
26869 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
26870 previous usage did only work for our methods.
26871 (Expression::ConvertImplicit): Handle decimal implicit numeric
26872 conversions as well.
26873 (Expression::InternalTypeConstructor): Used to invoke constructors
26874 on internal types for default promotions.
26876 (Unary::Emit): Implement special handling for the pre/post
26877 increment/decrement for overloaded operators, as they need to have
26878 the same semantics as the other operators.
26880 (Binary::ResolveOperator): ditto.
26881 (Invocation::ConversionExists): ditto.
26882 (UserImplicitCast::Resolve): ditto.
26884 2001-09-26 Ravi Pratap <ravi@ximian.com>
26886 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
26887 operator, return after emitting body. Regression tests pass again !
26889 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
26890 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
26891 (Invocation::OverloadResolve): Ditto.
26892 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
26894 * everywhere : update calls to the above methods accordingly.
26896 2001-09-26 Miguel de Icaza <miguel@ximian.com>
26898 * assign.cs (Assign): Make it inherit from ExpressionStatement.
26900 * expression.cs (ExpressionStatement): New base class used for
26901 expressions that can appear in statements, so that we can provide
26902 an alternate path to generate expression that do not leave a value
26905 (Expression::Emit, and all the derivatives): We no longer return
26906 whether a value is left on the stack or not. Every expression
26907 after being emitted leaves a single value on the stack.
26909 * codegen.cs (EmitContext::EmitStatementExpression): Use the
26910 facilties of ExpressionStatement if possible.
26912 * cs-parser.jay: Update statement_expression.
26914 2001-09-25 Miguel de Icaza <miguel@ximian.com>
26916 * driver.cs: Change the wording of message
26918 2001-09-25 Ravi Pratap <ravi@ximian.com>
26920 * expression.cs (Binary::ResolveOperator): Had forgottten to set
26921 the type of the expression to the return type of the method if
26922 we have an overloaded operator match ! The regression tests pass again !
26923 (Unary::ResolveOperator): Ditto.
26925 * expression.cs (Invocation::ConversionExists): Correct the member lookup
26926 to find "op_Implicit", not "implicit" ;-)
26927 (UserImplicitCast): New class to take care of user-defined implicit conversions.
26928 (ConvertImplicit, ForceConversion): Take TypeContainer argument
26930 * everywhere : Correct calls to the above accordingly.
26932 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
26933 (ConvertImplicit): Do user-defined conversion if it exists.
26935 2001-09-24 Miguel de Icaza <miguel@ximian.com>
26937 * assign.cs: track location.
26938 (Resolve): Use implicit conversions on assignment.
26940 * literal.cs: Oops. Not good, Emit of short access values should
26941 pass (Bytes) or the wrong argument will be selected.
26943 * expression.cs (Unary::Emit): Emit code for -expr.
26945 (Unary::ResolveOperator): Handle `Substract' for non-constants
26946 (substract from zero from the non-constants).
26947 Deal with Doubles as well.
26949 (Expression::ConvertImplicitRequired): New routine that reports an
26950 error if no implicit conversion exists.
26952 (Invocation::OverloadResolve): Store the converted implicit
26953 expressions if we make them
26955 2001-09-24 Ravi Pratap <ravi@ximian.com>
26957 * class.cs (ConstructorInitializer): Take a Location argument.
26958 (ConstructorBaseInitializer): Same here.
26959 (ConstructorThisInitializer): Same here.
26961 * cs-parser.jay : Update all calls accordingly.
26963 * expression.cs (Unary, Binary, New): Take location argument.
26964 Update accordingly everywhere.
26966 * cs-parser.jay : Update all calls to the above to take a location
26969 * class.cs : Ditto.
26971 2001-09-24 Ravi Pratap <ravi@ximian.com>
26973 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
26974 (Invocation::BetterConversion): Same here
26975 (Invocation::ConversionExists): Ditto.
26977 (Invocation::ConversionExists): Implement.
26979 2001-09-22 Ravi Pratap <ravi@ximian.com>
26981 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
26982 Also take an additional TypeContainer argument.
26984 * All over : Pass in TypeContainer as argument to OverloadResolve.
26986 * typemanager.cs (CSharpName): Update to check for the string type and return
26989 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
26992 2001-09-21 Ravi Pratap <ravi@ximian.com>
26994 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
26995 (Invocation::BetterFunction): Implement.
26996 (Invocation::BetterConversion): Implement.
26997 (Invocation::ConversionExists): Skeleton, no implementation yet.
26999 Okay, things work fine !
27001 2001-09-21 Miguel de Icaza <miguel@ximian.com>
27003 * typemanager.cs: declare and load enum_type, delegate_type and
27006 * expression.cs (Expression::Emit): Now emit returns a value that
27007 tells whether a value is left on the stack or not. This strategy
27008 might be reveted tomorrow with a mechanism that would address
27009 multiple assignments.
27010 (Expression::report118): Utility routine to report mismatches on
27013 (Unary::Report23): Report impossible type/operator combination
27016 (Unary::IsIncrementableNumber): Whether the type can be
27017 incremented or decremented with add.
27018 (Unary::ResolveOperator): Also allow enumerations to be bitwise
27020 (Unary::ResolveOperator): Implement ++, !, ~,
27022 (Invocation::Emit): Deal with new Emit convetion.
27024 * All Expression derivatives: Updated their Emit method to return
27025 whether they leave values on the stack or not.
27027 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
27028 stack for expressions that are statements.
27030 2001-09-20 Miguel de Icaza <miguel@ximian.com>
27032 * expression.cs (LValue): New interface. Must be implemented by
27034 (LocalVariableReference, ParameterReference, FieldExpr): Implement
27037 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
27038 interface for generating code, simplifies the code.
27040 2001-09-20 Ravi Pratap <ravi@ximian.com>
27042 * expression.cs (everywhere): Comment out return statements in ::Resolve
27043 methods to avoid the warnings.
27045 2001-09-20 Miguel de Icaza <miguel@ximian.com>
27047 * driver.cs (parse): Report error 2001 if we can not open the
27050 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
27053 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
27056 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
27057 otherwise nested blocks end up with the same index.
27059 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
27061 * expression.cs: Instead of having FIXMEs in the Resolve
27062 functions, throw exceptions so it is obvious that we are facing a
27065 * cs-parser.jay (invocation_expression): Pass Location information.
27067 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
27068 Use a basename for those routines because .NET does not like paths
27071 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
27074 2001-09-19 Miguel de Icaza <miguel@ximian.com>
27076 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
27077 are loading the correct data types (throws an exception if not).
27078 (TypeManager::InitCoreTypes): Use CoreLookupType
27080 * expression.cs (Unary::ResolveOperator): return the child
27081 expression for expressions which are just +expr.
27082 (Unary::ResolveOperator): Return negative literals for -LITERAL
27083 expressions (otherwise they are Unary {Literal}).
27084 (Invocation::Badness): Take into account `Implicit constant
27085 expression conversions'.
27087 * literal.cs (LongLiteral): Implement long literal class.
27088 (IntLiteral): export the `Value' of the intliteral.
27090 2001-09-19 Ravi Pratap <ravi@ximian.com>
27092 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
27094 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
27095 instead of 'Operator'
27097 * expression.cs (Binary::ResolveOperator): Update accordingly.
27098 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
27101 * cs-parser.jay (unary_expression): Update to use the new names.
27103 * gen-treedump.cs (GetUnary): Same here.
27105 * expression.cs (Unary::Resolve): Implement.
27106 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
27107 operators are found instead of making noise ;-)
27108 (Unary::ResolveOperator): New method to do precisely the same thing which
27109 Binary::ResolveOperator does for Binary expressions.
27110 (Unary.method, .Arguments): Add.
27111 (Unary::OperName): Implement.
27112 (Unary::ForceConversion): Copy and Paste !
27114 * class.cs (Operator::Define): Fix a small bug for the case when we have
27117 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
27118 for the inbuilt operators. Only overloading works for now ;-)
27120 2001-09-18 Miguel de Icaza <miguel@ximian.com>
27122 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
27123 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
27125 * expression.cs (This::Emit): Implement.
27126 (This::Resolve): Implement.
27127 (TypeOf:Resolve): Implement.
27128 (Expression::ResolveSimpleName): Add an implicit this to instance
27130 (MemberAccess::Resolve): Deal with Parameters and Fields.
27131 Bind instance variable to Field expressions.
27132 (FieldExpr::Instance): New field used to track the expression that
27133 represents the object instance.
27134 (FieldExpr::Resolve): Track potential errors from MemberLookup not
27136 (FieldExpr::Emit): Implement.
27138 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
27139 the last instruction contains a return opcode to avoid generating
27140 the last `ret' instruction (this generates correct code, and it is
27141 nice to pass the peverify output).
27143 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
27144 initializer for static and instance variables.
27145 (Constructor::Emit): Allow initializer to be null in the case of
27146 static constructors. Only emit initializer for instance
27149 (TypeContainer::FindMembers): Return a null array if there are no
27152 Also fix the code for the MemberTypes.Method branch, as it was not
27153 scanning that for operators (or tried to access null variables before).
27155 * assign.cs (Assign::Emit): Handle instance and static fields.
27159 * driver.cs: Stop compilation if there are parse errors.
27161 * cs-parser.jay (constructor_declaration): Provide default base
27162 initializer for non-static constructors.
27163 (constructor_declarator): Do not provide a default base
27164 initializers if none was specified.
27165 Catch the fact that constructors should not have parameters.
27167 * class.cs: Do not emit parent class initializers for static
27168 constructors, that should be flagged as an error.
27170 2001-09-18 Ravi Pratap <ravi@ximian.com>
27172 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
27173 Move back code into TypeContainer::Populate.
27175 2001-09-18 Ravi Pratap <ravi@ximian.com>
27177 * class.cs (TypeContainer::AddConstructor): Fix the check to
27178 compare against Name, not Basename.
27179 (Operator::OpType): Change Plus and Minus to Add and Subtract.
27181 * cs-parser.jay : Update accordingly.
27183 * class.cs (TypeContainer::FindMembers): For the case where we are searching
27184 for methods, don't forget to look into the operators too.
27185 (RegisterMethodBuilder): Helper method to take care of this for
27186 methods, constructors and operators.
27187 (Operator::Define): Completely revamp.
27188 (Operator.OperatorMethod, MethodName): New fields.
27189 (TypeContainer::Populate): Move the registering of builders into
27190 RegisterMethodBuilder.
27191 (Operator::Emit): Re-write.
27193 * expression.cs (Binary::Emit): Comment out code path to emit method
27194 invocation stuff for the case when we have a user defined operator. I am
27195 just not able to get it right !
27197 2001-09-17 Miguel de Icaza <miguel@ximian.com>
27199 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
27202 (Expression::MemberLookup): Provide a version that allows to
27203 specify the MemberTypes and BindingFlags.
27205 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
27206 so it was not fetching variable information from outer blocks.
27208 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
27209 Beforefieldinit as it was buggy.
27211 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
27212 that Ravi put here.
27214 * class.cs (Constructor::Emit): Only emit if block is not null.
27215 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
27216 deal with this by semantically definining it as if the user had
27219 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
27220 constructors as we now "emit" them at a higher level.
27222 (TypeContainer::DefineDefaultConstructor): Used to define the
27223 default constructors if none was provided.
27225 (ConstructorInitializer): Add methods Resolve and Emit.
27227 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
27229 2001-09-17 Ravi Pratap <ravi@ximian.com>
27231 * class.cs (TypeContainer::EmitDefaultConstructor): Register
27232 the default constructor builder with our hashtable for methodbuilders
27235 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
27236 and argument_count is 0 in which case we have a match.
27237 (Binary::ResolveOperator): More null checking and miscellaneous coding
27240 2001-09-17 Ravi Pratap <ravi@ximian.com>
27242 * rootcontext.cs (IsNameSpace): Compare against null.
27244 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
27246 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
27247 and Unary::Operator.
27249 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
27252 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
27253 we have overloaded operators.
27254 (Binary::ResolveOperator): Implement the part which does the operator overload
27257 * class.cs (Operator::Emit): Implement.
27258 (TypeContainer::Emit): Emit the operators we have too.
27260 * expression.cs (Binary::Emit): Update to emit the appropriate code for
27261 the case when we have a user-defined operator.
27263 2001-09-17 Miguel de Icaza <miguel@ximian.com>
27265 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
27267 2001-09-16 Ravi Pratap <ravi@ximian.com>
27269 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
27270 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
27271 (Constructor::Emit): Implement.
27272 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
27273 if we have no work to do.
27274 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
27277 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
27278 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
27280 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
27283 2001-09-15 Ravi Pratap <ravi@ximian.com>
27285 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
27287 (Tree::RecordNamespace): Method to do what the name says ;-)
27288 (Tree::Namespaces): Property to get at the namespaces hashtable.
27290 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
27293 * rootcontext.cs (IsNamespace): Fixed it :-)
27295 2001-09-14 Miguel de Icaza <miguel@ximian.com>
27297 * class.cs (TypeContainer::FindMembers): Add support for
27299 (MethodCore): New class that encapsulates both the shared aspects
27300 of a Constructor and a Method.
27301 (Method, Constructor): Factored pieces into MethodCore.
27303 * driver.cs: Added --fatal which makes errors throw exceptions.
27304 Load System assembly as well as part of the standard library.
27306 * report.cs: Allow throwing exceptions on errors for debugging.
27308 * modifiers.cs: Do not use `parent', instead use the real type
27309 container to evaluate permission settings.
27311 * class.cs: Put Ravi's patch back in. He is right, and we will
27312 have to cope with the
27314 2001-09-14 Ravi Pratap <ravi@ximian.com>
27316 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
27317 FamORAssem, not FamANDAssem.
27319 2001-09-14 Miguel de Icaza <miguel@ximian.com>
27321 * driver.cs: Added --parse option that only parses its input files
27324 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
27325 incorrect. IsTopLevel is not used to tell whether an object is
27326 root_types or not (that can be achieved by testing this ==
27327 root_types). But to see if this is a top-level *class* (not
27328 necessarly our "toplevel" container).
27330 2001-09-14 Ravi Pratap <ravi@ximian.com>
27332 * enum.cs (Enum::Define): Modify to call the Lookup method on the
27333 parent instead of a direct call to GetType.
27335 2001-09-14 Ravi Pratap <ravi@ximian.com>
27337 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
27338 Modifiers.TypeAttr. This should just be a call to that method.
27340 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
27341 object so that we can determine if we are top-level or not.
27343 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
27346 * enum.cs (Enum::Define): Ditto.
27348 * modifiers.cs (FieldAttr): Re-write.
27350 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
27351 (TypeContainer::HaveStaticConstructor): New property to provide access
27352 to precisely that info.
27354 * modifiers.cs (MethodAttr): Re-write.
27355 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
27357 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
27358 of top-level types as claimed.
27360 2001-09-13 Miguel de Icaza <miguel@ximian.com>
27362 * expression.cs (MemberLookup): Fruitless attempt to lookup
27363 constructors. Maybe I need to emit default constructors? That
27364 might be it (currently .NET emits this for me automatically).
27365 (Invocation::OverloadResolve): Cope with Arguments == null.
27366 (Invocation::EmitArguments): new function, shared by the new
27367 constructor and us.
27368 (Invocation::Emit): Handle static and instance methods. Emit
27369 proper call instruction for virtual or non-virtual invocations.
27370 (New::Emit): Implement.
27371 (New::Resolve): Implement.
27372 (MemberAccess:Resolve): Implement.
27373 (MethodGroupExpr::InstanceExpression): used conforming to the spec
27374 to track instances.
27375 (FieldExpr::Resolve): Set type.
27377 * support.cs: Handle empty arguments.
27379 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
27380 SimpleLookup): Auxiliary routines to help parse a qualifier
27383 Update qualifier_identifier rule.
27385 * codegen.cs: Removed debugging messages.
27387 * class.cs: Make this a global thing, this acts just as a "key" to
27388 objects that we might have around.
27390 (Populate): Only initialize method_builders_to_methods once.
27392 * expression.cs (PropertyExpr): Initialize type from the
27395 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
27396 Resolve pattern. Attempt to implicitly convert value to boolean.
27399 * expression.cs: Set the type for the int32/int32 argument case.
27400 (Binary::ResolveOperator): Set the return type to boolean for
27401 comparission operators
27403 * typemanager.cs: Remove debugging print code.
27405 (Invocation::Resolve): resolve type.
27407 * class.cs: Allocate a MemberInfo of the correct size, as the code
27408 elsewhere depends on the test to reflect the correct contents.
27410 (Method::) Keep track of parameters, due to System.Reflection holes
27412 (TypeContainer::Populate): Keep track of MethodBuilders to Method
27415 (TypeContainer::FindMembers): Use ArrayList and then copy an array
27416 of the exact size and return that.
27418 (Class::LookupMethodByBuilder): New function that maps
27419 MethodBuilders to its methods. Required to locate the information
27420 on methods because System.Reflection bit us again.
27422 * support.cs: New file, contains an interface ParameterData and
27423 two implementations: ReflectionParameters and InternalParameters
27424 used to access Parameter information. We will need to grow this
27427 * expression.cs (Invocation::GetParameterData): implement a cache
27428 and a wrapper around the ParameterData creation for methods.
27429 (Invocation::OverloadResolve): Use new code.
27431 2001-09-13 Ravi Pratap <ravi@ximian.com>
27433 * class.cs (TypeContainer::EmitField): Remove and move into
27434 (Field::Define): here and modify accordingly.
27435 (Field.FieldBuilder): New member.
27436 (TypeContainer::Populate): Update accordingly.
27437 (TypeContainer::FindMembers): Implement.
27439 2001-09-13 Miguel de Icaza <miguel@ximian.com>
27441 * statement.cs: (VariableInfo::VariableType): New field to be
27442 initialized with the full type once it is resolved.
27444 2001-09-12 Miguel de Icaza <miguel@ximian.com>
27446 * parameter.cs (GetParameterInfo): Use a type cache to compute
27447 things only once, and to reuse this information
27449 * expression.cs (LocalVariableReference::Emit): Implement.
27450 (OpcodeCast::Emit): fix.
27452 (ParameterReference::Resolve): Implement.
27453 (ParameterReference::Emit): Implement.
27455 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
27456 that are expressions need to stay as Expressions.
27458 * typemanager.cs (CSharpName): Returns the C# name of a type if
27461 * expression.cs (Expression::ConvertImplicit): New function that
27462 implements implicit type conversions.
27464 (Expression::ImplicitReferenceConversion): Implements implicit
27465 reference conversions.
27467 (EmptyCast): New type for transparent casts.
27469 (OpcodeCast): New type for casts of types that are performed with
27470 a sequence of bytecodes.
27472 (BoxedCast): New type used for casting value types into reference
27473 types. Emits a box opcode.
27475 (Binary::DoNumericPromotions): Implements numeric promotions of
27476 and computation of the Binary::Type.
27478 (Binary::EmitBranchable): Optimization.
27480 (Binary::Emit): Implement code emission for expressions.
27482 * typemanager.cs (TypeManager): Added two new core types: sbyte
27485 2001-09-12 Ravi Pratap <ravi@ximian.com>
27487 * class.cs (TypeContainer::FindMembers): Method which does exactly
27488 what Type.FindMembers does, only we don't have to use reflection. No
27489 implementation yet.
27491 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
27492 typecontainer objects as we need to get at them.
27493 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
27495 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
27496 typecontainer object.
27498 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
27499 of just a Report object.
27501 2001-09-11 Ravi Pratap <ravi@ximian.com>
27503 * class.cs (Event::Define): Go back to using the prefixes "add_" and
27505 (TypeContainer::Populate): Now define the delegates of the type too.
27506 (TypeContainer.Delegates): Property to access the list of delegates defined
27509 * delegates.cs (Delegate::Define): Implement partially.
27511 * modifiers.cs (TypeAttr): Handle more flags.
27513 2001-09-11 Ravi Pratap <ravi@ximian.com>
27515 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
27517 (Operator::Define): Re-write logic to get types by using the LookupType method
27518 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
27519 (Indexer::Define): Ditto.
27520 (Event::Define): Ditto.
27521 (Property::Define): Ditto.
27523 2001-09-10 Ravi Pratap <ravi@ximian.com>
27525 * class.cs (TypeContainer::Populate): Now define operators too.
27526 (TypeContainer.Operators): New property to access the list of operators
27528 (Operator.OperatorMethodBuilder): New member to hold the method builder
27529 for the operator we are defining.
27530 (Operator::Define): Implement.
27532 2001-09-10 Ravi Pratap <ravi@ximian.com>
27534 * class.cs (Event::Define): Make the prefixes of the accessor methods
27535 addOn_ and removeOn_
27537 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
27538 of the location being passed in too. Ideally, this should go later since all
27539 error reporting should be done through the Report object.
27541 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
27542 (Populate): Iterate thru the indexers we have and define them too.
27543 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
27544 for the get and set accessors.
27545 (Indexer::Define): Implement.
27547 2001-09-09 Miguel de Icaza <miguel@ximian.com>
27549 * expression.cs (Binary::Resolve): Beginning of it. I scratched
27550 my previous implementation, did not work.
27552 * typemanager.cs: Add a couple of missing types (the longs).
27554 * literal.cs: Use TypeManager.bool_type instead of getting it.
27556 * expression.cs (EventExpr): New kind of expressions.
27557 (Expressio::ExprClassFromMemberInfo): finish
27559 2001-09-08 Miguel de Icaza <miguel@ximian.com>
27561 * assign.cs: Emit stores to static fields differently.
27563 2001-09-08 Ravi Pratap <ravi@ximian.com>
27565 * Merge in changes and adjust code to tackle conflicts. Backed out my
27566 code in Assign::Resolve ;-)
27568 2001-09-08 Ravi Pratap <ravi@ximian.com>
27570 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
27571 instead Report.Error and also pass in the location.
27572 (CSharpParser::Lexer): New readonly property to return the reference
27573 to the Tokenizer object.
27574 (declare_local_variables): Use Report.Error with location instead of plain
27578 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
27579 (Operator.CheckBinaryOperator): Ditto.
27581 * cs-parser.jay (operator_declarator): Update accordingly.
27583 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
27584 (CheckBinaryOperator): Same here.
27586 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
27587 on the name without any prefixes of namespace names etc. This is because we
27588 already might have something already fully qualified like
27589 'System.Console.WriteLine'
27591 * assign.cs (Resolve): Begin implementation. Stuck ;-)
27593 2001-09-07 Ravi Pratap <ravi@ximian.com>
27595 * cs-tokenizer.cs (location): Return a string which also contains
27598 * expression.cs (ElementAccess): New class for expressions of the
27599 type 'element access.'
27600 (BaseAccess): New class for expressions of the type 'base access.'
27601 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
27604 * cs-parser.jay (element_access): Implement action.
27605 (base_access): Implement actions.
27606 (checked_expression, unchecked_expression): Implement.
27608 * cs-parser.jay (local_variable_type): Correct and implement.
27609 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
27611 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
27613 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
27614 name and the specifiers.
27616 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
27618 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
27619 making them all public ;-)
27621 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
27624 2001-09-07 Miguel de Icaza <miguel@ximian.com>
27626 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
27628 (FieldExpr, PropertyExprs): New resolved expressions.
27629 (SimpleName::MemberStaticCheck): Perform static checks for access
27630 to non-static fields on static methods. Maybe this should be
27631 generalized for MemberAccesses.
27632 (SimpleName::ResolveSimpleName): More work on simple name
27635 * cs-parser.jay (primary_expression/qualified_identifier): track
27636 the parameter index.
27638 * codegen.cs (CodeGen::Save): Catch save exception, report error.
27639 (EmitContext::EmitBoolExpression): Chain to expression generation
27640 instead of temporary hack.
27641 (::EmitStatementExpression): Put generic expression code generation.
27643 * assign.cs (Assign::Emit): Implement variable assignments to
27644 local variables, parameters and fields.
27646 2001-09-06 Miguel de Icaza <miguel@ximian.com>
27648 * statement.cs (Block::GetVariableInfo): New method, returns the
27649 VariableInfo for a variable name in a block.
27650 (Block::GetVariableType): Implement in terms of GetVariableInfo
27652 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
27653 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
27655 2001-09-06 Ravi Pratap <ravi@ximian.com>
27657 * cs-parser.jay (operator_declaration): Continue on my quest : update
27658 to take attributes argument.
27659 (event_declaration): Ditto.
27660 (enum_declaration): Ditto.
27661 (indexer_declaration): Ditto.
27663 * class.cs (Operator::Operator): Update constructor accordingly.
27664 (Event::Event): Ditto.
27666 * delegate.cs (Delegate::Delegate): Same here.
27668 * enum.cs (Enum::Enum): Same here.
27670 2001-09-05 Ravi Pratap <ravi@ximian.com>
27672 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
27674 * ../tests/cs0658.cs : New file to demonstrate error 0658.
27676 * attribute.cs (Attributes): New class to encapsulate all attributes which were
27677 being passed around as an arraylist.
27678 (Attributes::AddAttribute): Method to add attribute sections.
27680 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
27681 (struct_declaration): Update accordingly.
27682 (constant_declaration): Update.
27683 (field_declaration): Update.
27684 (method_header): Update.
27685 (fixed_parameter): Update.
27686 (parameter_array): Ditto.
27687 (property_declaration): Ditto.
27688 (destructor_declaration): Ditto.
27690 * class.cs (Struct::Struct): Update constructors accordingly.
27691 (Class::Class): Ditto.
27692 (Field::Field): Ditto.
27693 (Method::Method): Ditto.
27694 (Property::Property): Ditto.
27695 (TypeContainer::OptAttribute): update property's return type.
27697 * interface.cs (Interface.opt_attributes): New member.
27698 (Interface::Interface): Update to take the extra Attributes argument.
27700 * parameter.cs (Parameter::Parameter): Ditto.
27702 * constant.cs (Constant::Constant): Ditto.
27704 * interface.cs (InterfaceMemberBase): New OptAttributes field.
27705 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
27706 the attributes as a parameter.
27707 (InterfaceProperty): Update constructor call.
27708 (InterfaceEvent): Ditto.
27709 (InterfaceMethod): Ditto.
27710 (InterfaceIndexer): Ditto.
27712 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
27713 pass the attributes too.
27714 (interface_event_declaration): Ditto.
27715 (interface_property_declaration): Ditto.
27716 (interface_method_declaration): Ditto.
27717 (interface_declaration): Ditto.
27719 2001-09-05 Miguel de Icaza <miguel@ximian.com>
27721 * class.cs (Method::Define): Track the "static Main" definition to
27722 create an entry point.
27724 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
27725 EntryPoint if we find it.
27727 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
27728 (EmitContext::ig): Make this variable public.
27730 * driver.cs: Make the default output file be the first file name
27731 with the .exe extension.
27733 Detect empty compilations
27735 Handle various kinds of output targets. Handle --target and
27736 rename -t to --dumper.
27738 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
27739 methods inherited from Expression return now an Expression. This
27740 will is used during the tree rewriting as we resolve them during
27743 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
27744 the spec. Missing entirely is the information about
27745 accessability of elements of it.
27747 (Expression::ExprClassFromMemberInfo): New constructor for
27748 Expressions that creates a fully initialized Expression based on
27749 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
27752 (Invocation::Resolve): Begin implementing resolution of invocations.
27754 * literal.cs (StringLiteral): Implement Emit.
27756 2001-09-05 Ravi Pratap <ravi@ximian.com>
27758 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
27761 2001-09-04 Ravi Pratap <ravi@ximian.com>
27763 * cs-parser.jay (attribute_arguments): Implement actions.
27764 (attribute): Fix bug in production. Implement action.
27765 (attribute_list): Implement.
27766 (attribute_target): Implement.
27767 (attribute_target_specifier, opt_target_specifier): Implement
27768 (CheckAttributeTarget): New method to check if the attribute target
27770 (attribute_section): Implement.
27771 (opt_attributes): Implement.
27773 * attribute.cs : New file to handle attributes.
27774 (Attribute): Class to hold attribute info.
27776 * cs-parser.jay (opt_attribute_target_specifier): Remove production
27777 (attribute_section): Modify production to use 2 different rules to
27778 achieve the same thing. 1 s/r conflict down !
27779 Clean out commented, useless, non-reducing dimension_separator rules.
27781 * class.cs (TypeContainer.attributes): New member to hold list
27782 of attributes for a type.
27783 (Struct::Struct): Modify to take one more argument, the attribute list.
27784 (Class::Class): Ditto.
27785 (Field::Field): Ditto.
27786 (Method::Method): Ditto.
27787 (Property::Property): Ditto.
27789 * cs-parser.jay (struct_declaration): Update constructor call to
27790 pass in the attributes too.
27791 (class_declaration): Ditto.
27792 (constant_declaration): Ditto.
27793 (field_declaration): Ditto.
27794 (method_header): Ditto.
27795 (fixed_parameter): Ditto.
27796 (parameter_array): Ditto.
27797 (property_declaration): Ditto.
27799 * constant.cs (Constant::Constant): Update constructor similarly.
27800 Use System.Collections.
27802 * parameter.cs (Parameter::Parameter): Update as above.
27804 2001-09-02 Ravi Pratap <ravi@ximian.com>
27806 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
27807 (TypeContainer.delegates): New member to hold list of delegates.
27809 * cs-parser.jay (delegate_declaration): Implement the action correctly
27810 this time as I seem to be on crack ;-)
27812 2001-09-02 Miguel de Icaza <miguel@ximian.com>
27814 * rootcontext.cs (RootContext::IsNamespace): new function, used to
27815 tell whether an identifier represents a namespace.
27817 * expression.cs (NamespaceExpr): A namespace expression, used only
27818 temporarly during expression resolution.
27819 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
27820 utility functions to resolve names on expressions.
27822 2001-09-01 Miguel de Icaza <miguel@ximian.com>
27824 * codegen.cs: Add hook for StatementExpressions.
27826 * class.cs: Fix inverted test for static flag in methods.
27828 2001-09-02 Ravi Pratap <ravi@ximian.com>
27830 * class.cs (Operator::CheckUnaryOperator): Correct error number used
27831 to make it coincide with MS' number.
27832 (Operator::CheckBinaryOperator): Ditto.
27834 * ../errors/errors.txt : Remove error numbers added earlier.
27836 * ../errors/cs1019.cs : Test case for error # 1019
27838 * ../errros/cs1020.cs : Test case for error # 1020
27840 * cs-parser.jay : Clean out commented cruft.
27841 (dimension_separators, dimension_separator): Comment out. Ostensibly not
27842 used anywhere - non-reducing rule.
27843 (namespace_declarations): Non-reducing rule - comment out.
27845 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
27846 with TypeContainer::AddEnum.
27848 * delegate.cs : New file for delegate handling classes.
27849 (Delegate): Class for declaring delegates.
27851 * makefile : Update.
27853 * cs-parser.jay (delegate_declaration): Implement.
27855 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
27857 * class.cs (Event::Define): Implement.
27858 (Event.EventBuilder): New member.
27860 * class.cs (TypeContainer::Populate): Update to define all enums and events
27862 (Events): New property for the events arraylist we hold. Shouldn't we move to using
27863 readonly fields for all these cases ?
27865 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
27867 * class.cs (Property): Revamp to use the convention of making fields readonly.
27868 Accordingly modify code elsewhere.
27870 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
27871 the Define method of the Property class.
27873 * class.cs : Clean up applied patch and update references to variables etc. Fix
27875 (TypeContainer::Populate): Update to define all the properties we have. Also
27876 define all enumerations.
27878 * enum.cs (Define): Implement.
27880 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
27882 * cs-parser.jay (overloadable_operator): The semantic value is an
27883 enum of the Operator class.
27884 (operator_declarator): Implement actions.
27885 (operator_declaration): Implement.
27887 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
27888 validity of definitions.
27889 (Operator::CheckBinaryOperator): Static method to check for binary operators
27890 (TypeContainer::AddOperator): New method to add an operator to a type.
27892 * cs-parser.jay (indexer_declaration): Added line to actually call the
27893 AddIndexer method so it gets added ;-)
27895 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
27896 already taken care of by the MS compiler ?
27898 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
27900 * class.cs (Operator): New class for operator declarations.
27901 (Operator::OpType): Enum for the various operators.
27903 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
27905 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
27906 ostensibly handle this in semantic analysis.
27908 * cs-parser.jay (general_catch_clause): Comment out
27909 (specific_catch_clauses, specific_catch_clause): Ditto.
27910 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
27911 (catch_args, opt_catch_args): New productions.
27912 (catch_clause): Rewrite to use the new productions above
27913 (catch_clauses): Modify accordingly.
27914 (opt_catch_clauses): New production to use in try_statement
27915 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
27916 and re-write the code in the actions to extract the specific and
27917 general catch clauses by being a little smart ;-)
27919 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
27920 Hooray, try and catch statements parse fine !
27922 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
27924 * statement.cs (Block::GetVariableType): Fix logic to extract the type
27925 string from the hashtable of variables.
27927 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
27928 I end up making that mistake ;-)
27929 (catch_clauses): Fixed gross error which made Key and Value of the
27930 DictionaryEntry the same : $1 !!
27932 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
27934 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
27936 * cs-parser.jay (event_declaration): Correct to remove the semicolon
27937 when the add and remove accessors are specified.
27939 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
27941 * cs-parser.jay (IndexerDeclaration): New helper class to hold
27942 information about indexer_declarator.
27943 (indexer_declarator): Implement actions.
27944 (parsing_indexer): New local boolean used to keep track of whether
27945 we are parsing indexers or properties. This is necessary because
27946 implicit_parameters come into picture even for the get accessor in the
27947 case of an indexer.
27948 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
27950 * class.cs (Indexer): New class for indexer declarations.
27951 (TypeContainer::AddIndexer): New method to add an indexer to a type.
27952 (TypeContainer::indexers): New member to hold list of indexers for the
27955 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
27957 * cs-parser.jay (add_accessor_declaration): Implement action.
27958 (remove_accessor_declaration): Implement action.
27959 (event_accessors_declaration): Implement
27960 (variable_declarators): swap statements for first rule - trivial.
27962 * class.cs (Event): New class to hold information about event
27964 (TypeContainer::AddEvent): New method to add an event to a type
27965 (TypeContainer::events): New member to hold list of events.
27967 * cs-parser.jay (event_declaration): Implement actions.
27969 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
27971 * cs-parser.jay (dim_separators): Implement. Make it a string
27972 concatenating all the commas together, just as they appear.
27973 (opt_dim_separators): Modify accordingly
27974 (rank_specifiers): Update accordingly. Basically do the same
27975 thing - instead, collect the brackets here.
27976 (opt_rank_sepcifiers): Modify accordingly.
27977 (array_type): Modify to actually return the complete type string
27978 instead of ignoring the rank_specifiers.
27979 (expression_list): Implement to collect the expressions
27980 (variable_initializer): Implement. We make it a list of expressions
27981 essentially so that we can handle the array_initializer case neatly too.
27982 (variable_initializer_list): Implement.
27983 (array_initializer): Make it a list of variable_initializers
27984 (opt_array_initializer): Modify accordingly.
27986 * expression.cs (New::NType): Add enumeration to help us
27987 keep track of whether we have an object/delegate creation
27988 or an array creation.
27989 (New:NewType, New::Rank, New::Indices, New::Initializers): New
27990 members to hold data about array creation.
27991 (New:New): Modify to update NewType
27992 (New:New): New Overloaded contructor for the array creation
27995 * cs-parser.jay (array_creation_expression): Implement to call
27996 the overloaded New constructor.
27998 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
28000 * class.cs (TypeContainer::Constructors): Return member
28001 constructors instead of returning null.
28003 2001-08-26 Miguel de Icaza <miguel@ximian.com>
28005 * typemanager.cs (InitCoreTypes): Initialize the various core
28006 types after we have populated the type manager with the user
28007 defined types (this distinction will be important later while
28008 compiling corlib.dll)
28010 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
28011 on Expression Classification. Now all expressions have a method
28012 `Resolve' and a method `Emit'.
28014 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
28015 generation from working. Also add some temporary debugging
28018 2001-08-24 Miguel de Icaza <miguel@ximian.com>
28020 * codegen.cs: Lots of code generation pieces. This is only the
28021 beginning, will continue tomorrow with more touches of polish. We
28022 handle the fundamentals of if, while, do, for, return. Others are
28023 trickier and I need to start working on invocations soon.
28025 * gen-treedump.cs: Bug fix, use s.Increment here instead of
28028 * codegen.cs (EmitContext): New struct, used during code
28029 emission to keep a context. Most of the code generation will be
28032 * cs-parser.jay: Add embedded blocks to the list of statements of
28033 this block. So code generation proceeds in a top down fashion.
28035 2001-08-23 Miguel de Icaza <miguel@ximian.com>
28037 * statement.cs: Add support for multiple child blocks.
28039 2001-08-22 Miguel de Icaza <miguel@ximian.com>
28041 * codegen.cs (EmitCode): New function, will emit the code for a
28042 Block of code given a TypeContainer and its ILGenerator.
28044 * statement.cs (Block): Standard public readonly optimization.
28045 (Block::Block constructors): Link children.
28046 (Block::Child): Child Linker.
28047 (Block::EmitVariables): Emits IL variable declarations.
28049 * class.cs: Drop support for MethodGroups here, delay until
28051 (Method::): Applied the same simplification that I did before, and
28052 move from Properties to public readonly fields.
28053 (Method::ParameterTypes): Returns the parameter types for the
28054 function, and implements a cache that will be useful later when I
28055 do error checking and the semantic analysis on the methods is
28057 (Constructor::GetCallingConvention): Renamed from CallingConvetion
28058 and made a method, optional argument tells whether this is a class
28059 or a structure to apply the `has-this' bit.
28060 (Method::GetCallingConvention): Implement, returns the calling
28062 (Method::Define): Defines the type, a second pass is performed
28063 later to populate the methods.
28065 (Constructor::ParameterTypes): implement a cache similar to the
28066 one on Method::ParameterTypes, useful later when we do semantic
28069 (TypeContainer::EmitMethod): New method. Emits methods.
28071 * expression.cs: Removed MethodGroup class from here.
28073 * parameter.cs (Parameters::GetCallingConvention): new method.
28075 2001-08-21 Miguel de Icaza <miguel@ximian.com>
28077 * class.cs (TypeContainer::Populate): Drop RootContext from the
28080 (Constructor::CallingConvention): Returns the calling convention.
28081 (Constructor::ParameterTypes): Returns the constructor parameter
28084 (TypeContainer::AddConstructor): Keep track of default constructor
28085 and the default static constructor.
28087 (Constructor::) Another class that starts using `public readonly'
28088 instead of properties.
28090 (Constructor::IsDefault): Whether this is a default constructor.
28092 (Field::) use readonly public fields instead of properties also.
28094 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
28095 track of static constructors; If none is used, turn on
28096 BeforeFieldInit in the TypeAttributes.
28098 * cs-parser.jay (opt_argument_list): now the return can be null
28099 for the cases where there are no arguments.
28101 (constructor_declarator): If there is no implicit `base' or
28102 `this', then invoke the default parent constructor.
28104 * modifiers.cs (MethodAttr): New static function maps a set of
28105 modifiers flags into a MethodAttributes enum
28106 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
28107 MethodAttr, TypeAttr to represent the various mappings where the
28108 modifiers are used.
28109 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
28111 2001-08-19 Miguel de Icaza <miguel@ximian.com>
28113 * parameter.cs (GetParameterInfo): Fix bug where there would be no
28116 * interface.cs (PopulateIndexer): Implemented the code generator
28117 for interface indexers.
28119 2001-08-17 Miguel de Icaza <miguel@ximian.com>
28121 * interface.cs (InterfaceMemberBase): Now we track the new status
28124 (PopulateProperty): Implement property population. Woohoo! Got
28125 Methods and Properties going today.
28127 Removed all the properties for interfaces, and replaced them with
28128 `public readonly' fields.
28130 2001-08-16 Miguel de Icaza <miguel@ximian.com>
28132 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
28133 initialize their hashtables/arraylists only when they are needed
28134 instead of doing this always.
28136 * parameter.cs: Handle refs and out parameters.
28138 * cs-parser.jay: Use an ArrayList to construct the arguments
28139 instead of the ParameterCollection, and then cast that to a
28142 * parameter.cs: Drop the use of ParameterCollection and use
28143 instead arrays of Parameters.
28145 (GetParameterInfo): Use the Type, not the Name when resolving
28148 2001-08-13 Miguel de Icaza <miguel@ximian.com>
28150 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
28151 and instead use public readonly fields.
28153 * class.cs: Put back walking code for type containers.
28155 2001-08-11 Miguel de Icaza <miguel@ximian.com>
28157 * class.cs (MakeConstant): Code to define constants.
28159 * rootcontext.cs (LookupType): New function. Used to locate types
28162 2001-08-08 Miguel de Icaza <miguel@ximian.com>
28164 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
28165 this System.Reflection code is. Kudos to Microsoft
28167 * typemanager.cs: Implement a type cache and avoid loading all
28168 types at boot time. Wrap in LookupType the internals. This made
28169 the compiler so much faster. Wow. I rule!
28171 * driver.cs: Make sure we always load mscorlib first (for
28172 debugging purposes, nothing really important).
28174 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
28175 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
28177 * rootcontext.cs: Lookup types on their namespace; Lookup types
28178 on namespaces that have been imported using the `using' keyword.
28180 * class.cs (TypeContainer::TypeAttr): Virtualize.
28181 (Class::TypeAttr): Return attributes suitable for this bad boy.
28182 (Struct::TypeAttr): ditto.
28183 Handle nested classes.
28184 (TypeContainer::) Remove all the type visiting code, it is now
28185 replaced with the rootcontext.cs code
28187 * rootcontext.cs (GetClassBases): Added support for structs.
28189 2001-08-06 Miguel de Icaza <miguel@ximian.com>
28191 * interface.cs, statement.cs, class.cs, parameter.cs,
28192 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
28193 Drop use of TypeRefs, and use strings instead.
28195 2001-08-04 Miguel de Icaza <miguel@ximian.com>
28199 * class.cs (Struct::Struct): set the SEALED flags after
28200 checking the modifiers.
28201 (TypeContainer::TypeAttr): new property, returns the
28202 TypeAttributes for a class.
28204 * cs-parser.jay (type_list): Oops, list production was creating a
28205 new list of base types.
28207 * rootcontext.cs (StdLib): New property.
28208 (GetInterfaceTypeByName): returns an interface by type name, and
28209 encapsulates error handling here.
28210 (GetInterfaces): simplified.
28211 (ResolveTree): Encapsulated all the tree resolution here.
28212 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
28215 * driver.cs: Add support for --nostdlib, to avoid loading the
28216 default assemblies.
28217 (Main): Do not put tree resolution here.
28219 * rootcontext.cs: Beginning of the class resolution.
28221 2001-08-03 Miguel de Icaza <miguel@ximian.com>
28223 * rootcontext.cs: Provide better error reporting.
28225 * cs-parser.jay (interface_base): set our $$ to be interfaces.
28227 * rootcontext.cs (CreateInterface): Handle the case where there
28228 are no parent interfaces.
28230 (CloseTypes): Routine to flush types at the end.
28231 (CreateInterface): Track types.
28232 (GetInterfaces): Returns an array of Types from the list of
28233 defined interfaces.
28235 * typemanager.c (AddUserType): Mechanism to track user types (puts
28236 the type on the global type hash, and allows us to close it at the
28239 2001-08-02 Miguel de Icaza <miguel@ximian.com>
28241 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
28242 RecordInterface instead.
28244 * cs-parser.jay: Updated to reflect changes above.
28246 * decl.cs (Definition): Keep track of the TypeBuilder type that
28247 represents this type here. Not sure we will use it in the long
28248 run, but wont hurt for now.
28250 * driver.cs: Smaller changes to accomodate the new code.
28252 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
28255 * rootcontext.cs (CreateInterface): New method, used to create
28256 the System.TypeBuilder type for interfaces.
28257 (ResolveInterfaces): new entry point to resolve the interface
28259 (CodeGen): Property, used to keep track of the code generator.
28261 2001-07-26 Miguel de Icaza <miguel@ximian.com>
28263 * cs-parser.jay: Add a second production for delegate_declaration
28266 (enum_body): Put an opt_comma here instead of putting it on
28267 enum_body or enum_member_declarations so we can handle trailing
28268 commas on enumeration members. Gets rid of a shift/reduce.
28270 (type_list): Need a COMMA in the middle.
28272 (indexer_declaration): Tell tokenizer to recognize get/set
28274 * Remove old targets.
28276 * Re-add the parser target.
28278 2001-07-13 Simon Cozens <simon@simon-cozens.org>
28280 * cs-parser.jay: Add precendence rules for a number of operators
28281 ot reduce the number of shift/reduce conflicts in the grammar.
28283 2001-07-17 Miguel de Icaza <miguel@ximian.com>
28285 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
28288 Get rid of old crufty code.
28290 * rootcontext.cs: Use this to keep track of the parsed
28291 representation and the defined types available to the program.
28293 * gen-treedump.cs: adjust for new convention.
28295 * type.cs: Split out the type manager, and the assembly builder
28298 * typemanager.cs: the type manager will live here now.
28300 * cil-codegen.cs: And the code generator here.
28302 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
28304 * makefile: Fixed up for easy making.
28306 2001-07-13 Simon Cozens <simon@simon-cozens.org>
28308 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
28311 (unary_expression): Expand pre_increment_expression and
28312 post_decrement_expression to reduce a shift/reduce.
28314 2001-07-11 Simon Cozens
28316 * cs-tokenizer.cs: Hex numbers should begin with a 0.
28318 Improve allow_keyword_as_indent name.
28320 2001-06-19 Miguel de Icaza <miguel@ximian.com>
28322 * Adjustments for Beta2.
28324 2001-06-13 Miguel de Icaza <miguel@ximian.com>
28326 * decl.cs: Added `Define' abstract method.
28327 (InTransit): new property, used to catch recursive definitions.
28329 * interface.cs: Implement `Define'.
28331 * modifiers.cs: Map Modifiers.constants to
28332 System.Reflection.TypeAttribute flags.
28334 * class.cs: Keep track of types and user-defined types.
28335 (BuilderInit): New method for creating an assembly
28336 (ResolveType): New function to launch the resolution process, only
28337 used by interfaces for now.
28339 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
28340 that are inserted into the name space.
28342 2001-06-08 Miguel de Icaza <miguel@ximian.com>
28344 * ARGH. I have screwed up my tree so many times due to the use of
28345 rsync rather than using CVS. Going to fix this at once.
28347 * driver.cs: Objetify driver. Load assemblies, use assemblies to
28350 2001-06-07 Miguel de Icaza <miguel@ximian.com>
28352 * Experiment successful: Use System.Type rather that our own
28355 2001-05-25 Miguel de Icaza <miguel@ximian.com>
28357 * cs-parser.jay: Removed nsAliases from here.
28359 Use new namespaces, handle `using XXX;'
28361 * namespace.cs: Reimplemented namespace handling, use a recursive
28362 definition of the class. Now we can keep track of using clauses
28363 and catch invalid using clauses.
28365 2001-05-24 Miguel de Icaza <miguel@ximian.com>
28367 * gen-treedump.cs: Adapted for all the renaming.
28369 * expression.cs (Expression): this class now has a Type property
28370 which returns an expression Type.
28372 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
28373 `Type', as this has a different meaning now in the base
28375 2001-05-22 Miguel de Icaza <miguel@ximian.com>
28377 * interface.cs, class.cs: Removed from all the sources the
28378 references to signature computation, as we can not do method
28379 signature computation during the parsing time, as we are not
28380 trying to solve at that point distinguishing:
28384 void a (NS.Blah x) {}
28387 Which depending on the context might be valid or not, as we do not
28388 know if Blah is the same thing as NS.Blah at that point.
28390 * Redid everything so the code uses TypeRefs now instead of
28391 Types. TypeRefs are just temporary type placeholders, that need
28392 to be resolved. They initially have a pointer to a string and the
28393 current scope in which they are used. This is used later by the
28394 compiler to resolve the reference to an actual Type.
28396 * DeclSpace is no longer a CIR.Type, and neither are
28397 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
28398 are all DeclSpaces, but no Types.
28400 * type.cs (TypeRefManager): This implements the TypeRef manager,
28401 which keeps track of all the types that need to be resolved after
28402 the parsing has finished.
28404 2001-05-13 Miguel de Icaza <miguel@ximian.com>
28406 * ARGH. We are going to have to store `foreach' as a class rather
28407 than resolving it, as we need to verify error 1579 after name
28408 resolution. *OR* we could keep a flag that says `This request to
28409 IEnumerator comes from a foreach statement' which we can then use
28410 to generate the error.
28412 2001-05-10 Miguel de Icaza <miguel@ximian.com>
28414 * class.cs (TypeContainer.AddMethod): we now add methods to the
28415 MethodGroup instead of the method hashtable.
28417 * expression.cs: Add MethodGroup abstraction, which gets us one
28418 step closer to the specification in the way we handle method
28421 * cs-parser.jay (primary_expression): qualified_identifier now
28422 tried to match up an identifier to a local variable reference or
28423 to a parameter reference.
28425 current_local_parameters is now a parser global variable that
28426 points to the current parameters for the block, used during name
28429 (property_declaration): Now creates an implicit `value' argument to
28432 2001-05-09 Miguel de Icaza <miguel@ximian.com>
28434 * parameter.cs: Do not use `param' arguments as part of the
28435 signature, per the spec.
28437 2001-05-08 Miguel de Icaza <miguel@ximian.com>
28439 * decl.cs: Base class for classes, structs and interfaces. This
28440 is the "Declaration Space"
28442 * cs-parser.jay: Use CheckDef for checking declaration errors
28443 instead of having one on each function.
28445 * class.cs: Factor out some code for handling error handling in
28446 accordance to the "Declarations" section in the "Basic Concepts"
28447 chapter in the ECMA C# spec.
28449 * interface.cs: Make all interface member classes derive from
28450 InterfaceMemberBase.
28452 2001-05-07 Miguel de Icaza <miguel@ximian.com>
28454 * Many things: all interfaces are parsed and generated in
28455 gen-treedump. Support for member variables, constructors,
28456 destructors, properties, constants is there.
28458 Beginning of the IL backend, but very little done, just there for
28461 2001-04-29 Miguel de Icaza <miguel@ximian.com>
28463 * cs-parser.jay: Fix labeled statement.
28465 * cs-tokenizer.cs (escape): Escape " and ' always.
28466 ref_line, ref_name: keep track of the line/filename as instructed
28467 by #line by the compiler.
28470 2001-04-27 Miguel de Icaza <miguel@ximian.com>
28472 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
28473 to match the values in System.CodeDOM.
28475 Divid renamed to Divide.
28477 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
28479 (Statements.set): remove.
28481 * System.CodeDOM/CodeCatchClause.cs: always have a valid
28484 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
28485 falseStatements always have valid values.
28487 * cs-parser.jay: Use System.CodeDOM now.