1 2008-06-11 Martin Baulig <martin@ximian.com>
4 (Location.LookupFile): Add `CompilationUnit' argument; when given
5 a relative file name, make it relative to the directory the .cs
6 file is located in instead of using the current directory.
8 2008-06-11 Martin Baulig <martin@ximian.com>
11 (IMethodData.EmitExtraSymbolInfo): Added `SourceMethod' argument.
12 (MethodOrOperator.EmitExtraSymbolInfo): Likewise.
13 (SourceMethod.SetRealMethodName): Moved here from the symbol writer.
14 (SourceMethod.SetCompilerGenerated): Likewise.
16 2008-06-11 Marek Safar <marek.safar@gmail.com>
18 * codegen.cs, driver: Only write symbol file when it's asked for.
20 2008-06-11 Marek Safar <marek.safar@gmail.com>
22 * codegen.cs: Don't use assembly writer error handling for symbol writer.
24 2008-06-10 Martin Baulig <martin@ximian.com>
26 * symbolwriter.cs: Reflect latest MarkSequencePoint() API changes.
28 2008-06-09 Marek Safar <marek.safar@gmail.com>
31 * expression.cs: Include decimal operators in predefined table.
33 * parameters.cs: More readonlyness.
35 2008-06-09 Marek Safar <marek.safar@gmail.com>
38 * cs-parser.jay: One more missing current_local_parameters reset.
40 2008-06-09 Marek Safar <marek.safar@gmail.com>
43 * class.cs: Host backing field in partial container.
45 2008-06-09 Marek Safar <marek.safar@gmail.com>
48 * expression.cs: Check both operand types when predefined operator is used.
50 2008-06-05 Martin Baulig <martin@ximian.com>
52 Merged the `debugger-kahalo' branch.
55 (MethodData.Emit): Call SymbolWriter.SetCompilerGenerated() if
56 we're an iterator method.
57 (SourceMethod): Reflect latest symbol writer changes;
58 SymbolWriter.OpenMethod() now takes a `ICompileUnit' argument and
59 now `start_row' and `end_row'.
60 (Constructor.Emit): Fix the logic whether to emit symbol information.
62 * iterator.cs: Call SymbolWriter.SetCompilerGenerated() on all the
66 (CompilationUnit): New public class; derives from `SourceFile'.
67 (SourceFileEntry.DefineSymbolInfo): New public method.
68 (SourceFileEntry.SetChecksum): New public method.
69 (Location): Encode hidden line numbers by using `column == 255';
70 the .ctor now accepts `column == -1' to mark a hidden line number.
71 (Location.Hidden): New public property.
72 (Location.CheckPoint): Add `CompilationUnit'.
73 (Location.SourceFiles): Change return type to `CompilationUnit[]'.
74 (Location.Push): Add `CompilationUnit compile_unit' argument.
75 (Location.CompilationUnit): New public property.
78 (ToplevelBlock.Emit): Add `ec.Mark (EndLocation)'.
80 * cs-parser.jay: `SourceFile' -> `CompilationUnit'.
82 * driver.cs: `SourceFile' -> `CompilationUnit'.
84 * cs-tokenizer.cs: `SourceFile' -> `CompilationUnit'.
86 * namespace.cs: `SourceFile' -> `CompilationUnit'.
88 * cs-tokenizer.cs: Add support for `#pragma checksum' and
92 (SymbolWriter.MarkSequencePoint): Take a `Location' and use the
93 new symbol writer API to also pass the file.
95 2008-06-05 Marek Safar <marek.safar@gmail.com>
97 * statement.cs: Emit catch variable assignment using variable expression.
99 2008-06-05 Marek Safar <marek.safar@gmail.com>
101 * ecore.cs, expression.cs, statement.cs: Make TemporaryVariable compatible
102 with other variable types.
104 2008-06-04 Marek Safar <marek.safar@gmail.com>
106 * ecore.cs, expression.cs, statement.cs, typemanager.cs: Removed custom
107 GetLength method emit, it breaks resolve rules.
109 2008-06-02 Atsushi Enomoto <atsushi@ximian.com>
110 Marek Safar <marek.safar@gmail.com>
112 A fix for bug #395542
113 * cs-parser.jay: The trailing comma is allowed in anonymous type member
116 2008-06-02 Marek Safar <marek.safar@gmail.com>
118 A fix for bug #395287
119 * class.cs, modifiers.cs: Automatic properties method base modifiers checks.
121 2008-05-31 Marek Safar <marek.safar@gmail.com>
123 A fix for bug #395845
124 * class.cs, nullable.cs: User unary operator is allowed to have nullable and
125 non-nullable parameter type.
127 2008-05-31 Marek Safar <marek.safar@gmail.com>
129 * class.cs: Handle contructor initializer as a statement in top-level block.
131 2008-05-30 Marek Safar <marek.safar@gmail.com>
133 * attribute.cs: Don't mix old and new corlib types when emitting corlib
136 2008-05-24 Marek Safar <marek.safar@gmail.com>
138 * ecore.cs, expression.cs: Small IVariable refactoring.
140 2008-05-22 Marek Safar <marek.safar@gmail.com>
142 * assign.cs (LocalTemporary): Implemented CreateExpressionTree.
144 2008-05-21 Marek Safar <marek.safar@gmail.com>
146 * cs-parser.jay: Removed redundant catch type check.
148 2008-05-21 Marek Safar <marek.safar@gmail.com>
150 A fix for bug #390372
151 * nullable.cs: Set correct return type.
153 2008-05-21 Marek Safar <marek.safar@gmail.com>
155 A fix for bug #391062
156 * typemanager.cs: Fixed crash when comparing null types.
158 2008-05-21 Marek Safar <marek.safar@gmail.com>
160 A fix for bug #391871
161 * cs-parser.jay: Better error handling for invalid catch type.
163 2008-05-20 Marek Safar <marek.safar@gmail.com>
165 A fix for bug #392155
166 * cs-tokenizer.cs: Fixed casting of byte and decimal expression.
168 2008-05-15 Marek Safar <marek.safar@gmail.com>
170 A fix for bug #390666
171 * ecore.cs (BetterExpressionConversion): Unwrap each Expression<T>
174 2008-05-15 Marek Safar <marek.safar@gmail.com>
176 * class.cs, expression.cs, statement.cs: Removed a hack, setting block flag
179 2008-05-13 Marek Safar <marek.safar@gmail.com>
181 A fix for bug #389625
182 * delegate.cs, generic.cs: Some progress on method group return type
185 2008-05-13 Marek Safar <marek.safar@gmail.com>
187 A fix for bug #378419
188 * namespace.cs: Inspect also parent namespaces not only namespace entries.
190 2008-05-12 Marek Safar <marek.safar@gmail.com>
192 * class.cs (Constructor): Added IsCompilerGenerated.
194 2008-05-12 Marek Safar <marek.safar@gmail.com>
196 * expression.cs: Enum binary operators can accept non-enum operand only when
197 is implicitly convertible to underlying type.
199 2008-05-12 Marek Safar <marek.safar@gmail.com>
201 A fix for bug #389272
202 * support.cs: Workaround System.InvalidOperationException for enums.
204 2008-05-12 Marek Safar <marek.safar@gmail.com>
206 A fix for bug #389073
207 * convert.cs: More undocumented explicit IntPtr/UIntPtr conversions.
209 2008-05-10 Marek Safar <marek.safar@gmail.com>
211 * driver.cs: Split Parse.
213 * location.cs (LookupFile): Uses string.Empty.
215 2008-05-07 Marek Safar <marek.safar@gmail.com>
217 * expression.cs, parameter.cs: Small ParameterReference clean up.
219 2008-05-07 Marek Safar <marek.safar@gmail.com>
221 * anonymous.cs, codegen.cs, convert.cs, ecore.cs: Removed uber ugly TempEc
224 2008-05-06 Martin Baulig <martin@ximian.com>
226 * class.cs (Constructor.Emit): Fix the logic whether to emit
229 2008-05-06 Raja R Harinath <harinath@hurrynot.org>
232 * iterators.cs (Iterator.CurrentBlock.DoEmit): Don't emit
233 InvalidOperationException when the iterator is before the start or
236 2008-05-06 Marek Safar <marek.safar@gmail.com>
238 * nullable.cs (NullCoalescingOperator): Result is underlying type of left,
239 when left is nullable type.
241 2008-05-06 Marek Safar <marek.safar@gmail.com>
243 A fix for bug #386628
244 * expression.cs (LocalVariableReference): Continue in resolving when
245 variable is not assigned.
247 2008-05-05 Marek Safar <marek.safar@gmail.com>
249 * nullable.cs, statement.cs (Unwrap): Store non-variable expression in all
252 2008-05-04 Marek Safar <marek.safar@gmail.com>
254 * nullable.cs, statement.cs (Unwrap): Don't duplicate variable expressions,
255 it saves many redundant temporary variables for nullable operations.
257 2008-05-03 Marek Safar <marek.safar@gmail.com>
259 * assign.cs: EventAddOrRemove is a statement and cannot have a type.
261 * cfold.cs, constant.cs, expression.cs: Share Error_OperatorCannotBeApplied
264 * nullable.cs: Constant coalescing operator optimizations.
266 2008-05-03 Marek Safar <marek.safar@gmail.com>
268 * constant.cs: Use unsigned conversion for values which are unsigned only.
270 2008-05-03 Marek Safar <marek.safar@gmail.com>
272 * convert.cs, literal.cs, nullabel.cs, typemanager.cs: Implemeted null
273 coalescing operator as it should be.
275 2008-05-02 Marek Safar <marek.safar@gmail.com>
277 A fix for bug #371016
278 * expression.cs: All predefined delegate operators require implicit method
281 2008-05-02 Marek Safar <marek.safar@gmail.com>
283 * constant.cs: Emit long constant as uint when fits the range.
285 * convert.cs, expression.cs: Fixed few unsafe conversions.
287 2008-05-02 Marek Safar <marek.safar@gmail.com>
289 * convert.cs, literal.cs: Don't wrap implicit reference conversion to object
291 2008-05-02 Raja R Harinath <harinath@hurrynot.org>
294 * convert.cs (ImplicitNumericConversion): Don't modify the type of
296 * ecore.cs (EmptyCast.Create): Flatten nested EmptyCasts.
298 2008-05-01 Marek Safar <marek.safar@gmail.com>
300 * constant.cs, literal.cs: IsLiteral property for error reporting.
302 * ecore.cs, expression.cs: Implemented Property expression.
304 2008-05-01 Marek Safar <marek.safar@gmail.com>
306 * class.cs, modifiers.cs, flowanalysis.cs: New BACKING_FIELD flag.
308 * nullable.cs: Implemented nullable coalescing null operator.
310 * ecore.cs, expression.cs: Expression trees work.
312 2008-05-01 Marek Safar <marek.safar@gmail.com>
314 * ecore.cs: CreateExpressionTree is finally abstract.
316 * expression.cs, linq.cs: Updated.
318 2008-05-01 Marek Safar <marek.safar@gmail.com>
320 * expression.cs, ecore.cs: Block base access expression inside expression
323 2008-05-01 Marek Safar <marek.safar@gmail.com>
325 A fix for bug #385058
326 * expression.cs: User-defined operator implementations always take
327 precedence over predefined operator implementations.
329 2008-04-30 Marek Safar <marek.safar@gmail.com>
331 * assign.cs, anonymous.cs, lambda.cs, nullable.cs, ecore.cs, linq.cs,
332 class.cs, iterators.cs, expression.cs, attribute.cs: Filled a few more
333 expression tree conversions.
335 2008-04-30 Marek Safar <marek.safar@gmail.com>
337 * typemanager.cs, ecore.cs, class.cs, expression.cs, doc.cs: Merged all
338 operators method details to Operator class.
340 2008-04-30 Marek Safar <marek.safar@gmail.com>
342 * anonymous.cs: Pass unsafe flags to anonymous container.
344 * ecore.cs, expression.cs, statement.cs: Block unsafe pointer operations
345 inside expression tree.
347 2008-04-29 Martin Baulig <martin@ximian.com>
349 * cs-tokenizer.cs (Tokenizer.Position): Added `line'.
350 (Tokenizer.PopPosition): Also restore the `line'.
352 2008-04-29 Marek Safar <marek.safar@gmail.com>
354 * delegate.cs: Implemented Invoke expression.
356 2008-04-29 Marek Safar <marek.safar@gmail.com>
358 * expression.cs: Fixed equality reference comparison regression.
360 2008-04-29 Marek Safar <marek.safar@gmail.com>
362 * ecore.cs: Clean up EmptyCast hack.
364 * expression.cs, nullable.cs: Implemented enum binary and unary operations
365 using correct conversion rules. Also fixes #383993.
367 2008-04-28 Martin Baulig <martin@ximian.com>
369 * class.cs (Constructor.Emit): Don't emit debugging information
370 for generated default .ctor's.
372 2008-04-28 Marek Safar <marek.safar@gmail.com>
374 * convert.cs: Empty-cast ushort to int conversion.
376 2008-04-28 Marek Safar <marek.safar@gmail.com>
378 A fix for bug #384191
379 * ecore.cs, expression.cs: Fixed expression cloning.
381 2008-04-28 Marek Safar <marek.safar@gmail.com>
383 * ecore.cs, delegate.cs, assign.cs: Few tweaks for recent changes.
385 2008-04-28 Raja R Harinath <harinath@hurrynot.org>
387 Fix #381559, test-638.cs, test-639.cs
388 * assign.cs (CompoundAssign.Helper): New wrapper.
389 (CompoundAssign.DoResolve): Use it to wrap the nested 'target'
391 * ecore.cs (MethodGroupExpr.VerifyArgumentsCompat) <params arguments>:
392 Pass unconverted expressions to the params array creation expression.
393 (FieldExpr.EmitAssign): Don't special-case StringConcat.
394 (PropertyExpr.EmitAssign): Likewise.
395 * expression.cs (ArrayCreation.ResolveArrayElement): Keep track of the
396 element if it is of kind CompoundAssign.Helper.
397 (ArrayCreation.Emit): If we saw a CompoundAssign.Helper, emit it
398 first before anything else.
399 (ArrayAccess.EmitAssign): Don't special-case StringConcat.
400 (ArrayAccess.LoadArrayAndArguments): Simplify.
402 2008-04-27 Marek Safar <marek.safar@gmail.com>
404 * expression.cs: Fixed cloning of typeof(void).
406 2008-04-27 Raja R Harinath <harinath@hurrynot.org>
408 * assign.cs (Assign.DoResolve): Remove support for EventExprs.
409 (Assign.Emit): Likewise. Move it to ...
410 (CompoundAssign.DoResolve): ... here and ...
411 (CompoundAssign.Emit): ... here.
412 (EventAddOrRemove): New helper to handle += and -= on events, and
413 avoid the use of BinaryDelegates.
414 * ecore.cs (EventExpr.DoResolveLValue): Emit CS0070 unconditionally.
415 (EventExpr.EmitAddOrRemove): Improve.
416 * delegate.cs (DelegateInvocation.DoResolve): Simplify slightly.
418 * cs-parser.jay (type) <namespace_or_type_name variant>: Don't
419 create VarExprs for 'foo.bar.var'.
420 * ecore.cs (VarExpr.InferType): Rename from DoResolveLValue, which
421 is a highly inappropriate name for its functionality.
423 2008-04-26 Raja R Harinath <harinath@hurrynot.org>
425 Simplify handling of multiple assignments
426 * assign.cs (Assign): Clear out all 'embedded assign' gunk. Make
428 (SimpleAssign): New. Class to be used for normal assignments.
429 * anonymous.cs, class.cs, cs-parser.jay: Update to changes.
430 * expression.cs, parameter.cs, statement.cs: Likewise.
432 2008-04-25 Marek Safar <marek.safar@gmail.com>
434 * ecore.cs, expression.cs, nullable.cs: Implemeted enum binary add operation
435 for incompatible underlying types, more to come, uff.
437 2008-04-26 Raja R Harinath <harinath@hurrynot.org>
440 * expression.cs (VariableReference.EmitAssign) <source is NewInstance>:
443 2008-04-25 Marek Safar <marek.safar@gmail.com>
445 * expression.cs, nullable.cs: Implemented UnaryPlus expression.
447 2008-04-24 Raja R Harinath <harinath@hurrynot.org>
449 Fix test-636.cs. Sprinkle a few more 'EmitSideEffect's around
450 * expression.cs (Unary.TryReduceConstant): Unwrap SideEffectConstant.
451 * statement.cs (While, Do, For): Allow test to have side effects.
452 (For.DoEmit): Always emit InitStatement.
455 * expression.cs (Binary.DoResolve) <BitwiseAnd with zero constant>:
456 Always create SideEffectConstant.
457 (Binary.EnumLiftUp): Don't assume that the enumeration constant is
458 of type EnumConstant.
460 * expression.cs (Binary.EmitBranchable) <Equality with constant>:
461 Handle 'right' being SideEffectConstant of type 'bool'.
463 * expression.cs (Binary.EmitBranchable) <Equality with constant>:
464 Use left.EmitBranchable instead of open coding it, so as to
465 improve optimization opportunities.
467 * constant.cs (SideEffectConstant.EmitSideEffect): Simplify slightly.
469 * ecore.cs (Expression.EmitBranchable): Document some non-obvious
471 (Expression.EmitSideEffect): Document.
473 2008-04-23 Marek Safar <marek.safar@gmail.com>
475 * expression.cs: Implemented NewArrayBounds, TypeIs, and TypeAs expressions.
477 2008-04-23 Marek Safar <marek.safar@gmail.com>
479 * constant.cs, statement.cs: Use EmitSideEffect for constant if statement.
481 2008-04-23 Marek Safar <marek.safar@gmail.com>
483 * ecore.cs, expression.cs, delegate.cs: Implemeted delegate instantiation
484 conversion to expression tree.
486 2008-04-23 Marek Safar <marek.safar@gmail.com>
488 * ecore.cs: Removed unused expression.
490 2008-04-22 Marek Safar <marek.safar@gmail.com>
492 * expression.cs: Implemented NegateChecked and New expressions.
494 2008-04-22 Marek Safar <marek.safar@gmail.com>
496 * convert.cs, nullable.cs, expression.cs: Implemented Negate expression.
498 2008-04-22 Raja R Harinath <harinath@hurrynot.org>
501 * anonymous.cs (AnonymousMethodExpression.DoResolve): Mark as
502 needing final 'ret' instruction.
504 2008-04-22 Marek Safar <marek.safar@gmail.com>
506 * expression.cs: Disabled lifted binary conversion on ISO-1 profiles.
508 2008-04-21 Marek Safar <marek.safar@gmail.com>
510 * expression.cs: Emit ldnull and not null expression as an instance argument
511 of static method expression calls.
513 2008-04-21 Marek Safar <marek.safar@gmail.com>
515 A fix for bug #378200
516 * expression.cs: Fixed crash when creating parameterless expression tree
519 2008-04-21 Marek Safar <marek.safar@gmail.com>
521 A fix for bug #375297
522 * anonymous.cs: Fixed crash when inferring from null argument anonymous
525 2008-04-21 Marek Safar <marek.safar@gmail.com>
527 A fix for bug #377596
528 * decl.cs, class.cs: Emit delegate type argument attributes.
530 2008-04-21 Marek Safar <marek.safar@gmail.com>
532 A fix for bug #365314
533 * generic.cs, ecore.cs: Type parameter declaration cannot be of generic type
535 2008-04-21 Marek Safar <marek.safar@gmail.com>
537 * cs-parser.jay, expression.cs: ComposedCast can work with type expressions
540 2008-04-21 Marek Safar <marek.safar@gmail.com>
542 * generic.cs (TypeParameter): Removed redundant location.
544 2008-04-19 Marek Safar <marek.safar@gmail.com>
546 * generic.cs, parameter.cs, namespace.cs, ecore.cs, class.cs, decl.cs,
547 delegate.cs, iterators.cs, cs-parser.jay, const.cs, enum.cs: Use
548 FullNamedExpression in all declaration type expression, statements will come
551 2008-04-18 Marek Safar <marek.safar@gmail.com>
553 * generic.cs, namespace.cs, ecore.cs, class.cs, decl.cs, generic-mcs.cs,
554 nullable.cs, expression.cs, enum.cs, doc.cs: Cleaning up type expressions.
556 2008-04-18 Marek Safar <marek.safar@gmail.com>
558 * parameter.cs, delegate.cs, cs-parser.jay, expression.cs: Removed unused
561 2008-04-17 Marek Safar <marek.safar@gmail.com>
563 * decl.cs, class.cs, generic.cs: Verify partial parts type parameters and
566 2008-04-17 Marek Safar <marek.safar@gmail.com>
568 * decl.cs, class.cs, cs-parser.jay, ecore.cs, expression.cs: Unify all type
572 2008-04-17 Raja R Harinath <harinath@hurrynot.org>
574 Hook up 'EmitSideEffect'
575 * constant.cs (Constant.EmitSideEffect): New.
576 (SideEffectConstant.Emit): Simplify. Use EmitSideEffect.
577 (SideEffectConstant.EmitSideEffect): New.
578 * ecore.cs (BoxedCast.EmitBranchable): Remove. We can't use an
579 unconditional branch in EmitBranchable.
580 (FieldExpr.EmitBranchable): New.
581 * expression.cs (Unary.EmitSideEffect): New.
582 (Binary.EmitSideEffect): New.
583 (VariableReference.EmitSideEffect): New. Do nothing.
585 2008-04-16 Raja R Harinath <harinath@hurrynot.org>
587 Introduce 'EmitSideEffect'
588 * ecore.cs (Expression.EmitSideEffect): New.
589 (TypeCast): Rename from EmptyCast.
591 (EmptyCast.EmitBranchable, EmptyCast.EmitSideEffect): Implement.
592 (BoxedCast.EmitBranchable, BoxedCast.EmitSideEffect): Implement.
593 * convert.cs, nullable.cs: Update to changes.
595 2008-04-16 Marek Safar <marek.safar@gmail.com>
597 * class.cs, cs-parser.jay: Early check for base types expression.
599 2008-04-16 Marek Safar <marek.safar@gmail.com>
601 * decl.cs (MemberName): Declare PrettyName as obsolete.
603 2008-04-16 Marek Safar <marek.safar@gmail.com>
605 * namespace.cs: Use MemberName comparison.
607 2008-04-16 Raja R Harinath <harinath@hurrynot.org>
610 * decl.cs (MemberName.PrettyName): New. Replaces the misnamed
612 (MemberName.MethodName, MemberName.GetSignatureForError): Improve.
613 (MemberName.FullyQualifiedName): New. Provides the functionality
614 that users assume FullName would have.
615 * ecore.cs, namespace.cs: Update to changes.
617 * statement.cs (Using.assign): Make into ExpressionStatement.
618 (Using.EmitPreTryBody): Simplify.
620 2008-04-16 Marek Safar <marek.safar@gmail.com>
622 * report.cs: ColorFormat is protected.
624 * rootcontext.cs: Unused fields clean-up.
626 * namespace.cs: Made UsingEntry name private.
628 2008-04-16 Marek Safar <marek.safar@gmail.com>
630 * cs-tokenizer.cs, location.cs: Removed unused field.
632 2008-04-16 Jan Oravec <jan.oravec@6com.sk>
633 Raja R Harinath <harinath@hurrynot.org>
636 * constant.cs (SideEffectConstant.value): Rename from 'left'.
637 (SideEffectConstant.side_effect): Rename from 'right'.
638 (SideEffectConstant..ctor): Normalize 'side_effect'.
639 (SideEffectConstant.Emit): Emit 'value', not 'side_effect' as the
640 value of this constant.
641 * cfold.cs: Update to changes.
643 2008-04-15 Marek Safar <marek.safar@gmail.com>
645 * cs-paser.jay: Removed unused variable.
647 * driver.cs: Made Compile instance method.
649 2008-04-15 Raja R Harinath <harinath@hurrynot.org>
651 * flowanalysis.cs (FlowBranching.MergeChild): Simplify.
653 2008-04-15 Marek Safar <marek.safar@gmail.com>
655 * cs-paser.jay, namespace.cs: Simplified handling of namespace imports.
657 2008-04-13 Jb Evain <jbevain@novell.com>
659 * namespace.cs: update the System.Core fullname for 2.1
660 * driver.cs: update the list of required assemblies for 2.1.
661 Merged from the Moonlight 2 branch.
663 2008-04-11 Marek Safar <marek.safar@gmail.com>
665 * assign.cs, ecore.cs, expression.cs, nullable.cs: More work on nullable
666 types and user defined operators. User operators arguments has to be checked
667 for null value before invocation, which also means no operator is called
668 when any argument is not convertible to unwrapped nullable type.
670 2008-04-09 Marek Safar <marek.safar@gmail.com>
672 * convert.cs, ecore.cs, expression.cs, nullable.cs: Initial refactoring
673 of Unary expressions to follow operator overloading rules precisely.
674 Also fixes #321794, #323794
676 2008-04-08 Marek Safar <marek.safar@gmail.com>
678 * cs-parser.jay, expression.cs: Don't wrap Indirection expression in Unary
681 2008-04-08 Marek Safar <marek.safar@gmail.com>
683 * expression.cs, ecore.cs: Implemented MemberInit expression.
685 2008-04-08 Raja R Harinath <harinath@hurrynot.org>
687 Fix mono/tests/exception4.cs
688 * statement.cs (ExceptionStatement, TryCatch): Revert to using
689 ec.NeedReturnLabel () rather emitting a 'nop'.
691 * statement.cs (ExceptionStatement.SomeCodeFollows): A hook for a
693 (TryCatch.SomeCodeFollows): Likewise.
694 * flowanalysis.cs (FlowBranchingException): Call 'SomeCodeFollows'
695 for 'break', 'continue' and 'return' statements inside a try.
696 We're fairly sure that the generated IL stream will have more
697 instructions textually following the try.
698 (FlowBranchingTryCatch): Likewise.
700 * statement.cs (Throw.Resolve): Move CS0156 and CS0724 testing ...
701 * flowanalysis.cs (FlowBranching.CheckRethrow): ... here and to its
704 * statement.cs (CollectionForeach.DisposableWrapper): Make a true
705 wrapper -- forward everything to CollectionForeach.
706 (CollectionForeach.NonDisposableWrapper): New.
707 (CollectionForeach.EmitFinallyBody): Use 'endfinally' instruction
708 instead of a pop + branch to end.
710 2008-04-07 Marek Safar <marek.safar@gmail.com>
712 A fix for bug #377485
713 * assign.cs, expression.cs, decl.cs, class.cs, ecore.cs, namespace.cs:
714 Propagate location for extension method groups. Report conversion failure at
717 2008-04-07 Marek Safar <marek.safar@gmail.com>
719 * anonymous.cs, expression.cs, ecore.cs, typemanager.cs: Implemented
720 ListInit and Field expressions.
722 2008-04-06 Raja R Harinath <harinath@hurrynot.org>
724 * iterators.cs (Iterator.EmitMoveNext): Remove try/fault wrapper.
725 Since $PC is always -1 inside the body of MoveNext, the fault
727 * flowanalysis.cs (FlowBranchingException.EmitFinally): Kill.
728 * statement.cs (ExceptionStatement.emit_finally): Likewise.
729 (ExceptionStatement.ResolveFinally): Drop 'branching' argument.
731 The denouement! Fix #324708
732 * iterators.cs (Iterator.EmitMoveNext): Reset $PC to -1 on entry.
733 (Iterator.EmitYieldBreak): We no longer need to reset $PC.
734 * statement.cs (ExceptionStatement.DoEmit): Actually emit the
735 'finally' inside the finally clause.
737 * statement.cs (ExceptionStatement.DoEmit): Emit try/finally block
738 inside an iterator. Don't emit the body of the 'finally' inside
739 the finally clause yet.
741 Use the ResumableStatement infrastructure for MoveNext ()
742 * iterators.cs (Iterator.EmitMoveNext_NoResumePoints): New.
743 (Iterator.EmitMoveNext): Use 'resume_points'. Get rid of
744 'old_resume_points'. Move dispatcher upfront.
745 (Iterator.MarkYield): Mark the 'resume_point' of a Yield.
746 * statement.cs (ExceptionStatement.DoEmit): Emit a dispatcher if
747 in an enumerator. This encodes the main fix in this patch series
748 -- we can only jump into the first instruction of a try from the
749 outside, but we want to emit try/finally regions in iterators and
750 resume in the middle of them.
752 2008-04-05 Raja R Harinath <harinath@hurrynot.org>
754 * statement.cs (ExceptionStatement.ResolveFinally): Move setting
755 of NeedReturnLabel here.
757 Introduce a common point for emitting try/finally to IL
758 * statement.cs (ExceptionStatement.DoEmit): New. Combines all the
759 features of the various subclasses, which are now driven by ...
760 (ExceptionStatement.EmitPreTryBody): ... this and ...
761 (ExceptionStatement.EmitTryBody): ... this and the original
763 (TryFinally, Lock, Using, UsingTemporary, DisposableWrapper):
764 Remove DoEmit and update to follow above protocol.
766 * statement.cs (ExceptionStatement.EmitForDispose): If all labels
767 of the dispatcher are the same, skip emitting the 'switch'.
768 * iterator.cs (Iterator.EmitDispose): Update to changes.
770 Clean up handling of 'using' statement
771 * statement.cs (UsingTemporary): New. Carved out of ...
772 (Using): ... this. Simplify drastically. Handle exactly
774 * cs-parser.jay (using_statement): Split. Create UsingTemporary
775 or Using as appropriate. If there are multiple variable declared,
776 create nested Using statements.
777 (resource_acquisition): Kill.
779 * statement.cs (ExceptionStatement.EmitForDispose): Use
780 EmitFinallyBody, not EmitFinally.
782 * flowanalysis.cs (FlowBranching.StealFinallyClauses): Remove.
783 * iterator.cs: Update to changes.
785 Start using the ResumableStatement infrastructure
786 * statement.cs (ResumeableStatement.PrepareForDispose): New.
787 (ResumableStatement.EmitForDispose): New.
788 (ExceptionStatement): Override them.
789 * iterators.cs (Iterator.EmitDispose): Use PrepareForDispose and
790 EmitForDispose to create the body of the Dispose method. Don't
793 * iterator.cs (Iterator.AddResumePoint): Move here from ...
794 * statement.cs (Toplevel.AddResumePoint): ... here.
795 (Toplevel.MoveNextStatement.Resolve): Create FlowBranchingIterator.
796 * flowanalysis.cs (FlowBranchingIterator): New.
797 * codegen.cs (EmitContext): Update to changes.
799 * iterators.cs (Iterator.OldResumePoint): Rename from ResumePoint.
800 (Iterator.old_resume_points): Rename from 'resume_points'.
801 (Iterator.MoveNextStatement): Remove unused class.
803 New infrastructure for try/finally in iterators (still unused)
804 * flowanalysis.cs (FlowBranching.AddResumePoint): New.
805 (FlowBranchingToplevel.AddResumePoint): Hook into
806 ToplevelBlock.AddResumePoint.
807 (FlowBranchingTryCatch): Move CS01626 and CS01631 checks here.
808 (FlowBranchingException): Hook into ExceptionBlock.AddResumePoint.
809 * statement.cs (ToplevelBlock.AddResumePoint): New. Collect
810 resume points and assign program-counter values.
811 (ExceptionBlock.AddResumePoint): Collect resume points for
812 de-muxer at the top of try block.
813 * iterators.cs (Yield.CheckContext): Simplify.
814 (Yield.Resolve): Use FlowBranching.AddResumePoint.
816 2008-04-04 Raja R Harinath <harinath@hurrynot.org>
818 * flowanalysis.cs (FlowBranching.AddReturnOrigin): Change Location
819 argument to an ExitStatement.
820 (FlowBranchingException): Refactor saved origins code.
821 * statement.cs (ExitStatement): Update to cahges.
822 * iterator.cs (YieldBreak): Likewise.
824 * statement.cs (ResumableStatement): New. Common base class for
825 YieldReturn and ExceptionStatement.
826 (ExitStatement): New. Common base class for Return and YieldBreak.
827 (Return): Update to changes.
828 * iterator.cs (YieldBreak): Likewise.
829 * lambda.cs (ContextualReturn): Likewise.
832 * ecore.cs (Expression.ResolveAsTypeStep): If '!silent' attempt to
833 emit a meaningful error message.
836 * flowanalysis.cs (VariableInfo.IsEverAssigned): New.
837 (VariableInfo.SetAssigned): Set it.
838 * statement.cs (Block.UsageWarning): Use 'IsEverAssigned' to
839 determine if CS0219 or CS0168 is appropriate. Don't use
840 flow-analysis information.
841 (Block.Resolve): Use ec.EndFlowBranching, not ec.DoEndFlowBranching.
842 * codegen.cs (EmitContext.DoEndFlowBranching): Kill. Inline into ...
843 (EmitContext.EndFlowBranching): ... this.
845 2008-04-03 Marek Safar <marek.safar@gmail.com>
847 * class.cs, typemanager.cs: Emit volatile field with IsVolatile modifier.
849 2008-04-03 Marek Safar <marek.safar@gmail.com>
851 A fix for bug #376508
852 * convert.cs, expression.cs: Fixed difference between ImplicitConversion and
853 ImplicitConversionExists.
855 2008-04-03 Marek Safar <marek.safar@gmail.com>
857 * expression.cs (Binary): Added remaining binary operators to expression
860 * nullable.cs: Optimize shift with null argument.
862 2008-04-03 Raja R Harinath <harinath@hurrynot.org>
864 Fix minor IL regression
865 * statement.cs (TryCatch..ctor): Add 'inside_try_finally' argument.
866 (TryCatch.DoEmit): Use it to avoid creating another ExceptionBlock.
867 * cs-parser.jay (try_statement): Update to changes.
869 * statement.cs (TryFinally.need_exc_block): Delete.
870 (TryFinally): Update to changes.
872 Now all ExceptionStatements are unconditional
873 * statement.cs (CollectionForeach.DisposableWrapper): New.
874 Extract out the try/finally code into a new wrapper.
875 (CollectionForeach.Resolve): Use it to simplify the code.
877 2008-04-02 Raja R Harinath <harinath@hurrynot.org>
879 Start at simplifying ExceptionStatement semantics a bit
880 * statement.cs (TryCatch, TryFinally): Split 'Try' into two pieces.
881 * cs-parser.jay (try_statement): Update to changes.
882 (opt_catch_clauses): Remove.
883 * flowanalysis.cs: Update to changes.
884 (FlowBranching.BranchingType.TryCatch): New.
885 (FlowBranchingTryCatch): New.
887 * flowanalysis.cs (FlowBranching.BranchingType.SwitchSection): Kill.
888 (FlowBranching.CreateBranching): Update to changes.
889 (FlowBranchingBlock.AddSibling): Add sanity check.
890 * codegen.cs (EmitContext.StartFlowBranching) <Block variant>:
893 * iterators.cs (Iterator.MarkFinally): Remove.
894 * statement.cs (ExceptionStatement): Update to changes.
896 Add support for skipping over finally blocks at runtime. First
897 in a series to fix #324708
898 * iterators.cs (Iterator.SkipFinally): New LocalBuilder.
899 (Iterator.EmitMoveNext): Initialize it.
900 * statement.cs (ExceptionStatement.EmitFinally): Use it to emit a
901 branch over the body of the 'finally' clause.
903 2008-03-31 Raja R Harinath <harinath@hurrynot.org>
905 Avoid lopsided use of Foo/DoFoo names
906 * statement.cs (ExpressionStatement.EmitFinallyBody):
907 Rename from EmitFinally.
908 (ExpressionStatement.EmitFinally): Rename from DoEmitFinally.
909 * iterator.cs: Update to changes.
911 2008-04-02 Marek Safar <marek.safar@gmail.com>
913 * ecore.cs, expression.cs, nullable.cs: ConditionalLogicalOperator is now
914 based on UserOperatorCall. More binary nullable operators clean up.
916 2008-04-02 Martin Baulig <martin@ximian.com>
918 * symbolwriter.cs: Remove the `#if !DISABLE_TERRANIA_CHANGES' conditionals.
920 2008-04-02 Marek Safar <marek.safar@gmail.com>
922 * nullable.cs: Merge user and empty conversions when lifting expression
925 * expression.cs (StringConcat): Implemented expression tree representation.
927 2008-04-01 Marek Safar <marek.safar@gmail.com>
929 * nullable.cs: When lifting null literal and a user operator exists, no call
932 2008-04-01 Marek Safar <marek.safar@gmail.com>
934 * nullable.cs, ecore.cs, expression.cs: Convert null arithmetic to lifted
937 2008-04-01 Marek Safar <marek.safar@gmail.com>
939 * nullable.cs, expression.cs: Use namespace instead heavily nested
940 monster abstract class.
942 2008-04-01 Marek Safar <marek.safar@gmail.com>
944 * ecore.cs, convert.cs, constant.cs, nullable.cs, expression.cs: Implemented
945 lifting of null literal and user operators. Clean up of some temporary
948 2008-03-30 Raja R Harinath <harinath@hurrynot.org>
950 Fix #368224, test-629.cs
951 * flowanalysis.cs (FlowBranching.StealFinallyClauses): Return true
952 if it crossed an unwind-protect boundary.
953 * iterators.cs (Yield.CheckContext): Relax check for 'yield break'.
954 (Yield.Resolve, Yield.DoEmit): Track whether the yield occurs
955 inside an unwind-protected region.
956 (YieldBreak.Resolve, YieldBreak.DoEmit): Likewise.
957 (Iterator.MarkYield): Add 'unwind_protect' parameter. Emit a
958 'leave' instead of a 'br' if unwind-protected.
959 (Iterator.EmitYieldBreak): Likewise.
961 2008-03-29 Gert Driesen <drieseng@users.sourceforge.net>
963 * driver.cs: Only define versioninfo resources if no win32 resource
966 2008-03-28 Marek Safar <marek.safar@gmail.com>
968 A fix for bug #372375
969 * convert.cs: Fixed boxing of nullable types.
971 2008-03-28 Marek Safar <marek.safar@gmail.com>
973 * typemanager.cs: Initialize InternalsVisibleTo as the very first optional
976 2008-03-28 Marek Safar <marek.safar@gmail.com>
978 A fix for bug #374619
979 * nullable.cs: Fixed guarding of EmitBitwiseBoolean.
981 2008-03-27 Marek Safar <marek.safar@gmail.com>
983 * lambda.cs: Check return type only for invocation.
985 2008-03-27 Marek Safar <marek.safar@gmail.com>
987 A fix for bug #374214
988 * ecore.cs: Correctly report argument type mismatch.
990 2008-03-27 Marek Safar <marek.safar@gmail.com>
992 * convert.cs (ImplicitReferenceConversionCore): Correctly compare enum type
993 and not rely on broken IsEnum.
995 2008-03-27 Marek Safar <marek.safar@gmail.com>
997 * nullable.cs: New file, extracted from generic.cs.
999 * generic.cs, generic-mcs.cs, *.csproj, *.sources: Updated.
1001 2008-03-27 Marek Safar <marek.safar@gmail.com>
1003 * generic.cs, convert.cs, generic-mcs.cs, expression.cs: Added lifting of
1004 predefined comparison operators and null literals.
1006 * report.cs: New warning ID.
1008 2008-03-25 Marek Safar <marek.safar@gmail.com>
1010 A fix for bug #370577
1011 * lambda.cs: Check return type too.
1013 2008-03-25 Marek Safar <marek.safar@gmail.com>
1015 A fix for bug #372846
1016 * class.cs: Automatic properties can be declared as unsafe.
1018 2008-03-20 Marek Safar <marek.safar@gmail.com>
1020 * location.cs: Use string based concatenation.
1022 * expression.cs: LiftedBinaryOperator is gmcs only.
1024 2008-03-20 Marek Safar <marek.safar@gmail.com>
1026 * generic.cs, literal.cs, ecore.cs, expression.cs: Ongoing work on nullable
1027 conversions rules and expression trees.
1029 2008-03-19 Marek Safar <marek.safar@gmail.com>
1031 * delegate.cs: Use extension method source as delegate target.
1033 2008-03-19 Marek Safar <marek.safar@gmail.com>
1035 * generic.cs, generic-mcs.cs, expression.cs, ecore.cs: Rewrote nullable
1036 binary operations to be purely based on binary operations and optimized
1037 emitted code (30% less in some cases). Introduced ReducedExpression for ETs
1038 and other ET refactoring.
1040 * typemanager.cs: Fixed warning.
1042 2008-03-17 Marek Safar <marek.safar@gmail.com>
1044 * class.cs, decl.cs, delegate.cs: Do protected modifier check on each member
1046 * symbolwriter.cs: Fixed.
1048 2008-03-17 Marek Safar <marek.safar@gmail.com>
1050 * anonymous.cs, driver.cs: Reset anonymous types counters.
1052 2008-03-17 Marek Safar <marek.safar@gmail.com>
1054 * ecore.cs (MethodGroupExpr): Skip first candidate, it's already the best.
1056 * class.cs: Use fullname for all type member definitions.
1058 2008-02-19 Martin Baulig <martin@ximian.com>
1061 (IMethodData.EmitExtraSymbolInfo): New interface method.
1062 (MethodData.Emit): Call method.EmitExtraSymbolInfo().
1063 (MethodOrOperator.EmitExtraSymbolInfo): Implement this new
1064 interface method here as an empty public virtual method.
1067 (AnonymousMethodMethod.ctor): Added `string real_name' argument.
1068 (AnonymousMethodMethod.EmitExtraSymbolInfo): Override and call
1069 CodeGen.SymbolWriter.SetRealMethodName().
1071 2008-02-18 Martin Baulig <martin@ximian.com>
1074 (ScopeInfo.EmitType): Override this and emit debugging
1075 information for captured variables.
1076 (RootScopeInfo.EmitType): Override this and emit symbol
1077 information for a captured `this'.
1079 2008-02-15 Martin Baulig <martin@ximian.com>
1081 * iterators.cs: Emit debugging info.
1084 (EmitContext.Flags): Add `OmitDebuggingInfo'.
1085 (EmitContext.OmitDebuggingInfo): New public property.
1088 (While): Override Emit() and don't emit symbol info there; do it
1089 inside DoEmit() instead.
1090 (Block.Emit): Omit symbol information while emitting the scope
1091 initializers; don't ec.Mark() the `EndLocation'. Fix the lexical
1093 (ExplicitBlock.IsIterator): Moved here from `ToplevelBlock'.
1094 (ToplevelBlock.MakeIterator): Pass the `flags' to `ExplicitBlock's
1095 .ctor to make `IsIterator' work.
1097 2008-03-14 Martin Baulig <martin@ximian.com>
1099 * symbolwriter.cs: Added the new symbol writer function from the
1100 debugger's `terrania' branch; temporarily enclose them inside
1101 `#if !DISABLE_TERRANIA_CHANGES' conditionals until I'm back from
1104 2008-03-14 Martin Baulig <martin@ximian.com>
1107 (SymbolWriter): Make this a public static class.
1110 (CodeGen.SymbolWriter): Removed; use the new static `SymbolWriter'
1111 class instead of using `if (CodeGen.SymbolWriter != null)' everywhere.
1113 2008-03-14 Marek Safar <marek.safar@gmail.com>
1115 A fix for bug #370577
1116 * statement.cs, lambda.cs: Added extra limitations when dealing with void
1119 2008-03-14 Marek Safar <marek.safar@gmail.com>
1121 * typemanager.cs (CSharpName): Made 250 times faster.
1123 2008-03-13 Marek Safar <marek.safar@gmail.com>
1125 * ecore.cs, expression.cs: Emit conversion for ET shift argument.
1127 2008-03-12 Marek Safar <marek.safar@gmail.com>
1129 * generic.cs, typemanager.cs, enum.cs, codegen.cs, statement.cs: Try not to
1130 crash when predefined field does not exist.
1132 2008-03-12 Marek Safar <marek.safar@gmail.com>
1134 * ecore.cs (PropertyExpr): Fixed IsSingleDimensionalArrayLength regression.
1136 2008-03-12 Marek Safar <marek.safar@gmail.com>
1138 * class.cs (FixedField): Don't crash when contructors are missing.
1140 2008-03-11 Marek Safar <marek.safar@gmail.com>
1142 * typemanager.cs, namespace.cs, literal.cs, ecore.cs, class.cs, decl.cs,
1143 convert.cs, constant.cs, expression.cs, statement.cs: Use same method to
1144 check internal types accessibility for internal and external types.
1145 Replaced EnumToUnderlying by GetEnumUnderlyingType.
1147 2008-03-11 Marek Safar <marek.safar@gmail.com>
1149 * support.cs, typemanager.cs, pending.cs, ecore.cs, class.cs, delegate.cs
1150 convert.cs, const.cs, anonymous.cs, constant.cs, expression.cs,
1151 attribute.cs, statement: Use corect instance of predefined types (work
1152 related to #364674).
1154 2008-03-07 Marek Safar <marek.safar@gmail.com>
1156 * expression.cs (TypeOfVoid): Fixed predefined method initialization.
1158 2008-03-07 Marek Safar <marek.safar@gmail.com>
1160 * generic.cs, typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs,
1161 class.cs, delegate.cs, iterators.cs, const.cs, constant.cs, driver.cs,
1162 expression.cs, attribute.cs, codegen.cs, statement.cs: TypeManager optional
1163 predefined types clean up, delayed predefined types members initialization
1164 (work related to #364674).
1166 2008-03-05 Marek Safar <marek.safar@gmail.com>
1168 * typemanager.cs (IsFriendAssembly): InternalsVisibleTo is not mandatory.
1170 2008-03-05 Marek Safar <marek.safar@gmail.com>
1172 * typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, class.cs, decl.cs,
1173 delegate.cs, convert.cs, driver.cs, attribute.cs, codegen.cs: TypeManager
1174 predefined types clean up (work related to #364674).
1176 2008-03-04 Marek Safar <marek.safar@gmail.com>
1178 * ecore.cs: Print an error message instead of throwing exception.
1180 2008-03-04 Marek Safar <marek.safar@gmail.com>
1182 * generic.cs, typemanager.cs, literal.cs, convert.cs, cfold.cs, constant.cs,
1183 expression.cs, statement.cs: Unififed null literal representation.
1185 2008-03-03 Marek Safar <marek.safar@gmail.com>
1187 * anonymous.cs, cfold.cs, convert.cs, delegate.cs, doc.cs, ecore.cs,
1188 expression.cs: Refactored binary operators resolve phase and improved speed.
1189 The nullable code is still missing and won't work correctly, more fixes
1192 It also fixes #323726, #324312, #324248, and many other unreported issues.
1194 2008-02-29 Zoltan Varga <vargaz@gmail.com>
1196 * report.cs (FeatureIsNotAvailable): Use 'mcs1' instead of 'mcs', and 'mcs'
1199 2008-02-27 Marek Safar <marek.safar@gmail.com>
1201 * ecore.cs: Clean-up and split BetterConversion.
1203 2008-02-25 Raja R Harinath <harinath@hurrynot.org>
1206 * enum.cs (EnumMember.Value): Only access 'value' if
1207 ResolveValue says it's ok.
1208 (EnumMember.DoResolveValue): Don't set prev_member.value.
1209 (Enum.GetDefinition): Reverse arguments of Equals --
1210 EnumMember.Value can return 'null'.
1212 * statement.cs (Switch.Error_AlreadyOccurs): Fix typo in name.
1214 2008-02-22 Marek Safar <marek.safar@gmail.com>
1216 * generic.cs, expression.cs: More ongoing work on expression trees.
1218 2008-02-21 Marek Safar <marek.safar@gmail.com>
1220 * class.cs, typemanager.cs: Rewrote operator matching logic to correctly
1221 handle missing matches when mutiple operators exist.
1223 2008-02-20 Marek Safar <marek.safar@gmail.com>
1225 A fix for bug #363218
1226 * expression.cs (ArrayCreation.Clone): Deal with multi-dimensional
1229 2008-02-20 Marek Safar <marek.safar@gmail.com>
1231 * expression.cs, constant.cs, cfold.cs: Yet another side-effect constant
1232 update. This time to deal correctly with SideEffectConstant expression used
1233 as an argument for another constant folding.
1235 2008-02-20 Raja R Harinath <harinath@hurrynot.org>
1237 * typemanager.cs (DropGenericMethodArguments): Ensure we get an underlying
1240 2008-02-19 Marek Safar <marek.safar@gmail.com>
1242 * constant.cs, cfold.cs: SideEffectConstant results can apply for folding.
1244 2008-02-19 Marek Safar <marek.safar@gmail.com>
1246 A fix for bug #328136
1247 * expression.cs: Do not fold immediately LogicalAnd operators when the left
1248 side is a false constant, because we still need to evaluate the right-hand
1251 * statement.cs (If): Emit two types of boolean constants (simple constant,
1252 side-effect constant).
1254 2008-02-19 Marek Safar <marek.safar@gmail.com>
1256 * constant.cs (SideEffectConstant): Don't emit boolean constant.
1258 * expression.cs: Fold immediately LogicalAnd operators when both sides are
1261 2008-02-18 Marek Safar <marek.safar@gmail.com>
1263 A fix for bug #361457
1264 * ecore.cs (IsApplicable): Params methods have lower priority.
1266 * support.cs: Return correct parameter modifier for params types.
1268 2008-02-18 Marek Safar <marek.safar@gmail.com>
1270 * generic.cs (TypeParameter): Cache attribute target name.
1272 * support.cs: Removed unused variable.
1274 * typemanager.cs: Removed debugging leftover.
1276 * ecore.cs: Use local type instead of a property;
1278 * class.cs (VerifyMembers): Consider also parent to test whether type member
1281 * expression.cs (FullMethodDesc): Removed.
1283 * attribute.cs (IsValidArgumentType): Made static.
1285 2008-02-17 Raja R Harinath <harinath@hurrynot.org>
1287 Cleanup to be more readable.
1288 * Makefile (GMCS_PROFILE): Remove.
1289 (COMPILER_NAME): New helper.
1291 2008-02-15 Miguel de Icaza <miguel@novell.com>
1293 * cs-tokenizer.cs: if a conditional expression happens inside a
1294 (...) this also means that we do not need to de-ambiguate between
1295 an parenthesized expression and a cast.
1299 * constant.cs (SideEffectConstant): a constant value that happens
1300 to have a side effect.
1302 Fixes the build regressions introduced by the fix for #359789
1304 2008-02-14 Rodrigo Kumpera <rkumpera@novell.com>
1306 * expression.cs (Conditional.Emit): when emitting the ternary
1307 operator, use local variables to generate code verifiable code.
1309 The verifier cannot infer that the type on stack before the
1310 stloc.0 is executed is of type ParentB. This happens because the
1311 stack merge algorithm uses only parent types when deciding which
1312 is the common type. This is described in Part III 1.8.1.3 of ECMA
1315 This code compiled with mcs is not verifiable under MS. The MS
1316 verifier picks the first common interface of Foo and Bar, which is
1317 wrong, but doesn't use a full join type of the 2 interfaces.
1319 CSC uses a clever hack to compile such code in a verifiable
1320 way. It stores the intermediate values in a local variable with
1325 2008-02-14 Miguel de Icaza <miguel@novell.com>
1327 * expression.cs: Do not fold BitwiseAnd operators when the left
1328 side is a false constant, because we still need to evaluate the
1333 * support.cs: Instead of throwing an InternalErrorException when
1334 the position of the stream is outside the boundary of our buffer,
1335 reset the state of the reader, and restart the reading from the
1336 beginning of the file.
1338 2008-02-14 Marek Safar <marek.safar@gmail.com>
1340 * generic.cs (TypeParameter.GetMembers): Is not supported operation.
1342 2008-02-14 Marek Safar <marek.safar@gmail.com>
1344 A fix for bug #361686
1345 * decl.cs: A protected types used inside a private class which parents
1346 derives from the protected class are accessible.
1348 2008-02-13 Marek Safar <marek.safar@gmail.com>
1350 * generic.cs (ConstraintChecker): Use cached member lookup when looking for
1351 the parameterless constructor.
1353 2008-02-13 Marek Safar <marek.safar@gmail.com>
1355 * generic.cs, typemanager.cs, iterators.cs, codegen.cs: Refactored core
1356 lookup methods to use standard member cache when doing member lookup.
1358 2008-02-12 Marek Safar <marek.safar@gmail.com>
1360 * driver.cs: Don't report full path for referenced module as assembly error.
1362 2008-02-12 Marek Safar <marek.safar@gmail.com>
1364 * Makefile: Fixed `qh' target to work on all machines.
1366 * report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs, anonymous.cs,
1367 expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type IsSubclassOf
1368 and HasElementType with TypeManager implementation.
1370 2008-02-08 Marek Safar <marek.safar@gmail.com>
1372 A fix for bugs #325134, #359749
1373 * expression.cs, ecore.cs: Try to resolve an extension method even if the
1374 first binds point to non-method member expression.
1376 2008-02-08 Marek Safar <marek.safar@gmail.com>
1378 * cs-parser.jay: Null coalescing operator is not part of ISO-1.
1380 2008-02-08 Marek Safar <marek.safar@gmail.com>
1382 A fix for bugs #321394, #323028
1383 * generic.cs, parameter.cs, ecore.cs, class.cs, decl.cs, delegate.cs:
1384 Reworked naive IsAccessibleAs implementation to handle nested types.
1386 2008-02-05 Jb Evain <jbevain@novell.com>
1388 * class.cs: use generic type comparison for parameters
1391 2008-02-05 Marek Safar <marek.safar@gmail.com>
1393 A fix for bug #325372
1394 * class.cs: Use generic type comparison when testing method signatures.
1396 2008-02-05 Marek Safar <marek.safar@gmail.com>
1398 A fix for bug #357047
1399 * ecore.cs: Applied C# 3.0 changes to better conversion.
1401 2008-02-05 Marek Safar <marek.safar@gmail.com>
1403 A fix for bug #358374
1404 * cs-parser.jay: Correctly set modifiers for all constructor types.
1406 2008-02-04 Marek Safar <marek.safar@gmail.com>
1408 A fix for bug #355251
1409 * generic.cs: Added base class constraint based type inference.
1411 2008-02-01 Marek Safar <marek.safar@gmail.com>
1413 A fix for bug #357255
1414 * decl.cs: One more missing visibility check.
1416 2008-02-01 Marek Safar <marek.safar@gmail.com>
1418 * support.cs: Fixed broken return.
1420 2008-01-25 Marek Safar <marek.safar@gmail.com>
1422 * report.cs: Correctly reset warnings count after probing.
1424 2008-01-25 Martin Baulig <martin@ximian.com>
1427 (NamespaceEntry.SymbolFileID): Make this work again after
1428 MemberName.ToString() is gone.
1430 2008-01-25 Marek Safar <marek.safar@gmail.com>
1432 * expression.cs: Implemented Divide, Equal, ExclusiveOr, GreaterThanOrEqual
1435 2008-01-25 Marek Safar <marek.safar@gmail.com>
1437 * generic.cs: Use full implicit conversion for type inference fixing.
1439 2008-01-24 Marek Safar <marek.safar@gmail.com>
1441 * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
1442 Fixed user operator conversions.
1444 2008-01-24 Marek Safar <marek.safar@gmail.com>
1446 * generic.cs: Do nullable type to null comparison optimization during
1449 2008-01-24 Marek Safar <marek.safar@gmail.com>
1451 A fix for bug #355163
1452 * generic.cs: Enabled l-value resolve on nullable expressions.
1454 2008-01-24 Marek Safar <marek.safar@gmail.com>
1456 A fix for bug #353986
1457 * class.cs: Ingore static ctors with parameters for any further checks.
1459 2008-01-24 Marek Safar <marek.safar@gmail.com>
1461 A fix for bug #354310
1462 * namespace.cs: Removed redundant check.
1464 2008-01-24 Marek Safar <marek.safar@gmail.com>
1466 A fix for bug #354928
1467 * expression.cs: ElementInitializers can be resolved only once.
1469 2008-01-24 Marek Safar <marek.safar@gmail.com>
1471 * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
1472 Condition expressions.
1474 2008-01-23 Marek Safar <marek.safar@gmail.com>
1476 * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
1478 2008-01-22 Marek Safar <marek.safar@gmail.com>
1480 * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
1483 * generic.cs: Implemented coalesce expression.
1485 2008-01-22 Marek Safar <marek.safar@gmail.com>
1487 A fix for bug #355145
1488 * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
1489 expression tree type inference.
1491 2008-01-22 Raja R Harinath <harinath@hurrynot.org>
1494 * expression.cs (Binary.IsUnsignedType): Fix typo.
1496 2008-01-22 Marek Safar <marek.safar@gmail.com>
1498 * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
1500 2008-01-22 Marek Safar <marek.safar@gmail.com>
1502 A fix for bug #355161
1503 * ecore.cs, expression.cs: Wider range of extension method supported
1506 2008-01-22 Gert Driesen <drieseng@users.sourceforge.net>
1508 * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
1509 AssemblyBuilder to operate in compiler context. Fixes mcs part of
1512 2008-01-22 Marek Safar <marek.safar@gmail.com>
1514 A fix for bug #355148
1515 * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
1517 2008-01-22 Miguel de Icaza <miguel@novell.com>
1519 * expression.cs (CreateExpressionTree): Add support for or and
1520 logical or, and indent following the coding conventions.
1522 * typemanager.cs (LinqExpression): renamed from
1523 ExpressionTreeManager, for a shorter name.
1525 Use TypeManager.CoreLookupType to lookup types from our core
1526 assemblies and turn those into "Type" variables.
1528 Consumers that previously used "Namespace" and "Type" from this
1529 class should instead use the TypeExpression which is a type that
1530 is fully resolved (without involving the regular C# resolution
1533 This typically looks like this:
1535 TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
1536 new MemberAccess (texpr, name, type_arguments, loc)
1538 This avoids the problem in: #355178
1540 2008-01-21 Marek Safar <marek.safar@gmail.com>
1542 * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
1543 feature in parser only as we do in other cases.
1545 2008-01-21 Marek Safar <marek.safar@gmail.com>
1547 * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
1548 typemanager.cs: A refactoring of params arguments to reuse existing
1549 expressions (params -> array initializer) to emit params argument instead
1550 of specialized handling.
1551 It was required by expression tree implementation and it has other benefits
1552 as well, we now apply same optimization for params arguments as we do for
1555 2008-01-18 Marek Safar <marek.safar@gmail.com>
1557 A fix for bug #353526
1558 * generic.cs: A type inference of params arguments may not required any
1559 temporary array creation.
1561 2008-01-18 Marek Safar <marek.safar@gmail.com>
1563 A fix for bug #353534
1564 * generic.cs, ecore.cs, expression.cs: A method group type inference is
1565 supported for delegates only.
1567 2008-01-18 Marek Safar <marek.safar@gmail.com>
1569 * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
1570 type for more than 1 candidates.
1572 2008-01-18 Marek Safar <marek.safar@gmail.com>
1574 * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
1577 2008-01-16 Marek Safar <marek.safar@gmail.com>
1579 * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
1580 expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
1581 operator) expressions.
1583 2008-01-16 Zoltan Varga <vargaz@gmail.com>
1585 * statement.cs: Avoid declaring an IL variable for this_variable since it is
1586 not accessed from the generated IL.
1588 2008-01-14 Marek Safar <marek.safar@gmail.com>
1590 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
1591 iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
1592 statement.cs: The first expression tree implementation drop, mostly
1593 infrastructure work.
1595 2008-01-14 Marek Safar <marek.safar@gmail.com>
1597 * ecore.cs (IsNestedChild): Refactored.
1599 2008-01-11 Marek Safar <marek.safar@gmail.com>
1601 * lambda.cs: Don't use a cast on unknown expression statement.
1603 2008-01-10 Geoff Norton <gnorton@novell.com>
1605 * cs-tokenizer.cs: One more token to distinguish between method and lambda
1608 2008-01-09 Marek Safar <marek.safar@gmail.com>
1610 * doc.cs: Report better /doc crash details.
1612 2008-01-09 Marek Safar <marek.safar@gmail.com>
1614 A fix for bug #352536
1615 * ecore.cs, assign.cs, codegen.cs: Check event assignments.
1617 2008-01-08 Marek Safar <marek.safar@gmail.com>
1619 A fix for bug #352287
1620 * ecore.cs, expression.cs: Do `this' access checking in all member access
1623 2008-01-08 Marek Safar <marek.safar@gmail.com>
1625 * rootcontext.cs, driver.cs: Switch to linq mode by default.
1627 * report.cs: Reset message stacks.
1629 2008-01-08 Marek Safar <marek.safar@gmail.com>
1631 * generic.cs (InferInPhases): Correctly calculate params position.
1633 2008-01-08 Marek Safar <marek.safar@gmail.com>
1635 * cs-tokenizer.cs: No need to parse full string when parsing lambda
1638 2008-01-07 Marek Safar <marek.safar@gmail.com>
1640 * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
1642 * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
1644 * driver.cs: Updated --help option.
1646 2008-01-07 Marek Safar <marek.safar@gmail.com>
1648 * generic.cs (InferParamsTypeArguments): Removed.
1649 (InferInPhases): Add params type inference.
1650 (LowerBoundInference): Fixed scoring mechanism.
1652 * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
1654 2008-01-06 Gert Driesen <drieseng@users.sourceforge.net>
1656 * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
1657 byte array for unsigned "baked" assemblies.
1659 2008-01-05 Gert Driesen <drieseng@users.sourceforge.net>
1661 * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
1662 array for assemblies that are not strongnamed.
1664 2008-01-04 Marek Safar <marek.safar@gmail.com>
1666 A fix for bug #351481
1667 * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
1668 declaring type for nested generic types.
1670 2008-01-04 Marek Safar <marek.safar@gmail.com>
1672 * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
1673 instead of ToString.
1675 2008-01-03 Marek Safar <marek.safar@gmail.com>
1677 A fix for bug #351047
1678 * expression.cs (Binary.ResolveOperator): Allow equality operators between
1679 null and structs only when equality and inequality operators are defined
1680 either as an user-operators or predefined operators.
1682 2008-01-03 Marek Safar <marek.safar@gmail.com>
1684 A fix for bug #351047
1685 * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
1687 2008-01-03 Marek Safar <marek.safar@gmail.com>
1689 A fix for bug #351257
1690 * cs-tokenizer.cs: Advance line number for '\r' correctly.
1692 2008-01-03 Marek Safar <marek.safar@gmail.com>
1694 A fix for bug #351157
1695 * class.cs (Using): Fixed yet another broken cloning.
1697 (Block): Put back more sensible default value for statements.
1699 2008-01-01 Gert Driesen <drieseng@users.sourceforge.net>
1701 * codegen.cs: Allow AssemblyVersion with only major version component.
1704 2007-12-29 Marek Safar <marek.safar@gmail.com>
1706 A fix for bug #324654
1707 * class.cs: Use FullName property as member name.
1709 2007-12-28 Marek Safar <marek.safar@gmail.com>
1711 A fix for bug #342117
1712 * generic.cs (ConstraintChecker): Struct constraint also satisfies default
1713 constructor constraint.
1715 2007-12-28 Marek Safar <marek.safar@gmail.com>
1717 A fix for bug #338273
1718 * class.cs (ProbertyBase): Access modifier checks are required for overrides
1721 2007-12-28 Marek Safar <marek.safar@gmail.com>
1723 A fix for bug #350839
1724 * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
1726 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
1728 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
1731 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
1733 * statement.cs: Changed some Hashtables to use HybridDictionaries
1734 instead. It was observed that some HashTables only contained a few
1735 items in the vast majority of cases. Since HybridDictionary is
1736 more efficient on small sets (<10 elements), "known_variables"
1737 from class ExplicitBlock as well as "labels" and "constants " from
1738 class Block were changed to HybridDictionaries.
1740 Atsai results: (56216kb->54987kb)
1742 Miguel results (bootstrap of mcs): 59819kb -> 59290kb
1745 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
1747 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
1750 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
1752 * expression.cs: foreach loop to for loop, saved on allocation of
1753 enumerator (59333kb->59141kb)
1755 * statement.cs. Changed foreach loops to for loops, saved on
1756 allocation of enumerator (59141kb->59006kb)
1758 * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
1759 when constructed with no specified capacity. This was causing a
1760 few ArrayLists to allocate more memory than they would potentially
1761 need in the Block class and MemberCache class. Setting the
1762 ArrayLists to construct with a capacity of 1 saves some
1763 memory. (56216kb->55585kb)
1765 2007-12-27 Marek Safar <marek.safar@gmail.com>
1767 A fix for bug #347189 (2nd issue)
1768 * expression.cs (MemberAccess): Nested type can be found in base non-generic
1771 2007-12-27 Miguel de Icaza <miguel@novell.com>
1773 * report.cs: Do not use colors if stdout and stderr are not a
1776 2007-12-27 Marek Safar <marek.safar@gmail.com>
1778 A fix for bug #346998
1779 * ecore.cs (MethodGroupExpr): Implemented override filter for generic
1782 2007-12-27 Marek Safar <marek.safar@gmail.com>
1784 A fix for bug #343465
1785 * class.cs: Explicit method name for nested types uses dots only.
1787 2007-12-27 Marek Safar <marek.safar@gmail.com>
1789 A fix for bug #343707
1790 * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
1792 2007-12-27 Marek Safar <marek.safar@gmail.com>
1794 * ecore.cs: Report type inference errors only when arguments count matches
1797 * generic.cs (NullCoalescingOperator): Cannot be applied to null.
1799 * expression.cs, report.cs: New warning.
1801 * typemanager.cs: Catch anonymous method type too.
1803 2007-12-23 Marek Safar <marek.safar@gmail.com>
1805 A fix for bug #346379
1806 * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
1808 2007-12-23 Marek Safar <marek.safar@gmail.com>
1810 A fix for bug #347359
1811 * expression.cs (Invocation): Don't resolve already resolved expression.
1813 2007-12-23 Marek Safar <marek.safar@gmail.com>
1815 A fix for bug #347189
1816 * class.cs (FixedField): Use non-dependent code only in the define phase.
1818 2007-12-23 Marek Safar <marek.safar@gmail.com>
1820 A fix for bug #348076
1821 * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
1823 2007-12-22 Marek Safar <marek.safar@gmail.com>
1825 * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
1826 discovered extension methods.
1828 2007-12-22 Marek Safar <marek.safar@gmail.com>
1830 * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
1833 2007-12-21 Miguel de Icaza <miguel@novell.com>
1835 * report.cs (ErrorMessage): Add support for using colors on
1836 terminals that support it.
1838 2007-12-21 Marek Safar <marek.safar@gmail.com>
1840 * ecore.cs: Use information about expanded params for error reporting.
1842 2007-12-21 Marek Safar <marek.safar@gmail.com>
1844 * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
1845 and logic for params overloads.
1847 2007-12-15 Miguel de Icaza <miguel@novell.com>
1849 * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
1850 as this is also created from the parser. Fixes #349034
1852 2007-12-12 Miguel de Icaza <miguel@novell.com>
1854 * statement.cs (Throw.CloneTo): it is valid to have empty
1855 expressions for throw.
1857 2007-12-03 Marek Safar <marek.safar@gmail.com>
1859 * cs-parser.jay: Set delegate constraint parsing region correctly.
1861 2007-12-03 Marek Safar <marek.safar@gmail.com>
1863 A fix for bug #345467
1864 * typemanager.cs (IsEqual): Compare generic parameters position only.
1866 2007-11-28 Marek Safar <marek.safar@gmail.com>
1868 * expression.cs (BaseAccess): Type arguments can be null.
1870 2007-11-27 Raja R Harinath <harinath@gmail.com>
1872 * statement.cs (Block.Resolve): Ensure flow-branching tree is
1873 consistent even when an error has occured.
1874 (Switch.Resolve): Likewise.
1876 2007-11-22 Marek Safar <marek.safar@gmail.com>
1878 A fix for bug #334505
1879 * class.cs: Don't ignore InternalsVisibleTo attribute for internal
1882 2007-11-22 Marek Safar <marek.safar@gmail.com>
1884 * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of
1885 refactorings required to resolve extension methods correctly when mixing
1886 generics and non-generics members.
1888 2007-11-20 Marek Safar <marek.safar@gmail.com>
1890 A fix for bug #342584
1891 * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
1894 2007-11-19 Marek Safar <marek.safar@gmail.com>
1896 A fix for bug #342512
1897 * delegate.cs: Use delegate argument expression when is available. Don't
1898 emit virtual call when class is sealed.
1900 2007-11-16 Marek Safar <marek.safar@gmail.com>
1902 A fix for bug #325423
1903 * assign.cs (FieldInitializer): Use resolved expression for emit.
1905 * class.cs: Print less confusing error message.
1907 2007-11-16 Marek Safar <marek.safar@gmail.com>
1909 * cs-tokenizer.cs: Removed GMCS ifdefs.
1911 * rootcontext.cs, report.cs: Report unavailable gmcs features used by
1914 * cs-parser.jay: Disabled nullable check.
1916 * generic-mcs: Copied more generic stuff.
1918 2007-11-16 Marek Safar <marek.safar@gmail.com>
1920 * gcs-parser.jay: Merged to cs-parser.jay.
1922 * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
1923 * *.csproj, *.sources: Updated to use only jay parser file.
1925 2007-11-16 Marek Safar <marek.safar@gmail.com>
1927 * gcs-parser.jay: Added nullable and default expression feature checks.
1929 2007-11-16 Marek Safar <marek.safar@gmail.com>
1931 * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing,
1932 it fixes many TODOs and hidden bugs.
1934 * expression: Removed duplicate error check.
1936 2007-11-15 Marek Safar <marek.safar@gmail.com>
1938 * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
1939 implicitly type local variable only when it is used in a declaration.
1941 2007-11-15 Marek Safar <marek.safar@gmail.com>
1943 * attribute.cs: Use CS0612 for empty strings.
1945 2007-11-14 Marek Safar <marek.safar@gmail.com>
1947 * lambda.cs, statement.cs: Contextual return may act as a statement.
1949 2007-11-14 Marek Safar <marek.safar@gmail.com>
1951 A fix for a regression cause by #324222
1952 * class.cs: Don't report unused even when it implements an interface.
1954 2007-11-13 Marek Safar <marek.safar@gmail.com>
1956 A fix for bug #341205
1957 * ecore.cs, expression.cs: Method group expression cannot do static
1958 method access with an instance reference check before overloading takes
1961 2007-11-13 Marek Safar <marek.safar@gmail.com>
1963 A fix for bug #325359
1964 * class.cs: Use predictable name for automatically generated property.
1966 2007-11-12 Marek Safar <marek.safar@gmail.com>
1968 A fix for bug #324996
1969 * expression.cs (Is): Handle case where D is nullable and T is not
1972 * generics.cs (Nullable.HasValue): Nullable HasValue expression.
1974 2007-11-12 Marek Safar <marek.safar@gmail.com>
1976 * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
1977 anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
1978 Flush small error reporting changes.
1980 2007-11-09 Marek Safar <marek.safar@gmail.com>
1982 A fix for bug #324996
1983 * expression.cs: Rewrote Is expression implementation to work with
1984 generics, nullable types, anonymous method. A const result expression
1985 uses existing infrastructure instead of custom not fully-featured one.
1987 2007-11-08 Marek Safar <marek.safar@gmail.com>
1989 A fix for bug #340202
1990 * class.cs: Consider generics for volatile field.
1992 2007-11-08 Marek Safar <marek.safar@gmail.com>
1994 A fix for bug #335594
1995 * expression.cs: Use conversion rules when handling string addition.
1997 2007-11-07 Marek Safar <marek.safar@gmail.com>
1999 A fix for bug #336651
2000 * expression.cs: Fixed a crash when probing is on.
2002 2007-11-07 Marek Safar <marek.safar@gmail.com>
2004 A fix for bug #324242
2005 * covert.cs: Added a conversion from any nullable-type with an
2006 underlying enum-type to the type System.Enum.
2008 2007-11-07 Marek Safar <marek.safar@gmail.com>
2010 A fix for bug #324222
2011 * class.cs: Report all non-used event fields.
2013 2007-11-07 Marek Safar <marek.safar@gmail.com>
2015 A fix for bug #325161
2016 * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
2017 qualifier for generic types.
2019 2007-11-07 Marek Safar <marek.safar@gmail.com>
2021 A fix for bug #322971
2022 * expression.cs, ecore.cs: Added intermediate result value check for
2025 2007-11-07 Marek Safar <marek.safar@gmail.com>
2027 A fix for bug #324754
2028 * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
2029 when it was requested.
2031 2007-11-07 Marek Safar <marek.safar@gmail.com>
2033 A fix for bug #325101
2034 * expression.cs: Do type not value comparison for `is' expression.
2036 2007-11-07 Marek Safar <marek.safar@gmail.com>
2038 A fix for bug #320236
2039 * convert.cs: Don't apply user conversion on underlying target type.
2041 2007-11-06 Marek Safar <marek.safar@gmail.com>
2043 * expression.cs: Don't use unresolved expression for error reporting.
2045 2007-11-06 Marek Safar <marek.safar@gmail.com>
2047 A fix for bugs #337712, #324490
2048 * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
2049 overloading resolution too.
2051 * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
2052 the process consistent and more robust.
2054 * expression.cs, linq.cs, report.cs: Update.
2056 2007-11-02 Marek Safar <marek.safar@gmail.com>
2058 A fix for bug #332909
2059 * attribute.cs: Resolve attributes in correct context using error
2062 * rootcontext.cs: Define Obsolete attribute members as core members.
2064 2007-11-02 Marek Safar <marek.safar@gmail.com>
2066 * statement.cs: Removed unused methods.
2068 2007-10-31 Wade Berrier <wberrier@novell.com>
2070 * Makefile: reenable copy of gmcs.exe.config, but include it in EXTRA
2071 DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
2074 2007-10-31 Marek Safar <marek.safar@gmail.com>
2076 A fix for bug #338102
2077 * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
2078 methods registered as non-generics.
2080 2007-10-31 Marek Safar <marek.safar@gmail.com>
2082 A fix for bugs #337712, #324490
2083 * delegate.cs: Delegate covariance and contravariance is not allowed for
2086 2007-10-31 Marek Safar <marek.safar@gmail.com>
2088 A fix for bug #337719
2089 * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
2092 2007-10-30 Marek Safar <marek.safar@gmail.com>
2094 * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
2096 2007-10-29 Marek Safar <marek.safar@gmail.com>
2098 * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
2101 2007-10-29 Raja R Harinath <rharinath@novell.com>
2103 * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
2105 2007-10-29 Marek Safar <marek.safar@gmail.com>
2107 A fix for bug #334652
2108 * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
2109 extension methods when we have not found the best candidate in normal
2112 2007-10-27 Marek Safar <marek.safar@gmail.com>
2114 * AssemblyInfo.cs: Keep up-to-date.
2116 2007-10-27 Marek Safar <marek.safar@gmail.com>
2118 * Makefile: Fixed generics compiler name.
2120 2007-10-27 Marek Safar <marek.safar@gmail.com>
2122 * lambda.test: removed, lambda parsing is done differently.
2124 * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
2126 2007-10-27 Gert Driesen <drieseng@users.sourceforge.net>
2128 * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
2130 2007-10-27 Marek Safar <marek.safar@gmail.com>
2132 * Makefile, *.sources : All C# compilers are in mcs folder.
2134 * *.cs: Use existing 2_1 define for smcs.
2136 2007-10-26 Marek Safar <marek.safar@gmail.com>
2138 A fix for bug #335847
2139 * assign.cs, expression.cs: Couple of changes to avoid creating a
2140 temporary variable for each object initializer assignment statement. It
2141 simplifies struct initialization too, otherwise two temporary variables
2143 Implemented optimization of redundant default element initializers.
2145 2007-10-25 Marek Safar <marek.safar@gmail.com>
2147 A fix for bug #336766
2148 * expression.cs (Class.CheckBase): Use generic name when method is
2151 2007-10-25 Marek Safar <marek.safar@gmail.com>
2153 A fix for bug #334737
2154 * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
2155 variable and not variable argument for prepared copies.
2157 2007-10-24 Marek Safar <marek.safar@gmail.com>
2159 A fix for bug #325110
2160 * class.cs, expression.cs, attribute.cs: Use open generic method when
2161 checking conditional attribute.
2163 2007-10-24 Marek Safar <marek.safar@gmail.com>
2165 * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs,
2166 expression.cs, statement.cs: Renamed method FeatureIsNotISO to
2167 FeatureIsNotAvailable.
2169 2007-10-24 Marek Safar <marek.safar@gmail.com>
2171 ** C# 3.0 Partial methods
2173 * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
2174 methods support. Because of member cache issue with generics only
2175 non-generics partial methods are fully supported.
2177 2007-10-23 Marek Safar <marek.safar@gmail.com>
2179 * class.cs, decl.cs: Rewrote member overloads check to cope with
2180 generics and to use member cache for member checking. It also improves
2181 performance and fixes remaining overloads issues.
2183 2007-10-20 Marek Safar <marek.safar@gmail.com>
2185 * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
2186 roottypes.cs, typemanager.cs:
2188 A member cache creation logic changed to add members immediately and
2189 not rely on fallback. The member cache is now only prefered way
2190 how to access and find type declaration members. It saves 5 MB of memory
2191 during MWF compilation and makes code ready for more optimizations and
2192 clean-ups, it's also a pre-requirement for partial methods.
2194 2007-10-18 Raja R Harinath <harinath@gmail.com>
2196 * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
2197 handling for generic parameters.
2199 2007-10-15 Marek Safar <marek.safar@gmail.com>
2201 * class.cs (FixedField): Removed redundant volatile check.
2203 2007-10-15 Marek Safar <marek.safar@gmail.com>
2205 * class.cs, decl.cs: Fixed overload members verification to do only one
2206 check per possible collision.
2208 2007-10-13 Marek Safar <marek.safar@gmail.com>
2210 A fix for bug #325478
2211 * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
2212 and create only one disposable flags container.
2214 2007-10-12 Marek Safar <marek.safar@gmail.com>
2216 A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
2217 * statement.cs (Fixed): Fixed variables cloning.
2219 2007-10-12 Marek Safar <marek.safar@gmail.com>
2221 A fix for bug #333342
2222 * class.cs (EventField): Don't mark value type event as synchronized.
2224 2007-10-12 Marek Safar <marek.safar@gmail.com>
2226 * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
2227 inference to identify best candidate method correctly.
2228 (ProperyExpr): A range variable is read only and cannot be modified.
2230 2007-10-11 Marek Safar <marek.safar@gmail.com>
2232 * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
2233 logic to identify best candidate method correctly.
2235 2007-10-11 Marek Safar <marek.safar@gmail.com>
2237 * location.cs (Equals, GetHashCode): Removed.
2239 2007-10-11 Marek Safar <marek.safar@gmail.com>
2241 * report.cs: Implemented message recorder. It is used mainly for lambda
2242 expressions to capture otherwise swallowed error messages.
2244 * anonymous.cs, lambda.cs.cs: Do full parameters check.
2246 * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
2248 (MethodGroupExpr.DoResolve): Use message recorder for error handling.
2250 * expression.cs (MemberAccess): Always report lookup failure.
2252 * location.cs: Implemented Equals, GetHashCode.
2254 * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
2256 2007-10-10 Jb Evain <jbevain@novell.com>
2258 * codegen.cs: re-enable assembly version check.
2260 2007-10-09 Marek Safar <marek.safar@gmail.com>
2262 * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
2265 * namespace.cs (UsingAlias): Do correct version check.
2267 2007-10-08 Marek Safar <marek.safar@gmail.com>
2269 * expresison.cs, ecore.cs: Issue extension method error message when
2272 * rootcontext.cs: Added ISO_2 compiler mode option.
2274 2007-10-08 Marek Safar <marek.safar@gmail.com>
2276 * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
2279 2007-10-08 Marek Safar <marek.safar@gmail.com>
2281 * attribute.cs (GetString, GetBoolean): Work with both literal and
2284 * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
2285 Moved method overload specific methods to MethodGroupExpr.
2287 (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
2288 it should be less memory consuming.
2290 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
2292 * codegen.cs: remove the assembly version check until the buildbot is
2295 2007-10-07 Jb Evain <jbevain@novell.com>
2297 * attribute.cs (Attribute.GetString): if the value
2298 expression is a StringConstant, return its string value.
2300 2007-10-07 Jb Evain <jbevain@novell.com>
2302 * typemanager.cs: add `assembly_version_attribute_type`.
2303 * codegen.cs: on attribute emission, check that the
2304 AssemblyVersionAttribute doesn't overflow.
2306 2007-10-05 Marek Safar <marek.safar@gmail.com>
2308 A fix for bug #324677
2309 * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
2310 parent container of a scope container with currently resolved one.
2312 2007-10-05 Marek Safar <marek.safar@gmail.com>
2314 A fix for bug #325534
2315 * class.cs (Invocation.DoResolve): Check invocation of object finalizer
2318 2007-10-05 Marek Safar <marek.safar@gmail.com>
2320 A fix for bug #327504
2321 * class.cs (Operator.Define): Refactored implicit and explicit user
2322 operator conversion rules.
2324 2007-10-05 Marek Safar <marek.safar@gmail.com>
2326 A fix for bug #327520
2327 * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
2329 2007-10-04 Marek Safar <marek.safar@gmail.com>
2331 A fix for bug #328022
2332 * class.cs (MethodData.Define): Use correct method to check whether
2333 a method implementents an accessor.
2335 2007-10-04 Marek Safar <marek.safar@gmail.com>
2337 A fix for bug #330069
2338 * statement.cs (Fixed.Resolve): Read the first array element only when
2339 an array is instantiated.
2341 2007-10-04 Marek Safar <marek.safar@gmail.com>
2343 * expression.cs, assign.cs, generics.cs: Print correct operator when
2344 compound assignment is used.
2346 2007-10-04 Marek Safar <marek.safar@gmail.com>
2348 A fix for bug #325841
2349 * expression.cs (ArrayAccess): Use full argument cloning only for
2350 string compound concatenation.
2352 2007-10-03 Marek Safar <marek.safar@gmail.com>
2354 A fix for bug #328774
2355 * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
2357 (PropertyExpr.EmitAssign): Fixed string concatenation compound
2360 2007-10-03 Raja R Harinath <rharinath@novell.com>
2363 * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
2364 Event accessibility checks here. Remove some bogus code that
2365 accidently made GenericMethods work.
2366 (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
2368 2007-09-25 Marek Safar <marek.safar@gmail.com>
2370 * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
2372 * statement.cs (Block): Refactored AddVariable to allow error handling
2375 * generic.cs: New stub.
2377 2007-09-23 Marek Safar <marek.safar@gmail.com>
2379 * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
2382 2007-09-17 Marek Safar <marek.safar@gmail.com>
2384 * class.cs: Use partial container to record whether any partial part
2385 contains static field initializer and therefore default contructor has
2388 2007-09-14 Marek Safar <marek.safar@gmail.com>
2390 * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
2391 mono-list when only one of two partial parts has defined accessibility
2394 2007-09-14 Marek Safar <marek.safar@gmail.com>
2396 A fix for bug #82845
2398 * class.cs (TypeContainer): Set correct resolve context for all field
2401 2007-09-13 Marek Safar <marek.safar@gmail.com>
2403 * assign.cs: Fixed a crash when field is resolved twice with an error.
2405 * codegen.cs: Changed InFieldInitializer to be flag.
2407 * anonymous.cs, ecore.cs, expression.cs: Update after
2408 IsInFieldInitializer rename.
2410 * const.cs: Removed unused parameter.
2412 * class.cs: Changed the way how we resolve and emit field initializers.
2413 The field initilizers have to have access to contructor block to emit
2414 compiler generated code.
2416 2007-09-13 Marek Safar <marek.safar@gmail.com>
2418 * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
2419 generics use TypeContainer instead.
2421 2007-09-12 Marek Safar <marek.safar@gmail.com>
2423 * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
2425 * lambda.cs (ResolveParameters): Use more powerful
2426 InflateGenericArgument.
2428 * parameters.cs: Better exception message.
2430 2007-09-10 Marek Safar <marek.safar@gmail.com>
2432 * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
2433 correct expression block type.
2435 * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
2437 * expression.cs (Invocation): Extracted method group resolve to
2440 2007-09-07 Marek Safar <marek.safar@gmail.com>
2442 * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
2443 (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
2445 * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
2446 generic extension methods.
2448 2007-09-06 Marek Safar <marek.safar@gmail.com>
2450 A fix for bug #82676 (Do I get it right now?)
2451 * convert.cs (Binary.ResolveOperator): An interface is converted to the
2452 object before a standard conversion is applied.
2454 2007-09-06 Marek Safar <marek.safar@gmail.com>
2456 * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
2459 2007-09-05 Marek Safar <marek.safar@gmail.com>
2461 A fix for bug #82676
2462 * convert.cs (ImplicitReferenceConversionCore): Check both sides for
2463 non-generic interface types.
2465 2007-09-05 Marek Safar <marek.safar@gmail.com>
2467 A fix for bug #82690
2468 * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
2470 2007-09-05 Marek Safar <marek.safar@gmail.com>
2472 A fix for bug #82571
2473 * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal
2474 modifier for container based methods.
2476 2007-09-05 Marek Safar <marek.safar@gmail.com>
2478 A fix for bug #82676
2479 * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
2480 any interface-type T means to any of interface type T.
2482 2007-09-04 Marek Safar <marek.safar@gmail.com>
2484 * namespace.cs: We have 2 versions of System.Core assembly.
2486 2007-09-04 Marek Safar <marek.safar@gmail.com>
2488 A fix for bug #82652
2489 * class.cs (Class.GetClassBases): Compare types and not expressions.
2491 2007-09-04 Marek Safar <marek.safar@gmail.com>
2493 A fix for bug #82620
2494 * expression.cs (Invocation.EmitArguments): Duplicate params arguments
2495 actually never worked before.
2496 (IndexerAccess): Emit prepared arguments before they are modified.
2498 2007-09-04 Marek Safar <marek.safar@gmail.com>
2500 A fix for bug #82563
2501 * assign.cs: Revert wrong fix.
2503 * expression.cs (VariableReference.EmitAssign): Handle ref reference
2505 (ArrayAccess): Changed the way we emit compound (prepared) assignments.
2506 Instead of ldelema/stdind we have to use temporary variables to handle
2507 cases like String.Concat (params string[]).
2509 2007-08-31 Marek Safar <marek.safar@gmail.com>
2511 * class.cs: EmitAttributes to Emit rename.
2513 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
2515 (MemberCore.HasClsCompliantAttribute): Don't depend on
2516 GetClsCompliantAttributeValue execution.
2518 2007-08-31 Marek Safar <marek.safar@gmail.com>
2520 * anonymous.cs: Use shorter type prefix.
2522 * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
2525 * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
2526 variables when probing is on.
2528 * statement.cs (LocaLInfo.Clone): Clone correctly resolved and
2529 unresolved variables.
2530 (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
2531 handle transparent identifiers.
2533 2007-08-26 Marek Safar <marek.safar@gmail.com>
2535 * attribute.cs (IsClsCompliant): Add nullable types test.
2537 2007-08-24 Atsushi Enomoto <atsushi@ximian.com>
2539 * doc.cs : catch other types of exception than XmlException to
2540 report CS1570. Fixed bug #82565.
2542 2007-08-23 Marek Safar <marek.safar@gmail.com>
2544 * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference):
2545 The number of delegate parameters has to match.
2546 (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
2549 2007-08-21 Marek Safar <marek.safar@gmail.com>
2551 * anonymous.cs (AnonymousMethod): Generate private anonymous method
2552 to fix problem with private arguments.
2554 2007-08-20 Marek Safar <marek.safar@gmail.com>
2556 * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
2558 * decl.cs (MemberName): Ignore generic type with no generic arguments.
2560 * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
2561 empty. Add cloning suport.
2563 * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
2565 2007-08-20 Marek Safar <marek.safar@gmail.com>
2567 * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method
2568 to create EmptyCast. It handles EmptyConstantCast specialization for
2571 2007-08-18 Marek Safar <marek.safar@gmail.com>
2573 * expression.cs (Binary.is_unsigned): Handle unsafe types too.
2574 (EmitArrayArgument): One routine for array arguments.
2575 (ArrayCreation.MakeByteBlob): Fixed an array alignment.
2577 2007-08-17 Marek Safar <marek.safar@gmail.com>
2579 * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
2581 2007-08-17 Marek Safar <marek.safar@gmail.com>
2583 * anonymous.cs: MemberLookupFinal update.
2585 * class.cs (ConstructorInitializer): Is expression based.
2587 * delegate.cs: MethodGroupExpr update.
2589 * ecore.cs (Error_MemberLookupFailed): Improved to report better error
2591 (Error_MemberLookupFailed): Customizable error override.
2592 (MethodGroupExpr): Keep queried type for later usage.
2593 (MethodGroupExpr.OverloadResolve): Catch errors related to overload
2596 * expression.cs: Error_MemberLookupFailed refactoring.
2597 (New.DoResolve): Resolve as much as possible.
2598 (ElementInitializer.Error_MemberLookupFailed): Object initializer
2599 customization for invalid member types.
2601 * statement.cs: MethodGroupExpr update.
2603 2007-08-16 Marek Safar <marek.safar@gmail.com>
2605 * modifier.cs (Check): Check all modifiers and not only accessibility
2608 2007-08-16 Marek Safar <marek.safar@gmail.com>
2610 * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
2611 type and not an expression.
2613 2007-08-16 Marek Safar <marek.safar@gmail.com>
2615 * statement.cs (Catch.Clone): Type and variable can be null.
2617 2007-08-16 Marek Safar <marek.safar@gmail.com>
2619 A fix for bug #81979
2620 * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
2621 I am really not sure whether this is the best fix.
2623 * expression.cs (VariableReference.EmitAssign): Do prepare_load test
2626 2007-08-14 Marek Safar <marek.safar@gmail.com>
2628 ** C# 3.0 Object and collection initializers (major re-write)
2630 * assign.cs (DoResolve): Initializers are not assign related.
2632 * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
2633 used during collection or object initialization.
2635 * expression.cs (Error_InvalidArguments): Add initializers specific
2636 messages. More will come later because it requires some general
2638 (New.DoResolve): Better error handling for unsafe types.
2639 (EmptyExpressionStatement): New class.
2640 (ElementInitializer): An object initializer expression.
2641 (CollectionElementInitializer): A collection initializer expression.
2642 (CollectionOrObjectInitializers): A block of object or collection
2644 (NewInitialize): New expression with element/object initializers.
2646 * statement.cs: Reverted object/collection initializer hacks.
2648 * typemanager.cs (CSharpName): Filter __arglist type.
2650 2007-08-09 Marek Safar <marek.safar@gmail.com>
2652 ** C# 3.0 Anonymous Types (update to the latest standard)
2654 * expression.cs (Binary.ResolveOperator): Threat all null based types
2656 (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
2657 (AnonymousTypeParameter): Updated.
2659 * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
2660 (AnonymousTypeClass): New anonymous type container.
2662 * class.cs (AddField): Return operation result.
2664 * generic.cs: Another empty TypeArguments overload.
2666 * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
2667 are stored at top of normal hierarchy.
2669 * typemanager.cs (CSharpName): Filter anonymous types.
2671 2007-08-09 Marek Safar <marek.safar@gmail.com>
2673 * expression.cs (StringConcat.Append): Handle 3 and more concatenation
2674 as single Concat call. How could we miss that :-(
2676 2007-08-08 Marek Safar <marek.safar@gmail.com>
2678 * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
2680 2007-08-07 Miguel de Icaza <miguel@novell.com>
2682 * expression.cs: Fix the previous commit, the creation of the
2683 arguments array list needs also to be conditional on the arguments
2686 * class.cs: Add a little bit of help to help narrow down problems.
2688 * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
2689 not try to copy in that case.
2691 * driver.cs: When building SMCS, include a new different set of
2692 default assemblies here. Do this here so we can control whether
2693 to include the default assemblies with /noconfig.
2695 2007-08-03 Marek Safar <marek.safar@gmail.com>
2697 A fix for bug #81979
2698 * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
2701 2007-08-03 Marek Safar <marek.safar@gmail.com>
2703 A fix for bug #82300
2705 * anonymous.cs (AnonymousContainer.Define): Don't define anything when
2706 we are in probing scope.
2708 2007-08-03 Marek Safar <marek.safar@gmail.com>
2710 A fix for bug #82301
2712 * statement.cs (Catch.CloneTo): Clone blocks in the right order.
2713 (Statement.CloneTo): Clone and not map children blocks.
2715 2007-08-03 Marek Safar <marek.safar@gmail.com>
2717 A fix for bug #82299
2719 * expression.cs (LocalVariableReference.CloneTo): Remap local info
2722 * statement.cs (Statement.CloneTo): Clone variables before statements
2723 to allow remaping of local variables.
2725 2007-08-03 Marek Safar <marek.safar@gmail.com>
2727 A fix for bug #82296
2730 * report.cs: Log crash details for future clone problems.
2732 * statement.cs (Return.Clone): Don't clone non-existent expression.
2734 2007-08-03 Raja R Harinath <harinath@gmail.com>
2736 * class.cs (TypeContainer.AddBasesForPart): Make virtual.
2737 (Class.AddBasesForPart): Move CS0537 check here from ...
2738 * cs-parser.jay (class_declaration): ... here. Move calling of
2739 'AddBasesForPart' to ...
2740 (class_bases): ... here.
2741 (struct_declaration, interface_declaration): Update to changes.
2743 2007-08-02 Marek Safar <marek.safar@gmail.com>
2745 A fix for bug #81923
2747 * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
2748 conversion is allowed.
2750 2007-08-02 Marek Safar <marek.safar@gmail.com>
2752 A fix for bug #81564
2754 * ecore.cs (EventExpr): Add IsBase handling.
2756 * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
2759 2007-08-02 Raja R Harinath <harinath@gmail.com>
2761 Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
2762 * cs-parser.jay: Some whitespace cleanups.
2763 (current_delegate): New.
2765 (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
2766 a dummy code block, and use 'type_name' instead of 'member_name'.
2767 (interface_declaration, class_declaration): Likewise.
2768 (delegate_declaration): Likewise. Rearrange slightly and use
2770 * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
2771 (GetKeyword): Update to change. Use '!foo' instead of 'foo == false'.
2773 2007-08-02 Marek Safar <marek.safar@gmail.com>
2775 A fix for bug #82039
2777 * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
2780 * typemanager.cs (CSharpName): Split to string overload.
2782 2007-08-02 Marek Safar <marek.safar@gmail.com>
2785 * report.cs: Updated warning CS0472.
2787 2007-08-01 Marek Safar <marek.safar@gmail.com>
2789 A fix for bug #82181
2791 * cs-tokenizer.cs: Ignore partial keyword inside block expression.
2793 2007-08-01 Marek Safar <marek.safar@gmail.com>
2795 A fix for bug #82277
2796 * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
2798 2007-08-01 Marek Safar <marek.safar@gmail.com>
2800 ** C# 3.0 Type Inference (major bits are working)
2802 * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
2803 (.ImplicitStandardConversionExists): Uses compatible.
2804 (.ExplicitTypeInference): Infers type arguments based on explicit arguments
2805 (.InferReturnType): New method.
2806 (.Compatible): Refactored.
2807 (.ResolveParameters): Uses factory to create resolved parameters.
2808 (.CompatibleMethod): Add probing mode support.
2809 (AnonymousContainer): Removed unused fields. Split Define and Resolve to
2810 clearly distinguish between 2 different operations.
2811 (LambdaMethod): Moved to lambda.cs.
2812 (AnonymousMethod): Removed unused fields and methods.
2813 (AnonymousDelegate): Simplified.
2815 * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
2817 * convert. cs (ImplicitConversionStandard): Compatible works differently.
2819 * delegate.cs (Delegate): New mehods to reduce code duplication.
2820 (.GetConstructor): New method.
2821 (.GetInvokeMethod): New method.
2822 (DelegateCreation): Updated.
2824 * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
2826 (OverloadResolve): Made probing little bit faster.
2828 * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
2831 * generic.cs (TypeInferenceContext): Dummy implementation.
2833 * iterators.cs: Updated after Resolve/Define rename.
2835 * lambda.cs (LambdaExpression)
2836 (.ResolveParameters): Handles both type of arguments and type inference too.
2838 * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
2839 (InflateTypes): Updated.
2841 * support.cs (InflateTypes): Changed signature and updated.
2843 * typemanager.cs (LookupMemberCache): Better dynamic type check.
2844 (MemberLookup_FindMembers): More MS tricks.
2845 (GetParameterData): Ditto.
2846 (GetDelegateParameters): Uses quick path for dynamic types.
2848 2007-08-01 Marek Safar <marek.safar@gmail.com>
2850 * class.cs (MethodData.Define): EmitContext is required for generic stuff
2853 2007-07-31 Marek Safar <marek.safar@gmail.com>
2855 * statement.cs (ProcessParameters): Don't crash when parameters have wrong
2858 2007-07-26 Jb Evain <jbevain@novell.com>
2860 * typemanager.cs (TypeManager.GetConstructor): Add a method overload
2861 which takes a boolean 'report_errors', similar to the GetMethod.
2862 (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
2863 in .net 2.1, do not report errors here.
2865 * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
2866 System.Runtime.CompilerServices.RequiredAttributeAttribute and
2867 System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
2870 * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
2871 of the type InternalsVisibleToAttribute before the first call
2872 to CoreLookupType which is allowed to fail (third boolean parameter
2873 to true). Because, during the resolution for a type that is not
2874 immediately found, we try to check if the type is not defined in
2875 a friend assembly, and to do so, we need the
2876 InternalVisibleToAttribute.
2878 2007-07-23 Miguel de Icaza <miguel@novell.com>
2880 * expression.cs (Binary): Add support for the brain-dead CSC 2.x
2881 feature that allows structs to be compared against null and inline
2882 the result as true or false.
2884 Notice that the same code is not permitted inside a generic block
2885 of code that would do:
2887 class Foo<T> where T : struct {
2894 It is only allowed if the type of T is not bound (no where
2895 clause). In my opinion, this CSC 2 behavior is broken but people
2896 seem to be using it (IronRuby does, a few bug reports on bugzilla
2897 have it and some people have complained about it).
2899 All of the users that depend on this behavior have code that is
2902 * report.cs (Warning, Error): make these take object arguments,
2903 not strings, as that allows us to take advantage of Format.
2905 2007-07-20 William Holmes <billholmes54@gmail.com>
2907 * decl.cs: Changed MemberName.CountTypeArguments to also check the
2908 Left member variable for the Count.
2909 * doc.cs: Changed DocUtil.GetMethodDocCommentName to call
2910 MemberName.CountTypeArguments to avoid a NRE.
2912 This code is contributed under the MIT X11 license
2914 2007-07-18 Marek Safar <marek.safar@gmail.com>
2916 * cs-tokenizer.cs: Improved lambda parsing and removed old code.
2918 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
2920 * doc.cs : generic method arguments are written as ``x while generic
2921 type arguments are `x. Combined with the previous change, fixed bug
2924 2007-07-18 Raja R Harinath <rharinath@novell.com>
2927 * expression.cs (Binary.ResolveOperator): When converting
2928 'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
2930 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
2932 * doc.cs : when T: or whatever x: is specified, it does not really
2933 check the doc comment's syntax correctness. Fixed bug #82006.
2935 2007-07-18 Marek Safar <marek.safar@gmail.com>
2937 * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
2938 LambdaExpression better.
2940 * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
2942 * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
2944 * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
2945 as it can be generated.
2947 * expression.cs (Invocation.Error_InvalidArguments): Show correct
2950 * lambda.cs (LambdaExpression): Refactored to share same code with
2951 AnonymousMethodExpression.
2953 2007-07-17 Marek Safar <marek.safar@gmail.com>
2955 * anonymous.cs (MakeName): Include host name for easier debugging.
2956 (LambdaMethod): New class for lambda spcecific stuff.
2958 * attribute.cs: Set EmitContext return type.
2960 * class.cs: Set EmitContext return type.
2962 * codegen.cs (EmitContext): Return type cannot be null to stop messing
2963 with null/void meaning.
2965 * iterators.cs (ContainerType): Implemented.
2967 * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
2969 * statement.cs (Return): Updated to lambda expressions.
2970 (Block.CloneTo): Parent can be null.
2972 2007-07-13 Marek Safar <marek.safar@gmail.com>
2974 A fix for bug #81917
2975 * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
2977 * class.cs (FixedField): Check whether field is in unsafe scope.
2979 * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
2980 (FieldExpr.Emit): Fixed buffers cannot be volatile.
2982 * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
2985 * statement.cs (Fixed.Resolve): Simplified fixed buffers.
2987 2007-07-13 Marek Safar <marek.safar@gmail.com>
2989 * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
2990 rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
2993 2007-07-13 Marek Safar <marek.safar@gmail.com>
2995 * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
2997 2007-07-13 Marek Safar <marek.safar@gmail.com>
2999 * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
3000 (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
3002 * codegen.cs(EmitContext): Add ProbingMode flag.
3004 * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
3006 * driver.cs: For now set both warning values.
3008 * ecore.cs (SimpleName): Name is readonly.
3009 (MethodGroup.OverloadResolve): One quick path for probing.
3011 * expression.cs (Unary): Set Oper r/o.
3012 (Binary): Set Oper r/o.
3013 (ParameterReference): Set few instance variables as r/o.
3014 (ParameterReference.DoResolveBase): Don't capture aruments when
3016 (Invocation.CloneTo): Fixed typo, looks easy, yeah.
3017 (Arglist): arguments are private.
3018 (SizeOf): type is private and r/o.
3019 (MemberAccess): arguments are private.
3021 * report.cs: Enhanced reporting on/off capabilities.
3023 * lambda.cs: Uses ec.IsInProbingMode.
3024 (ContextualReturn): Derives from return.
3026 * rootcontext.cs: For now set both warning values.
3028 * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
3030 (Return.Resolve): Don't die immediately.
3031 (Block.Resolve): Speed-up probing.
3032 (Block.CloneTo): Clone only child blocks.
3034 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
3036 * iterators.cs: reverted Miguel's latest change (r81925) as it
3037 breaks the build in System.
3039 2007-07-13 Miguel de Icaza <miguel@novell.com>
3041 * iterators.cs (Yield.CheckContext): Check for the iterator type
3042 also here as we can call into Yield even in codepaths that are not
3044 (MethodOrOperator is the only path that was checked).
3046 In addition to the standard check, use a more specific check for
3047 constructors to report a more verbose error.
3049 2007-07-12 Miguel de Icaza <miguel@novell.com>
3051 * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
3052 report the warning and continue
3054 * statement.cs (Using.EmitLocalVariableDecls): We were leaving
3055 values on the stack on the call to Emit. Use EmitStatement if
3056 possible, or using Emit + Pop if not possible. Fixes #82064
3058 2007-07-12 Raja R Harinath <rharinath@novell.com>
3060 * expression.cs (Invocation.IsApplicable): Reorganize slightly to
3061 avoid try...finally in some cases.
3063 2007-07-10 Marek Safar <marek.safar@gmail.com>
3065 * attribute.cs (Attribute.ResolveConstructor): Uses method group.
3067 * class.cs (ConstructorInitializer.Resolve): Use and keep method group
3068 instead of method. Re-use standard error handling.
3069 (ConstructorInitializer.Emit): Simplified.
3071 * delegate.cs: Updated after Invocation.EmitCall change.
3073 * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
3074 (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
3075 (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
3076 method and don't permanently changing input arguments.
3077 (MethodGroupExpr): Introduced resolved best_candidate, when method group
3078 is resolved it has one of the candidates is the best one which is later
3079 used to emit. Removed a few unused method.
3080 (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
3082 * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
3083 (Binary.ResolveOperator): Ditto.
3084 (ConditionalLogicalOperator.DoResolve): Ditto.
3085 (Invocation): Uses method group.
3086 (Invocation.DoResolve): Simplified.
3087 (Invocation.EmitCall): Removed useless is_static.
3088 (Invocation.Emit): Delegate to method group.
3089 (Invocation.EmitStatement): Simplified.
3090 (New): Uses method group.
3091 (MemberAccess.DoResolve): Don't destroy original expression.
3093 * statement.cs (ForEach.Resolve): Use null for no method arguments.
3095 2007-07-04 Marek Safar <marek.safar@gmail.com>
3097 * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
3100 * lambda.cs: Add custom error message type.
3102 2007-07-03 Marek Safar <marek.safar@gmail.com>
3104 * lambda.cs: Simplified little bit.
3106 * parameter.cs: Introduced ImplicitLambdaParameter.
3107 (Parameters.CreateFullyResolved): New factory instead of ctor.
3111 * delegate.cs: Updated parameter creation.
3113 2007-07-03 Marek Safar <marek.safar@gmail.com>
3115 * ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
3118 * generic.cs: Synchronized with gmcs.
3120 2007-07-03 Marek Safar <marek.safar@gmail.com>
3122 * class.cs (Indexer): Check return type as soon as possible.
3124 * cs-parser.jay: Initialize implicit_value_parameter_type for interface
3127 * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
3129 * expression.cs (Invocation.Error_InvalidArguments): Show type only.
3131 * parameter.cs (Parameter): Use expression type when it is available.
3133 * support.cs (ReflectionParameters.ParameterDesc): Show an extension
3134 method modifier for the first parameter only.
3136 2007-06-24 Marek Safar <marek.safar@gmail.com>
3138 A fix for bug #81938
3139 * typemanager.cs (ChangeType): Fixed couple of char conversions.
3141 * constant.cs: Tide up an exception message.
3143 2007-06-22 Marek Safar <marek.safar@gmail.com>
3145 * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
3146 an uninitialized variable is used.
3148 * expression.cs (LocalVariableReference.DoResolve): Ditto.
3150 2007-06-22 Marek Safar <marek.safar@gmail.com>
3152 * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
3153 not found error handling.
3155 * expression.cs (ArrayCreation): Removed redundant fields and little bit
3157 (ArrayCreation.ResolveArrayElement): To be ready to customization.
3158 (ArrayCreation.DoResolve): Simplified.
3159 (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
3160 its own resolve process.
3161 (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
3163 2007-06-20 Marek Safar <marek.safar@gmail.com>
3165 * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
3168 2007-06-20 Marek Safar <marek.safar@gmail.com>
3170 * cs-tokenizer.cs: Removed var related stuff.
3172 * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
3173 (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
3174 a type and a keyword at same time.
3176 * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
3179 * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
3180 implicitly typed arrays, more changes will follow.
3182 * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
3184 2007-06-19 Marek Safar <marek.safar@gmail.com>
3186 * ecore.cs (VarExpr): Removed Handled field.
3188 * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
3189 build-in assign functionality.
3190 (ForEach.Resolve): Removed all implicitly typed local variable code and
3192 (ArrayForeach.Resolve): Infer implicitly typed local variable here.
3193 (CollectionForeach.Resolve): Infer implicitly typed local variable here.
3195 2007-06-18 Marek Safar <marek.safar@gmail.com>
3197 * assign.cs: Removed implicitly typed local variable check.
3199 * expression.cs (LocalVariableReference.DoResolve): Add check for self
3200 referencing implicitly typed local variable.
3201 (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
3204 * statement.cs (Fixed): Removed unsupported implicitly typed local
3207 2007-06-15 Marek Safar <marek.safar@gmail.com>
3209 * decl.cs (MemberName): Moved all Unbound stuff to parser.
3211 2007-06-14 Marek Safar <marek.safar@gmail.com>
3213 A fix for bugs #81855 and #76274
3214 * attribute.cs (AttachTo): Always set owner for global attributes to
3217 * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
3220 * cs-parser.jay: Assembly and module attributes must precede all other
3221 elements except using clauses and extern alias declarations.
3223 2007-06-13 Marek Safar <marek.safar@gmail.com>
3225 A fix for bug #81748
3227 * expression.cs: More checks for non ISO-1 features.
3229 2007-06-12 Marek Safar <marek.safar@gmail.com>
3231 A fix for bug #81807
3232 * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
3233 present inside switch statement and it is required by nullable check.
3235 2007-06-12 Marek Safar <marek.safar@gmail.com>
3237 A fix for bug #81840
3238 * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
3239 when type matching fails.
3241 * namespace.cs: Tiny error message change.
3243 2007-06-12 Marek Safar <marek.safar@gmail.com>
3245 * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
3246 reporting. Added automatic property check.
3248 * class.cs: Updated after CheckAbstractAndExtern relocation.
3249 (AEventPropertyAccessor.GetSignatureForError): Customized.
3251 2007-06-11 Marek Safar <marek.safar@gmail.com>
3253 * class.cs (DefineBaseTypes): Base type can be undefined.
3255 * ecore.cs (TypeLookup): Minor refactoring.
3256 (DoResolveAsTypeStep): Removed redundant check.
3258 * namespace.cs (Lookup): Removed redundant check.
3260 * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal
3261 ResolveAsTypeTerminal step.
3262 (BootstrapCorlib_*): Simplified.
3263 (PopulateCoreType): Core types can be now external.
3265 2007-06-07 Marek Safar <marek.safar@gmail.com>
3267 * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
3269 (InferTypeArguments): Infers anonymous expression type arguments.
3270 (Compatible): Split to Compatible and InferTypeArguments.
3272 * lambda.cs: Updated.
3274 2007-06-08 Marek Safar <marek.safar@gmail.com>
3276 * anonymous.cs (AnonymousContainer): Marked as compiler generated.
3278 2007-06-07 Raja R Harinath <harinath@gmail.com>
3280 Fix #80477, cs0135-2.cs, cs0135-3.cs
3281 * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
3282 names to the "known" variables list.
3283 (Block.CheckInvariantMeaningInBlock): Handle the fact the
3284 parameter names are also "known".
3285 (Block.CheckError136): Remove.
3286 (ExplicitBlock.CloneTo): New. Set 'known_variables' in target to
3289 2007-06-07 Marek Safar <marek.safar@gmail.com>
3291 * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
3293 2007-06-06 Marek Safar <marek.safar@gmail.com>
3295 * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
3296 internal error not an user error.
3298 * expression.cs (IsApplicable): Refactored to make debugging easier.
3300 * support.cs: More tricks for non-mono runtimes.
3302 * typemanager.cs (CoreLookupType): Made public.
3303 (InitSystemCore): All linq specific stuff moved to linq.cs
3305 2007-06-05 Marek Safar <marek.safar@gmail.com>
3307 * typemanager.cs (CSharpSignature): One more missing build-in types
3309 More tricks for non-mono runtime.
3311 2007-06-05 Raja R Harinath <harinath@gmail.com>
3313 * statement.cs (Block.CheckError136_InParents): Remove.
3314 (Block.AddVariable): Use GetParameterInfo instead.
3315 (ToplevelBlock.ProcessArguments): Likewise.
3317 2007-06-04 Raja R Harinath <rharinath@novell.com>
3319 * statement.cs (ToplevelBlock.CloneTo): New. Copy over parameter
3321 (ToplevelBlock.GetParameterInfo): Split out of ...
3322 (ToplevelBlock.GetParameterRefernce): ... this.
3323 (ToplevelBlock.ParameterMap): Remove.
3324 * expression.cs (ParameterReference): Update to use
3325 ToplevelParameterInfo.
3327 * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
3330 * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
3331 * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
3333 * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
3334 (ToplevelBlock.ProcessParameters) ... here.
3335 (ToplevelBlock..ctor): Invoke it.
3337 * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
3340 * statement.cs (IKnownVariable): New interface.
3341 (LocalInfo): Implement it.
3342 (ToplevelParameterInfo): New class.
3343 (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
3344 (ExplicitBlock.GetKnownVariable): Likewise. Rename from
3345 GetKnownVariableInfo.
3347 2007-06-03 Raja R Harinath <harinath@gmail.com>
3349 Partly speed up CS0136 error checks.
3350 * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
3351 'recurse' parameter.
3352 (Block.DoCheckError136): Only check errors in parameters. Move
3353 local variable checks ...
3354 (Block.AddVariable): ... here, and ...
3355 (ToplevelBlock.ResolveMeta): ... here.
3357 2007-06-02 Raja R Harinath <harinath@gmail.com>
3359 * statement.cs (Block.IsChildOf): Remove.
3361 * statement.cs (Statement.Clone): Move special case code ...
3362 (Block.CloneTo): ... here.
3364 2007-05-29 Raja R Harinath <rharinath@novell.com>
3366 * statement.cs (ToplevelBlock.container): Remove field. It's
3367 redundant with 'Parent'.
3368 (ToplevelBlock.ContainerBlock): Remove accessor.
3369 (ToplevelBlock..ctor): Update to changes. Register anonymous
3370 child with parent here, ...
3371 * cs-parser.jay (end_anonymous): ... not here. Don't modify
3373 (start_anonymous): Don't save current_block.
3374 (top_current_block): Remove.
3376 * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
3377 (Block.Resolve): Update to changes.
3378 (Block..ctor): Move setting of "correct" 'Toplevel'
3379 and 'Explicit' fields to ...
3380 (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
3382 2007-05-27 Raja R Harinath <harinath@gmail.com>
3385 * statement.cs (Block.Implicit): Remove.
3386 (Block): Update to changes.
3387 * flowanalysis.cs: Likewise.
3389 Mildly speed up CheckInvariantMeaningInBlock
3390 * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
3391 Recursively call AddKnownVariable to all enclosing blocks.
3392 (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
3393 Remove recursive calls.
3394 (Block): Update to changes.
3396 New ExplicitBlock invariants
3397 * statement.cs (Block.Explicit): New field. It points to the
3398 immediately enclosing non-implicit block.
3399 (Block..ctor): Maintain the invariant.
3400 * cs-parser.jay: Take advantage of invariant.
3402 Introduce ExplicitBlock
3403 * statement.cs (ExplicitBlock): New.
3404 (ToplevelBlock): Derive from it.
3405 (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
3407 (Block.Implicit): Update to changes.
3408 * cs-parser.jay: Update to changes.
3411 * codegen.cs (EmitContext.IsLastStatement): Remove.
3412 * statement.cs (Block.DoEmit): Update to changes.
3414 2007-05-25 Raja R Harinath <rharinath@novell.com>
3416 * cs-parser.jay: Use 'start_block' and 'end_block' rather than
3417 modifying current_block directly.
3419 2007-05-23 Scott Peterson <lunchtimemama@gmail.com>
3421 * class.cs: Implemented automatic properties (C# 3.0)
3422 Thanks to Marek for the help.
3424 2007-05-23 Raja R Harinath <rharinath@novell.com>
3426 * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
3427 variable as assigned, note also that all its components are
3429 (MyBitVector.SetRange): New. Function to set multiple bits to true.
3431 2007-05-19 Marek Safar <marek.safar@gmail.com>
3433 * anonymous.cs, class.cs: Emit Compiler generated attribute when
3434 member is marked as compiler generated.
3436 * decl.cs (MemberCore): Refactored ModFlags into property.
3438 * modifiers.cs: Add new modifier (COMPILER_GENERATED).
3439 (Check): Check only accessibility modifiers.
3441 2007-05-18 Raja R Harinath <rharinath@novell.com>
3443 Track all assignable slots in one bit array
3444 * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
3445 (ToplevelBlock.ResolveMeta): Don't create a VariableMap. Move
3446 logic from VariableMap constructor here. Use the same 'offset'
3447 variable that's later used for computing offsets of local
3449 * flowanalysis.cs (UsageVector.parameters): Remove.
3450 (UsageVector): Update to changes.
3451 (VariableMap): Remove.
3453 Avoid creating ParameterMap in every block
3454 * statement.cs (Block.ParameterMap): Move ...
3455 (ToplevelBlock.ParameterMap): ... here.
3456 (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
3458 * flowanalysis.cs (FlowBranching.param_map): Remove.
3459 (FlowBranching.UsageVector): Update to changes.
3460 (FlowBranchingToplevel.CheckOutParameters): Likewise.
3462 * statement.cs (Block.CloneTo): Clone Toplevel field too.
3464 * expression.cs (ParameterReference): Distinguish between block
3465 where parameter was referenced and declared.
3467 2007-05-18 Marek Safar <marek.safar@gmail.com>
3469 * flowanalysis.cs, statement.cs: Put back improved error handling.
3471 2007-05-15 Scott Peterson <lunchtimemama@gmail.com>
3475 Imporved object and collection initialization (C# 3.0).
3477 2007-05-15 Marek Safar <marek.safar@gmail.com>
3479 A fix for bug #81380
3480 * expression.cs (Is.DoResolve): Only value types have constant `is'
3483 2007-05-15 Raja R Harinath <rharinath@novell.com>
3485 * statement.cs (ToplevelBlock.child): Remove.
3487 2007-05-15 Raja R Harinath <harinath@gmail.com>
3489 Rationalize ResolveMeta: refactoring
3490 (Block.ResolveMeta): Remove wrong or superfluous comments. Carve
3491 out constant handling code into ...
3492 (Block.DoResolveConstants): ... this.
3494 Rationalize ResolveMeta: kill local_map
3495 * statement.cs (Block.local_map, Block.LocalMap): Remove.
3496 (Block.AssignableSlots): New.
3497 (Block.ResolveMeta): Make protected. Don't create a VariableMap
3498 for locals -- move code from VariableMap here. Avoid unnecessary
3500 * flowanalysis.cs (FlowBranching.local_map): Remove.
3501 (FlowBranching..ctor): Use Block.AssignableSlots.
3502 (VariableMap): Remove unused constructors.
3504 2007-05-11 Raja R Harinath <rharinath@novell.com>
3506 * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
3508 2007-05-11 Marek Safar <marek.safar@gmail.com>
3510 * typemanager.cs (IsFriendAssembly): Should not be called for building
3513 2007-05-09 Marek Safar <marek.safar@gmail.com>
3515 * literal.cs (NullConstant): Print null in all cases.
3517 * expression.cs (Binary.ResolveOperator): Implemented delegate
3518 comparison based on C# 2.0 changes.
3520 2007-04-28 Scott Peterson <lunchtimemama@gmail.com>
3522 This code is contributed under the MIT X11 license
3524 The following enables support for several C# 3.0 language features:
3526 * cs-tokenizer.cs: Added support for the "var" keyword.
3528 * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
3529 Added VarExpr class to facilitate type inferencing.
3531 * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
3532 to support anonymous types.
3534 * assign.cs: Added support for type inferencing and initialization.
3536 * anonymous.cs: Added AnonymousClass class to enable anonymous types.
3538 * expression.cs: Added implicit array support to ArrayCreation.
3539 Added 5 types and 1 interface:
3541 IInitializable Implementing classes can inject initializing
3542 statements after object instantiation.
3544 Initializer Stores data for object initialization.
3546 AnonymousType An expression for anonymous types.
3548 AnonymousTypeParameter Stores data about an anonymous type's field.
3550 NewInitialize An expression for object initialization.
3552 CollectionInitialize An expression for collection initialization.
3554 * statement.cs: Added "var" keyword support to the foreach, using, and fixed
3557 2007-05-06 Marek Safar <marek.safar@gmail.com>
3559 A fix for bug #81500
3560 * cs-tokenizer.cs: Add special handling for coalescing operator.
3562 2007-05-06 Marek Safar <marek.safar@gmail.com>
3564 A fix for bug #81529
3565 * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
3566 its value from base class until it is redefined.
3568 2007-05-02 Raja R Harinath <rharinath@novell.com>
3570 Fix regression in cs0631-3.cs
3571 * cs-parser.jay (operator_declarator): Add opt_attributes to error
3572 fallback. Make error fallback catch more cases.
3574 2007-05-01 Miguel de Icaza <miguel@novell.com>
3576 * cs-parser.jay: Allow parameters in operator declarations to have
3579 2007-04-27 Miguel de Icaza <miguel@novell.com>
3581 * statement.cs (If.CloneTo): Only clone the FalseStatement if it
3584 * lambda.cs (ContextualReturn.Resolve): An expression is valid
3585 inside the ContextualReturn, it does not have to be an
3586 ExpressionStatement.
3588 2007-04-24 Miguel de Icaza <miguel@novell.com>
3590 * lambda.cs (ContextualReturn.Resolve): if the return type is not
3593 2007-04-23 Miguel de Icaza <miguel@novell.com>
3595 * anonymous.cs (AnonymousContainer): split the virtual Resolve
3596 method in two methods: ResolveNoDefine and Resolve.
3598 ResolveNoDefine will stop just after ResolveTopBlock has been
3601 Resolve will then continue by creating a method and issuing the
3602 call to method.Define ().
3604 (AnonymousMethod): Split and implement the new Resolve and
3605 ResolveNoDefine as well.
3607 * lambda.cs (LambdaExpression): Split the anonymous method
3608 resolution code into a separate routine (CoreCompatibilityTest)
3609 from DoCompatibleTest.
3611 (LambdaExpression.TryBuild): New method, this method tries to
3612 build the LambdaExpression with the given set of types to be used
3613 as the types for the various parameters of the lambda expression.
3615 If the compilation succeed with the given types, the infered type
3616 of the Anonymous method is returned, otherwise null is returned.
3618 2007-04-23 Marek Safar <marek.safar@gmail.com>
3620 A fix for bug #81414
3621 * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
3623 2007-04-22 Miguel de Icaza <miguel@novell.com>
3625 * cs-tokenizer.cs: Change various identifiers here from the
3626 camelCasing to the recommended Linux-like style for instance
3627 variables from the Coding Guidelines.
3629 2007-04-19 Martin Baulig <martin@ximian.com>
3632 (Convert.ImplicitReferenceConversionCore): Allow conversions from
3633 System.Enum to System.ValueType.
3635 2007-04-13 Martin Baulig <martin@ximian.com>
3637 Rewrote implicit reference conversions. We need to distinguish
3638 between implicit reference conversions (13.1.4) and implicit
3639 boxing conversions (13.1.5).
3641 According to the spec, there's an an implicit conversion
3642 "From a one-dimensional array-type S[] to IList<T> and base
3643 interfaces of this interface, provided there is an implicit
3644 reference conversion from S to T." Note that this does not
3645 include boxing conversions.
3648 (Convert.ImplicitTypeParameterBoxingConversion): New method.
3649 (Convert.ImplicitReferenceConversion): Split into
3650 ImplicitReferenceConversionCore() and
3651 ImplicitBoxingConversionExist().
3652 (Convert.ImplicitReferenceConversionExists): Use the new
3653 ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
3655 2007-04-12 Martin Baulig <martin@ximian.com>
3657 * convert.cs (Convert.ImplicitReferenceConversion): Move the
3658 `TypeManager.null_type' checks up to the top of the method.
3660 2007-04-11 Marek Safar <marek.safar@gmail.com>
3662 A fix for bug #81350
3663 * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
3666 2007-04-11 Martin Baulig <martin@ximian.com>
3668 * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
3669 Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
3670 to make this work for generic classes; fixes #79561.
3672 2007-04-11 Martin Baulig <martin@ximian.com>
3674 * expression.cs (As): Add support for nullable types; fixes #79371.
3676 2007-04-11 Martin Baulig <martin@ximian.com>
3678 * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
3679 `type.FullName' is null; fixes #80243.
3681 2007-04-11 Martin Baulig <martin@ximian.com>
3683 * expression.cs (Invocation.IsApplicable): Don't modify the method
3684 if type inference succeeded, but the method was not applicable.
3687 2007-04-10 Marek Safar <marek.safar@gmail.com>
3689 A fix for bug #81324
3690 * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
3691 internal and external namespaces containers.
3693 2007-04-10 Martin Baulig <martin@ximian.com>
3695 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
3696 TypeManager.DropGenericMethodArguments() so we also call
3697 IMethodData.SetMemberIsUsed() for generic methods. Fixes #80357.
3699 2007-04-10 Martin Baulig <martin@ximian.com>
3701 * iterators.cs (Iterator.CreateIterator): Don't crash if
3702 `method.ReturnType' is null. This happens if something went wrong
3703 while resolving that typ (we already reported an error in this case).
3705 2007-04-10 Martin Baulig <martin@ximian.com>
3707 * expression.cs (New.DoResolve): Don't call CheckComImport() on
3708 generic interfaces; report the CS0144 directly.
3710 2007-04-10 Martin Baulig <martin@ximian.com>
3712 * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
3713 `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
3715 2007-04-10 Martin Baulig <martin@ximian.com>
3717 * expression.cs (New.DoEmitTypeParameter): Fix #81109.
3719 2007-04-09 Raja R Harinath <rharinath@novell.com>
3722 * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
3723 * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
3726 * statement.cs (For.Resolve): If resolution fails, use
3729 2007-04-08 Marek Safar <marek.safar@gmail.com>
3731 * anonymous.cs (MakeName): Make faster and zero-based.
3732 (VerifyExplicitParameterCompatibility): Back to mode where generic
3733 parameter is ignored.
3734 (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
3736 * class.cs (EmitType): Method can emit another new method.
3738 * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
3740 * driver.cs: Updated.
3742 * lambda.cs: Reuse predefined empty parameters.
3744 * parameter.cs: Updated
3746 * support.cs: Implemented InflateTypes.
3748 * typemanager.cs (GetFullName): Don't use FullName as it can be null.
3749 (InitSystemCore): Introduced to isolate 3.0 dependencies.
3751 2007-04-03 Martin Baulig <martin@ximian.com>
3755 * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
3756 version of TypeManager.IsOverride() which also works with generic
3759 2007-04-03 Martin Baulig <martin@ximian.com>
3764 (Convert.ExplicitReferenceConversion): We need to cast when
3765 converting from IList<T> to S[].
3767 2007-04-01 Marek Safar <marek.safar@gmail.com>
3769 * decl.cs (FindExtensionMethods): Consider all candidates with same name
3772 * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
3774 2007-03-31 Marek Safar <marek.safar@gmail.com>
3776 * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
3777 argument and return type inferring.
3779 * codegen.cs (InferReturnType): Flag whether return can be inferred.
3780 (ReturnType): Turned to property.
3782 * statement.cs (Return): Implemented return type inferring.
3784 * support.cs (ReflectionParameters): Use local types if possible.
3786 2007-03-30 Raja R Harinath <rharinath@novell.com>
3788 * flowanalysis.cs (FlowBranching.Reachability): Remove.
3789 (FlowBranching.UsageVector): Update to changes.
3791 Prepare to kill 'Reachability'
3792 * flowanalysis.cs (UsageVector): Remove 'Reachability' from
3793 argument of constructor.
3795 2007-03-29 Raja R Harinath <rharinath@novell.com>
3797 Prepare to kill 'Reachability'
3798 * flowanalysis.cs (UsageVector.is_unreachable): New.
3799 (UsageVector): Update to maintain 'is_unreachable' in parallel to
3800 'reachability', and verify they're consistent.
3803 * expression.cs (New.EmitStatement): Handle type parameters here too.
3805 2007-03-29 Martin Baulig <martin@ximian.com>
3810 (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
3811 CompilerGeneratedClass.
3812 (ScopeInfo.EmitScopeInstance): Make this protected.
3813 (CapturedVariable.EmitInstance): Use `Ldarg_0' if
3814 `ec.CurrentAnonymousMethod.Scope == Scope'.
3816 * statement.cs (Block.ScopeInfo): Make this a property.
3818 2007-03-27 Raja R Harinath <harinath@gmail.com>
3820 Prepare to kill 'Reachability'
3821 * flowanalysis.cs (FlowBranching.Reachability): Make class private.
3822 (FlowBranching.UsageVector.Reachability): Remove property.
3823 (FlowBranching.UsageVector.IsUnreachable): New property.
3824 (FlowBranching.UsageVector.ResetBarrier): New.
3825 (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
3826 * codegen.cs, statement.cs: Update to changes.
3828 2007-03-27 Martin Baulig <martin@ximian.com>
3833 (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
3836 2007-03-26 Raja R Harinath <rharinath@novell.com>
3838 * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
3839 instead of TriState. Remove all mention of TriState.
3841 * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
3842 replaced by a boolean. Add boolean 'is_unreachable' field, check
3843 and maintain invariants.
3845 2007-03-25 Marek Safar <marek.safar@gmail.com>
3847 * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
3849 2007-03-25 Marek Safar <marek.safar@gmail.com>
3851 * expression.cs: Stop using obsolete 2.0 opcodes.
3853 2007-03-25 Marek Safar <marek.safar@gmail.com>
3855 * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
3856 one of the latests Martin's fixes.
3858 2007-03-23 Miguel de Icaza <miguel@novell.com>
3860 * expression.cs: On BigEndian systems, swap the bytes, temporary
3861 solution until we get a new bitconverter class.
3863 2007-03-23 Martin Baulig <martin@ximian.com>
3867 * decl.cs (MemberCache.AddMembers): Add generic methods both as
3868 "Method" and "Method`1". Normally, a cache lookup is done on the
3869 "Method" form (ie. without the generic arity), but this one makes
3870 lookups on the full form work as well.
3872 2007-03-22 Raja R Harinath <rharinath@novell.com>
3874 * flowanalysis.cs (Reachability): Reorganize slightly, and remove
3877 2007-03-20 Bill Holmes <billholmes54@gmail.com>
3879 Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
3880 ordered_member_list, to TypeBuilder to store members to be defined
3881 in the order they were parsed in.
3882 - ordered_explicit_member_list contains all properties indexers
3883 and methods that are defined as explicit implementation of an
3884 interface or base class.
3885 - ordered_member_list contains all properties indexers and methods
3886 that are not defined as explicit implementation of an interface
3889 Removed MethodArrayList and IndexerArrayList from TypeBuilder. The
3890 functionality in these removed classes has been replaced with
3891 ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and
3892 CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
3894 Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
3895 to CheckForDuplications inside GetMethod and SetMethod Define Method
3896 to handle method property and indexer name conflicts.
3900 All code is contributed under the MIT/X11 license.
3902 2007-03-20 Martin Baulig <martin@ximian.com>
3904 * class.cs (TypeContainer.Interfaces): Removed; they're now
3905 included in `TypeContainer.Types'.
3907 2007-03-20 Martin Baulig <martin@ximian.com>
3909 Fix #77963, #80314 and #81019. Added gtest-317, ..., gtest-320.
3911 * class.cs (TypeContainer.CreateType): New public method. This is
3912 now called before DefineType() to create the TypeBuilders.
3913 (TypeContainer.DefineType): Don't create the TypeBuilder here; it
3914 has already been created by CreateType().
3915 (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
3916 don't resolve our base classes here; this has been moved into
3917 DefineBaseTypes(). We're now called from CreateType().
3918 (TypeContainer.DefineBaseTypes): New private method; resolve our
3919 base classes here. We're now called from DefineType().
3922 (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
3923 our types first to create all the TypeBuilders. After that, call
3924 TypeContainer.DefineType() on all the types which'll resolve their
3925 base classes and setup the resolve order.
3927 2007-03-20 Martin Baulig <martin@ximian.com>
3929 * class.cs (TypeContainer.Enums): Removed; they're now included in
3930 `TypeContainer.Types'.
3932 2007-03-20 Martin Baulig <martin@ximian.com>
3935 (TypeContainer.DefineType): Don't call ResolveMembers() here.
3936 (TypeContainer.DoResolveMembers): Call DefineType() on our
3937 `compiler_generated' classes; moved here from DefineNestedTypes().
3940 (RootContext.ResolveTree): Call ResolveMembers() on all
3941 TypeContainer's in the `type_container_resolve_order'.
3943 2007-03-19 Marek Safar <marek.safar@gmail.com>
3945 * class.cs: Use corlib to handle InternalMethodImplAttribute.
3947 2007-03-17 Marek Safar <marek.safar@gmail.com>
3949 * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
3950 implementation flags.
3952 2007-03-17 Marek Safar <marek.safar@gmail.com>
3954 * class.cs: More optimizations for type parameters.
3956 2007-03-15 Marek Safar <marek.safar@gmail.com>
3958 * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
3960 * ecore.cs, parameter.cs: More common code for both corlibs.
3962 * typemanager.cs (IsGenericMethod): Simplified.
3964 2007-03-15 Raja R Harinath <rharinath@novell.com>
3966 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
3968 * statement.cs, iterators.cs, lambda.cs: Update to changes.
3970 * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
3971 unconditionally. Simplify explanation.
3972 (Try.Resolve, Using.Resolve): Likewise.
3974 2007-03-15 Martin Baulig <martin@ximian.com>
3978 * decl.cs (DeclSpace): If we're a partial class, use our
3979 `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
3981 2007-03-15 Raja R Harinath <rharinath@novell.com>
3983 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
3985 (FlowBranching.UsageVector): Update to changes.
3986 (FlowBranching.MergeSiblings): Likewise.
3987 * statement.cs: Likewise.
3989 2007-03-15 Martin Baulig <martin@ximian.com>
3994 (MemberCache): Added a special .ctor for type parameters.
3997 (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
4000 2007-03-09 Martin Baulig <martin@ximian.com>
4002 * enum.cs (Enum): Make this a TypeContainer.
4003 (EnumMember): Derive from `Const'.
4006 (Const.DoResolveValue): New protected virtual method; move most of
4007 the functionality of ResolveValue() here so we can override it in
4009 (Const.CreateConstantReference): Make this virtual.
4011 * class.cs (Kind): Add `Kind.Enum'.
4012 (TypeContainer.Emit): Don't emit the enums here; they're already
4013 in the `RootContext.typecontainer_resolve_order'.
4015 * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
4016 here; they're already in the `typecontainer_resolve_order'.
4018 * ecore.cs (EnumConstant.ConvertImplicitly): Add
4019 TypeManager.DropGenericTypeArguments().
4022 (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
4023 (TypeManager.IsEnumType): Likewise.
4024 (TypeManager.EnumToUnderlying): Likewise.
4025 (TypeManager.IsEqual): Add support for enums.
4027 2007-03-12 Raja R Harinath <rharinath@novell.com>
4029 * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
4030 DefaultParameterValueAttribute to be undefined, say if System.dll
4033 2007-03-11 Marek Safar <marek.safar@gmail.com>
4035 * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
4038 2007-03-10 Marek Safar <marek.safar@gmail.com>
4040 * class.cs, parameter.cs: Unified parameters verification.
4042 2007-03-08 Martin Baulig <martin@ximian.com>
4044 * cs-parser.jay (constructor_header): Pass the location to the
4045 newly created TopLevelBlock.
4047 2007-03-07 Martin Baulig <martin@ximian.com>
4049 * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
4051 2007-03-06 Miguel de Icaza <miguel@novell.com>
4053 * convert.cs (ExplicitReferenceConversionExists): Sync this method
4054 with the changes from David, fixes the build.
4056 2007-03-05 David Mitchell <dmitchell@logos.com>
4058 * convert.cs: Implement From System.Collecitons.Generic.IList<T>
4059 and its base interfaces to a one-dimensional array type S[],
4060 provided there is an implicit or explicit reference conversion
4063 2007-03-03 Marek Safar <marek.safar@gmail.com>
4065 * cs-tokenizer.cs: Implemented basic linq grammar.
4067 * driver.cs: Set linq lang version on demand.
4069 2007-02-26 Marek Safar <marek.safar@gmail.com>
4071 * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
4073 2007-02-25 Marek Safar <marek.safar@gmail.com>
4075 * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
4078 * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
4080 Check property and event extern attributes.
4082 * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
4085 2007-02-24 Marek Safar <marek.safar@gmail.com>
4087 A fix for bug #80407
4088 * ecore.cs: Don't report ambiguity error when methods have same parent.
4090 2007-02-23 Marek Safar <marek.safar@gmail.com>
4092 A fix for bug #80878
4093 * class.cs, cs-parser.jay: Event property can host anonymous methods.
4095 2007-02-22 Marek Safar <marek.safar@gmail.com>
4097 * attribute.cs: Enable ExtensionAttribute presence test.
4099 2007-02-22 Marek Safar <marek.safar@gmail.com>
4101 * class.cs: Warn about missing GetHashCode only when Equals is override.
4103 * decl.cs: Check accessibility of type arguments.
4105 * typemanager.cs: Correctly report nullable array.
4107 2007-02-20 Marek Safar <marek.safar@gmail.com>
4109 * class.cs, report.cs: Capture more details when things go wrong.
4111 2007-02-20 Marek Safar <marek.safar@gmail.com>
4113 A fix for bug #80650
4114 * cs-parser.jay: Anonymous container starts at constructor declaration
4115 and not at block beginning because it has to be usable in constructor
4118 * statement.cs: Use context location and not block one for error reporting.
4120 2007-02-18 Marek Safar <marek.safar@gmail.com>
4122 A fix for bug #78712
4123 * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
4126 2007-02-18 Marek Safar <marek.safar@gmail.com>
4128 A fix for bug #80493 by Atsushi Enomoto
4129 * cs-parser.jay: Ignore invalid attribute target.
4131 2007-02-18 Marek Safar <marek.safar@gmail.com>
4133 * cs-tokenizer.cs: Ignore '\0' as white space character.
4135 2007-02-17 Miguel de Icaza <miguel@novell.com>
4137 * cs-parser.jay: Add support for lambda expressions to the mcs
4140 * lambda.cs: Only clone when we are probing, not on the final call
4141 (Compatible is the final call).
4143 * statement.cs (CloneContext): Introduce class to provide block
4144 remapping during clone.
4146 All statements Clone themselves now.
4148 (Clone): special handling for blocks, when we clone a block, we
4149 register the block inside this routine, as children of the block
4150 might trigger a lookup.
4152 * expression.cs: Add support for CloneContext in all expressions.
4154 2007-02-17 Marek Safar <marek.safar@gmail.com>
4156 A fix for bug #80493
4157 * statement.cs: Report ambiguous warning when interfaces are not related.
4159 2007-02-15 Marek Safar <marek.safar@gmail.com>
4161 C# 3.0 extension methods.
4163 * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
4164 cannot be used directly.
4166 * class.cs (Class.Emit): Emit extension attribute if any class method
4167 is extension method.
4168 (Method.Define): Add basic extension method validation conditions.
4169 (Method.Emit): Emit extension attribute for method.
4171 * codegen.cs (AssemblyClass): Emit extension attribute if at least one
4172 extension method exists. Currently we follow same approach as Microsoft
4173 does, emit even if a method or a class are private but this can change
4176 * cs-parser.jay: Add handling of `this' keyword in method parameters
4179 * decl.cs (DeclSpace.IsStaticClass): New property.
4180 (MemberCache.FindExtensionMethods): Looks for extension methods with
4181 defined name and extension type.
4183 * doc.cs: Updated after OverloadResolve changes.
4185 * driver.cs: Add new soft reference to System.Core.dll.
4187 * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
4188 (ExtensionMethodGroupExpr): Represents group of extension methods.
4190 * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
4191 BetterFunction, IsOverride, IsAncestralType, OverloadResolve
4192 to MethodGroupExpr and made non-static for easier customization.
4193 (Invocation.DoResolve): Add extension method lookup when no standard
4195 (MemberAccess.DoResolve): Try extension methods if no member exists.
4197 * modifiers.cs: Add METHOD_EXTENSION modifier.
4199 * namespace.cs (RegisterExtensionMethodClass): Register class namespace
4200 as well as candidate extension type.
4201 (ComputeNamespaces): When assembly constains extension methods registers
4203 (Namespace.RegisterExternalExtensionMethodClass): Register type for later
4204 extension method lookup.
4205 (Namespace.LookupExtensionMethod): Looks for extension method in this
4207 (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
4208 find a method which matches name and extensionType.
4210 * parameter.cs (Parameter): Add This modifer.
4211 (HasExtensionMethodModifier): New property.
4212 (Resolve): Add extension parameter check.
4213 (ModFlags): turned to property to exclude this modifier as it is not real
4215 (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
4217 * support.cs (ParameterData): Add ExtensionMethodType.
4218 (ReflectionParameters): Implemented ExtensionMethodType interface property.
4220 * typemanager.cs: Add type and ctor extension attribute type.
4222 2007-02-15 Miguel de Icaza <miguel@novell.com>
4224 * report.cs (DisableErrors, EnableErrors): used to prevent error
4225 output when we are "trying" to compile various methods with
4228 * ecore.cs (Expression): Add Clone method that calls the virtual
4229 CloneTo method. The current CloneTo method in Expression throws
4230 an exception so we can track down all the places where this must
4231 be implemented (not using abstract, because that would be a lot of
4232 up-front-work before we can start testing the implementation
4235 Important: we only need Clone capabilities for expressions created
4236 by the parser, as the expressions we will be cloning are
4237 expressions in the pre-resolved state. This vastly simplifies
4240 (SimpleName): Add CloneTo that does nothing.
4241 (EmptyCast): Add CloneTo.
4243 * expression.cs (Binary): Implement CloneTo.
4244 (Invocation.IsApplicable): Store the current ec in
4245 EmitContext.TempEc and restore it on return. This is used so we
4246 do not have to sprinkle hundres of methods with an extra
4247 EmitContext, we know that the only user is the lambda expression
4248 ImplicitConversionExists code.
4250 (Argument): Add Cloning capabilities.
4251 (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
4252 Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
4253 ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
4254 UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
4255 IndexerAccess): Add Clone capability.
4257 (LocalVariableReference, This): TODO: needs cloned Block mapping.
4259 (Argument): Add cloning capability.
4261 * assign.cs (Assign): Implement CloneTo.
4263 * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
4265 * lambda.cs (ImplicitStandardConversionExists): Implement lambda
4266 version by calling Convert with the EmitContext (that we are
4267 currently storing in ec, this is not great, but will do for now,
4268 to avoid passing EmitContext parameters to hundreds of functions
4269 that do not need them now).
4271 (SetExpression): Remove, it is not needed.
4273 (ContextualReturn): Implement CloneTo.
4275 * statement.cs (Statement): Implement cloning infrastructure,
4276 similar to expressions.
4278 (Block): Partial implementation of Clone for statements.
4280 (Return): Implement clone.
4282 * constant.cs (Constant.CloneTo): New method, does nothing.
4284 * codegen.cs (TempEc): Add a static EmitContext as a temporary
4285 solution, until we decide how to exactly do this.
4287 2007-02-14 Marek Safar <marek.safar@gmail.com>
4289 A fix for bug #80493
4290 * class.cs (FindOutBaseMethod): When the base accessor does not exist and
4291 a property is override we need to use second accessor.
4293 2007-02-13 Marek Safar <marek.safar@gmail.com>
4295 A fix for bug #80418
4296 * attribute.cs, class.cs: Use correct calling conventions for pinvoke
4299 2007-02-13 Marek Safar <marek.safar@gmail.com>
4301 Another fix for bug #80749
4302 * pending.cs: Abstract class has priority over interfaces.
4304 2007-02-13 Marek Safar <marek.safar@gmail.com>
4306 Another fix for bug #80749
4307 * pending.cs: Abstract class has priority over interfaces.
4309 2007-02-13 Marek Safar <marek.safar@gmail.com>
4311 Another fix for bug #80749
4312 * pending.cs: Abstract class has priority over interfaces.
4314 2007-02-13 Marek Safar <marek.safar@gmail.com>
4316 Another fix for bug #80749
4317 * pending.cs: Abstract class has priority over interfaces.
4319 2007-02-13 Marek Safar <marek.safar@gmail.com>
4321 * class.cs Better error message.
4323 * driver.cs: Add shorter versions of -optimize option.
4325 2007-02-13 Martin Baulig <martin@ximian.com>
4327 * class.cs (Constructor.Emit): Check the return value of
4328 ec.ResolveTopBlock() and return on error.
4330 2007-02-13 Raja R Harinath <rharinath@novell.com>
4332 * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
4333 message to fix error message regression.
4335 2007-02-12 Marek Safar <marek.safar@gmail.com>
4337 * delegate.cs: Delegate creation expression cannot be of Nullable type.
4339 2007-02-12 Marek Safar <marek.safar@gmail.com>
4341 A fix for bug #80749
4342 * assign.cs (FieldInitializer): FieldInitializer has to keep track of
4343 its parent container.
4345 * class.cs (DefineFieldInitializers): Each initializer can has different
4348 * const.cs: Updated.
4350 2007-02-11 Miguel de Icaza <miguel@novell.com>
4352 * lambda.cs (LambdaExpression.Compatible): Remove some early code,
4353 now all the heavy lifting to check that embedded statements or
4354 expressions have the right form is done in the ContextualReturn.
4356 (ContextualReturn): New class.
4358 * ecore.cs (Error_InvalidExpressionStatement): Make a helper
4359 method that can be invoked to report 201, so we do not replicate
4362 * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
4364 * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
4365 treating tabs as spaces.
4367 2007-02-09 Marek Safar <marek.safar@gmail.com>
4369 A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
4370 * assign.cs: Use full implicit conversion for right side check.
4372 2007-02-09 Marek Safar <marek.safar@gmail.com>
4374 * statement.cs (Switch): Switch over boolean type is not standardized.
4376 2007-02-08 Marek Safar <marek.safar@gmail.com>
4378 A fix for bug #80755
4379 * decl.cs (FindBaseEvent): Don't use method cache for events.
4381 2007-02-07 Marek Safar <marek.safar@gmail.com>
4383 * cs-parser.jay: Better syntax error handling.
4385 * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
4386 instead of underlying type value.
4388 2007-02-06 Marek Safar <marek.safar@gmail.com>
4390 * driver.cs: Check define identifier before is registered.
4392 * namespace.cs: Use existing error message.
4394 * report.cs: New warning.
4396 2007-02-06 Marek Safar <marek.safar@gmail.com>
4398 A fix for bug #80742
4399 * expression.cs: Delegate Invoke method can be called directly.
4401 2007-02-06 Marek Safar <marek.safar@gmail.com>
4403 A fix for bug #80676
4404 * class.cs (IsEntryPoint): The Main method can have params modifier.
4406 2007-02-04 Miguel de Icaza <miguel@novell.com>
4408 * parameter.cs (Parameter, Parameters): Add Clone method.
4410 * anonymous.cs (Compatible): Turn method into virtual method, so
4411 LambdaExpression can implement a different behavior.
4413 (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
4414 out the basic checking here, so it can be used by
4417 * lambda.cs: Introduce "Compatible" function that will do the
4420 2007-02-02 Marek Safar <marek.safar@gmail.com>
4422 * attribute.cs: Unified one error message.
4424 * class.cs (Class): Use type attributes and not properties to test static
4426 (IsEntryPoint): Don's pass local variable.
4428 * convert.cs: Removed duplicate check.
4430 * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
4432 * driver.cs: Don't crash when soft reference does not exist.
4434 * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
4435 (UsingEntry): Removed redundant allocation.
4437 * parameter.cs: Add fast path for type parameters.
4439 * support.cs: Don't allocate attribute when it's not used.
4441 2007-01-30 Miguel de Icaza <miguel@novell.com>
4444 (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
4445 this into a virtual method, so we can override it in LambdaExpression.
4447 * driver.cs: Improve diagnostics in case of failure.
4449 * cs-tokenizer.cs: Instead of trying to parse a type and a name,
4450 write a function that is slightly more complex and that parses:
4452 type identifier [, type identifier]* )
4454 The old function would return incorrectly a OPEN_PARENS_LAMBDA for
4457 (canEmpty ? i >= 0 : i > 0)
4459 2007-01-30 Raja R Harinath <rharinath@novell.com>
4461 * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
4462 exception on possibly valid code.
4464 2007-01-29 Raja R Harinath <rharinath@novell.com>
4466 * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
4468 (parse_opt_type_arguments): Remove. It's almost the same as
4470 (parse_namespace_or_typename): Use parse_less_than.
4472 2007-01-28 Miguel de Icaza <miguel@novell.com>
4474 * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
4475 this bug took a few hours to find, because the state saved and
4476 restored by PushPosition and PopPosition was ignoring the state of
4477 parse_generic_less_than.
4479 I can also now remove the handling of OP_LT and OP_GT, this solves
4482 * cs-tokenizer.cs: store the location for the ARROW token, we use
4485 (PushPosition, PopPosition): save/restore also `current_token',
4486 restore `parse_generic_less_than' (was missing).
4488 (parse_opt_type_arguments): use parse_type, not
4489 parse_namespace_or_typename to parse types.
4491 * lambda.cs: Empty new file, will eventually have the lambda
4492 expression implementation.
4494 * lambda.test: used to test the internal tokenizer.
4496 * report.cs (FeatureIsNotISO1): Rename from
4497 FeatureIsNotStandardized, because it was about the language level
4498 (1 vs 2) it was not about standarization.
4500 (FeatureRequiresLINQ): New.
4502 * support.cs (SeekableStreamReader): Only require that the reader
4503 is a TextReader, not a StreamReader, so we can plug StringReader.
4505 * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
4506 given position in the input stream the following tokens can be
4507 parsed as a type followed by an identifier.
4509 (is_punct): after a '(' if parse_type_and_parameter returns true,
4510 then return a special token OPEN_PARENS_LAMBDA which is used to
4511 avoid reduce/reduce errors in the grammar for the
4512 lambda_expression rules.
4514 (parse_type): implement a type parser inside the
4515 tokenizer, the parser only returns true or false depending on
4516 whether the input at a given position can be parsed as a type.
4518 (peek_token): new method used during type parsing.
4520 2007-01-28 Raja R Harinath <rharinath@novell.com>
4523 * anonymous.cs (ScopeInfo.InflateParameters): New.
4524 (AnonymousContainer.Resolve): Use it to redirect types of
4525 delegate parameters.
4527 2007-01-27 Raja R Harinath <rharinath@novell.com>
4530 * expression.cs (Error_InvalidArguments): Don't use two different
4531 messages for CS1503. Use ExtraInformation and
4532 SymbolRelatedToPreviousError instead.
4535 * decl.cs (DeclSpace.initialize_type_params): Don't access
4536 'type_params' of a partial class directly.
4538 2007-01-26 Miguel de Icaza <miguel@novell.com>
4540 * constant.cs: Removed a handful of out-of-range checks that were
4543 2007-01-25 Marek Safar <marek.safar@gmail.com>
4545 * expression.cs (CheckUselessComparison): Add additional check for char
4548 * namespace.cs: Fixed typo.
4550 2007-01-23 Miguel de Icaza <miguel@novell.com>
4552 * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
4553 gone, instead we inline the test, preventing the needless casts to
4554 longs, ulongs and doubles for the parameters, avoiding calls to
4555 methods that overchecked stuff, and instead inlined things
4558 2007-01-20 Marek Safar <marek.safar@gmail.com>
4560 * cs-parser.jay: Better parameter error handling.
4562 2007-01-17 Marek Safar <marek.safar@gmail.com>
4564 A fix for bug #80368, #80522
4565 * expression.cs (ArrayCreation.only_constant_initializers): Indicates
4566 whether array initializer contains constants only.
4567 (ArrayCreation.Emit): Use better formula to decide when
4568 are array initializers for static initialization.
4569 (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
4570 have to emit even constants otherwise they are pre-initialized.
4572 2007-01-17 Bill Holmes <bill.holmes@ansys.com>
4573 Raja R Harinath <rharinath@novell.com>
4575 Fix emit order of 'get' vs. 'set'.
4576 * support.cs (Accessors): New.
4577 * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
4578 Note the order in which accessors are declared in the source.
4579 * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
4580 Refactored from Property.Define and Indexer.Define.
4581 (PropertyBase.DefineAccessors): New helper that calls the above in
4582 appropriate order as noted by the parser.
4583 (Property.Define, Indexer.Define): Update to changes.
4584 (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
4586 2007-01-17 Raja R Harinath <rharinath@novell.com>
4588 Fix cs0029-6.cs and gcs0029-2.cs (regression)
4589 * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
4590 there's an implicit conversion from the current type to the target
4591 type before converting the underlying constant.
4593 2007-01-16 Marek Safar <marek.safar@gmail.com>
4595 * const.cs (ResolveValue): Updated after constant conversion was made more
4598 * constant.cs (GetAttributableValue): constant to object conversion is
4599 used for attributes only.
4600 (IntConstant.ConvertImplicitly): Moved from convert to be used in all
4601 constant conversions.
4602 (LongConstant.ConvertImplicitly): Ditto.
4604 * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
4605 (ImplicitConversionStandard): Handle constant conversion as extra step.
4606 It solves the issue when constant conversion was called indirectly like
4607 inside array initializer and constant folding was skipped.
4609 * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
4612 * statement.cs(ImplicitConversionStandard): Updated after constant
4613 conversion was made more generic.
4615 2007-01-16 Sergey P. Kondratyev <se@unicom.tomica.ru>
4617 * expression.cs (As.DoResolve): Use GenericConstraints instead of
4618 Constraints, solves the problem where the compiler incorrectly
4619 reported that a type parameter was not constrained to a class (Bug
4622 2007-01-14 Marek Habersack <grendello@gmail.com>
4624 * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
4626 2007-01-14 Marek Safar <marek.safar@gmail.com>
4628 A fix for bug #80368
4629 * assign.cs (FieldInitializer): New class implements field
4630 initializer statement.
4632 * attribute.cs: Update after FieldMember rename.
4634 * class.cs (PropertyBasedMember): New common class for property based
4636 (InterfaceMemberBase): New base class for all members which can be used as
4637 an interface members.
4638 (MethodCore): Moved really common code to InterfaceMemberBase.
4639 (Method.Define): Equal and GetHasCode detection is relevant for methods
4641 (MethodData.Define): Don't assume that public event implements an
4642 interface automatically.
4643 (MethodData.DefineMethodBuilder): Issue an error even if only extern
4645 (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
4646 (FieldMember): Merged with FieldBase.
4647 (EventProperty.AEventPropertyAccessor): New specialization to check whether
4648 event extern modifier can be used.
4649 (EventField.EventFieldAccessor): Moved event field specific code here.
4650 (Event.AllowedModifiers): Even event can be extern.
4651 (Event.FindOutBaseMethod): New override specific to events.
4652 (Indexer.parameters): Reintroduce parameters because base class holds
4653 only properties common data.
4654 (Indexer.CheckForDuplications): Indexers are threated as methods so we
4655 need do extra parameters check.
4657 * const.cs: Update after FieldMember rename.
4659 * decl.cs (MemberCache.FindBaseEvent): New method.
4661 * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
4662 to reflect that indexer is now derived from PropertyBased.
4664 * ecore.cs (GetMemberType): Made public.
4665 (EventExpr.ResolveMemberAccess): Use right event cache and checks for
4668 * flowanalysis.cs, statement.cs: Update after FieldMember rename.
4670 * typemanager.cs (CSharpSignature): Correctly print event accessors.
4671 (RegisterEvent): Removed.
4672 (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
4673 (GetPrivateFieldOfEvent): Renamed to GetEventField.
4675 2007-01-11 Raja R Harinath <rharinath@novell.com>
4678 * statement.cs (CollectionForeach.TryType): Prefer generic
4679 GetEnumerator over non-generic variant. Fix code to follow comments.
4681 2007-01-09 Raja R Harinath <rharinath@novell.com>
4684 * support.cs (ReflectionParameter): Don't use an invalid index on
4685 the generic parameter data.
4687 2007-01-08 Miguel de Icaza <miguel@novell.com>
4689 * driver.cs: Just add a tiny bit of infrastructure.
4691 2007-01-02 Marek Safar <marek.safar@gmail.com>
4693 * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
4694 where field type is struct from current assembly.
4696 * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
4699 2007-01-02 Marek Safar <marek.safar@gmail.com>
4701 A fix for bug #80381
4702 * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
4705 * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
4707 (Namespace.LookupType): Always use core types from corlib when speficied.
4709 * report.cs: A new warning.
4711 * rootcontext.cs (BootstrapCorlib_ResolveInterface,
4712 BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
4713 (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
4715 * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
4716 (InitCoreTypes): Set expression type of object_type and value_type
4717 immediately after lookup.
4719 2007-01-01 Miguel de Icaza <miguel@novell.com>
4721 * cs-tokenizer.cs: Accept Pc class characters (Connector
4722 Punctuation) as valid identifiers. Fixes #78259
4724 * expression.cs (Invocation.DoResolve): Moved the check for the
4725 use of `this' for doing method calls to the Invocation resolution
4726 step, after overload resolution has taken place instead of doing
4727 the check at the low-level `This.DoResolve' level.
4729 The `This.DoResolve'(appens before overload resolution, so it has
4730 no way of knowing if the method that will be called will be
4731 instace or static, triggering an erroneous report for cs0188 (Bug
4734 We now do the check for instance method invocations after we know
4735 what method will be called.
4737 (This.CheckThisUsage): Move the actual use of this structure
4738 checking into its own method and expose it.
4740 * Everywhere that called Error_ValueCannotBeConverted: pass a new
4743 Exceptions: Null.ConvertImplicitly,
4744 Constant.ImplicitConversionRequired as there are too many call
4745 sites for passing the ec.
4747 * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
4748 EmitContext, if the value is null, then we do not try to provide
4749 the extra information from the error (If a userdefined conversion
4750 exists, as UserDefinedConversion requires a non null-EmitContext).
4754 2006-12-30 Raja R Harinath <rharinath@novell.com>
4756 * flowanalysis.cs (MyBitVector): Document some invariants.
4757 (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
4758 introduced below, and add a couple of others,
4760 2006-12-30 Marek Safar <marek.safar@gmail.com>
4762 * attribute.cs (GetMethodObsoleteAttribute): Uses new
4763 GetPropertyFromAccessor and GetEventFromAccessor.
4765 * class.cs (MethodCore.CheckBase): A new warning when obsolete member
4766 overrides non-obsolete one.
4767 (Indexer.Define): Error message has been moved to the parser.
4769 * cs-parser.jay: Better syntax errors handling.
4771 * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
4772 when an invocation has no arguments.
4774 * ecore.cs: Removed not used caching.
4776 * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
4779 * report.cs: Add a new warning.
4781 * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
4783 * typemanager.cs (enumeration_type): Removed.
4784 (CSharpSignature): Reuses IsSpecialMethod.
4785 (IsEqual): Hack for MS BCL.
4786 (GetPropertyFromAccessor): New method.
4787 (GetEventFromAccessor): New method.
4788 (IsSpecialMethod): Fixed to handle more cases.
4790 2006-12-30 Marek Safar <marek.safar@gmail.com>
4792 * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
4793 Made white spaces array static.
4795 * ecore.cs (RemoveGenericArity): Optimized.
4797 * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
4799 (MyBitVector.initialize_vector): Simplified.
4801 2006-12-22 Miguel de Icaza <miguel@novell.com>
4803 * ecore.cs: Am not entirely happy with this hack, but it seems to
4804 address the issue in 80257 (a small test case for
4807 I set the MethodGroupExpr.Type to an internal compiler type
4808 (itself in this case) to force the resolution to take place. Why
4809 it does not take place with a null is beyond me.
4811 2006-12-20 Marek Safar <marek.safar@gmail.com>
4813 A fix for bug #80288
4814 * expression.cs (ResolveOperator): Consider user defined conversion for
4815 logical and operator too.
4816 (EmitBranchable): Optimization for logical and when full constant folding
4817 could not be applied but one operand is constant.
4819 2006-12-19 Marek Safar <marek.safar@gmail.com>
4821 * class.cs (GetClassBases): Write 5 times every day, will never use
4822 FullName for error reporting.
4824 * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
4826 2006-12-19 Martin Baulig <martin@ximian.com>
4828 * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
4829 the symbol file info here.
4831 2006-12-18 Marek Safar <marek.safar@gmail.com>
4833 * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
4834 of `elseif' is taking then following sections are not taking.
4835 Fixes an issue reported on mono mailing list.
4837 2006-12-18 Marek Safar <marek.safar@gmail.com>
4839 A fix for bug #80300
4840 * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
4841 a caller is not taking.
4843 2006-12-18 Raja R Harinath <rharinath@novell.com>
4845 * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
4846 (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
4847 (RootScopeInfo, AnonymousMethodMethod): Update to changes.
4848 * iterator.cs: Change several TypeContainer declarations to DeclSpace.
4849 * class.cs: Update to changes.
4851 2006-12-17 Marek Safar <marek.safar@gmail.com>
4853 A fix for bug #79934
4854 * anonymous.cs (CompilerGeneratedClass): Register class in a shared
4857 * class.cs (ResolveMembers): Register an iterator in current container and
4860 2006-12-16 Raja R Harinath <rharinath@novell.com>
4863 * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
4864 satisfy a params annotated parameter.
4866 2006-12-16 Marek Safar <marek.safar@gmail.com>
4868 A fix for bug #77014
4869 * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
4870 paramters correctly and not rely on hacks in Parameters class.
4871 (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
4873 (Invocation.VerifyArgumentsCompat): Ditto.
4874 (Invocation.EmitArguments): Changed to correctly emit params arguments at
4877 * parameter.cs (HasParams): Don't assume that params is the last one.
4879 * support.cs (ReflectionParameters.ctor): Look for params attribute
4881 (ReflectionParameters.ParameterType): Removed hack when we returned last
4882 parameter for out of range parameters.
4883 (ParameterName, ParameterModifier): Ditto.
4885 2006-12-14 Marek Safar <marek.safar@gmail.com>
4887 A fix for bug #79987
4888 * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
4889 when assembly is not CLS compliant but type is. I have no idea why is this
4892 * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
4894 2006-12-13 Miguel de Icaza <miguel@novell.com>
4896 * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
4897 in struct constructors, they are basically no-ops.
4899 2006-12-12 Marek Safar <marek.safar@gmail.com>
4901 * cs-tokenizer.cs (Position): Save preprocessor status too.
4903 2006-12-12 Marek Safar <marek.safar@gmail.com>
4905 A fix for bug #77794
4906 * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
4908 2006-12-12 Marek Safar <marek.safar@gmail.com>
4910 * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
4912 (pp_expr): Report error for an invalid expression.
4913 (handle_preprocessing_directive): Simplified; add more error checking.
4915 2006-12-11 Marek Safar <marek.safar@gmail.com>
4917 A fix for bug #74939
4918 * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
4919 directives handling.
4921 2006-12-10 Marek Safar <marek.safar@gmail.com>
4923 A fix for bugs #80093, and #75984
4924 * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
4925 logic, it seems to me as it worked before "by coincidence".
4926 (xtoken): Simplified to use reworked handle_preprocessing_directive.
4927 (cleanup): Enabled endif check.
4929 2006-12-09 Marek Safar <marek.safar@gmail.com>
4931 A fix for bug #80162
4932 * statement.cs (CollectionForeach.TryType): Generics and non-generics
4933 enumerators are never ambiguous.
4935 2006-12-08 Raja R Harinath <rharinath@novell.com>
4938 * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
4940 2006-12-06 Marek Safar <marek.safar@gmail.com>
4942 A fix for bug #80144
4943 * class.cs (EventProperty.Define): Explicit implementation means
4944 that an even is used.
4946 2006-12-06 Marek Safar <marek.safar@gmail.com>
4948 Fixes the operators implementation (part II)
4950 * cfold.cs (DoConstantNumericPromotions): Renamed to
4951 DoBinaryNumericPromotions and simplified.
4952 (BinaryFold): Couple of conversion fixes; simplified.
4954 * constant.cs, ecore.cs, literal.cs
4955 (ToType): Renamed to ConvertImplicitly.
4956 (Reduce): Renamed to ConvertExplicitly.
4958 * class.cs, convert.cs: Updated.
4960 * expression.cs: TryReduce doesn't throw an exception.
4962 2006-12-01 Marek Safar <marek.safar@gmail.com>
4964 A fix for bug #80108
4965 * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
4968 2006-11-30 Marek Safar <marek.safar@gmail.com>
4970 Fixes unary operators implementation (part I)
4973 * cfold.cs (Error_CompileTimeOverflow): Made internal
4975 * const.cs (IConstant): Changed to use reference to constant and
4976 not constant itself.
4977 Updated IConstant implementations.
4979 * constant.cs (CreateConstant): New factory method.
4980 Updated IConstant implementation.
4982 * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
4984 * ecore.cs: Updated to use CreateConstantReference.
4986 * enum.cs: Reflects IConstant changes.
4988 * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
4990 * literal.cs (NullConstant): Change to be independently usable.
4992 2006-11-29 Martin Baulig <martin@ximian.com>
4994 * class.cs (Constructor.Emit): Correctly handle anonymous methods;
4995 we need to emit the scope initializer before calling the base .ctor.
4997 * anonymous.cs: Merged back from the new anonymous methods branch.
4998 (AnonymousMethodHost): Renamed to `RootScopeInfo'.
5000 * expression.cs (ParameterReference.DoResolveBase): Create a
5001 "normal" ScopeInfo when capturing parameters rather than using the
5002 root scope; this makes things work with anonymous methods having
5006 (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
5008 2006-11-22 Marek Safar <marek.safar@gmail.com>
5010 A fix for bug #79987
5011 * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
5012 check to a base class.
5013 * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
5014 only when assembly has missing attribute.
5015 * report.cs: Update.
5017 2006-11-21 Marek Safar <marek.safar@gmail.com>
5019 * cs-tokenizer.cs: Merged with gmcs version.
5021 2006-11-20 Marek Safar <marek.safar@gmail.com>
5024 * cs-parser.jay: Better error message when partial keyword is misplaced.
5026 2006-11-19 Gert Driesen <drieseng@users.sourceforge.net>
5028 A fix for bug #79810
5029 report.cs: CS1058 only applies to 2.0 profile (gmcs).
5030 codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
5031 a RuntimeWrappedException by default.
5033 2006-11-18 Marek Safar <marek.safar@gmail.com>
5035 A fix for bug #79843
5036 * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
5038 (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
5040 2006-11-18 Marek Safar <marek.safar@gmail.com>
5042 * driver.cs, namespace.cs: Uses faster IndexOf version.
5044 2006-11-17 Marek Safar <marek.safar@gmail.com>
5046 A fix for bug #79941
5047 * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
5049 (Operator.Define): Implicit/Explicit operator of same type is duplicate
5050 even if internal name is different.
5051 * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
5052 (UserDefinedConversion): Simplified as the operators cannot be internal.
5053 * ecore.cs (Error_ValueCannotBeConverted): Take account of user
5055 (MethodLookup): Replaced EmitContext with parentType.
5056 * expression.cs: Updated.
5058 2006-11-09 Raja R Harinath <rharinath@novell.com>
5060 * driver.cs (BadAssembly): Handle all the ugliness of
5061 DefineDynamicAssembly.
5063 2006-11-08 Raja R Harinath <rharinath@novell.com>
5065 Address parts of #58244 -- most of what's left is in the runtime
5066 * driver.cs (LoadAssembly): Simplify slightly. Add CS0009 and
5067 CS1509 error checks, and handle them for all assembly loads, not
5068 just the first invocation.
5069 (LoadModule): Likewise. Move handling of 'adder_method' ...
5070 * codegen.cs (AssemblyClass.AddModule): ... here.
5072 2006-11-02 Marek Safar <marek.safar@gmail.com>
5074 * statement.cs.cs (CollectionForeach.TryType): Issue a error when
5075 IEnumerable<T> is ambiguous.
5077 2006-10-31 Marek Safar <marek.safar@gmail.com>
5079 A fix for bug #67689
5080 * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
5081 GetEnumerator is ambiguous.
5083 * report.cs: Add new warning.
5085 2006-10-29 Marek Safar <marek.safar@gmail.com>
5087 A fix for bug #78602
5088 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
5089 to protected member can be nested type.
5091 2006-10-28 Marek Safar <marek.safar@gmail.com>
5093 A fix for bug #78965
5094 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
5095 to protected member must derive from current type.
5097 2006-10-27 Marek Safar <marek.safar@gmail.com>
5099 assign.cs: Reuses error method.
5101 ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
5102 instead of type for constants.
5103 (Expression.Error_ValueAssignment): Common error method.
5105 * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
5108 2006-10-27 Marek Safar <marek.safar@gmail.com>
5110 A fix for bug #79081
5111 * expression.cs (MemberAccess.DoResolve): Check nested type
5114 2006-10-27 Atsushi Enomoto <atsushi@ximian.com>
5116 * doc.cs : nested delegates were not handled. Fixed bug #79754.
5118 2006-10-26 Marek Safar <marek.safar@gmail.com>
5120 A fix for bug #76591
5121 * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
5123 2006-10-26 Marek Safar <marek.safar@gmail.com>
5125 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
5126 type forwarder of the same type multiple times.
5128 2006-10-26 Raja R Harinath <rharinath@novell.com>
5131 * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
5132 instance as an rvalue, even when we later resolve as an lvalue.
5134 2006-10-25 Martin Baulig <martin@ximian.com>
5136 * anonymous.cs: Fix #79673.
5138 2006-10-24 Marek Safar <marek.safar@seznam.cz>
5140 A fix for bug #79666
5141 expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
5142 ignored when is optimized (= default value) as its value is already set.
5144 2006-10-23 Marek Safar <marek.safar@seznam.cz>
5146 A fix for bug #79724
5147 * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
5148 TypeContainer for type lookup.
5150 2006-10-23 Marek Safar <marek.safar@seznam.cz>
5152 A fix for bug #79231
5153 * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
5154 * expression.cs (OverloadResolve): Always convert type name for
5156 (ResolveNamespaceOrType): Don't confuse a nested type with any
5159 2006-10-18 Martin Baulig <martin@ximian.com>
5161 * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
5163 2006-10-17 Miguel de Icaza <miguel@novell.com>
5165 * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
5166 an int32, but requesting an int64 from the conversion
5168 2006-10-12 Martin Baulig <martin@ximian.com>
5171 (AnonymousContainer.Resolve): Inflate the `ReturnType'. Fixes #79592.
5173 2006-10-12 Martin Baulig <martin@ximian.com>
5176 (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
5178 2006-10-11 Miguel de Icaza <miguel@novell.com>
5180 * convert.cs: Remove broken code: I was doing the "Existance"
5181 tests for Implicit conversions.
5183 2006-10-10 Miguel de Icaza <miguel@novell.com>
5185 * convert.cs: Added one missing case in
5186 ImplicitStandardConversionExists uint64 to intptr.
5190 * typemanager.cs (uintptr_type): another core known type.
5192 * ecore.cs (OperatorCast): routine used to do cast operations that
5193 depend on op_Explicit. We could change some of the Decimal
5194 conversions to use this.
5196 This one has a probe mechanism that checks both types for an op_
5197 which it coudl be used to eliminate two classes: CastToDecimal
5198 and CastFromDecimal.
5200 * convert.cs: Implement the conversions documented in #59800
5202 2006-10-10 Martin Baulig <martin@ximian.com>
5204 * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
5205 before RootScope.ResolveMembers().
5207 * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
5208 `CurrentType' if appropriate.
5210 2006-10-09 Marek Safar <marek.safar@seznam.cz>
5212 A fix for bug #78568
5213 * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
5214 when contains binary operators.
5215 * cs-parser.jay: Updated.
5217 2006-10-09 Martin Baulig <martin@ximian.com>
5220 (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
5221 moved that into Define() and also do the other type parameter
5222 checks there. Fixes #79094. Added gtest-292.cs.
5225 (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
5226 since that doesn't include type parameters; don't use `Ldelema'
5227 for type parameters. Fixes #78980. Added gtest-293.cs.
5229 2006-10-08 Marek Safar <marek.safar@seznam.cz>
5232 * convert.cs (ExplicitReferenceConversion): Only enum to enum value
5233 conversion is allowed.
5235 2006-10-06 Marek Safar <marek.safar@seznam.cz>
5237 * ecore.cs (Expression.MemberLookup): Don't register any symbol for
5238 error reporting when no error occurs.
5240 2006-10-06 Marek Safar <marek.safar@seznam.cz>
5242 * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
5245 2006-10-06 Raja R Harinath <rharinath@novell.com>
5248 * class.cs (DefineTypeBuilder): Check circular dependencies before
5249 setting the parent of the TypeBuilder.
5250 (CheckRecursiveDefinition): Don't use 'BaseType', since
5251 it may not be valid until after DefineTypeBuilder. Use
5252 'base_type' instead.
5254 2006-10-04 Martin Baulig <martin@ximian.com>
5256 Merged the Anonymous Methods patch.
5258 * anonymous.cs, iterators.cs: The new anonymous methods code.
5260 * statement.cs (Variable): New public abstract class.
5261 (LocalInfo.Variable): New public property.
5262 (LocalInfo.ResolveVariable): New public method.
5263 (Block.Flags): Add `IsIterator'.
5264 (Block.AddVariable): Improved the CS0136 check.
5265 (Block.AnonymousChildren): New public property.
5266 (Block.AddAnonymousChild): New public method.
5267 (ToplevelBlock): Update to use the new anonymous method framework.
5268 (ToplevelBlock.ctor): `container' is now a `Block' and not a
5269 `ToplevelBlock'; this is required to correctly implement the
5271 (Fixed, Using): Use `TemporaryVariable' instead of directly
5272 creating the `LocalBuilder'.
5274 * parameter.cs (Parameter.ResolveVariable): New public method.
5275 (Parameters.ResolveVariable): Likewise.
5277 * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
5279 * class.cs (TypeContainer): Replaced the `iterators' list and
5280 corresponding methods with a list of `CompilerGeneratedClass'es.
5281 (TypeContainer.ResolveMembers): New public method.
5282 (Method): `IIteratorContainer' has been replaced by
5285 * expression.cs (VariableReference): New public abstract base
5286 class for `LocalVariableReference', `ParameterReference' and
5289 * codegen.cs (EmitContext): Removed `capture_context',
5290 `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
5291 (EmitContext.EmitThis): Removed.
5293 * cs-parser.jay: Replace `iterator_container' with
5296 2006-10-04 Martin Baulig <martin@ximian.com>
5298 * generic.cs (GenericMethod): Don't make this abstract.
5299 (Constraints.Clone): Added dummy implementation.
5301 2006-10-04 Raja R Harinath <harinath@gmail.com>
5304 * namespace.cs (LookForAnyGenericType): Avoid nullref on
5305 'declspaces'. Avoid allocating arrays willy-nilly.
5308 * cfold.cs (BinaryFold): Move boolean Equality and Inequality
5309 cases out of the switch.
5311 2006-09-28 Marek Safar <marek.safar@seznam.cz>
5313 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
5314 message when non-generic type is used with the type arguments.
5315 * expression.cs: Updated.
5317 2006-09-28 Raja R Harinath <rharinath@novell.com>
5320 * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
5321 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
5322 Change semantics slightly. Don't insist on having only one
5323 temporary EmptyExpression -- just throttle the creation of new ones.
5326 * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
5327 non-interfaces too. If no methods are found, don't try to create
5330 2006-09-28 Marek Safar <marek.safar@seznam.cz>
5332 * ecore.cs (ResolveAsTypeStep): Print better error when type can be
5335 * namespace.cs (Namespace.LookForAnyGenericType): New method to help
5336 us produce better error message.
5338 2006-09-27 Marek Safar <marek.safar@seznam.cz>
5340 * expression.cs (Binary.ResolveOperator): Warn about a side effect
5341 of the `|' operator.
5343 * report.cs: A new warning added.
5345 2006-09-27 Martin Baulig <martin@ximian.com>
5347 * generic.cs (GenericMethod): Don't make this abstract.
5349 2006-09-27 Martin Baulig <martin@ximian.com>
5352 (InternalErrorException): Added overloaded ctor taking a params array.
5354 2006-09-26 Marek Safar <marek.safar@seznam.cz>
5356 * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
5357 Fixed the cases when same error was reported twice.
5359 * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
5360 now report symbol information.
5362 2006-09-25 Martin Baulig <martin@ximian.com>
5364 * class.cs: Completely unified with the gmcs version.
5366 2006-09-25 Martin Baulig <martin@ximian.com>
5368 * typemanager.cs (TypeManager.IsNullableType): New public function.
5369 (TypeManager.IsNullableTypeOf): Likewise.
5370 (TypeManager.IsNullableValueType): Likewise.
5372 * class.cs (MethodCore): Added the `GenericMethod' argument from
5373 gmcs and also unified all classes derived from `MethodCore' with gmcs.
5375 2006-09-24 Raja R Harinath <harinath@gmail.com>
5377 * convert.cs: Unify with gmcs version.
5379 2006-09-24 Marek Safar <marek.safar@seznam.cz>
5381 * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
5382 verify them as well.
5384 * report.cs: New warning.
5386 2006-09-24 Marek Safar <marek.safar@seznam.cz>
5388 * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
5389 for anonymous block with out argument.
5391 2006-09-24 Marek Safar <marek.safar@seznam.cz>
5393 * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
5394 not used private events only.
5396 2006-09-23 Marek Safar <marek.safar@seznam.cz>
5398 * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
5400 * const.cs (Const.Define): Check for constant type.
5401 (Const.IsConstantTypeValid): Looks for valid constant types.
5403 * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
5405 * ecore.cs (EmptyConstantCast): New common class for all constant based
5408 * expression.cs (Is.DoResolve): Handle null constant especially.
5409 (New.DoResolve): Check for new void().
5410 (MemberAccess.DoResolve): Cope with all kind of nulls.
5412 * literal.cs (NullConstant): Uses EmptyConstantCast.
5413 (NullDefault): Based on EmptyConstantCast.
5414 (NullLiteral): Uses EmptyConstantCast.
5416 * statement.cs (Block.ResolveMeta): Check for constant type.
5418 2006-09-22 Martin Baulig <martin@ximian.com>
5420 * delegate.cs, attribute.cs: Merged with the gmcs versions.
5422 2006-09-22 Raja R Harinath <rharinath@novell.com>
5424 * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
5428 * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
5429 * decl.cs (DeclSpace.FindMemberToOverride): Likewise. Reorganize
5432 2006-09-22 Martin Baulig <martin@ximian.com>
5434 * ecore.cs: Merged with the gmcs version.
5436 * generic.cs (ConstructedType): New dummy class.
5437 (TypeArguments): Don't make this abstract.
5440 (TypeManager.IsGenericTypeDefinition): New method.
5441 (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
5443 2006-09-22 Raja R Harinath <rharinath@novell.com>
5445 * expression.cs (ComposedCast): Check for arrays of TypedReference
5446 before creating the type, not after.
5448 2006-09-21 Marek Safar <marek.safar@seznam.cz>
5450 * cfold.cs, const.cs, enum.cs, statement.cs: Updated
5451 after ToType change.
5453 * constant.cs (Constant.ImplicitConversionRequired): Designed to used
5454 when constant must be implicitly convertible.
5456 * convert.cs (ImplicitReferenceConversion): Reuse ToType.
5458 * ecore.cs (NullCast): Derives from NullConstant.
5460 * expression.cs (Is.DoResolve): Removed useless variables.
5461 (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
5462 (New.Constantify): Add enum support.
5463 (MemberAccess.DoResolve): Add warning when accessing null constant or
5466 * generic.cs (GenericConstraints.IsReferenceType): Another dummy
5469 * literal.cs (NullConstant): New abstract class with common
5470 functionality for all null specializations.
5471 (NullDefault): Represents default(X) when result can be
5473 (NullLiteral): Updated.
5475 * report.cs: Add new warning.
5477 2006-09-21 Martin Baulig <martin@ximian.com>
5479 * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
5481 2006-09-21 Martin Baulig <martin@ximian.com>
5483 * generic.cs (GenericConstraints): New dummy class.
5484 (Constraints): Likewise.
5485 (TypeParameter): Likewise.
5486 (TypeParameterName): Likewise.
5487 (GenericMethod): Likewise.
5489 * typemanager.cs (TypeManager.GetGenericArguments): New method.
5491 * decl.cs: Merged with the gmcs version.
5493 2006-09-21 Raja R Harinath <rharinath@novell.com>
5495 * generic.cs (TypeParameter): Implement IMemberContainer.
5496 (GenericTypeParameterBuilder): New. An abominable repugnant hack.
5498 * rootcontext.cs: Unify with gmcs version.
5500 * report.cs: Unify with gmcs version.
5501 * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
5502 from gmcs/generics.cs.
5503 * generics.cs (TypeParameter): New dummy class.
5505 * support.cs: Unify with gmcs version.
5507 2006-09-20 Raja R Harinath <rharinath@novell.com>
5509 * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
5510 * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
5512 * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
5513 * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
5514 * mcs.exe.sources: Add generic.cs.
5516 * codegen.cs: Unify with gmcs version.
5518 * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
5519 (EmitContext): Add GenericDeclContainer implementation.
5520 * decl.cs (MemberCore, DeclSpace): Likewise.
5521 * namespace.cs: Remove #ifdef GMCS_SOURCE.
5523 * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
5524 MCS TypeManager has a corresponding dummy method.
5526 2006-09-19 Martin Baulig <martin@ximian.com>
5528 * expression.cs: Completely merged with the gmcs version.
5530 2006-09-19 Martin Baulig <martin@ximian.com>
5532 * expression.cs (Invocation): Merged with the gmcs version.
5533 (ArrayAccess.GetStoreOpcode): Likewise.
5535 2006-09-19 Martin Baulig <martin@ximian.com>
5538 (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
5539 (TypeManager.IsGenericMethodDefinition): Likewise.
5541 2006-09-19 Martin Baulig <martin@ximian.com>
5544 (TypeManager.IsEqual): Moved the gmcs implementation here.
5545 (TypeManager.DropGenericTypeArguments): Likewise.
5546 (TypeManager.DropGenericMethodArguments): Likewise.
5547 (TypeManager.GetTypeArguments): Moved here from gmcs.
5548 (TypeManager.HasGenericArguments): Likewise.
5550 2006-09-19 Martin Baulig <martin@ximian.com>
5552 * expression.cs (Binary): Merged with the gmcs version.
5554 2006-09-19 Martin Baulig <martin@ximian.com>
5556 * expression.cs (Probe, As, Is): Merged with the gmcs version.
5558 2006-09-19 Martin Baulig <martin@ximian.com>
5560 * typemanager.cs: Merged with the gmcs version.
5562 2006-09-16 Raja R Harinath <rharinath@novell.com>
5564 * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
5565 * driver.cs: Likewise.
5567 2006-09-16 Marek Safar <marek.safar@seznam.cz>
5570 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
5571 only if parent type is class.
5572 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
5575 2006-09-15 Marek Safar <marek.safar@seznam.cz>
5578 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
5580 * typemanager.cs(CSharpName): Converts NullType to null.
5582 2006-09-15 Martin Baulig <martin@ximian.com>
5585 (TypeManager.GetMethodName): Added mcs implementation.
5586 (TypeManager.IsEqual): Likewise.
5589 (SimpleName.RemoveGenericArity): Added dummy implementation.
5591 * pending.cs: Merged with the gmcs version.
5593 2006-09-15 Martin Baulig <martin@ximian.com>
5595 * statement.cs: Merge with the gmcs version.
5597 2006-09-15 Martin Baulig <martin@ximian.com>
5599 * statement.cs (Switch): Merge with the gmcs implementation
5600 (without nullables), which is newer.
5602 2006-09-15 Martin Baulig <martin@ximian.com>
5604 * statement.cs (Block.Variables): Make this public.
5605 (ToplevelBlock.Parameters): Make this a property.
5606 (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
5608 2006-09-15 Martin Baulig <martin@ximian.com>
5610 * namespace.cs: Merge with the gmcs version.
5612 2006-09-15 Martin Baulig <martin@ximian.com>
5614 * decl.cs (MemberName): Minor code cleanups.
5616 2006-09-15 Martin Baulig <martin@ximian.com>
5618 * parameter.cs: Merge with the gmcs version.
5620 2006-09-15 Martin Baulig <martin@ximian.com>
5622 * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
5623 and an error in mcs.
5625 2006-09-15 Martin Baulig <martin@ximian.com>
5627 * flowanalysis.cs: Merged from GMCS; added the generics code into
5628 a `GMCS_SOURCE' conditional so we can share this file.
5630 2006-09-08 Martin Baulig <martin@ximian.com>
5632 * typemanager.cs (TypeManager.interlocked_type): New public field.
5633 (TypeManager.int_interlocked_compare-exchange): New public field.
5634 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
5635 enumerator types here and call InitGenericCoreTypes().
5636 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
5637 after calling InitEnumUnderlyingTypes().
5640 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
5641 `classes_second_stage'.
5643 2006-09-14 Marek Safar <marek.safar@seznam.cz>
5645 * assign.cs, ecore.cs, expression.cs: Share error message text.
5646 * class.cs (FieldMember.Define): Check for varible of static type.
5647 * driver.cs (LoadAssembly): Uses error output for errors.
5648 * statement.cs: Updated.
5650 2006-09-08 Marek Safar <marek.safar@seznam.cz>
5652 * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
5655 2006-09-07 Martin Baulig <martin@ximian.com>
5658 (MainDriver): Revert r62663 from Marek; see #70506 for details.
5660 2006-08-29 Miguel de Icaza <miguel@novell.com>
5662 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
5664 2006-08-17 Miguel de Icaza <miguel@novell.com>
5666 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
5667 #52019 and #79064, the use of the \uXXXX sequence in source code
5668 to represent unicode characters.
5670 2006-08-15 Marek Safar <marek.safar@seznam.cz>
5672 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
5674 * class.cs, ecore.cs, statement.cs: Merged to one error message.
5676 2006-08-13 Miguel de Icaza <miguel@novell.com>
5678 * assign.cs: Catch attempts to assign to a method groups in += and
5681 2006-08-13 Marek Safar <marek.safar@seznam.cz>
5684 * cs-parser.jay: Don't destroy current array type by typeof of array's.
5686 2006-08-12 Marek Safar <marek.safar@seznam.cz>
5688 * class.cs (Method.Define): Issue a warning when generic method looks like
5690 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
5693 2006-08-09 Marek Safar <marek.safar@seznam.cz>
5695 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
5697 * decl.cs (MemberCache.FindMembers): When container is interface we need to
5698 search all base interfaces as a member can be ambiguous.
5699 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
5700 Constructor member type filter.
5701 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
5702 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
5703 reporting for returned memberinfos.
5704 * report.cs: Updated.
5705 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
5706 version to work on all runtimes.
5707 (TypeManager.RealMemberLookup): Removed members filtering.
5709 2006-08-08 Raja R Harinath <rharinath@novell.com>
5711 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
5712 (PropertyExpr.EmitAssign): Likewise.
5713 * expression.cs (Indirection.EmitAssign): Likewise.
5714 (LocalVariableReference.EmitAssign): Likewise.
5715 (ParameterReference.EmitAssign): Likewise.
5716 (Invocation.EmitArguments): Likewise.
5717 (ArrayAccess.EmitAssign): Likewise.
5718 (IndexerAccess.EmitAssign): Likewise.
5719 (This.EmitAssign): Likewise.
5720 (ConditionalLogicalOperator.Emit): Likewise.
5723 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
5724 instead of ArrayList. If the hashtable has a LocalBuilder, don't
5725 leave it in after returning it.
5726 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
5728 2006-08-06 Marek Safar <marek.safar@seznam.cz>
5730 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
5733 2006-08-03 Raja R Harinath <rharinath@novell.com>
5735 Fix cs0146-3.cs and cs0146-4.cs.
5736 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
5737 enclosing types don't depend on the current type.
5739 2006-08-02 Raja R Harinath <rharinath@novell.com>
5742 * class.cs (TypeContainer.DoDefineMembers): Use
5743 FindBaseMemberWithSameName on Parent, since we're interested in
5744 whether we hide inherited members or not.
5745 (FindBaseMemberWithSameName): Make slightly more robust.
5747 Fix the non-generic testcase from #77396
5748 * decl.cs (DeclSpace.DeclContainer): Remove override.
5750 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
5751 declspaces for doppelgangers too.
5752 (UsingEntry): Implement IResolveContext.
5753 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
5754 'this' as the resolve context.
5755 (LocalAliasEntry): Likewise.
5757 Implement parts of #77403
5758 * roottypes.cs (RootDeclSpace): New. Used to represent the
5759 toplevel declaration space. Each namespace declaration introduces
5760 a "partial" root declaretion space.
5761 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
5762 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
5763 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
5764 from 'current_namespace.SlaveDeclSpace'.
5765 (namespace_declaration): Likewise.
5766 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
5767 check. It can't happen now.
5768 * decl.cs (DeclSpace.LookupType): Likewise.
5769 * driver.cs (MainDriver): Sanity check.
5771 2006-08-01 Raja R Harinath <rharinath@novell.com>
5773 * decl.cs (DeclSpace.FindNestedType): Remove.
5774 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
5775 LookupTypeContainer to get the container of the nested type.
5776 * class.cs (TypeContainer.FindNestedType): Make non-override.
5778 2006-07-31 Raja R Harinath <rharinath@novell.com>
5780 * decl.cs (DeclSpace.PartialContainer): Move field from ...
5781 * class.cs (TypeContainer.PartialContainer): ... here.
5782 (TypeContainer.AddBasesForPart): New helper.
5783 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
5785 * cs-parser.jay (current_class): Convert to DeclSpace.
5786 (struct_declaration, interface_declaration, class_declaration):
5787 Use AddBasesForPart instead of .Bases directly.
5788 * const.cs, iterators.cs: Update to changes.
5790 2006-07-28 Raja R Harinath <rharinath@novell.com>
5792 * class.cs (TypeContainer.AddMemberType): Rename from
5794 (TypeContainer.AddMember): Rename from AddToMemberContainer.
5795 (AddTypeContainer): New. Combine AddClassOrStruct and
5797 (AddPartial): Update. Add 'is_partial' argument.
5798 * roottypes.cs: Update to changes.
5799 * cs-parser.jay (push_current_class): New helper for handling
5800 current_container and current_class.
5801 (struct_declaration, interface_declaration, class_declaration):
5804 2006-07-26 Raja R Harinath <rharinath@novell.com>
5806 * roottypes.cs: Rename from tree.cs.
5808 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
5809 * tree.cs (Tree, ITreeDump): Remove types.
5810 * rootcontext.cs (tree, Tree): Remove fields.
5811 (root, ToplevelTypes): New.
5812 * *.cs: Update to rename.
5814 * tree.cs (Tree.RecordDecl): Remove.
5815 (RootTypes.AddToTypeContainer): Record the toplevel type in its
5817 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
5819 2006-07-23 Raja R Harinath <harinath@gmail.com>
5821 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
5822 DoFlowAnalysis and OmitStructFlowAnalysis here.
5823 (ec.With): Rename from WithUnsafe and generalize.
5824 (ec.WithCheckState): Remove. All users can be handled by 'With'.
5825 (ec.WithFlowAnalyis): New.
5826 * ecore.cs, expression.cs, statement.cs: Update.
5828 2006-07-22 Raja R Harinath <harinath@gmail.com>
5830 * statement.cs (Block.ResolveMeta): Simplify slightly.
5832 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
5833 multiple boolean fields. Convert InUnsafe, constant_check_state,
5834 check_state to flags.
5835 (CheckState, ConstantCheckState): Update.
5836 (InUnsafe): New read-only property.
5837 (FlagsHandle): Rename from CheckStateHandle and convert to handle
5839 (WithUnsafe): New helper similar to WithCheckState.
5840 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
5841 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
5843 2006-07-21 Raja R Harinath <rharinath@novell.com>
5845 Make comparisons use the same IL irrespective of whether they're
5846 in a 'checked' or 'unchecked' context: one of the issues in #78899
5847 * codegen.cs (EmitContext.CheckState): Make read-only property.
5848 (EmitContext.ConstantCheckState): Likewise.
5849 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
5850 helper that implement a save/restore stack for CheckState
5851 values. This is the only way to change check-state.
5852 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
5853 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
5854 (CheckedExpr.EmitBranchable): New forwarding method.
5855 (UnCheckedExpr): Likewise.
5856 * statement.cs (Block.ResolveMeta): Use WithCheckState.
5857 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
5858 (Checked.Resolve, checked.DoEmit): Likewise.
5860 2006-07-20 Miguel de Icaza <miguel@novell.com>
5862 * anonymous.cs: Cache the resolved anonymous delegate, and return
5863 this so that the ResolveTopBlock is only triggered once, not
5866 Currently we trigger ResolvetopBlock twice due to a first pass of
5867 argument check compatibility, and a second pass that does the
5870 2006-07-15 Marek Safar <marek.safar@seznam.cz>
5872 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
5874 * rootcontext.cs (Reset): Add helper_classes.
5876 2006-07-15 Marek Safar <marek.safar@seznam.cz>
5879 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
5882 2006-07-13 Miguel de Icaza <miguel@novell.com>
5884 * statement.cs (Lock): Handle expressions of type
5885 TypeManager.null_type specially. Fixes #78770
5887 2006-07-08 Marek Safar <marek.safar@seznam.cz>
5889 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
5892 2006-07-08 Marek Safar <marek.safar@seznam.cz>
5894 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
5895 for accessors as well.
5896 * ecore.cs (EventExpr): Add AccessorTable.
5898 2006-07-01 Marek Safar <marek.safar@seznam.cz>
5901 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
5902 for CS0122 where appropriate.
5903 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
5905 (Filter): Assembly can be null in the case of top level attributes.
5907 2006-06-25 Marek Safar <marek.safar@seznam.cz>
5911 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
5912 is done at global level.
5914 2006-06-24 Marek Safar <marek.safar@seznam.cz>
5916 A fix for #77002, Implemented TypeForwarder support.
5918 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
5919 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
5920 * typemanager.cs (): Add type_forwarder_attr_type.
5922 2006-06-24 Marek Safar <marek.safar@seznam.cz>
5924 * report.cs: Add CS0469 warning.
5926 2006-06-21 Martin Baulig <martin@ximian.com>
5928 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
5929 the `try'-block, so we also report CS0016 etc. there.
5931 2006-06-21 Martin Baulig <martin@ximian.com>
5934 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
5936 2006-06-21 Martin Baulig <martin@ximian.com>
5938 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
5939 also report CS1686 for parameters.
5941 2006-06-21 Martin Baulig <martin@ximian.com>
5943 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
5944 instead of an error if the value is not implicitly convertible to
5945 the switch types; fixes #77964.
5947 2006-06-21 Raja R Harinath <rharinath@novell.com>
5950 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
5951 FieldBuilder is null.
5954 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
5955 'left' and 'right' before error-checking.
5957 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
5959 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
5961 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
5962 (FieldExpr.DoResolve): likewise.
5963 (PropertyExpr.InstanceResolve): likewise.
5964 (EventExpr.InstanceResolve): likewise.
5966 2006-06-04 Marek Safar <marek.safar@seznam.cz>
5968 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
5969 attribute applicable tests for attribute argument.
5971 2006-06-02 Raja R Harinath <rharinath@novell.com>
5974 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
5975 (Binary.OverloadResolve_PredefinedIntegral): New.
5976 (Binary.OverloadResolve_PredefinedFloating): New.
5977 (Binary.OverloadResolve_PredefinedString): New.
5978 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
5979 Follow the standard more closely, and treat numeric promotions in
5980 terms of overload resolution.
5981 (Binary.CheckShiftArguments): Simplify.
5983 2006-06-01 Raja R Harinath <rharinath@novell.com>
5985 * flowanalysis.cs (MyBitVector): Simplify representation.
5986 (MyBitVector.Clone): Avoid allocating BitArray.
5987 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
5988 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
5989 (*): Update. Change all references to MyBitVector.And and
5990 MyBitVector.Or to &= and |=.
5992 2006-05-29 Raja R Harinath <rharinath@novell.com>
5995 * cs-parser.jay (formal_parameter_list): Extend the pattern below
5996 to param arguments too.
5998 2006-05-26 Miguel de Icaza <miguel@novell.com>
6000 * cs-parser.jay: Catch another parsing form for arglist being
6001 followed by other arguments. Fixes #78313.
6003 2006-05-24 Raja R Harinath <rharinath@novell.com>
6005 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
6006 checking of out parameters to ...
6007 (FlowBranchingToplevel.Merge): ... here.
6008 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
6009 set, propagate the origin upward, and only complain if there was
6011 (FlowBranchingException.AddContinueOrigin): Likewise.
6012 (FlowBranchingException.AddReturnOrigin): Likewise.
6013 (FlowBranchingException.AddGotoOrigin): Likewise.
6015 2006-05-23 Raja R Harinath <rharinath@novell.com>
6017 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
6018 unreachable, skip it.
6019 (FlowBranchingException.Merge): Always propagate jumps, even if
6020 the finally block renders subsequent code unreachable.
6022 2006-05-18 Raja R Harinath <rharinath@novell.com>
6025 * statement.cs (Goto.Resolve): Move responsibility for resolving
6026 'goto' to FlowBranching.AddGotoOrigin.
6027 (Goto.SetResolvedTarget): New. Callback to set the
6028 LabeledStatement that's the target of the goto.
6029 (Goto.DoEmit): Use Leave instead of Br when crossing an
6030 unwind-protect boundary.
6031 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
6032 LookupLabel and adjust to new semantics.
6033 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
6034 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
6035 Goto.SetResolvedTarget to update target.
6036 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
6037 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
6038 AddBreakOrigin & co. Delay propagation until ...
6039 (FlowBranchingException.Merge): ... this.
6041 * statement.cs (Block.Resolve): Always depend on flow-branching to
6042 determine unreachability. Kill workaround that originally emitted
6043 only one statement after an "unreachable" label (see infloop in
6046 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
6047 This is still "wrong", but anything better would probably need a
6048 multi-pass algorithm.
6049 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
6050 usage vector. Force current usage vector to be reachable, to
6051 optimistically signify backward jumps.
6052 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
6054 (FlowBranchingLabeled.Merge): New. If no backward jump was
6055 detected, return the original salted-away usage vector instead,
6056 updated with appropriate changes. Print unreachable warning if
6058 * statement.cs (Block.Resolve): Don't print unreachable warning on
6059 a labeled statement.
6061 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
6063 * driver.cs: Pass filename without path to AssemblyBuilder's
6064 AddResourceFile. Fixes bug #78407.
6066 2006-05-17 Raja R Harinath <rharinath@novell.com>
6068 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
6069 * flowanalysis.cs (FlowBranchingLabeled): ... here.
6070 (FlowBranching.MergeChild): Overwrite
6071 reachability information from Labeled branchings too.
6073 2006-05-16 Raja R Harinath <rharinath@novell.com>
6075 * statement.cs (Goto.Resolve): Merge jump origins here ...
6076 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
6078 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
6079 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
6080 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
6081 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
6083 * statement.cs (Goto.Resolve): ... not here.
6084 (Goto.Emit): Remove CS1632 check.
6086 2006-05-14 Marek Safar <marek.safar@seznam.cz>
6088 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
6091 2006-05-11 Raja R Harinath <rharinath@novell.com>
6093 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
6094 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
6095 (FlowBranchingException.Label): Likewise.
6097 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
6099 (MyBitVector.Or): Use it to avoid losing information (Count).
6100 (FlowBranching.MergeOrigins): Likewise.
6102 * flowanalysis.cs (UsageVector.IsDirty): Remove.
6103 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
6104 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
6105 (UsageVector.ToString): Simplify.
6106 (UsageVector.MergeSiblings): Move here from ...
6107 (FlowBranching.Merge): ... here.
6108 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
6111 2006-05-10 Raja R Harinath <rharinath@novell.com>
6113 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
6114 null bitvector is treated as all-true.
6116 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
6117 (MyBitVector): Rationalize invariants. 'vector != null' implies
6118 that we have our own copy of the bitvector. Otherwise,
6119 'InheritsFrom == null' implies all inherited bits are true.
6121 2006-05-09 Marek Safar <marek.safar@seznam.cz>
6123 * statement.cs (LocalInfo): Add IsConstant.
6124 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
6125 local variable for constants.
6127 2006-05-09 Raja R Harinath <rharinath@novell.com>
6129 * flowanalysis.cs (MyBitVector.Empty): New.
6130 (MyBitVector): Don't allow InheritedFrom to be null.
6131 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
6132 (UsageVector, FlowBranching): Update to changes.
6134 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
6135 recursion. The 'Parent == null' condition isn't sufficient for
6137 (FlowBranching.AddBreakOrigin): Likewise.
6138 (FlowBranching.AddContinueOrigin): Likewise.
6139 (FlowBranching.AddReturnOrigin): Likewise.
6140 (FlowBranching.StealFinallyClauses): Likewise.
6141 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
6142 (FlowBranching.CheckOutParameters): Likewise.
6143 (FlowBranchingToplevel): Terminate all the above recursions here.
6144 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
6145 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
6147 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
6149 (FlowBranchingToplevel): New. Empty for now.
6150 (FlowBranching.MergeTopBlock): Update.
6151 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
6152 branching for the anonymous delegate.
6153 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
6155 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
6156 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
6157 information at the start of the merge. Reorganize.
6159 2006-05-07 Marek Safar <marek.safar@seznam.cz>
6161 * class.cs (MethodData.Define): Method cannot implement interface accessor.
6163 2006-05-07 Marek Safar <marek.safar@seznam.cz>
6165 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
6166 to newly introduced ctor.
6168 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
6169 message to one place.
6170 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
6173 2006-05-07 Marek Safar <marek.safar@seznam.cz>
6175 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
6177 * ecore.cs (Expression.ResolveAsConstant): Updated.
6179 * statement.cs (ResolveMeta): Updated.
6181 2006-05-06 Marek Safar <marek.safar@seznam.cz>
6183 * cs-parser.jay: __arglist cannot be used in initializer.
6185 2006-05-06 Marek Safar <marek.safar@seznam.cz>
6188 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
6191 2006-05-05 Raja R Harinath <rharinath@novell.com>
6193 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
6194 (LabeledStatement): Add 'name' parameter.
6195 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
6196 (Block.AddLabel): Update to changes.
6197 * cs-parser.jay (labeled_statement): Likewise.
6199 * flowanalysis.cs (BranchingType.Labeled): New.
6200 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
6201 (FlowBranchingLabeled): New. Does nothing for now, but will
6202 eventually handle 'goto' flows.
6203 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
6204 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
6205 that's terminated ...
6206 (Block.Resolve): ... here.
6208 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
6209 (UsageVector.MergeFinallyOrigins): Likewise.
6210 (FlowBranching.InTryOrCatch): Likewise.
6211 (FlowBranching.AddFinallyVector): Likewise.
6212 (FlowBranchingException): Update to changes.
6215 * statement.cs (Return.Resolve): Move error checking to ...
6216 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
6217 (FlowBranchingException): Handle return origins like break and
6219 (FlowBranching.UsageVector.CheckOutParameters): Remove.
6221 2006-05-04 Marek Safar <marek.safar@seznam.cz>
6224 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
6227 2006-05-04 Marek Safar <marek.safar@seznam.cz>
6230 * class.cs (MethodData.Define): Do public accessor check only when method
6231 implements an interface.
6233 2006-05-04 Raja R Harinath <rharinath@novell.com>
6235 Remove special handling of 'break'
6236 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
6237 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
6238 (UsageVector.Break): Remove.
6239 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
6241 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
6243 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
6244 UsageVector.Breaks (). Don't set NeedsReturnLabel.
6246 2006-05-03 Marek Safar <marek.safar@seznam.cz>
6249 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
6250 be the interface member.
6252 2006-05-03 Marek Safar <marek.safar@seznam.cz>
6255 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
6256 for emitting small (int) values.
6258 2006-05-03 Raja R Harinath <rharinath@novell.com>
6261 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
6262 control-flow passes through the 'finally' after merging-in all the
6263 control-flows from 'try' and the 'catch' clauses.
6265 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
6266 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
6267 always true at the only non-recursive entry point.
6268 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
6269 FlowBranchingBreakable.
6270 (FlowBranchingLoop): Remove.
6271 * statement.cs (Return.DoResolve): Update to changes.
6274 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
6275 (FlowBranching.CreateBranching): Handle it: create a
6276 FlowBranchingContinuable.
6277 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
6278 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
6279 except that it handles the 'continue' command.
6280 (FlowBranching.UsageVector.MergeOrigins): Rename from
6282 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
6283 except that it overrides AddContinueOrigin.
6284 (FlowBranchingException): Override AddContinueOrigin, similar to
6286 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
6287 Create a new branching around the embedded statement.
6288 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
6289 control flow after the embedded statement.
6290 (Continue.Resolve): Move all error checking to AddContinueOrigin.
6292 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
6293 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
6294 FlowBranchingBreakable.
6295 (FlowBranchingSwitch): Remove.
6298 * statement.cs (Break.Resolve): Simplify. Move responsibility for
6299 error reporting to ...
6300 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
6301 Rename from 'AddBreakVector'. Add new location argument. Return
6302 a bool indicating whether the 'break' crosses an unwind-protect.
6303 (FlowBranchingException.AddBreakOrigin): Add.
6304 (FlowBranchingException.Merge): Propagate 'break's to surrounding
6305 flowbranching after updating with the effects of the 'finally'
6307 (FlowBranchingBreakable): New common base class for
6308 FlowBranchingLoop and FlowBranchingSwitch.
6310 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
6312 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
6314 2006-05-02 Raja R Harinath <rharinath@novell.com>
6316 * statement.cs (Do.Resolve): If the loop is infinite, set the
6318 (While.Resolve, For.Resolve): Set a barrier after the embedded
6319 statement. There's no direct control flow that goes from the end
6320 of the embedded statement to the end of the loop.
6321 * flowanalysis.cs (FlowBranching.Infinite): Remove.
6322 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
6323 above ensure that the reachability is correctly computed.
6325 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
6326 (UsageVector.MergeBreakOrigins): If the current path is
6327 unreachable, treat it as if all parameters/locals are initialized.
6328 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
6329 infinite loops before merging-in break origins.
6331 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
6332 (Reachability.Reachable): Split part into ...
6333 (Reachability.Unreachable): ... this. Simplify.
6334 (Reachability.IsUnreachable): Use 'Unreachable' instead.
6336 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
6337 (Reachability.SetThrowsSometimes): Likewise.
6338 (FlowBranchingBlock.MergeTopBlock): Don't compare against
6339 TriState.Always, use corresponding property.
6340 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
6341 (Block.Resolve): Likewise. Remove some redundant checks.
6343 2006-05-02 Raja R Harinath <harinath@gmail.com>
6345 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
6346 (Reachability.Meet): Don't bother checking AlwaysThrows --
6347 barrier is always set.
6348 (FlowBranchingBlock.Merge): Likewise.
6350 2006-05-01 Raja R Harinath <harinath@gmail.com>
6352 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
6353 checks for unreachable.
6355 2006-05-01 Marek Safar <marek.safar@seznam.cz>
6358 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
6360 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
6361 whether field is really assigned.
6363 2006-04-30 Raja R Harinath <harinath@gmail.com>
6365 * flowanalysis.cs (Reachability): Make 4-argument constructor
6367 (Reachability.Meet): Rename from 'And'. Remove static variant.
6368 (Reachability.Always): Rename from the highly misleading
6369 'Reachability.Never'.
6370 (FlowBranching.Merge): Update to changes. Mark an impossible
6371 situation with a 'throw'.
6372 (*): Update to changes.
6374 2006-04-29 Raja R Harinath <harinath@gmail.com>
6376 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
6378 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
6379 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
6380 (*): Update to changes.
6381 * statement.cs: Update to changes.
6383 2006-04-28 Marek Safar <marek.safar@seznam.cz>
6386 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
6388 2006-04-28 Raja R Harinath <harinath@gmail.com>
6390 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
6393 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
6394 argument to two arguments: an usage-vector and a bool. Move call
6395 to FlowBranching.Merge () ...
6396 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
6398 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
6399 handling of loop and switch reachability to ...
6400 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
6402 2006-04-27 Raja R Harinath <harinath@gmail.com>
6404 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
6405 handling to FlowBranchingLoop.InLoop.
6406 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
6408 2006-04-26 Marek Safar <marek.safar@seznam.cz>
6411 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
6412 anonymous method is allowed from AnonymousContainer here.
6414 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
6416 2006-04-24 Raja R Harinath <rharinath@novell.com>
6419 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
6421 2006-04-23 Marek Safar <marek.safar@seznam.cz>
6424 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
6425 (DoubleConstant.Reduce): Ditto.
6427 2006-04-23 Raja R Harinath <rharinath@novell.com>
6429 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
6430 Remove 'lvalue_right_side' argument. Move parts to ...
6431 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
6432 (LocalVariable.DoResolveLValue): ... these.
6434 2006-04-21 Raja R Harinath <rharinath@novell.com>
6437 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
6438 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
6439 (LocalVariableReference.DoResolveBase): Use it to implement new
6441 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
6442 (Argument.Resolve): Simplify. Move CS1510 check ...
6443 * ecore.cs (Expression.ResolveLValue): ... here.
6444 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
6445 (PropertyExpr.DoResolveLValue): Likewise.
6446 (FieldExpr.Report_AssignToReadonly): Likewise.
6447 (FieldExpr.DoResolve): Add 'out_access' argument. Use
6448 LValueMemberAccess or LValueMemberOutAccess on instance depending
6450 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
6451 DoResolve as appropriate.
6453 2006-04-20 Raja R Harinath <rharinath@novell.com>
6456 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
6457 implicit conversions on 'out' and 'ref' arguments.
6459 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
6460 improve clarity. Remove dead code.
6463 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
6464 (Catch.Resolve): Resolve VarBlock if it exists.
6466 2006-04-19 Miguel de Icaza <miguel@novell.com>
6468 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
6469 twice, this was some residual code, the enumerator was emitted
6470 properly in the two branche of if later.
6472 2006-04-19 Raja R Harinath <rharinath@novell.com>
6474 * expression.cs (Cast.ResolveLValue): Remove. The result of a
6475 cast is never an lvalue.
6476 (Cast.DoResolve, Cast.ResolveRest): Combine.
6477 (Argument.Emit): Simplify slightly. Move 'Expr is
6478 IMemoryLocation' check ...
6479 (Argument.Resolve): ... here.
6480 (Argument.Error_LValueRequired): Remove. Inline into only user.
6482 Simplifications. Fix cs0191-2.cs
6483 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
6484 CS1649 and CS1651 to ...
6485 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
6486 the actual selection of the error code and message to a lookup
6487 table. Add a dummy return value to simplify callsites.
6488 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
6489 readonly fields of other instances of the same type. Move CS0197
6491 * expression.cs (Argument.Resolve): ... here. Simplify code.
6492 Ensure that ec.InRefOutArgumentResolving is only set during LValue
6493 resolution of an out or ref argument. The code simplification
6494 above uses this invariant.
6496 2006-04-18 Raja R Harinath <rharinath@novell.com>
6498 Possibly fix #77752. Fix cs1690-[4-7].cs.
6499 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
6500 CheckMarshallByRefAccess. Drop parameter.
6501 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
6503 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
6505 * report.cs (AllWarnings): Add CS1690.
6506 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
6508 (LocalVariableReference.DoResolveBase): Update.
6510 2006-04-09 Marek Safar <marek.safar@seznam.cz>
6512 * class.cs (MethodOrOperator): Moved common parts from method class.
6513 detect obsolete attributes.
6514 (Method.Define): Simplified as it reuses code from base.
6515 (Constructor.ValidAttributeTargets): Fixed issue found during
6517 (Destructor.ValidAttributeTargets): Fixed issue found during
6519 (Operator): Finished refactoring set off by #78020. Operator class is now
6520 ordinary method class.
6522 * anonymous.cs: Updated.
6524 * decl.cs (DeclSpace): Add IsGeneric
6526 2006-04-09 Marek Safar <marek.safar@seznam.cz>
6528 * class.cs (Constructor.Emit): Don't emit the attributes twice.
6530 2006-04-09 Marek Safar <marek.safar@seznam.cz>
6532 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
6533 detect obsolete attributes.
6534 (Method.CreateEmitContext): Moved to MethodOrOperator.
6536 2006-04-09 Marek Safar <marek.safar@seznam.cz>
6539 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
6540 customized exception to make crash detection easier.
6541 (MethodOrOperator): Started to work on new base class for methods and
6543 (Method): Derives from MethodOrOperator.
6544 (Constructor.Emit): Emits its own attributes.
6545 (AbstractPropertyEventMethod.Emit): Ditto.
6546 (Operator): Derives from MethodOrOperator, will refactor fully in extra
6548 (Operator.Emit): It's temporary more tricky than should be.
6550 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
6552 * report.cs (InternalErrorException): Add ctor with inner exception.
6554 2006-04-08 Marek Safar <marek.safar@seznam.cz>
6557 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
6560 2006-04-07 Marek Safar <marek.safar@seznam.cz>
6563 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
6566 2006-04-06 Marek Safar <marek.safar@seznam.cz>
6568 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
6569 attribute is present and Guid not.
6570 (Interface.ApplyAttributeBuilder): Ditto.
6572 * attribute.cs: Add error message.
6574 2006-04-06 Marek Safar <marek.safar@seznam.cz>
6578 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
6579 sources (it's composite) so hold them in extra array as they are used in
6580 Emit phase only. It worked in the previous versions by mistake.
6581 (Attribute.Emit): Emit attribute for more owners when exist.
6583 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
6584 it has now different behaviour.
6586 2006-04-04 Marek Safar <marek.safar@seznam.cz>
6588 * constant.cs (Constant.IsDefaultInitializer): New method.
6590 * class.cs: Updated.
6592 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
6593 re-initialize default values. It saves KBs almost for every assembly.
6594 Thanks Zoltan for the idea.
6595 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
6596 (ArrayCreation.DoResolve): Resolve only once.
6597 (ArrayCreation.Emit): Emit static initializer only when it is faster.
6598 (ArrayCreation.GetAttributableValue): Cope with optimized values.
6600 2006-04-03 Zoltan Varga <vargaz@gmail.com>
6602 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
6605 2006-04-01 Marek Safar <marek.safar@seznam.cz>
6607 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
6608 in an embedded statement too.
6610 2006-04-01 Raja R Harinath <rharinath@novell.com>
6613 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
6615 2006-04-01 Marek Safar <marek.safar@seznam.cz>
6619 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
6622 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
6624 2006-03-31 Marek Safar <marek.safar@seznam.cz>
6626 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
6629 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
6630 LocalTemporary change.
6632 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
6634 (ClassOrStruct.DefineFieldInitializers): Implemented static field
6635 initializers optimization.
6636 (ClassOrStruct.TypeAttr): Moved from modifiers.
6637 (Constructor.CheckBase): Don't crash when static ctor has parameters.
6638 (FieldBase.ResolveInitializer): Resolves initializer.
6639 (FieldBase.HasDefaultInitializer): New property.
6641 * cs-parser.jay: Removed message.
6643 * expression.cs (CompilerGeneratedThis): New specialization.
6645 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
6647 2006-03-28 Marek Safar <marek.safar@seznam.cz>
6649 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
6651 2006-03-27 Marek Safar <marek.safar@seznam.cz>
6653 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
6654 be now EnumConstants only.
6656 2006-03-27 Marek Safar <marek.safar@seznam.cz>
6658 * attribute.cs, driver.cs: Reset more caches.
6660 2006-03-26 Marek Safar <marek.safar@seznam.cz>
6662 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
6664 2006-03-26 Marek Safar <marek.safar@seznam.cz>
6666 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
6667 for easier reuse. Updated all overrides.
6668 (IntegralConstant): New base class for all integral constants.
6669 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
6670 of the constant range, report custom error.
6671 (UIntConstant.Reduce): Fixed uint conversion.
6673 * ecore.cs, literal.cs: Reduce updates.
6675 2006-03-26 Marek Safar <marek.safar@seznam.cz>
6679 * class.cs (Constructor.Define): Removed extra if for default ctors.
6680 A patch from Atsushi Enomoto.
6682 2006-03-26 Marek Safar <marek.safar@seznam.cz>
6684 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
6685 GetAttributableValue.
6687 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
6690 * convert.cs (ImplicitConversionRequired): Error message moved to
6693 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
6694 automatic implicit conversion of an output value.
6695 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
6697 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
6699 (TypeOf.GetAttributableValue): Add extra handling for object type.
6701 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
6702 special error message.
6704 2006-03-25 Marek Safar <marek.safar@seznam.cz>
6706 * class.cs (Constructor.Emit): Don't crash when struct ctor is
6708 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
6709 compatible with MS runtime.
6711 2006-03-23 Marek Safar <marek.safar@seznam.cz>
6713 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
6714 attribute arguments here.
6716 * class.cs (Indexer.Define): The check was moved to attribute class.
6718 2006-03-22 Marek Safar <marek.safar@seznam.cz>
6720 * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
6721 expression.cs, typemanager.cs: Minor changes from gmcs to make merging
6724 2006-03-22 Raja R Harinath <rharinath@novell.com>
6726 Support ParameterDefaultValueAttribute in gmcs. Also applied to
6727 mcs to keep code differences small.
6728 * attribute.cs (Attribute.GetParameterDefaultValue): New.
6729 * typemanager.cs (parameter_default_value_attribute_type): New.
6730 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
6733 2006-03-21 Marek Safar <marek.safar@seznam.cz>
6735 * expression.cs (StringConcat.Append): Reverted back to no warning state.
6737 2006-03-21 Marek Safar <marek.safar@seznam.cz>
6739 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
6741 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
6744 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
6746 * doc-bootstrap.cs : fix build.
6748 2006-03-20 Marek Safar <marek.safar@seznam.cz>
6750 * expression.cs (StringConcat.Append): Issue a warning when empty string
6753 2006-03-20 Marek Safar <marek.safar@seznam.cz>
6755 * assign.cs (CompoundAssign.ResolveSource): Removed.
6757 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
6760 * class.cs (TypeContainer.FindMethods): Removed.
6761 (TypeContainer.CheckMemberUsage): Made static.
6763 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
6765 * constant.cs (CheckRange): Removed unused type argument.
6766 (CheckUnsigned): Removed unused type argument.
6768 * cs-parser.jay: Updated after MemberAccess clean up.
6769 Uses Length for empty string test.
6771 * cs-tokenizer.cs: Uses Length for empty string test.
6772 (IsCastToken): Made static.
6773 (is_hex): Made static.
6774 (real_type_suffix): Made static.
6776 * decl.cs (SetupCache): Made static.
6777 (OnGenerateDocComment): Removed unused ds argument.
6779 * delegate.cs (VerifyDelegate): Removed unused argument.
6781 * doc.cs: Uses Length for empty string test.
6783 * driver.cs: Uses Length for empty string test.
6785 * enum.cs (IsValidEnumType): Made static
6787 * expression.cs (EnumLiftUp): Removed unused argument.
6788 (ResolveMethodGroup): Ditto.
6789 (BetterConversion): Ditto.
6790 (GetVarargsTypes): Ditto.
6791 (UpdateIndices): Ditto.
6792 (ValidateInitializers): Ditto.
6793 (MemberAccess.ctor): Ditto.
6794 (GetIndexersForType): Ditto.
6796 * flowanalysis.cs: (MergeFinally): Removed unused argument.
6798 * iterators.cs: Updated after MemberAccess clean up.
6800 * location.cs: Uses Length for empty string test.
6802 * namespace.cs: Uses Length for empty string test.
6804 * report.cs (CheckWarningCode): Made static.
6806 * statement.cs (LabeledStatement): Removed unused argument.
6808 * typemanager.cs (FilterNone): Removed.
6810 2006-03-18 Marek Safar <marek.safar@seznam.cz>
6812 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
6815 * class.cs: Updated.
6817 2006-03-18 Marek Safar <marek.safar@seznam.cz>
6819 * cs-parser.jay.cs: __arglist is not allowed for delegates.
6821 2006-03-18 Marek Safar <marek.safar@seznam.cz>
6825 * expression.cs (VerifyArgumentsCompat): Reverted to double error
6826 reporting, it's more tricky than I thought.
6828 2006-03-18 Marek Safar <marek.safar@seznam.cz>
6832 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
6834 (AnonymousMethod.ImplicitStandardConversionExists): New method.
6835 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
6836 Add more error reporting; Fixed issue with params.
6838 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
6840 * cs-parser.jay: AnonymousMethod requires host container.
6842 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
6844 2006-03-18 Raja R Harinath <harinath@gmail.com>
6846 * class.cs: Change 'TypeContainer ds' constructor argument to
6847 'DeclSpace parent'. Some classes were missed below due to
6848 different naming convention.
6850 * class.cs (MemberCore.Parent): Delete. This makes the
6851 ParentContainer changes below enforceable by the compiler.
6853 Treat pointers to enclosing declaration space as 'DeclSpace', not
6855 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
6856 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
6858 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
6860 (Block.AddThisVariable): Likewise.
6861 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
6862 (AbstractPropertyEventMethod.Emit): Likewise.
6863 (AbstractPropertyEventMethod.EmitMethod): Likewise.
6864 (GetMethod.Define, SetMethod.Define): Likewise.
6865 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
6866 (DelegateMethod.EmitMethod): Likewise.
6868 Fix regression test-partial-13.cs.
6869 Rationalize use of PartialContainer. Ensure that the partial
6870 class semantics can be tied to type-correctness, i.e., any
6871 violation will cause a compile error.
6872 * class.cs, const.cs: Access all fields that belong to class
6873 TypeContainer via ParentContainer. Arguments of EmitContexts and
6874 Resolve()-like functions still use 'Parent'.
6876 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
6877 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
6878 (PropertyMethod.CheckModifiers): Remove unused argument.
6879 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
6882 2006-03-17 Raja R Harinath <harinath@gmail.com>
6884 Make semantics of PartialContainer simpler.
6885 * decl.cs (DeclSpace.IsPartial): Remove.
6886 * class.cs (TypeContainer.IsPartial): Likewise.
6887 (TypeContainer..ctor): Set PartialContainer to point to self.
6888 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
6889 (TypeContainer.FindNestedType): Likewise.
6890 (MemberCore.ParentContainer): Simplify. Remove deprecation.
6892 2006-03-17 Marek Safar <marek.safar@seznam.cz>
6894 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
6896 2006-03-15 Marek Safar <marek.safar@seznam.cz>
6898 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
6901 2006-03-15 Marek Safar <marek.safar@seznam.cz>
6903 * class.cs (Operator.Define): An error for base conversion was not
6906 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
6908 * iterator.cs : yield break is allowed in try statement which has
6909 catch clauses. Fixed bug #77767.
6911 2006-03-13 Marek Safar <marek.safar@seznam.cz>
6913 A fix for #77593, #77574.
6915 * class.cs (MethodCore.CheckBase): Another if for operator.
6917 2006-03-09 Marek Safar <marek.safar@seznam.cz>
6919 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
6922 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
6923 (DelegateCreation.ImplicitStandardConversionExists): New method for just
6926 *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
6929 * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
6930 Updated after another emitcontext usage was clean up. It should help us to
6931 synchronize with gmcs easier.
6933 2006-03-04 Marek Safar <marek.safar@seznam.cz>
6937 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
6938 (Event.Define): ditto
6939 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
6941 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
6942 Removed redundant code and set NewSlot for Invoke method too.
6944 * parameter.cs (Parameters.ctor): Add custom, type ctor.
6945 (Parameters.MergeGenerated): New method. Use this method when you merge
6946 compiler generated argument with user arguments.
6948 2006-03-03 Marek Safar <marek.safar@seznam.cz>
6950 * attribute.cs (ResolveAsTypeTerminal): Removed.
6952 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
6953 specialization for predefined types; 30% speed up.
6954 Finally placed obsolete check to right place.
6955 (Expression.ResolveType): Removed.
6957 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
6958 Updated after ResolveType was removed.
6960 * expression.cs (Cast.ctor): Check void cast.
6961 (Binary.ResolveAsTypeTerminal): Is never type.
6962 (Conditional.ResolveAsTypeTerminal): Is never type.
6964 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
6966 2006-03-01 Raja R Harinath <rharinath@novell.com>
6969 * expression.cs (ParameterReference.DoResolveBase): Change return
6971 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
6975 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
6978 * typemanager.cs (GetFullNameSignature): Don't nullref on
6979 protected accessors.
6981 2006-02-27 Marek Safar <marek.safar@seznam.cz>
6983 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
6984 these two separated members to simplify the code.
6985 (Attribute.Resolve): Refactored to use new fields and methods.
6986 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
6987 implemented obsolete attribute checking.
6988 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
6989 implemented obsolete checking again. It look line never ending quest ;-)
6990 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
6992 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
6994 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
6996 *class.cs (Property.Define): Add RegisterProperty call.
6998 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
6999 argument groups (only 2).
7001 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
7002 encoding expression to arguments.
7003 (Expression.ExprClassToResolveFlags): Just turned to property.
7005 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
7006 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
7007 optimized as well as implemented support for zero-length attributes.
7009 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
7010 Add caching of PropertyInfo's.
7012 2006-02-25 Marek Safar <marek.safar@seznam.cz>
7014 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
7015 error multiple times.
7017 2006-02-25 Marek Safar <marek.safar@seznam.cz>
7019 New partial class implementation.
7020 A fix for #77027, #77029, #77403
7022 * attribute.cs (Attributable): Made attributes protected.
7024 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
7025 the replacements of ClassPart and PartialContainer.
7026 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
7027 (TypeContainer.AddInterface): Ditto.
7028 (TypeContainer.AddPartial): The main method for partial classes. It checks
7029 for errors and merges ModFlags and attributes. At the end class is added to
7031 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
7033 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
7034 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
7035 from the rest of partial classes.
7036 (TypeContainer.GetClassBases): Simplified.
7037 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
7039 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
7040 (TypeContainer.HasExplicitLayout): Uses Flags now.
7041 (PartialContainer): Removed.
7042 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
7043 (StaticClass): Was merged with Class.
7044 (Class.GetClassBases): class and static class bases are verified here.
7045 (Class.TypeAttr): Added static attributes when class is static.
7046 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
7047 (MemberBase): In some cases we need to call parent container for partial
7048 class. It should be eliminated but it's not easy now.
7050 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
7052 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
7053 partial classed to accumulate class comments.
7054 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
7056 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
7058 * driver.cs (MainDriver): Tree.GetDecl was removed.
7060 * modifiers.cs (Modifiers): Add partial modifier.
7062 * tree.cs (Tree.decl): Removed.
7063 (RootTypes): Started to use this class more often for root types
7066 2006-02-22 Marek Safar <marek.safar@seznam.cz>
7070 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
7071 external interface does not have an attribute.
7073 2006-02-22 Marek Safar <marek.safar@seznam.cz>
7075 Another prerequisites for new partial classs implementation.
7077 * attribute.cs (Attribute.Equal): Implemented.
7078 (Attribute.Emit): Changed as attributes can be applied more than twice.
7079 (Attributes.Emit): Check for duplicate attributes here.
7081 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
7082 as a parameter, clean-up.
7084 2006-02-11 Marek Safar <marek.safar@seznam.cz>
7088 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
7089 contains obsolete attribute check which can in some cases look for base
7090 type of current class which is not initialized yet.
7091 (TypeContainer.BaseType): Replacement of ptype.
7093 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
7095 2006-02-11 Marek Safar <marek.safar@seznam.cz>
7097 First of prerequisites for new partial classs implemention.
7099 * attribute.cs (Attributable): Extended by ResolveContext;
7100 Attributes finally have correct context for resolving in all cases.
7101 (AttachTo): Attribute owner is assigned here.
7103 * codegen.cs (IResolveContext): Introduce new interface to hold
7104 all information needed in resolving phase.
7105 (EmitContext): Implements IResolveContext; more clean-up needed here.
7107 * decl.cs (MemberCore): Implemented IResolveContext.
7109 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
7110 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
7111 parameter.cs, statement.cs, tree.cs, typemanager.cs:
7112 Refactored to use new IResolveContext instead of EmitContext; cleanup
7114 2006-02-06 Miguel de Icaza <miguel@novell.com>
7116 * codegen.cs (EmitScopeInitFromBlock): check here the
7117 capture_context, there is no need to make two calls to the
7120 * anonymous.cs: Add some debugging messages that might help me
7121 track other instances of this problem in the future (the
7122 regression of test 467).
7124 * cs-parser.jay: track the variable block, as we need to initalize
7125 any captured variables declared in this block for the "catch"
7126 portion of the "Try" statement.
7128 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
7129 scope initialization for captured variables.
7131 Also, move the emit for the variables after the block location has
7134 2006-02-06 Marek Safar <marek.safar@seznam.cz>
7136 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
7138 2006-02-02 Miguel de Icaza <miguel@novell.com>
7140 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
7141 commit yesterday, the initialization for the roots is necessary.
7142 What is not necessary is the scope activation.
7144 2006-02-02 Raja R Harinath <rharinath@novell.com>
7146 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
7147 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
7149 (Argument.Resolve): Remove CS0206 checks.
7151 2006-02-01 Miguel de Icaza <miguel@novell.com>
7153 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
7154 scopes for all the roots, the scopes will now be emitted when the
7155 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
7157 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
7158 code. This reduces a lot of existing cruft.
7160 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
7161 that the ScopeInfo is generated as we enter the scope, not at the
7162 time of use, which is what we used to do before.
7164 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
7165 every time a Block is about to be emitted if we have a
7168 2006-02-01 Raja R Harinath <rharinath@novell.com>
7170 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
7172 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
7174 * typemanager.cs (cons_param_array_attribute): Make private.
7175 (Reset): Set it to null.
7176 (InitCoreHelpers): Don't initialize it.
7177 (ConsParamArrayAttribute): New. Initialize it as needed.
7178 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
7180 2006-01-31 Miguel de Icaza <miguel@novell.com>
7182 * expression.cs: There might be errors reported during the
7183 selection of applicable methods. If there are errors, do not
7184 continue execution as it will lead the compiler to crash.
7186 2006-01-30 Miguel de Icaza <miguel@novell.com>
7188 * expression.cs: Member access is not allowed on anonymous
7189 methods. Fixes #77402.
7191 2006-01-30 Raja R Harinath <rharinath@novell.com>
7194 * cs-parser.jay (VariableDeclaration): Don't set
7195 current_array_type to null.
7196 (field_declaration, event_declaration, declaration_statement):
7197 Set it to null here.
7199 2006-01-28 Raja R Harinath <harinath@gmail.com>
7201 * typemanager.cs (GenericParameterPosition): New.
7204 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
7206 * doc.cs : To process "include" elements, first we should create
7207 another list than XmlNodeList, because it could result in node
7208 removal, which could result in that the XmlNodeList gives up
7211 (Also made code identical to gmcs again.)
7213 2006-01-25 Miguel de Icaza <miguel@novell.com>
7215 * ecore.cs: Introduce an error report that we were not catching
7216 before, if not silent, we must report the error. Gonzalo ran into
7219 2006-01-23 Miguel de Icaza <miguel@novell.com>
7221 A fix for bug: #76957
7223 * iterators.cs (MoveNextMethod.CreateMethodHost): call
7224 ComputeMethodHost before creating the method, this is a new
7227 * anonymous.cs (AnonymousContainer): Now we track all the scopes
7228 that this method references (RegisterScope). The actual scope
7229 where the method is hosted is computed with the ComputeMethodHost
7230 before we create the method.
7232 Moved the Deepest routine here.
7234 (AnonymousContainer.ComputeMethodHost): New routine used to
7235 compute the proper ScopeInfo that will host the anonymous method.
7237 (ScopeInfo): Deal with multiple roots. The problem was that we
7238 did not have a unique root where all ScopeInfos could be hanged
7239 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
7242 Remove AdjustMethodScope which is now computed at the end. Remove
7243 LinkScope which did a partial link, instead link all ScopeInfos
7244 before code generation from the new "LinkScopes" routine.
7246 Simplify all the Add* routines as they no longer need to maintain
7247 the tree, they just need to record that they are using variables
7250 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
7251 routines to produce the forest of ScopeInfo trees.
7253 * class.cs (TypeContainer.AppendMethod): This is just like
7254 AddMethod, but ensures that an interface implementation method
7255 (IEnumerable.XXX) is not inserted at the beginning of the queue of
7256 methods, but at the end.
7258 We use this functionality to ensure that the generated MoveNext
7259 method in the iterator class is resolved/emitted before the
7260 enumerator methods created.
7262 This is required because the MoveNext method computes the right
7263 ScopeInfo for the method. And the other methods will eventually
7264 need to resolve and fetch information computed from the anonymous
7267 2006-01-21 Raja R Harinath <harinath@gmail.com>
7268 Carlos Alberto Cortez <calberto.cortez@gmail.com>
7271 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
7273 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
7274 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
7276 2006-01-18 Raja R Harinath <rharinath@novell.com>
7278 Fix #76656, cs0231-2.cs.
7279 * cs-parser.jay (formal_parameter_list): Make error case catch
7281 (parenthesized_expression_0): Add CS1026 check.
7282 (invocation_expression): Remove unused { $$ = lexer.Location }.
7284 2006-01-17 Raja R Harinath <rharinath@novell.com>
7287 * cs-parser.jay (statement_expression): Don't list out the
7288 individual statement-expressions. Convert syntax error into
7291 2006-01-16 Raja R Harinath <rharinath@novell.com>
7294 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
7295 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
7296 CheckIntermediateModification.
7297 (FieldExpr.DoResolve): Add new two-argument version that
7298 allows us to resolve the InstanceExpression as an lvalue.
7299 The one-argument variant is now just a wrapper.
7300 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
7301 Resolve the lhs as an lvalue if the it has a value type.
7302 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
7303 from Assign.DoResolve.
7304 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
7305 resolved as an lvalue.
7306 (PropertyExpr.DoResolve): Update.
7307 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
7308 has a value type. Move CS1612 check here from
7309 CheckIntermediateModification.
7310 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
7311 * expression.cs (EmptyExpression.OutAccess): New. Used as the
7312 'right_side' of a ResolveLValue on an 'out' argument.
7313 (EmptyExpression.LValueMemberAccess): New. Used as the
7314 'right_side' of a propagated ResolveLValue on a value type.
7315 (LocalVariableReference.DoResolveBase): Recognize
7316 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
7318 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
7319 EmptyExpression.Null.
7321 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
7323 * typemanager.cs : added IsGenericParameter(). In mcs it always
7325 * doc.cs : for generic parameters, use GenericParameterPosition,
7328 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
7330 * expression.cs: Fix Console.WriteLine ((this = x).foo);
7332 2006-01-12 Miguel de Icaza <miguel@novell.com>
7334 This fixes the problem where we used ldfld instead of ldflda to
7335 load the "THIS" pointer on captured parameters, when THIS is a
7336 value type. See bug #77205.
7338 * iterators.cs (CapturedThisReference.Emit): Pass false to
7339 EmitThis (we do not need the address).
7341 * codegen.cs (EmitThis): it needs to know whether we need the
7342 address of `this' or not. This is used by value types.
7344 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
7345 every other call passes false.
7347 2006-01-12 Raja R Harinath <rharinath@novell.com>
7350 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
7352 * expression.cs (Invocation.OverloadResolve): Update.
7353 (Invocation.DoResolve): Avoid double resolution of invocation.
7355 2006-01-11 Raja R Harinath <rharinath@novell.com>
7358 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
7359 unary negation of floating point types as 0-expr; negation cannot
7360 overflow in floating point types.
7363 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
7364 on operands of 'void' type.
7367 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
7368 and ExclusiveOr for boolean constants too.
7370 2006-01-09 Raja R Harinath <rharinath@novell.com>
7373 * expression.cs (Invocation.OverloadResolve): Replace reflected
7374 override methods with their base virtual methods, rather than
7376 * typemanager.cs (TypeManager.GetOverride): New.
7378 2006-01-05 Jb Evain <jbevain@gmail.com>
7380 * class.cs (Property.Define, Indexer.Define): do not tag the
7381 properties as SpecialName | RTSpecialName.
7383 2006-01-04 Miguel de Icaza <miguel@novell.com>
7385 * class.cs (MethodCore.IsDuplicateImplementation): This method was
7386 doing a low-level comparission of parameter types. It was lacking
7387 a check for __argslist.
7389 2005-12-30 Miguel de Icaza <miguel@novell.com>
7391 * expression.cs (ParameterReference.DoResolveBase): Allow
7392 reference parameters if they are local to this block.
7394 This allows the ref and out parameters of a delegate to be used in
7395 an anonymous method, for example:
7397 delegate void set (out int x);
7399 set s = delegate (out int x){
7403 This is used by functionality introduced late in the C# language.
7405 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
7406 method that take ref and out parameters.
7408 Fixes #77119 which was a late change in the spec.
7410 2005-12-23 Miguel de Icaza <miguel@novell.com>
7412 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
7413 parent if its the same scope. Fixes #77060.
7415 2005-12-21 Miguel de Icaza <miguel@novell.com>
7417 * driver.cs: Report the case of no source files and no -out:
7420 2005-12-20 Raja R Harinath <rharinath@novell.com>
7423 * expression.cs (ComposedCast.GetSignatureForError): Define.
7425 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
7429 * namespace.cs (NamespaceEntry): Add extern_aliases as a
7430 ListDictionary, to contain the ExternAliasEntry entries (in
7431 addition to the NamespaceEntry.aliases hashtable). This field is
7432 shared between the original entry and its doppelganger (bodyless
7434 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
7435 extern_aliases field.
7436 (NamespaceEntry.Lookup): Move the IsImplicit check after the
7437 lookup in extern_aliases.
7439 2005-12-16 Raja R Harinath <rharinath@novell.com>
7442 * class.cs (TypeContainer.Mark_HasEquals): New.
7443 (TypeContainer.Mark_HasGetHashCode): New.
7444 (ClassPart): Override them.
7445 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
7448 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
7449 'parent' argument to the base constructor.
7451 Remove all mention of TypeContainer from decl.cs.
7452 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
7453 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
7454 (DeclSpace.DeclSpace): Likewise.
7455 (DeclSpace.DefineMembers): Remove unused argument.
7456 * cs-parser.jay (pop_current_class): Update to changes. Simplify
7457 debugging check -- we don't care if the debug code throws an
7458 InvalidCastException instead of an InternalErrorException.
7459 * class.cs (TypeContainer.DefineMembers): Update to changes.
7460 (TypeContainer.DoDefineMembers): Likewise.
7461 (TypeContainer.GetMethods): Likewise.
7462 (PropertyMember.Define): Likewise.
7463 (MemberBase.Parent): New property that forwards to
7464 MemberCore.Parent, but ensures that we get a TypeContainer.
7465 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
7466 (RootContext.PopulateTypes): Likewise. Remove special case code
7467 for !RootContext.StdLib: DefineMembers is idempotent.
7469 2005-12-14 Miguel de Icaza <miguel@novell.com>
7471 * convert.cs (ExplicitConversionCore): Check the return value from
7472 ExplicitConversionCore which can return null on failure. Fixes #76914
7474 2005-12-13 Marek Safar <marek.safar@seznam.cz>
7476 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
7478 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
7480 * doc.cs : The search for referenced namespace was insufficient to
7481 get global one as it used to do. Fixed bug #76965.
7483 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
7485 * doc.cs : check name in cref in the last phase that whether it is
7488 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
7490 * cs-tokenizer.cs : reverted the latest change: it somehow broke
7493 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
7495 * doc.cs : so it turned out that we cannot skip override check for
7496 interface members. Fixed bug #76954.
7498 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
7500 * cs-tokenizer.cs : fixed bug #75984:
7501 - #warning and #error should not be handled when the source line
7503 - #line is not checked strictly when the source line is disabled.
7504 - #define and #undef is on the other hand checked strictly at any
7507 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
7509 * cs-tokenizer.cs : missing Location (actually, filename) in one of
7512 2005-12-05 Marek Safar <marek.safar@seznam.cz>
7514 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
7516 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
7518 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
7519 (FieldBase.Initializer): Initializer is now optional.
7520 (EventField.Define): Only event field can have initializer.
7522 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
7524 * const.cs (Const): Reuse initializer.
7526 * cs-parser.jay: Updated after FieldBase changes.
7527 Added current_array_type to simplify array initializers.
7529 * ecore.cs (NullCast.IsDefaultValue): Implemented.
7531 * expression.cs, iterators.cs: Updated.
7533 * namespace.cs (NamespaceEntry): Made UsingFound private.
7535 2005-12-05 Marek Safar <marek.safar@seznam.cz>
7537 * parameterCollection.cs: Obsolete, removed.
7538 * parser.cs: Obsolete, removed.
7540 2005-12-05 Marek Safar <marek.safar@seznam.cz>
7543 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
7545 * enum.cs (Enum.Define): Set obsolete context here.
7547 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
7550 - FindDocumentedMember() now expects 1) paramList as null
7551 when "we don't have to check the number of parameters" and
7552 2) Type.EmptyTypes when "there is no arguments".
7553 - Introduced FoundMember struct to hold the exact type which was
7554 used to find the documented member (the above change broke
7555 test-xml-044; it might be better just to use DeclaringType than
7556 what MS does, like this change does, but it depends on usage.)
7558 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
7560 * doc.cs : documented member might be from DeclaringType for nested
7561 types. Fixed bug #76782.
7563 2005-12-03 Ben Maurer <bmaurer@ximian.com>
7565 * anonymous.cs: Have the param code handle leaving copies on the
7566 stack etc. Allows anonymous params to take part in the assignment
7567 code (++, +=, etc). Fixes bug #76550
7569 * expression.cs: Handle the prepare_for_load/leave_copy by passing
7570 it down to the anon code.
7572 * iterators.cs: Use dummy var here
7574 * codegen.cs: Handle new vars
7576 2005-12-01 Marek Safar <marek.safar@seznam.cz>
7579 * class.cs (MethodData.Define): Set proper Obsolete context.
7581 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
7583 (FieldExpr.DoResolve): Ditto.
7585 2005-12-01 Marek Safar <marek.safar@seznam.cz>
7588 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
7589 parent is not obsolete.
7591 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
7593 * doc.cs : (FindDocumentedMember) find parameterless members first
7594 and get CS0419 in the early stage. Fixed first case of bug #76727.
7596 2005-11-30 Marek Safar <marek.safar@seznam.cz>
7599 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
7600 no error was reported.
7602 *expression.cs (Binary.DoResolve): left can be null.
7604 2005-11-22 Marek Safar <marek.safar@seznam.cz>
7607 * class.cs (MethodData.Emit): Parameters should be labeled first.
7609 2005-11-21 Marek Safar <marek.safar@seznam.cz>
7612 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
7614 2005-11-18 Marek Safar <marek.safar@seznam.cz>
7616 * attribute.cs (AreParametersCompliant): Moved to Parameter.
7618 * class.cs (MethodCore): Parameter clean up.
7619 (IMethodData): Added ParameterInfo.
7620 (MethodData): Parameter clean up.
7621 (Indexer.Define): Parameter clean up.
7633 * typemanager.cs: Parameter clean up.
7635 * delegate.cs (Define): Get rid of duplicated code.
7637 * expression.cs (ParameterReference): Removed useless parameters
7639 (Invocation): Ditto.
7641 * parameter.cs (ParamsParameter): New class, params specialization.
7642 (ArglistParameter): Attemp to separate arglist.
7643 (Parameter): Refactored to be reusable and faster.
7644 (Parameter.Modifier): Made understandable.
7645 (Parameters): Changed to be used as a class for `this' assembly
7646 parameters. Refactored to use new specialized classes.
7648 * support.cs (ParameterData): Added Types property.
7649 (InternalParameters): Deleted.
7651 2005-08-20 Martin Baulig <martin@ximian.com>
7653 Merging this patch from GMCS to fix #75867.
7655 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
7656 scope if we don't already have it.
7658 2005-11-17 Martin Baulig <martin@ximian.com>
7661 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
7662 inherit the scope from our parent. Fixes #76653.
7664 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
7666 * doc.cs : the previous patch does not actually fix the bug.
7667 PropertyInfo override check is now implemented and really fixed it.
7668 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
7670 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
7672 * doc.cs : apply "override filter" also to properties.
7675 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
7677 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
7678 no need to check overrides. For classes, omit those results from
7679 interfaces since they must exist in the class. Fixed bug #76726.
7681 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
7683 * typemanager.cs : (GetFullNameSignature) differentiate indexers
7684 with different parameters. Fixed the second problem in #76685.
7686 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
7688 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
7689 get expected 'protected' access in CheckValidFamilyAccess()).
7692 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
7694 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
7695 Fixed bug #76705. CS1569 was incorrectly commented out.
7697 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
7699 * doc.cs : use Invocation.IsOverride() to do real override check.
7700 * expression.cs : made Invocation.IsOverride() internal.
7702 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
7704 * doc.cs : use TypeManager.FindMembers() instead of (possible)
7705 TypeBuilder.FindMembers() and filter overriden base members out.
7708 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
7710 * doc.cs : ref/out parameters are represented as '@' (instead of
7711 '&' in type FullName). Fixed bug #76630 (additionally crefs).
7713 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
7715 * doc.cs : when there was no '.' in cref to methods in doc comment,
7716 then parameters were missing in the output. Fixed bug #76691.
7718 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
7720 * driver.cs : don't output docs when there is an error.
7723 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
7726 Now it should detect indexers. Fixed primary concern in bug #76685.
7727 Fixed CS0419 message to not show the identical member signature in
7730 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
7732 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
7733 instead of Type.FindMembers() since it does not handle events.
7736 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
7738 * codegen.cs: Fixed typo (speficied -> specified).
7740 2005-11-11 Marek Safar <marek.safar@seznam.cz>
7743 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
7745 2005-11-11 Marek Safar <marek.safar@seznam.cz>
7747 * attribute.cs: Changed error message.
7749 * cs-tokenizer.cs: One more check.
7751 2005-11-10 Marek Safar <marek.safar@seznam.cz>
7753 * statement.cs (Block.Resolve): Ignore empty statement.
7755 2005-11-10 Marek Safar <marek.safar@seznam.cz>
7757 * report.cs: Made error/warning methods more strict to avoid
7760 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
7761 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
7762 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
7763 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
7765 2005-11-08 Marek Safar <marek.safar@seznam.cz>
7767 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
7768 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
7770 * class.cs (TypeContainer.IsComImport): New property.
7771 (Constructor.Define): Create proper ctor for ComImport types.
7773 * expression.cs (New.CheckComImport): Fixed.
7775 2005-11-07 Miguel de Icaza <miguel@novell.com>
7777 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
7778 that a parameter has been captured does not mean that we do not
7779 have to do the rest of the processing. This fixes the second part
7780 of #76592. If there was another anonymous method capturing
7781 values in the past, the Scope would never be set for the second
7782 method that captured the same parameter.
7784 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
7785 properly manipulate the stack. Second part of fix for #76592.
7787 * expression.cs (New): Add support for invoking "new" on
7788 interfaces that have been flagged with the ComImport attribute and
7789 the CoClass. Fixes #76637
7791 * statement.cs (Try.DoEmit): When a variable is captured, do not
7792 try to emit the vi.LocalBuilder variable as it has been captured.
7793 Create a temporary variable and store the results on the
7794 FieldBuilder. Fixes #76642
7796 2005-11-07 Marek Safar <marek.safar@seznam.cz>
7798 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
7800 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
7802 * expression.cs (Binary.DoResolve): Added && optimalization.
7804 * typemanager.cs (AddUserType): Removed useless argument.
7806 2005-11-04 Marek Safar <marek.safar@seznam.cz>
7808 * statement.cs (Block.variables): Uses ListDictionary.
7810 2005-11-03 Marek Safar <marek.safar@seznam.cz>
7813 * class.cs (PartialContainer.EmitType): Customized to emit
7814 security attributes.
7815 (ClassPart.ApplyAttributeBuilder): Transform security attribute
7816 for partial classes.
7818 2005-11-03 Marek Safar <marek.safar@seznam.cz>
7821 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
7822 access has to be fixed.
7824 * typemanager.cs (IsUnmanagedType): Wrong common field type.
7826 2005-11-01 Marek Safar <marek.safar@seznam.cz>
7829 * ecore.cs (NullCast.Reduce): Implemented.
7831 * expression.cs (ArrayCreation.CheckIndices): Correcly check
7834 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
7836 (Foreach.Resolve): Catch null properly.
7838 2005-10-29 Marek Safar <marek.safar@seznam.cz>
7840 * cs-tokenizer.cs: Warning text fix.
7842 * driver.cs: AllWarningNumbers exposed on public interface.
7844 * report.cs (): Reviewed warning numbers.
7845 (IsValidWarning): Use binary search.
7847 2005-10-29 Marek Safar <marek.safar@seznam.cz>
7849 * driver.cs: Implemeted resource visibility.
7850 (Resources): New class for code sharing between /res: and
7853 2005-10-28 Marek Safar <marek.safar@seznam.cz>
7856 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
7859 * convert (Convert.ImplicitReferenceConversion): NullCast holds
7862 * ecore.cs (NullCast): Child is contant only.
7864 * literal.cs (NullLiteral.Reduce): null can be converted to any
7867 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
7869 * driver.cs: Use Encoding.Default as default code page instead
7872 2005-10-27 Raja R Harinath <rharinath@novell.com>
7875 * expression.cs (Invocation.Error_InvalidArguments): Handle
7876 __arglist parameters.
7877 (Invocation.VerifyArgumentsCompat): Likewise.
7878 * support.cs (ReflectionParameters.GetSignatureForError): Print
7879 __arglist parameters.
7880 (InternalParamters.GetSignatureForError): Likewise.
7881 * parameter.cs (Parameters.GetSignatureForError): Likewise.
7883 2005-10-26 Marek Safar <marek.safar@seznam.cz>
7885 * attribute.cs (GetPropertyValue): Made public.
7887 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
7889 Add new property WrapNonExceptionThrows to handle 2.0 assembly
7891 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
7894 * driver.cs: Reflect method name change.
7896 * statement.cs (Try.Resolve): Warn when try has both general
7899 * typemanager.cs: runtime_compatibility_attr_type new predefined
7902 2005-10-26 Raja R Harinath <harinath@gmail.com>
7905 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
7906 treat it as an empty parameter list.
7908 2005-10-26 Raja R Harinath <rharinath@novell.com>
7911 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
7912 ResolveAsTypeStep silent.
7913 * statement.cs (Block.AddConstant): Mark block as used.
7914 (Block.ResolveMeta): Avoid piling on error messages
7915 if a constant initializer resolution fails.
7917 2005-10-25 Raja R Harinath <rharinath@novell.com>
7919 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
7921 (NamespaceEntry.VerifyAllUsing): New.
7922 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
7923 behaviour. Delegates actual resolution of alias to ...
7924 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
7925 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
7927 * driver.cs (Driver.MainDriver): Update.
7929 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
7930 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
7932 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
7934 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
7935 RootNamespace.DefineNamespacesForAll.
7937 2005-10-24 Raja R Harinath <harinath@gmail.com>
7939 * typemanager.cs (assemblies, external_aliases, modules)
7940 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
7941 (ComputeNamespaces, GetRootNamespace): Remove extra staging
7942 overhead. Move resposibility ...
7943 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
7944 * driver.cs, attribute.cs, codegen.cs: Update to changes.
7946 2005-10-23 Raja R Harinath <harinath@gmail.com>
7948 * namespace.cs (RootNamespace.all_namespaces): Renamed from
7949 cached_namespaces. Improve usage.
7950 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
7951 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
7952 Move from GlobalRootNamespace and simplify.
7953 (RootNamespace.Global): Make instance variable.
7954 (RootNamespace.RootNamespace): Add "alias name" parameter.
7955 (GlobalRootNamespace): Simplify drastically.
7956 (Namespace.Lookup): Don't use GetNamespace.
7957 * typemanager.cs (GetRootNamespace): Rename from
7958 ComputeNamespaceForAlias.
7959 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
7961 2005-10-23 Marek Safar <marek.safar@seznam.cz>
7963 * anonymous.cs (AnonymousContainer): Don't crash when container
7966 2005-10-23 Marek Safar <marek.safar@seznam.cz>
7968 * expression.cs (Binary.DoResolve): Warn when comparing same
7971 2005-10-23 Marek Safar <marek.safar@seznam.cz>
7974 * expression.cs (Binary.DoResolve): It looks like there are no
7975 convetsion rules in enum context.
7977 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
7979 Add support for extern alias qualifiers.
7980 * typemanager.cs: Move some LookupTypeReflection code
7981 to namespace.cs, to have cleaner code. Added some methods
7982 to help us keep track of the extern aliased references.
7983 * driver.cs: Add suport for extern alias assemblies on command
7984 line and check for their warnings/errors. Also keep track of the
7985 extern aliased assemblies.
7986 * namespace.cs: Move the global functionality of Namespace
7987 to GlobalRootNamespace/RootNamespace. Now the global namespace
7988 is GlobalRootNamespace.Globa. Also the code moved from
7989 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
7990 Finally added LocalAliasEntry (AliasEntry before) and
7991 ExternAliasEntry, to handle alias statements.
7992 * cs-parser.jay: Add support in the grammar for extern alias
7994 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
7995 Update callings to Namespace (now in GlobalRootNamespace).
7997 2005-10-18 Raja R Harinath <rharinath@novell.com>
8000 * class.cs (TypeContainer.DefineType): Move updating of
8001 topological sort earlier in the code.
8002 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
8004 2005-10-18 Marek Safar <marek.safar@seznam.cz>
8007 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
8009 * constant.cs (Constant.TryReduce): Moved from Cast class.
8010 (Reduce): Made little bit more OO and fixed missing conversions.
8012 * ecore.cs (Reduce): Implemented.
8013 (Binary.EnumLiftUp): New method to upgrade values to enum values.
8015 * literal.cs (Reduce): Implemented.
8017 * class.cs: Reverted Miguel's wrong commit.
8019 2005-10-14 Miguel de Icaza <miguel@novell.com>
8021 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
8023 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
8025 * cs-parser.jay, expression.cs : CS0214 was missing error location
8026 for constants. Fixed bug #76404.
8028 2005-10-11 Marek Safar <marek.safar@seznam.cz>
8031 * convert.cs (ExplicitConversionCore): Fixed object->enum
8034 2005-10-10 Raja R Harinath <rharinath@novell.com>
8036 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
8038 (PropertyExpr.EmitCall): Likewise.
8039 * expression.cs (Invocation.EmitArguments): Handle case where
8041 (Invocation.EmitCall): Avoid allocating temporary variable if
8042 there are no arguments.
8044 2005-10-07 Raja R Harinath <rharinath@novell.com>
8047 * convert.cs (ImplicitConversionStandard): Move conversion of
8048 void* to arbitrary pointer types ...
8049 (ExplicitConversionStandard): .. here.
8050 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
8051 error to always print typenames.
8053 2005-10-07 Raja R Harinath <rharinath@novell.com>
8055 * convert.cs (GetConversionOperator): Rename from
8056 GetConversionOperators. Move operator selection code from ...
8057 (UserDefinedConversion): ... here.
8059 2005-10-06 Marek Safar <marek.safar@seznam.cz>
8061 * convert.cs (ExplicitConversionCore): Removed duplicate enum
8064 2005-10-05 Marek Safar <marek.safar@seznam.cz>
8066 * assign.cs (Assign.DoResolve): Error method changed.
8068 * cfold.cs (DoConstantNumericPromotions): Error method changed.
8070 * const.cs (ResolveValue): Reset in_transit immediately.
8072 * constant.cs: Error method changed.
8074 * convert.cs: Removed useless location parameter.
8075 (ExplicitNumericConversion): Don't do double enum check.
8076 (ExplicitConversionCore): Renamed from ExplicitConversion.
8077 (ExplicitUnsafe): Extracted from ExplicitConversion.
8078 (ExplicitConversion): Uses for error reporting.
8080 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
8082 (ResolveBoolean): Uses common error method.
8083 (CastToDecimal): Get rid of ec.
8084 (CastFromDecimal): Optimized.
8085 (ConvCast): Get rid of ec.
8087 * enum.cs (ResolveValue): Reset in_transit immediately.
8088 (Emit): Return after first error.
8090 * expression.cs: Convert changes.
8092 * literal.cs: Error method changed.
8094 * statement.cs: Error method changed.
8096 2005-10-03 Raja R Harinath <rharinath@novell.com>
8098 * support.cs (SeekableStreamReader.Position): Don't error out when
8099 the requested position is just beyond the end of the current
8102 2005-09-28 Raja R Harinath <rharinath@novell.com>
8104 * support.cs (SeekableStreamReader): Simplify drastically. Don't
8105 try to keep in sync with the byte count of the underlying Stream.
8106 However, this limits us to a window size of 2048 characters: i.e.,
8107 the maximum lookahead of our lexer/parser can be 2048 characters.
8109 2005-09-28 Marek Safar <marek.safar@seznam.cz>
8112 * driver.cs: Fix compilation files with full root path.
8114 2005-09-25 Miguel de Icaza <miguel@novell.com>
8116 * report.cs (SymbolRelatedToPreviousError): Format the output so
8117 it does not use an open parenthesis that is never closed.
8119 * driver.cs: Follow coding guidelines
8121 2005-09-27 Marek Safar <marek.safar@seznam.cz>
8124 * const.cs (Const.ResolveValue): Check for assigning non-null
8125 value to reference type.
8127 2005-09-27 Marek Safar <marek.safar@seznam.cz>
8129 * anonymous.cs: Implemented ExprClassName.
8131 * assign.cs (Assign.DoResolve): Don't chrash when type is not
8134 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
8137 * class.cs (StaticClass.DefineContainerMembers): Report protected
8140 * codegen.cs: if(ed) PRODUCTION.
8142 * convert.cs (Error_CannotImplicitConversion): Better error
8145 * cs-parser.jay: More error checks.
8147 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
8149 * driver.cs (CSCParseOption): Enabled wrong option check.
8151 * ecore.cs (Expression.ExprClassName): Turned to property.
8152 (MemberExpr.CheckIntermediateModification): For checking boxed
8153 value types modification.
8155 * statement.cs (Fixed.Resolve): Expression type must be
8156 convertible to fixed type.
8157 (CollectionForeach.GetEnumeratorFilter,TryType):
8158 Small refactoring for easier error checking.
8160 2005-09-26 Marek Safar <marek.safar@seznam.cz>
8162 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
8165 * class.cs (GeneratedBaseInitializer): New class for customization
8166 compiler generated initializers.
8167 (MemberBase.DoDefine): Check Obsolete attribute here.
8168 (FieldMember.DoDefine): Ditto.
8170 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
8173 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
8174 (MemberCore.GetObsoleteAttribute): Removed argument.
8175 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
8176 (MemberCore.CheckObsoleteType): New helper.
8180 * statement.cs: Updates after MemberCore changes.
8182 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
8183 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
8185 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
8186 obsolete attribute for compiler construct.
8187 (As.DoResolve): Cache result.
8189 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
8191 2005-09-26 Raja R Harinath <rharinath@novell.com>
8194 * expression.cs (This.VerifyFixed): In a value type T, the type of
8195 'this' is T&, iow, 'this' is either an out or ref parameter. In a
8196 value type R, 'this' is treated as a value parameter.
8198 2005-09-22 Miguel de Icaza <miguel@novell.com>
8200 * statement.cs (Lock): Use the TemporaryVariable class instead of
8201 manually using local variables as those do not work when variables
8204 * ecore.cs: Moved the TemporaryVariable class from being a nested
8205 class inside Foreach to be a public class that can be employed in
8208 2005-09-19 Marek Safar <marek.safar@seznam.cz>
8210 * cs-parser.jay: interface_accessors replaced by
8211 accessor_declarations.
8213 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
8216 * statement.cs (GotoCase.Resolve): Convert null constant to
8218 (SwitchLabel.ResolveAndReduce): Ditto.
8219 (SwitchLabel.NullStringCase): Custom null stamp.
8220 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
8222 typemanager.cs (CSharpSignature): Don't skip first argument
8225 2005-09-18 Miguel de Icaza <miguel@novell.com>
8227 * driver.cs: Set InEmacs based on the environment variable EMACS.
8229 * location.cs (InEmacs): in this mode, do not report column
8230 location as it confuses Emacs.
8232 2005-09-16 Marek Safar <marek.safar@seznam.cz>
8234 * cfold.cs, constant.cs, convert.cs, ecore.cs,
8235 expression.cs, iterators.cs, literal.cs: Store constants and
8238 * class.cs (MemberBase.ShortName): Pass location.
8240 * cs-parser.jay: Some location fixes.
8242 * ecore.cs (Expression.Location): Made virtual.
8244 2005-09-05 Miguel de Icaza <miguel@novell.com>
8246 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
8247 if the underlying types are the same, otherwise we need to produce
8248 code that will do the proper cast.
8250 This was exposed by Marek's constant rewrite which produced
8251 invalid code for the call site:
8254 void Method (X v) {}
8258 This fixes test-49.cs
8260 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
8262 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
8263 Type/Object should be allowed as well. Fixed bug #75968.
8265 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
8267 * expression.cs : (Binary.DoResolve): when one is enum constant and
8268 another is constant 0, then return enum one *as enum type*.
8271 2005-09-02 Raja R Harinath <rharinath@novell.com>
8273 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
8277 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
8278 flow-branching for LocalVariableReferences in case we were invoked
8279 from a MemberAccess.
8280 * expression.cs (LocalVariableReference.VerifyAssigned): New.
8282 (LocalVariableReference.DoResolveBase): ... this.
8283 (MemberAccess.Resolve): Do the check that was disabled during
8286 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
8289 (PartialContainer.Create): check abstract/sealed/static strictly
8290 but abstract/sealed can exist only at one side. Fixed bug #75883.
8292 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
8295 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
8296 specified, don't default to UnmanagedType.I4.
8298 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
8300 * expression.cs : conditional operator should check possibly
8301 incorrect assign expression. Fixed bug #75946.
8303 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
8305 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
8306 Reverting the change. gmcs is much complex than mcs on this matter.
8308 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
8310 * cs-tokenizer.cs : To read another token ahead of the actual
8311 consumption, use new SavedToken and cache token instead of moving
8312 back the stream with SeekableStreamReader (it seemed problematic).
8314 driver.cs : Thus use StreamReader directly.
8315 * support.cs : Thus removed SeekableStreamReader.
8317 2005-08-30 Raja R Harinath <rharinath@novell.com>
8320 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
8321 (ScopeInfo.EmitScopeType): Use it to construct field names from
8322 names of captured locals.
8325 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
8326 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
8327 Pass 'target_type' to BoxedCast. Don't default to 'object'.
8328 (ExplicitConversion): Remove enum cases already handled by
8329 implicit conversion. Move implicit conversion check to the beginning.
8330 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
8331 * expression.cs (ArrayCreation.EmitDynamicInitializers):
8332 Don't treat System.Enum as a struct.
8334 2005-08-30 Jb Evain <jbevain@gmail.com>
8336 * attribute.cs: handles as expression in parameters.
8338 2005-08-30 Raja R Harinath <rharinath@novell.com>
8341 * class.cs (TypeContainer.VerifyClsName): Don't use a
8342 PartialContainer when verifying CLS compliance.
8343 (AbstractPropertyEventMethod): Set Parent here, ...
8344 (PropertyMethod): ... not here.
8346 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
8348 * attribute.cs : escaped attribute name should not be allowed to be
8349 resolved (e.g. @class as classAttribute). Fixed bug #75930.
8351 2005-08-29 Raja R Harinath <rharinath@novell.com>
8354 * convert.cs (ImplicitStandardConversionExists): Allow zero also
8355 when converting a long constant to unsigned long.
8356 * expression.cs (Invocation.OverloadResolve): Add sanity check to
8357 detect where IsApplicable and VerifyArgumentsCompat disagree.
8359 2005-08-29 Raja R Harinath <rharinath@novell.com>
8360 and Carlos Alberto Cortez <carlos@unixmexico.org>
8363 * class.cs (TypeContainer.CanElideInitializer): New helper.
8364 (TypeContainer.EmitFieldInitializers): Use it to determine if we
8365 can safely emitting the initializer of a field.
8367 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
8369 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
8370 allowed inside a switch (without loop). Fixed bug #75433.
8372 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
8374 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
8375 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
8377 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
8379 * driver.cs : kinda reverting the default encoding changes (not exact
8380 revert since I noticed that "codepage:reset" might not work fine).
8382 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
8384 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
8385 Location. Now getter and setter store location correctly.
8386 (errors/cs0111-12.cs now reports the expected location.)
8388 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
8390 * driver.cs : Use default encoding on the environment.
8391 Removed (now that) extra parameter for SeekableStreamReader.
8392 * support.cs : (SeekableStreamReader) third .ctor() argument for
8393 StreamReader is not required (always true). preamble size could
8394 be acquired in simpler and safe way.
8396 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
8398 * cs-parser.jay: report CS0642 at warning level 3
8399 and report CS0642 for an if else statement also
8400 fixes bug #74745. Patch by John Luke (and a bit
8402 Removed extra CS0642 warning check for "while",
8404 * statement.cs: In Block.Resolve(), CS0642 check
8405 is reimplemented to check a sequence of an empty
8406 statement and a block.
8408 Both fix bug #66777.
8410 2005-08-24 Marek Safar <marek.safar@seznam.cz>
8412 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
8413 detection until I fix it.
8415 * cs-tokenizer.cs: Changed error message.
8417 * cs-parser.jay: Fixed 2 error locations.
8419 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
8420 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
8423 * enum.cs (GetSignatureForError): Fixed.
8425 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
8429 * typemanager.cs (RegisterProperty): Removed.
8431 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
8433 2005-08-24 Raja R Harinath <rharinath@novell.com>
8436 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
8437 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
8439 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
8441 * expression.cs : tiny fix is required for not warning positive ulong.
8444 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
8446 * expression.cs : add CS0652 check for constant and integral
8447 expression. Fixed bug #53974.
8449 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
8451 * expression.cs : in DoNumericPromotions(), check if there is implicit
8452 conversion overload for string (to check CS0034). Fixed bug #52492.
8454 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
8456 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
8458 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
8460 * ecore.cs : report location when it is *not* Null.
8462 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
8468 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
8469 correctly. Fixed bug #75721.
8471 2005-08-23 Raja R Harinath <rharinath@novell.com>
8473 * support.cs (SeekableStreamReader.Position): Avoid an expensive
8474 loop that performs 'min (pos, char_count)'.
8477 * expression.cs (Unary.ResolveOperator): Don't discard implicit
8478 converted value in Operator.OnesComplement.
8480 2005-08-22 Ben Maurer <bmaurer@ximian.com>
8482 * anonymous.cs: If the anon method is pulled into a helper class,
8483 it needs to be `internal' not `private'. Fixes runtime behavior on
8486 2005-08-20 Martin Baulig <martin@ximian.com>
8488 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
8489 scope if we don't already have it.
8491 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
8492 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
8495 2005-08-17 Marek Safar <marek.safar@seznam.cz>
8498 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
8501 2005-08-16 Marek Safar <marek.safar@seznam.cz>
8503 The big constants rewrite
8504 Fix #75746, #75685 and more
8505 As a side effect saved 1MB for MWF ;-)
8507 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
8508 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
8509 enum based for corlib compilation.
8511 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
8514 * class.cs (FixedField.Define): Use ResolveAsConstant.
8516 * const.cs (IConstant): Interface constants and enums.
8517 (Const.ResolveValue): New method for constant resolvning.
8518 (ExternalConstant): Constants from imported assemblies.
8520 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
8521 conversion; like enums.
8522 (Constant.ToType): Converts this constant to different type.
8523 (Constant.Increment): Adds 1.
8525 * convert.cs (ImplicitConversionRequired): Simplified.
8527 * cs-parser.jay: Create EnumMember directly.
8529 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
8531 * doc.cs (GenerateEnumDocComment): Removed.
8533 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
8534 (ConvertIntLiteral): Removed.
8535 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
8537 * enum.cs (EnumMember): Implement IConstant.
8538 (Enum.IsValidEnumConstant): Removed.
8539 (Enum.GetNextDefaultValue): Removed.
8540 (Enum.FindMembers): Updated.
8541 (Enum.GenerateDocComment): Iterate enum members.
8543 * expression.cs (Cast.TryReduce): Handle enums correctly.
8544 (New.Constantify): Made public.
8545 (MemberAccess.DoResolve): Removed contant specific if(s).
8547 * literal.cs (NullLiteral): Implement new abstract methods.
8549 * statement.cs (GotoCase.Resolve): Use new constant methods.
8550 (SwitchLabel.ResolveAndReduce): Use new constant methods.
8552 * typemanager.cs (LookupEnum): Removed.
8553 (IsEnumType): Fixed to work with corlib.
8554 (RegisterConstant): Removed.
8555 (LookupConstant): Removed.
8556 (GetConstant): Changed to work with IConstant.
8558 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
8560 * location.cs : Fixed overflown (>255) column number.
8562 2005-08-03 Raja R Harinath <rharinath@novell.com>
8564 First cut of the qualified-alias-member feature.
8565 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
8567 * cs-parser.jay (DOUBLE_COLON): New token.
8568 (namespace_or_type_name): Add rule for recognizing
8569 qualified-alias-members.
8570 (primary_expression): Likewise.
8571 (element_access): Allow QualifiedAliasMember as a possible
8572 type-bearing expression.
8573 (local_variable_type, local_variable_pointer_type): Likewise.
8574 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
8575 aliases in the current and enclosing namespace declarations.
8576 (NamespaceEntry.UsingAlias): Add CS0440 warning.
8577 * decl.cs (MemberName.is_double_colon): New.
8578 (MemberName.MemberName): Add new constructor for alias-member.
8579 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
8580 * expression.cs (QualifiedAliasMember): New expression type.
8582 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
8584 * location.cs : it borked when no argument was specified.
8586 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
8588 * location.cs : tiny ToString() format fix.
8590 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
8592 * statement.cs : oops, it was missing.
8594 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
8596 A set of fixes for precise line/column location.
8599 "token" field now holds a file/line "delta", a line number offset
8600 from the segment, and a column number. See also:
8601 http://lists.ximian.com/pipermail/mono-devel-list/2004-
8602 December/009508.html
8603 Removed static IsNull. Use instance IsNull property instead.
8605 For some tokens it stores Location. For Identifier it stores
8606 LocatedToken which is a pair of string name and location.
8607 Column numbers are adjusted only at getChar().
8609 Use Location.ToString() for reporting (it now contains column).
8611 Largely modified to use LocatedToken instead of
8612 string (IDENTIFIER), and to acquire Location from some tokens.
8613 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
8614 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
8616 Now MemberName holds Location. DeclSpace.ctor() receives Location
8617 as a parameter. Removed extra parameters to all derived classes.
8618 Replaced Location.IsNull() with instance property.
8619 * assign.cs, expression.cs :
8620 Added .ctor() overload that omits Location.
8622 Added "nameEscaped" flag that indicates the identifier was escaped
8623 in the source file. This fixes bug #57047.
8625 2005-08-02 Marek Safar <marek.safar@seznam.cz>
8627 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
8628 New method, looking for lo-case imported cls type.
8630 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
8633 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
8635 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
8637 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
8639 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
8641 Optimized to save 3.5 MB for SWF compilation.
8643 2005-08-01 Marek Safar <marek.safar@seznam.cz>
8645 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
8646 (PartialContainer.Create): Moved logic AddToContainer.
8647 (PartialContainer.MarkForDuplicationCheck): Shares name.
8649 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
8652 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
8654 (Namespace.GetSignatureForError): New method.
8656 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
8657 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
8659 2005-08-01 Raja R Harinath <rharinath@novell.com>
8662 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
8663 member lookup rather than qualifier_type, since qualifier_type can
8666 2005-08-01 Marek Safar <marek.safar@seznam.cz>
8668 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
8671 2005-07-31 Miguel de Icaza <miguel@novell.com>
8673 * statement.cs: Copy the local exception into the exception
8674 captured local. Fixes 75674
8676 2005-07-31 Raja R Harinath <harinath@gmail.com>
8679 * expression.cs (Invocation.OverloadResolve): Don't report error
8680 CS1501 if error CS1502 has been reported.
8681 (New.DoResolve): Delegate CS1501 reporting to
8682 Invocation.OverloadResolve.
8685 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
8686 invariant-meaning-in-block property in an enclosing block if
8689 2005-07-29 Marek Safar <marek.safar@seznam.cz>
8691 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
8692 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
8693 (Switch.CheckSwitch): Just save 50kb for SWF.
8695 2005-07-27 Martin Baulig <martin@ximian.com>
8697 * anonymous.cs (CaptureContext.AddField): Added
8698 `AnonymousContainer am' argument; compute its toplevel scope if
8699 it's not already computed. Fixes #75649.
8701 2005-07-26 Raja R Harinath <rharinath@novell.com>
8704 * class.cs (Constructor.Emit): Reset block to null if the block
8707 2005-07-25 Marek Safar <marek.safar@seznam.cz>
8709 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
8711 2005-07-25 Marek Safar <marek.safar@seznam.cz>
8713 * class.cs (MethodData.Define): Check whether accessor implementing
8714 interface is public.
8716 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
8718 2005-07-22 Marek Safar <marek.safar@seznam.cz>
8721 * namespace.cs (LookupType): Moved same type check to...
8723 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
8726 2005-07-21 Raja R Harinath <rharinath@novell.com>
8728 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
8729 already found a typebuilder.
8730 * class.cs (MethodCore.IsDuplicateImplementation): Compare
8731 MemberNames, not strings.
8733 * const.cs (Error_ExpressionMustBeConst):
8734 Rename from Error_EpressionMustBeConst.
8735 * const.cs, class.cs, statement.cd: Update.
8737 2005-07-21 Marek Safar <marek.safar@seznam.cz>
8741 * const.cs (Const.LookupConstantValue): Report missing contant expression
8743 (Error_EpressionMustBeConstant): Only one error method.
8745 * class.cs, statement.c: Updated.
8747 2005-07-20 Raja R Harinath <rharinath@novell.com>
8749 * statement.cs (Block.Flags): Add back HasVarargs.
8750 (Block.flags): Make protected.
8751 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
8753 * typemanager.cs (types, typecontainers, user_types): Remove.
8754 (UserTypes, TypeContainers): Likewise.
8755 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
8756 (CleanUp, Reset): Update.
8757 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
8758 (GetNestedType): Use Type.GetNestedType.
8759 (CoreLookupType): Take two arguments, the namespace and the
8760 basename of the type. Update to use the Namespace.Lookup
8762 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
8763 (RealMemberLookup): Use IsNestedChildOf instead of playing with
8764 string concatenation and substring matches.
8765 * class.cs, enum.cs, delegate.cs: Update to changes.
8767 2005-07-20 Marek Safar <marek.safar@seznam.cz>
8769 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
8770 Expression and made virtual.
8772 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
8773 (ImplicitStandardConversionExists): Fixed `byte' typo ?
8775 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
8777 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
8780 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
8783 2005-07-18 Marek Safar <marek.safar@seznam.cz>
8786 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
8787 AssemblyCultureAttribute is not used on executable.
8790 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
8792 2005-07-16 Raja R Harinath <rharinath@novell.com>
8795 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
8796 New. Reports CS0252/CS0253.
8797 Mostly taken from preliminary patch by Duncak Mak.
8798 (Binary.DoResolveOperator): Store results of operator lookup.
8799 Use them to detect if we need to warn about unintended reference
8802 2005-07-15 Raja R Harinath <rharinath@novell.com>
8805 * namespace.cs (Namespace.Lookup): Add back location parameter.
8806 (Namespace.LookupType): Add CS0436 report. Add location parameter.
8807 * delegate.cs, ecore.cs, expression.cs: Update to changes.
8809 * codegen.cs (EmitContext.DeclSpace): Make readonly.
8810 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
8811 (Namespace.LookupType): ... this.
8812 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
8814 * typemanager.cs (LookupTypeReflection): Remove buggy code that
8815 purported to handle pointers.
8816 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
8819 2005-07-15 Marek Safar <marek.safar@seznam.cz>
8821 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
8824 2005-07-15 Raja R Harinath <rharinath@novell.com>
8826 * namespace.cs (Namespace.Lookup): Drop location parameter.
8827 (NamespaceEntry.LookupAlias): Remove. Merge into ...
8828 (NamespaceEntry.Lookup): ... this.
8829 (NamespaceEntry.Error_AmbiguousTypeReference):
8830 Move here from DeclSpace.
8831 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
8833 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
8834 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
8835 Move to NamespaceEntry.
8836 * delegate.cs, expression.cs: Update to changes.
8838 2005-07-14 Marek Safar <marek.safar@seznam.cz>
8840 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
8841 CheckAttributeType and refactored.
8842 (Attribute.ResolvePossibleAttributeType): Changed to reuse
8843 ResolveAsTypeTerminal error handling.
8844 (ResolveAsTypeTerminal): Introduced because of global attributes extra
8846 (GetSignatureForError): Print errors in same way.
8849 * codegen.cs: Reflect attribute GetSignatureForError change.
8852 * expression.cs: Add silent parameter to ResolveAsTypeStep.
8854 * namespace.cs (UsingEntry): Refactored to make fields private.
8857 statement.cs: Error_UnexpectedKind has extra parameter.
8859 2005-07-14 Raja R Harinath <rharinath@novell.com>
8861 * ecore.cs (IAlias): Remove.
8862 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
8863 that implement the interface.
8864 * namespace.cs (Namespace): Likewise.
8865 (Namespace.declspaces): Renamed from 'defined_names'.
8866 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
8867 DeclSpace instead of an IAlias.
8868 * tree.cs (Tree.AddDecl): Update.
8870 2005-07-12 Raja R Harinath <rharinath@novell.com>
8872 * statement.cs (Block.Flags); Remove HasVarargs.
8873 (Block.HasVarargs): Move to ToplevelBlock.
8874 (Block.ThisVariable, Block.AddThisVariable): Likewise.
8875 (Block.Variables): Make protected. Initialize variable hashtable
8877 (Block.AddVariable): Update.
8878 (Block.Resolve): Update to changes.
8879 (ToplevelBlock.HasVarargs): New boolean.
8880 (ToplevelBlock.ThisVariable): Move here from Block.
8881 (ToplevelBlock.AddThisVariable): Likewise.
8882 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
8883 * expression.cs (This.ResolveBase): Update to changes.
8884 (ArglistAccess.DoResolve): Likewise.
8886 2005-07-11 Marek Safar <marek.safar@seznam.cz>
8889 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
8891 * class.cs (TypeContainer.VerifyMembers): Distinguish between
8892 not used and not used & assigned.
8893 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
8895 2005-07-11 Marek Safar <marek.safar@seznam.cz>
8898 * expression.cs (Is.DoResolve): null is never provided type.
8900 2005-07-08 Marek Safar <marek.safar@seznam.cz>
8903 * cs-parser.jay: Less strict event error rule to catch more errors.
8905 2005-07-08 Martin Baulig <martin@ximian.com>
8907 Fix test-iter-10.cs - distinguish whether we `yield' in a property
8908 gettter (allowed) or setter (not allowed).
8910 * class.cs (Accessor): Implement IIteratorContainer.
8911 (Accessor.Yields): New public field.
8912 (PropertyBase.PropertyMethod.Define): Handle iterators on a
8916 (get_accessor_declaration, set_accessor_declaration): Set the
8917 `yields' flag on the accessor, not the property.
8918 (property_declaration): Do the iterators check on a per-accessor
8919 basis and not for the whole property.
8921 2005-07-08 Martin Baulig <martin@ximian.com>
8923 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
8924 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
8926 2005-07-07 Marek Safar <marek.safar@seznam.cz>
8929 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
8930 (ExtractSecurityPermissionSet): Cope with self referencing security
8931 attributes properly.
8933 * driver.cs (SetOutputFile): Made public property OutputFile.
8935 2005-07-07 Raja R Harinath <rharinath@novell.com>
8938 * class.cs (TypeContainer.first_nonstatic_field): Rename from
8939 has_nonstatic_fields. Make into a FieldBase pointer.
8940 (TypeContainer.AddField): Add CS0282 check.
8941 (TypeContainer.EmitType): Update.
8943 2005-07-06 Miguel de Icaza <miguel@novell.com>
8945 * cs-tokenizer.cs (consume_identifier): Do not create strings to
8946 compare if they start with __.
8948 2005-07-06 Raja R Harinath <rharinath@novell.com>
8950 * statement.cs (Switch.SwitchGoverningType): Only look at
8951 UserCasts that don't need implicit standard conversions to one of
8952 the allowed switch types (Fixes test-322.cs).
8953 (LocalInfo.Resolve): Re-enable sanity-test.
8955 2005-07-06 Marek Safar <marek.safar@seznam.cz>
8957 * cs-tokenizer.cs (consume_identifier): Detect double undescores
8959 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
8961 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
8963 2005-07-06 Raja R Harinath <rharinath@novell.com>
8966 * ecore.cs (SimpleName.GetSignatureForError): Add.
8967 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
8968 (MemberAccess.GetSignatureForError): Add.
8970 2005-07-05 Marek Safar <marek.safar@seznam.cz>
8972 The big error and warning messages review.
9002 * typemanager.cs: Updated.
9004 * class.cs: (MethodCore.SetYields): Moved here to share.
9005 (PropertyMethod.Define): Moved iterator setup here.
9007 * iterators.cs: Add orig_method to have full access to parent
9010 2005-07-05 Raja R Harinath <rharinath@novell.com>
9012 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
9013 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
9014 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
9015 variable of struct type.
9016 * expression.cs (Unary.ResolveOperator): Update to change.
9017 (Indirection.VerifyFixed): Likewise.
9018 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
9019 (ParameterReference.VerifyFixed): Value parameters are fixed.
9020 (This.VerifyFixed): Treat 'this' as a value parameter.
9021 * statement.cs (LocalInfo.IsFixed): Remove.
9023 2005-07-01 Martin Baulig <martin@ximian.com>
9025 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
9026 `ec.EmitThis ()' to get the correct scope.
9028 2005-07-01 Martin Baulig <martin@ximian.com>
9030 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
9031 instance is a ParameterReference; fixes #75299.
9033 2005-07-01 Martin Baulig <martin@ximian.com>
9035 Reverted Marek's latest patch (r46725):
9036 - it contains structural changes which are neither mentioned in
9037 the ChangeLog nor explained anywhere; for example the additional
9038 argument of EmitContext's and Iterator's .ctor's and the
9039 TypeContainer.DefineMembers() change.
9040 - structural changes like this should go in in seperate patches
9041 and not be hidden in a huge patch which just seems to affect
9042 warnings and errors.
9043 a big and hard to understand patch.
9044 - it breaks iterators and causes regressions, for instance in
9047 2005-06-30 Raja R Harinath <rharinath@novell.com>
9050 * expression.cs (Indexers.map): Remove.
9051 (Indexers.Append): Filter out inaccessible setters and getters.
9052 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
9055 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
9057 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
9058 (FieldExpr.Emit, PropertyExpr.Emit): Update.
9059 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
9060 * expression.cs (Invocation.EmitCall): Add CS0120 check.
9062 2005-06-30 Marek Safar <marek.safar@seznam.cz>
9065 * class.cs (FieldBase.GetInitializerExpression): One more field
9068 2005-06-28 Miguel de Icaza <miguel@novell.com>
9070 * pending.cs: Do not define a proxy if the base method is virtual,
9071 it will be picked up by the runtime (bug 75270).
9073 2005-06-08 Martin Baulig <martin@ximian.com>
9075 The big Iterators rewrite :-)
9077 * iterators.cs: Rewrite this to use the anonymous methods framework.
9079 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
9080 before the TypeContainers; see 2test-21.cs.
9083 (TypeContainer.DefineType): Don't create a new EmitContext if we
9084 already have one (this only happens if we're an Iterator).
9085 (TypeContainer.Define): Also call Define() on all our iterators.
9086 (Method.CreateEmitContext): Added support for iterators.
9089 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
9090 (AnonymousContainer.CreateMethodHost): Moved here from
9091 AnonymousMethod and made abstract.
9092 (AnonymousContainer.CreateScopeType): New abstract method.
9093 (AnonymousContainer.IsIterator): New public property.
9094 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
9095 get the ScopeTypeBuilder rather than manually defining it here.
9096 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
9099 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
9100 before RootContext.DefineTypes().
9102 * codegen.cs (EmitContext.RemapToProxy): Removed.
9103 (EmitContext.CurrentAnonymousMethod): Changed type from
9104 AnonymousMethod -> AnonymousContainer.
9105 (EmitContext.ResolveTopBlock): Protect from being called twice.
9106 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
9107 (EmitContext.EmitThis): Removed the iterators hacks; use the
9108 anonymous methods framework for that.
9111 (ToplevelBlock.Container): Make this a property, not a field.
9112 (ToplevelBlock.ReParent): New public method; move the
9113 ToplevelBlock into a new container.
9114 (Foreach.TemporaryVariable): Simplify.
9116 2005-06-05 Martin Baulig <martin@ximian.com>
9118 * statement.cs (LocalInfo.CompilerGenerated): New flag.
9119 (Block.AddTemporaryVariable): New public method; creates a new
9120 `LocalInfo' for a temporary variable.
9121 (Block.EmitMeta): Create the LocalBuilders for all the temporary
9123 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
9124 non-iterator variables.
9126 2005-06-05 Martin Baulig <martin@ximian.com>
9128 * statement.cs (Foreach.TemporaryVariable): Create the
9129 LocalBuilder in the Emit phase and not in Resolve since in some
9130 situations, we don't have an ILGenerator during Resolve; see
9131 2test-19.cs for an example.
9133 2005-06-04 Martin Baulig <martin@ximian.com>
9135 **** Merged r45395 from GCS ****
9137 The big Foreach rewrite - Part II.
9139 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
9140 with `PropertyInfo ienumerator_getcurrent'.
9142 * codegen.cs (VariableStorage): Removed.
9145 (Foreach): Derive from Statement, not ExceptionStatement.
9146 (Foreach.CollectionForeach): New nested class. Moved all the code
9147 dealing with collection foreach here.
9148 (Foreach.ForeachHelperMethods): Removed.
9149 (Foreach.TemporaryVariable): Implement IMemoryLocation.
9151 2005-05-23 Martin Baulig <martin@ximian.com>
9153 * statement.cs (Try.DoResolve): Don't create a `finally' if we
9154 don't need to. Fix #75014.
9156 2005-05-20 Martin Baulig <martin@ximian.com>
9158 Merged r44808 from GMCS.
9160 * class.cs (TypeContainer.CircularDepException): Removed.
9161 (TypeContainer.DefineType): Removed the `InTransit' stuff.
9162 (TypeContainer.CheckRecursiveDefinition): Check for circular class
9163 (CS0146) and interface (CS0529) dependencies here.
9165 2005-06-21 Raja R Harinath <rharinath@novell.com>
9167 * expression.cs (Invocation.EmitCall): Fix initialization
9168 'this_call' to reflect current behaviour. Fix indentation.
9170 * convert.cs (FindMostEncompassedType): Add two trivial special
9171 cases (number_of_types == 0 || number_of_types == 1).
9172 (FindMostEncompasingType): Likewise.
9174 2005-06-17 Raja R Harinath <rharinath@novell.com>
9176 Some cleanups preparing for the fix of #75283.
9177 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
9179 (EventExpr.InstanceResolve): Likewise.
9180 (EventExpr.DoResolve): Remove redundant checks.
9182 2005-06-10 Duncan Mak <duncan@novell.com>
9184 * cs-tokenizer.cs (process_directives): New flag for controlling
9185 the processing of preprocessor directives.
9186 (x_token): After seeing a '#', return Token.NONE instead of going
9187 to handle_preprocessing_directive() when not processing
9188 directives. This avoids unnecessary processing during the token peek in
9193 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
9194 the existing error reporting methods instead of Report.Error.
9196 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
9197 after Raja's rewrite.
9199 2005-06-08 Miguel de Icaza <miguel@novell.com>
9201 * class.cs: Small fix.
9203 2005-06-08 Raja R Harinath <rharinath@novell.com>
9206 * class.cs (GetPartialBases): Fix return value check of
9209 2005-06-07 Raja R Harinath <rharinath@novell.com>
9211 Ensure that partial classes are registered in their enclosing
9212 namespace. Initial part of fix of #75160.
9213 * tree.cs (Tree.RecordDecl): Add new namespace argument.
9214 Register declspace with namespace here, not in
9215 DeclSpace.RecordDecl.
9216 * cs-parser.jay: Pass namespace to RecordDecl.
9217 * class.cs (PartialContainer.Create): Likewise.
9218 (ClassPart.DefineType): New sanity-check. Throws an exception if
9220 * decl.cs (Declspace.RecordDecl): Remove.
9221 * namespace.cs (NamespaceEntry.DefineName): Remove.
9223 2005-06-06 Marek Safar <marek.safar@seznam.cz>
9225 * rootcontext.cs: Reset TargetExt as well.
9227 2005-06-03 Raja R Harinath <rharinath@novell.com>
9229 * ecore.cs (Expression.Resolve): Emit CS0654 error when
9232 2005-06-02 Raja R Harinath <rharinath@novell.com>
9234 Fix #75080, cs0119.cs.
9235 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
9237 (Expression.Resolve): ... this. Use it. Remove bogus code
9238 allowing ExprClass.Type and ExprClass.Namespace for
9239 ResolveFlags.VariableOrValue.
9240 (Expression.Resolve) [1-argument variant]: Change default resolve
9241 flags based on language version.
9242 (Expression.Error_UnexpectedKind): Use a simple string array
9243 rather than an ArrayList.
9244 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
9246 (TypeOfVoid.DoResolve): Likewise.
9247 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
9248 flags argument -- it always has the same value.
9250 2005-05-31 Raja R Harinath <rharinath@novell.com>
9253 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
9254 Use it in the error message.
9255 * assign.cs, expression.cs, statement.cs: Update.
9257 2005-05-30 Raja R Harinath <rharinath@novell.com>
9260 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
9261 the "almostMatchedMember" case too.
9262 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
9263 that failed the accessibility checks to 'almost_match'.
9265 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
9267 * attribute.cs: Use internal MethodBuilder methods to set
9268 ExactSpelling and SetLastError on PInvoke methods, instead
9269 of passing them via charset. Fixes #75060.
9271 2005-05-27 Raja R Harinath <rharinath@novell.com>
9273 * parameter.cs (Parameter): Remove TODO comment.
9274 (Parameter.DefineParameter): Remove Location parameter.
9275 (Parameters.LabelParameters): Likewise.
9276 * class.cs (Constructor.Emit): Update to change.
9277 (MethodData.Emit): Likewise.
9278 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
9279 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
9281 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
9284 Removed Parameters.Location and added Parameter.Location instead.
9285 Removed Location parameter from Emit() and GetSignature().
9292 Modified all related calls.
9294 2005-05-26 Raja R Harinath <rharinath@novell.com>
9296 Improve user-defined conversion handling.
9297 * convert.cs (GetConversionOperators): Rewrite. Return only the
9298 applicable operators.
9299 (AddConversionOperators): New. Helper for GetConversionOperators.
9300 (FindMostEncompassedType, FindMostEncompassingType): Verify that
9301 there is only one most encompassed/encompassing type.
9302 (FindMostSpecificSource, FindMostSpecificTarget): Remove
9303 "applicable operator" handling.
9304 (UserConversion): Move cache here from GetConversionOperators.
9305 Directly cache the chosen operator, rather than the whole
9307 (ExplicitNumericConversion): Fix buggy implementation of Decimal
9308 case. Allow conversion of decimal to sbyte and byte too.
9309 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
9310 New static methods. Used to avoid allocating EmptyExpressions in
9313 2005-05-24 Duncan Mak <duncan@novell.com>
9315 * ecore.cs (CastFromDecimal): New class for casting a decimal to
9316 another class, used in Convert.ExplicitNumericConversion.
9317 (CastToDecimal): New class, similar to above, but casts to
9318 System.Decimal, used in Convert.ImplicitNumericConversion and also
9319 in explicit convesion from double/float to decimal.
9321 * convert.cs (ImplicitNumericConversion): Handle implicit
9322 conversions to System.Decimal.
9323 (ExplicitNumericConversion): handle explicit conversions to
9328 2005-05-20 Miguel de Icaza <miguel@novell.com>
9330 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
9331 know the type at this stage, just break through. Fixes #75008
9333 2005-05-19 Martin Baulig <martin@ximian.com>
9336 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
9337 to disable error reporting.
9339 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
9340 here since we don't want to report an error; see the new test-336.cs.
9342 2005-05-19 Raja R Harinath <rharinath@novell.com>
9344 * statement.cs (ToplevelBlock.GetParameterReference)
9345 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
9346 Move here from class Block.
9347 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
9348 * expression.cs (ParameterReference.DoResolveBase): Likewise.
9350 2005-05-18 Martin Baulig <martin@ximian.com>
9355 (FlowBranching.Reachability): Add non-static public And() and Or()
9357 (FlowBranchingSwitch): New class; do the `break_origins' thing
9358 like in FlowBranchingLoop.
9359 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
9360 reachability, not just locals and parameters.
9361 (FlowBranching.MergeChild): Remove some of the hacks for loop and
9362 switch; MergeBreakOrigins() now takes care of that.
9364 2005-05-18 Martin Baulig <martin@ximian.com>
9366 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9367 a loop and may leave it, reset the barrier; fixes #74974.
9369 2005-05-17 Marek Safar <marek.safar@seznam.cz>
9371 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
9374 * cs-parser.jay: Catch more lexical errors.
9376 * report.cs: Add one more Error method.
9379 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
9381 2005-05-17 Martin Baulig <martin@ximian.com>
9383 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
9386 2005-05-16 Raja R Harinath <rharinath@novell.com>
9388 Fix test-382.cs. Emit values of decimal constants.
9389 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
9391 (TypeContainer.AddField): ... this.
9392 (TypeContainer.EmitFieldInitializers): Allow the list of fields
9393 with initializers to include 'Const's.
9394 (ClassPart.RegisterFieldForInitialization): Forward to
9396 * const.cs (Const.Const): Pass initializer to base class.
9397 (Const.Define): In case of decimal constants, register them for
9398 initialization in a static constructor.
9400 2005-05-14 Martin Baulig <martin@ximian.com>
9402 * statement.cs (Block.Resolve): Correctly handle unreachable code;
9403 do not call ResolveUnreachable() on unreachable statements in
9404 here, see the comment in the source code.
9406 2005-05-13 Raja R Harinath <rharinath@novell.com>
9409 * expression.cs (BinaryResolveOperator): If one of the operands of
9410 an equality comparison is 'null' and the other is a pointer type,
9411 convert the null to a NullPointer.
9412 * convert.cs (ImplicitReferenceConversion): If the expression is a
9413 NullLiteral and the target type is a pointer type, return a
9414 NullPointer instead.
9415 (ImplicitConversionStandard): Likewise.
9417 2005-05-13 Marek Safar <marek.safar@seznam.cz>
9419 * cs-parser.jay: Set readonly context based on special constructs.
9421 * expression.cs (LocalVariableReference.DoResolveBase): Improved
9422 readonly variable error handling.
9424 * rootcontext.cs (EmitCode): Don't verify members when error
9427 * statement.cs (LocalInfo): Add reaodnly context information.
9428 (SetReadOnlyContext, GetReadOnlyContext): New methods.
9430 2005-05-13 Raja R Harinath <rharinath@novell.com>
9432 * statement.cs (Block.Resolve): Revert change below. Modify fix
9433 for #74041 to initialize 'resolved' to false only for explicit
9434 blocks. Fixes #74873.
9436 2005-05-12 Raja R Harinath <harinath@gmail.com>
9439 * typemanager.cs (unmanaged_enclosing_types): New.
9440 (IsUnmanagedType): Avoid infloops by using
9441 'unmanaged_enclosing_types' to talk with recursive invocations.
9443 2005-05-13 Martin Baulig <martin@ximian.com>
9445 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
9446 instance variable, not a local. Fix #74873.
9447 (Block.ResolveUnreachable): Set it to true here.
9449 2005-05-11 Duncan Mak <duncan@novell.com>
9451 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
9452 continuing to process for 'arg'.
9453 (handle_preprocessing_directive): Check the argument of the #endif
9454 directive and report error CS1025 if there are any trailing
9457 According to the C# spec, having even whitespace after the #endif
9458 directive is illegal; however, because we call arg.TrimEnd ()
9459 beforehand, we have the same behavior as csc, allowing whitespace
9460 after the directive.
9464 2005-05-11 Marek Safar <marek.safar@seznam.cz>
9468 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
9469 (Constructor.GetObsoleteAttribute): Implemented correctly.
9471 2005-05-10 Martin Baulig <martin@ximian.com>
9473 * support.cs (ReflectionParameters.ParameterModifier): Use
9474 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
9475 and `ParameterAttributes.In'. Fixes #74884.
9477 2005-05-10 Marek Safar <marek.safar@seznam.cz>
9479 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
9481 * expression.cs (Argument.GetParameterModifier): Turned to property.
9482 (Invocation.Error_InvalidArguments): Add more descriptive errors.
9484 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
9487 2005-05-09 Raja R Harinath <rharinath@novell.com>
9490 * decl.cs (MemberCache.AddMethods): Register override methods,
9491 rather than non-override methods.
9492 * typemanager.cs (RegisterOverride): New.
9493 (IsOverride): Update.
9495 2005-05-09 Marek Safar <marek.safar@seznam.cz>
9499 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
9500 recursive declaration.
9502 * statement.cs (Block.ResolveMeta): Report any error in resolving.
9504 2005-05-06 Marek Safar <marek.safar@seznam.cz>
9506 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
9508 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
9510 2005-05-05 Raja R Harinath <rharinath@novell.com>
9513 * decl.cs (DeclSpace.FamilyAccessible):
9514 Use TypeManager.IsNestedFamilyAccessible.
9516 Fix reopened #64812.
9517 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
9520 2005-05-04 Raja R Harinath <rharinath@novell.com>
9521 Abin Thomas <projectmonokochi@rediffmail.com>
9522 Anoob V E <projectmonokochi@rediffmail.com>
9523 Harilal P R <projectmonokochi@rediffmail.com>
9526 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
9527 allow access to all static members.
9529 2005-05-04 Martin Baulig <martin@ximian.com>
9531 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
9533 2005-05-04 Martin Baulig <martin@ximian.com>
9537 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
9538 section at the end; make things work if `default' is not the last
9541 2005-05-04 Martin Baulig <martin@ximian.com>
9545 * statement.cs (Switch): Replaced the `got_default' field with a
9546 `default_section' one.
9547 (Switch.CheckSwitch): Set `default_section' here.
9548 (Switch.Resolve): If we're a constant switch and the constant is
9549 not found, use the default section.
9551 2005-05-03 Martin Baulig <martin@ximian.com>
9553 * expression.cs (ArrayAccess.EmitGetLength): New public method.
9555 * statement.cs (Foreach.ArrayForeach): New nested class.
9556 (Foreach.TemporaryVariable): New nested class.
9557 (Foreach.EmitArrayForeach): Removed; this is now in the new
9560 2005-05-03 Raja R Harinath <rharinath@novell.com>
9562 * pending.cs (BaseImplements): Move the #74773 fix here. This is
9564 (VerifyPendingMethods): Revert change below.
9566 * typemanager.cs (IsOverride, RegisterNonOverride): New.
9567 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
9568 that used to trigger warning -28. Remove warning -28.
9569 * expression.cs (Invocation.OverloadResolve): Use
9570 TypeManager.IsOverride to distinguish override methods.
9573 * pending.cs (VerifyPendingMethods): If a base type implements the
9574 requested interface, don't bother checking individual methods of
9575 the base type. As a side-effect, this prevents the creation of
9576 unnecessary proxies.
9578 2005-05-02 Martin Baulig <martin@ximian.com>
9582 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
9583 Also `And' the locals if the old vector is null.
9584 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
9585 null; in this case we basically reset all the variables.
9587 2005-05-02 Martin Baulig <martin@ximian.com>
9591 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
9592 Added `FlowBranching branching' argument; always `and' the
9593 variables instead of `or'ing them unless we're an infinite loop.
9595 * statement.cs (While.Resolve): Create a new sibling unless we're
9598 2005-05-02 Martin Baulig <martin@ximian.com>
9602 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
9603 arguments; use it instead of creating a new TopLevelBlock.
9604 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
9605 our ConstructorInitializer.
9608 (TopLevelBlock.TopLevelBranching): New public property.
9609 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
9610 and create our `TopLevelBranching'.
9612 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
9613 anonymous method host, use `block.TopLevelBranching' rather than
9614 creating a new branching.
9616 2005-04-20 Miguel de Icaza <miguel@novell.com>
9618 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
9619 a ScopeInfo, if any of the current children is a child of the new
9620 entry, move those children there.
9622 2005-04-30 Martin Baulig <martin@ximian.com>
9624 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
9625 at the beginning of a SwitchSection. Fix #73335.
9627 2005-04-27 Marek Safar <marek.safar@seznam.cz>
9630 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
9632 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
9633 (FieldExpr.DoResolve): Obsolete members are ignored for field
9636 2005-04-26 Marek Safar <marek.safar@seznam.cz>
9638 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
9639 of arrays detection.
9641 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
9643 (Field.VerifyClsCompliance): Volatile fields are not compliant.
9645 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
9648 2005-04-25 Ben Maurer <bmaurer@ximian.com>
9650 * cs-parser.jay: Use the prefered version of -unsafe in error
9653 2005-04-22 Marek Safar <marek.safar@seznam.cz>
9655 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
9658 2005-04-20 John Luke <john.luke@gmail.com>
9660 * driver.cs: fix typo in error message, --outout to --output
9662 2005-04-20 Marek Safar <marek.safar@seznam.cz>
9664 * codegen.cs (InRefOutArgumentResolving): New field.
9666 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
9667 fields outside contructor.
9669 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
9671 2005-04-19 Miguel de Icaza <miguel@novell.com>
9673 * anonymous.cs (CaptureContext.EmitParameterInstance): The
9674 parameter code was not completed ever, so it was not as up-to-date
9675 as local variables. Must finish it.
9677 The bug fix was to compare the Toplevel of the block, not the
9678 current block. Thanks for Ben for pointing this out.
9680 2005-04-19 Raja R Harinath <rharinath@novell.com>
9682 * decl.cs (AddMethods): Use the declaring type of the problem
9683 method to determine if we want to squash a warning.
9685 2005-04-19 Marek Safar <marek.safar@seznam.cz>
9687 * attribute.cs: Removed debug output.
9689 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
9691 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
9694 2005-04-18 Raja R Harinath <rharinath@novell.com>
9697 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
9698 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
9699 all null comparisons against reference types.
9701 2005-04-18 Marek Safar <marek.safar@seznam.cz>
9704 * class.cs (TypeContainer.CircularDepException) New nested
9706 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
9707 (TypeContainer.DefineType): Removed error, reset InTransit before
9709 (Class.DefineType): Throw exception when is in Transit.
9710 Catch exception and report error.
9711 (Struct.DefineType): Throw exception when is in Transit.
9712 Catch exception and report error.
9713 (Interface.DefineType): Throw exception when is in Transit.
9714 Catch exception and report error.
9716 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
9717 handle nested exception handlers.
9719 * flowanalysis.cs (InTryWithCatch): New method, search for try with
9722 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
9723 InFinally and InCatch storage.
9725 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
9726 (Catch.Resolve): Set and Restore ec.InCatch.
9727 (Try.Resolve): Set and Restore ec.InFinally.
9728 (Try.HasCatch): True when try has catch.
9730 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
9732 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
9733 for the same event member, so exclude such cases from warning 419.
9736 2005-04-16 Miguel de Icaza <miguel@novell.com>
9738 * expression.cs (Binary.ResolveOperator): Apply patch from John
9739 Luke to fix bug 59864: operators &, | and ^ on enumerations
9740 require that the same enum type on both sides.
9742 * driver.cs: Add warnings to old flag usage, this is to assist
9743 people who produce Makefiles and hope that the Makefiles will be
9746 * class.cs (TypeContainer.EmitType): Moved the definition of the
9747 special $PRIVATE$ field from the resolve phase to the Emit phase.
9748 During resolve we do not know if we are a struct with
9749 HasExplicitLayout, we know this only after the attributes for the
9752 Set the FieldOffset to zero on the dummy field that we create for
9753 the class. Fixes 74590.
9755 2005-04-16 Raja R Harinath <rharinath@novell.com>
9758 * ecore.cs (PropertyExpr.resolved): New.
9759 (DoResolve): Use it to handle a case of double resolution here.
9760 Handle a case of identical-name-and-type-name.
9761 * expression.cs (ArrayCreation.CheckIndices): Avoid double
9762 resolution by storing the results of expression resolution back
9763 into the "probes" array.
9765 2005-04-15 Raja R Harinath <rharinath@novell.com>
9767 Fix cs0208-7.cs and cs0208-8.cs.
9768 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
9769 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
9770 error reporting to point out the reason a struct is not unmanaged.
9772 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
9774 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
9775 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
9777 2005-04-13 Raja R Harinath <rharinath@novell.com>
9780 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
9781 IdenticalNameAndTypeName here.
9782 (EventExpr.InstanceResolve): Likewise.
9784 2005-04-13 Marek Safar <marek.safar@seznam.cz>
9786 C# 2.0 DefaultCharSetAttribute implementation
9788 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
9789 which allows us to set GlobalNamespace for every resolve.
9790 (Attribute.ResolveArguments): Cut from Resolve.
9791 (Attribute.GetCharSetValue): Returns CharSet named argument.
9792 (Attribute.DefinePInvokeMethod): Gets default charset from
9794 (GlobalAttribute.ResolveAsTypeStep): Override.
9795 (GlobalAttribute.ResolveArguments): Override.
9797 * class.cs (TypeAttr): Is protected.
9799 * codegen.cs (ModuleClass.DefaultCharSet): New member.
9800 (ModuleClass.DefaultCharSetType): New memeber.
9801 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
9803 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
9804 charset from module.
9806 * delegate.cs (TypeAttr): Override.
9807 (Delegate.DefineType): Use this TypeAttr.
9809 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
9810 at very early stage (before types are defined) to resolve model
9811 module attributes. It will probably not work with corlib but it
9814 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
9815 charset from module.
9817 * typemanager.cs (default_charset_type): New type.
9819 2005-04-13 Raja R Harinath <rharinath@novell.com>
9821 * decl.cs (MemberCache.AddMethods): Don't warn if
9822 System.Object.Finalize has buggy MethodAttributes.
9824 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
9827 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
9829 * doc.cs : detect ambiguous reference to overloaded members.
9830 Fixed bug #71603. MS 1.1 csc does not detect it.
9832 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
9834 * doc.cs : delegates must not be referenced with parameters.
9837 2005-04-12 Miguel de Icaza <miguel@novell.com>
9839 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
9841 2005-04-10 Miguel de Icaza <miguel@novell.com>
9843 * driver.cs (MainDriver): Stop processing if the CLS stage found
9846 (CompilerCallableEntryPoint.InvokeCompiler): Always
9847 reset after execution; Take a TextWriter argument for the
9850 * report.cs: Use the error stream instead of hardcoding stderr.
9852 2005-04-09 Miguel de Icaza <miguel@novell.com>
9854 * class.cs: Reduce code paths to test, too small of an
9855 optimization to make it worth the extra testing. Always perform
9858 2005-04-08 Raja R Harinath <rharinath@novell.com>
9861 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
9862 operators that had errors reported on them.
9864 2005-04-08 Marek Safar <marek.safar@seznam.cz>
9866 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
9868 (Attribute.Resolve): Add named argument type checking.
9870 * class.cs (FixedField.Define): Use IsPrimitiveType
9872 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
9874 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
9875 unsafe parameter types.
9877 * statement.cs (Using.ResolveExpression): Add better error description.
9879 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
9881 2005-04-08 Raja R Harinath <rharinath@novell.com>
9884 * attribute.cs (Attribute.GetAttributeUsage): Resolve
9885 AttributeUsageAttribute in the emitcontext of the attribute class,
9886 not in the emitcontext of the attributable entity it was attached to.
9887 * cs-parser.jay: Use 'current_class', not 'current_container',
9888 when creating a GlobalAttribute.
9890 2005-04-08 Alp Toker <alp@atoker.com>
9892 * pending.cs: The fix to #58413 failed to compile methods implementing
9893 interfaces with/without params modifiers and vice versa, even though
9894 params modifiers aren't part of the signature. Make the modifier check
9895 less strict as in csc.
9897 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
9898 Anoob V E <projectmonokochi@rediffmail.com>
9899 Harilal P R <projectmonokochi@rediffmail.com>
9902 * pending.cs (TypeAndMethods.mods): New. Store the parameter
9903 modifiers of pending methods.
9904 (PendingImplementation.PendingImplementation): Initialize it.
9905 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
9906 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
9907 with ParameterData. Add check for modifiers.
9908 * class.cs (MethodData.Define): Update to changes.
9910 2005-04-07 Raja R Harinath <rharinath@novell.com>
9912 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
9914 2005-04-07 Marek Safar <marek.safar@seznam.cz>
9916 * class.cs (PropertyMethod.Define): Check private accessor in abstract
9919 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
9922 * typemanager.cs: Registered RequiredAttributeAttribute.
9924 2005-04-06 Marek Safar <marek.safar@seznam.cz>
9926 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
9927 Warning CS0169 is back at level 3.
9928 (IMethodData.SetMemberIsUsed): New method.
9930 * decl.cs (IsUsed): New value; moved from FieldBase.Status
9931 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
9933 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
9935 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
9937 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
9940 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
9943 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
9944 to avoid the problems with nested types.
9946 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
9947 Anoob V.E <projectmonokochi@rediffmail.com>
9948 Harilal P.R <projectmonokochi@rediffmail.com>
9949 Raja R Harinath <rharinath@novell.com>
9952 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
9954 * typemanager (GetConstructor): Make public.
9956 2005-04-05 John Luke <john.luke@gmail.com>
9957 Raja R Harinath <rharinath@novell.com>
9960 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
9961 struct too. Return false quicker in a few cases.
9962 (VerifyUnManaged): Use it.
9964 2005-04-05 Raja R Harinath <rharinath@novell.com>
9967 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
9968 not 'unreachable_seen'.
9970 2005-04-04 Marek Safar <marek.safar@seznam.cz>
9972 * attribute.cs (Attribute.GetValue): Removed unused.
9974 * codegen.cs (CodeGen.TrimExt): Removed unused.
9976 * cs-parser.jay (output): Removed unused.
9978 * cs-tokenizer.cs (hex_digits): Removed unused.
9980 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
9982 * expression.cs (Indirection.LoadExprValue): Removed unused.
9983 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
9985 * iterators.cs (Iterator.param_types): Removed unused.
9987 * statement.cs (Goto.block): Removed unused.
9988 (ToplevelBlock.did): Removed unused.
9989 (Switch.ResolveConstantSwitch): Removed unused.
9991 2005-04-01 Ben Maurer <bmaurer@ximian.com>
9993 * rootcontext.cs: Allow mcs to bootstrap with the compilation
9996 2005-04-01 Raja R Harinath <rharinath@novell.com>
9998 Fix #74232 and cs0208-3.cs.
9999 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
10000 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
10001 unmanaged type. Don't use FieldBuilders when 't' is a
10002 TypeBuilder. Use ModFlags and MemberType fields.
10003 * class.cs (MemberBase.member_type): Rename from MemberType.
10004 (MemberBase.MemberType): New property. Determines member_type on
10006 (MemberBase.DoDefine): Don't initialize MemberType here.
10007 (FieldMember.Define): Likewise.
10009 2005-04-01 Marek Safar <marek.safar@seznam.cz>
10012 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
10013 Attributes are emitted there.
10015 2005-04-01 Raja R Harinath <rharinath@novell.com>
10017 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
10018 keyword in 'partial enum' too.
10019 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
10021 Report from Kamil Skalski <nazgul@omega.pl>.
10024 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
10025 have partial containers too.
10027 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
10028 in block' checks to Block.CheckInvariantMeaningInBlock.
10029 * statement.cs (Block.GetKnownVariableInfo): Make private.
10030 (Block.IsVariableUsedInChildBlock): Remove.
10031 (Block.IsVariableUsedInBlock): Likewise.
10032 (Block.CheckInvariantMeaningInBlock): New. Show location of
10033 conflicting declaration.
10034 (Block.AddVariable): Make error messages less long-winded and more
10035 specific. Show location of conflicting declaration.
10036 * parameter.cs (Parameters.Location): New readonly property.
10038 2005-03-31 Raja R Harinath <rharinath@novell.com>
10040 Clean up semantics of invoking ResolveMemberAccess.
10041 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
10042 can have an instance, ensure that we pass in a non-TypeExpression
10043 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
10044 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
10045 argument. Update to changes and simplify.
10046 (FieldExpr.Emitinstance): Remove CS0120 check.
10047 (PropertyExpr.EmitInstance): Likewise.
10048 * expression.cs (Argument.Resolve): Likewise.
10049 (Invocation.DoResolve): Update to changes in semantics of
10050 InstanceExpression.
10052 2005-03-31 Marek Safar <marek.safar@seznam.cz>
10055 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
10058 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
10060 2005-03-31 Raja R Harinath <rharinath@novell.com>
10062 Fix difference in behaviour with commandline invocation.
10063 * driver.cs (Driver.Reset): New.
10064 (CompilerCallableEntryPoint): Call it.
10066 * statement.cs (If.Resolve): Avoid spurious "uninitialized
10067 variable" warnings if the boolean expression failed to resolve.
10069 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
10071 * attribute.cs: Fix the union of several permissions when some of them
10072 are unrestricted (so the result isn't an unrestricted permission set).
10075 2005-03-30 Raja R Harinath <rharinath@novell.com>
10077 * ecore.cs (MemberExpr): New class. Convert from interface
10079 (MemberExpr.ResolveMemberAccess): Refactor and move here from
10080 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
10082 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
10083 (MethodGroupExpr.IsExplicitImpl): Remove.
10084 (Expression.GetFieldFromEvent): Remove.
10085 (SimpleName.MemberStaticCheck): Remove.
10086 (SimpleName.DoSimpleNameResolve): Update to changes.
10087 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
10088 (MemberAccess.IdenticalNameAndTypeName): Remove.
10089 (MemberAccess.error176): Move to MemberExpr.
10090 (MemberAccess.DoResolve): Update to changes.
10091 (BaseAccess.DoResolve): Likewise.
10093 2005-03-30 Marek Safar <marek.safar@seznam.cz>
10095 C# 2.0 Conditional attribute class implementation
10097 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
10098 Analyzes class whether it has attribute which has ConditionalAttribute
10099 and its condition is not defined.
10101 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
10102 (Class.IsExcluded): New method. Search for at least one defined
10103 condition in ConditionalAttribute of attribute class.
10105 2005-03-30 Raja R Harinath <rharinath@novell.com>
10107 * ecore.cs (PropertyExpr): Derive from Expression, not
10108 ExpressionStatement.
10109 (PropertyExpr.EmitStatement): Remove.
10111 2005-03-29 Raja R Harinath <rharinath@novell.com>
10114 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
10115 internal field "value__" of an enum be private. The examples for
10116 "value__" that I found on MSDN all used FieldAttributes.Private.
10118 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
10119 Don't mention IL method attribute names.
10121 Fix #47991. Remove a TODO.
10122 * statement.cs (Block.Toplevel): Make into a field.
10123 (Block.Parameters): Move into ToplevelBlock.
10124 (Block.known_variables): Rename from child_variable_names.
10125 (Block.Block): Remove variants that take Parameters. Initialize
10126 'Toplevel' with the immediately surrounding toplevel block.
10127 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
10128 LocalInfo parameter.
10129 (Block.GetKnownVariableInfo): New.
10130 (Block.IsVariableNameUsedInChildBlock): Update.
10131 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
10132 the block, even though it may not be in scope.
10133 (Block.AddVariable): Remove Parameters parameter. Use
10134 Toplevel.Parameters instead.
10135 (Block.AddConstant): Remove Parameters parameter.
10136 (Block.GetParameterReference): Update to use Toplevel.Parameters.
10137 (Block.IsParamaterReference): Likewise.
10138 (Block.IsLocalParameter): Likewise. Simplify a lot.
10139 (ToplevelBlock.Parameters): New. Moved from Block.
10140 (ToplevelBlock.ToplevelBlock): Update to changes. Always
10141 initialize Parameters to a non-null value.
10142 * cs-parser.jay: Update to changes.
10143 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
10144 simple names that mean different things in the same block. Use
10145 Block.IsVariableNameUsedInBlock.
10147 2005-03-28 Raja R Harinath <rharinath@novell.com>
10149 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
10150 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
10151 GetTypeHandle. It is possible for a reflected type to derive from
10152 a TypeBuilder (e.g., int[] derives from the TypeBuilder
10153 System.Array during mscorlib compilation).
10154 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
10155 contain a method_hash, don't create one either. Don't create a
10156 deep copy of the base cache's method_hash.
10157 (MemberCache.SetupCache): Rename back from DeepCopy.
10158 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
10159 already initialized. If we see an override function, add its
10160 underlying base virtual function to the member_hash too.
10162 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
10164 2005-03-26 Raja R Harinath <harinath@acm.org>
10167 * assign.cs (Assign.DoResolve): When the RHS of an assignment
10168 fails to resolve, ensure that the LHS is still resolved as an
10171 2005-03-25 Raja R Harinath <harinath@acm.org>
10173 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
10175 (Enum.current_ec): Remove.
10176 (Enum.LookupEnumValue): Remove EmitContext argument.
10177 Just uses the one created during DefineType.
10178 (Enum.FindMembers): Update.
10179 * expression.cs (MemberAccess.DoResolve): Update.
10181 2005-03-22 Marek Safar <marek.safar@seznam.cz>
10183 * assign.cs (Assign.DoResolve): Check for CS1717 when
10184 source and target are same (uses Equals).
10186 * expression.cs (LocalVariableReference, ParameterReference,
10187 This): Implemented Equals, GetHashCode.
10189 * statement.cs (Block.GetParameterReference): Removed useless
10192 2005-03-22 Raja R Harinath <rharinath@novell.com>
10195 * statement.cs (Block.AddVariable): Ensure that we skip implicit
10196 blocks before deciding whether the error is cs0136 or cs0128.
10198 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
10199 (using_alias_directive, using_namespace_directive): Pass
10200 MemberName, not an expression to Namespace.UsingAlias and
10202 (MakeName): Use the MemberName of the namespace.
10203 * namespace.cs (Namespace.MemberName): New.
10204 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
10205 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
10207 * decl.cs (MemberName.Name): Make readonly.
10208 (MemberName.FromDotted): New "constructor".
10209 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
10210 (MemberCore.Name): Compute from MemberName on demand.
10211 (MemberCore.SetMemberName): Provide a way to change the
10213 (MemberCore.AddToContainer): Don't take a fullname parameter.
10214 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
10215 fully qualified name of the container to the member name.
10216 (TypeContainer.AddToTypeContainer): Use a fully qualified name
10217 only if the type is a member of the root container.
10218 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
10219 MemberName.Left rather than searching for an embedded ".".
10220 (PartialContainer.CreatePart): Update to changes in RootContext.
10221 (MemberBase.ShortName): Turn into a property. Use
10222 MemberCore.SetMemberName.
10223 (MemberBase.ExplicitInterfaceName): Remove.
10224 (MemberBase.UpdateMemberName): Remove.
10225 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
10226 (PropertyBase.SetMemberName): New override.
10227 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
10228 (Tree.GetDecl): New.
10229 (Tree.AllDecls): Rename from Decls.
10230 * attribute.cs, enum.cs, report.cs: Update to changes.
10231 * driver.cs (MainDriver): Use MemberName.FromDotted on
10232 RootContext.MainClass.
10234 2005-03-21 Marek Safar <marek.safar@seznam.cz>
10236 * class.cs (FixedField.Define): Check for CS1664 and more sanity
10239 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
10241 2005-03-18 Marek Safar <marek.safar@seznam.cz>
10243 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
10244 property accessor modifiers.
10246 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
10247 fixed buffer attribute (CS1716).
10248 (PropertyMethod.HasCustomAccessModifier): When property accessor
10249 has custom modifier.
10251 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
10253 (PropertyExpr.DoResolveLValue): Add CS0272.
10255 2005-03-17 Miguel de Icaza <miguel@novell.com>
10257 * convert.cs: When converting to a pointer, use the proper Conv.U
10258 or Conv.I depending on the source data type.
10260 * cs-tokenizer.cs: Make the size for large decimal constants,
10263 2005-03-17 Martin Baulig <martin@ximian.com>
10265 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
10266 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
10268 2005-03-17 Martin Baulig <martin@ximian.com>
10270 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
10271 to bool so we can return an error condition.
10272 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
10275 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
10277 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
10280 2005-03-16 Raja R Harinath <rharinath@novell.com>
10282 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
10283 Refactor to avoid traversing the list of assemblies, and to avoid
10284 string concatenation.
10285 * typemanager.cs (guid_attr_type): Remove.
10286 (negative_hits, pointers, references): Remove hashes.
10288 (GetConstructedType): New. Uses type_hash to handle constructed
10289 types (arrays, references, pointers).
10290 (GetReferenceType, GetPointerType): Use it.
10291 (GetNestedType): New. Uses type_hash to handle nested types of
10293 (LookupType, LookupTypeDirect): Remove.
10294 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
10295 'types' hash and LookupTypeReflection directly.
10296 (params_string, params_object): Use GetConstructedType.
10297 * namespace.cs (Namespace.cached_types): New. Cache of reflected
10299 (Namespace.Lookup): Use cached_types.
10300 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
10301 provided by old TypeManager.LookupType.
10302 * rootcontext.cs (MakeFQN): Remove.
10303 * decl.cs (DeclSpace.MakeFQN): Likewise.
10304 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
10305 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
10306 TypeManager.GetConstructedType.
10307 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
10309 2005-03-15 Marek Safar <marek.safar@seznam.cz>
10311 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
10314 * cs-parser.jay: Reports CS1527 for any namespace element.
10316 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
10319 * expression.cs (ParameterReference.IsAssigned): Changed error to
10321 (Error_WrongNumArguments): Moved CS0245 detection here.
10323 * statement.cs (Return.Resolve): Add CS1622 report.
10325 2005-03-11 Marek Safar <marek.safar@seznam.cz>
10327 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
10329 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
10331 * attribute.cs expression.cs: Get rid of some allocations.
10333 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
10335 * doc.cs : just eliminate the latest change.
10337 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
10339 * doc.cs : commented out the latest change. It breaks xml-030.cs
10341 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
10343 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
10344 fail. So invoke CreateType() in FindDocumentedType().
10346 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
10348 * cs-tokenizer.cs : added IsKeyword().
10349 * doc.cs : Detect keyword incorrectly used as identifier.
10350 Allow identifiers prefixed by @.
10352 2005-03-10 Marek Safar <marek.safar@seznam.cz>
10354 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
10355 It caused exception in namespace resolving (again!).
10357 * class.cs (Class.ctor): Removed exit.
10358 (PropertyMethod.ctor): ditto.
10360 * codegen.cs (Codegen.Reset): Reset static data.
10361 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
10363 * cs-tokenizer.cs (Cleanup): Removed.
10365 * driver.cs (GetSystemDir): Rewrote to one line command.
10366 It caused problem with unloaded dynamic modules.
10367 (UnixParseOption): Removed Exit.
10368 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
10369 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
10370 Now can be mcs used as library.
10372 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
10375 * location.cs (Reset): Reset static data.
10377 * namespace.cs (Reset): Reset static data.
10379 * report.cs (Report.Reset): Reset static data.
10381 * rootcontext.cs (RootContext.Reset): Reset static data.
10383 * tree.cs (RootTypes.ctor): Use Location.Null
10385 * typemanager.cs (TypeManager.Reset): Reset static data.
10386 (CoreLookupType): Removed Exit.
10387 (TypeHandle.Reset): Reset static data.
10389 2005-03-10 Raja R Harinath <rharinath@novell.com>
10392 * typemanager.cs (ComputeNamespaces): Import namespaces from
10393 referenced modules too.
10395 2005-03-09 Raja R Harinath <rharinath@novell.com>
10397 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
10400 2005-03-09 Raja R Harinath <rharinath@novell.com>
10402 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
10403 enclosing DeclSpace. This ensures that a name-lookup populates
10404 more caches and there are fewer 'TypeExpression's. Carve out
10405 nested type lookup into ...
10406 (LookupNestedTypeInHierarchy): ... this.
10408 2005-03-09 Raja R Harinath <rharinath@novell.com>
10410 Clean up a few partial-class semantics.
10411 Fixes test-357.cs and cs1618-2.cs.
10412 * cs-parser.jay (struct_declaration): Use 'current_class' as
10413 parent of newly-created struct. Remove call to Register ().
10414 Use 'pop_current_class' to complete handing the current struct.
10415 (interface_declaration): Likewise.
10416 (class_declaration): Likewise.
10417 (enum_declaration): Use 'current_class' as parent of newly created
10419 (delegate_declaration): Likewise.
10420 (pop_current_class): New function. This is used to handle closing
10421 up the 'current_class' and 'current_container', and pointing them
10422 to the enclosing class/container.
10423 (CSharpParser): Initialize 'current_class' too.
10424 * decl.cs (MemberCore): Add check for invariant: a partial
10425 container is not a parsed entity, and thus does not enclose any
10427 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
10428 (DeclSpace.BaseTypeExpr): Use it.
10429 (DeclSpace.LookupType): Add check for invariant.
10430 * class.cs (TypeContainer): Add check for invariant: a nested
10431 class should have the same NamespaceEntry as its enclosing class.
10432 (TypeContainer.EmitFieldInitializers): Make virtual.
10433 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
10435 (TypeContainer.Register): Remove.
10436 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
10437 null. Use TypeResolveEmitContext for resolving base types and
10438 interfaces. Move initialization of Parts.TypeBuilder here from
10440 (TypeContainer.DefineNestedTypes): ... here.
10441 (PartialContainer): Take a Namespace not a NamespaceEntry.
10442 (PartialContainer.Create): Don't use Register. Call the
10443 appropriate Add... function directly.
10444 (ClassPart): Take both the PartialContainer and the enclosing
10445 class as constructor arguments.
10446 (ClassPart.EmitFieldInitializers): Override.
10447 (ClassPart.PartFindNestedTypes): Remove.
10448 (FieldBase.GetInitializerExpression): Resolve the initializer
10449 expression in the emit context of the enclosing class.
10450 * tree.cs (RootTypes): Remove Register ().
10452 2005-03-08 Marek Safar <marek.safar@seznam.cz>
10454 * cs-parser.jay: Removed CS0134.
10456 * driver.cs: Removed CS1901.
10458 * expression.cs (SizeOf.DoResolve): Don't report CS0233
10459 for predefined types.
10461 2005-03-07 Duncan Mak <duncan@novell.com>
10463 * codegen.cs (Save): Catch UnauthorizedAccessException as
10464 well. Fixes bug #73454.
10466 2005-03-07 Marek Safar <marek.safar@seznam.cz>
10468 * cs-tokenizer.cs (xtoken): Add CS1035.
10470 * class.cs (MethodData.Define): Add CS0683.
10471 (FieldMember.ctor): Add CS0681.
10473 2005-03-07 Raja R Harinath <rharinath@novell.com>
10475 * ecore.cs (SimpleName.DoResolve): Rename from
10476 SimpleName.DoResolveAllowStatic.
10477 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
10478 Pass 'intermediate' flag to MemberStaticCheck.
10479 (SimpleName.MemberStaticCheck): Skip "static check" only in case
10480 of "intermediate" lookups via MemberAccess.
10481 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
10482 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
10484 2005-03-07 Raja R Harinath <rharinath@novell.com>
10487 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
10488 slipped in because of variable names that are identical to a
10489 builtin type's BCL equivalent ('string String;', 'int Int32;').
10490 (PropertyExpr.EmitInstance): Likewise.
10492 2005-03-04 Marek Safar <marek.safar@seznam.cz>
10494 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
10496 * report.cs (warning_ignore_table): Made public.
10498 2005-03-04 Raja R Harinath <rharinath@novell.com>
10501 * class.cs (MethodData.Emit): Pass 'container' to
10502 container.GetObsoleteAttribute instead of 'container.Parent'.
10504 2005-03-03 Marek Safar <marek.safar@seznam.cz>
10506 * cs-parser.jay: Add 1534 error test.
10508 * iterators.cs (Yield.CheckContext): Add error 1629.
10509 (Iterator.ctor): Save unsafe modifier.
10510 (MoveNextMethod.DoEmit): Restore unsafe context.
10512 * namespace.cs (UsingAlias): Better error message.
10514 2005-03-03 Dan Winship <danw@novell.com>
10516 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
10517 the warning message [#73219]
10519 2005-03-03 Raja R Harinath <rharinath@novell.com>
10521 Fix compile with MCS 1.0.0.0.
10522 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
10523 w_restore to not depend on string constant folding.
10525 2005-03-03 Raja R Harinath <rharinath@novell.com>
10527 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
10528 CS0246 check to users who passed 'silent = false'.
10529 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
10531 (SimpleName.SimpleNameResolve): Update.
10532 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
10533 (MemberAccess.IdenticalNameAndTypeName): Update.
10534 * doc.cs (FindDocumentedTypeNonArray): Update.
10536 2005-03-03 Raja R Harinath <rharinath@novell.com>
10538 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
10539 * parameters.cs (ComputeAndDefineParameters): Remove.
10540 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
10541 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
10542 Use GetParameterInfo.
10544 2005-03-02 Marek Safar <marek.safar@seznam.cz>
10546 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
10548 2005-03-02 Raja R Harinath <rharinath@novell.com>
10550 Unify DeclSpace.LookupType and DeclSpace.FindType.
10551 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
10552 is in charge of defining nested types on demand.
10553 (DeclSpace.LookupType): Use it when the current_type is a
10554 TypeBuilder. Use LookupTypeDirect for reflected types.
10555 (DeclSpace.FindType): Remove.
10556 (DeclSpace.LookupInterfaceOrClass): Likewise.
10557 (DeclSpace.DefineTypeAndParents): Likewise.
10558 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
10559 DeclSpace.LookupType.
10560 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
10561 * typemanager.cs (LookupType): Simplify.
10562 (AddUserType): Remove type from negative_hits.
10563 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
10564 * class.cs (TypeContainer.FindMembers): Move handling of nested
10566 (TypeContainer.FindMembers_NestedTypes): ... here.
10567 (TypeContainer.FindNestedType): Implement override.
10568 (ClassPart.FindNestedType): Delegate to PartialContainer.
10569 (ClassPart.PartFindNestedType): Looks up the nested types of the
10572 2005-03-02 Martin Baulig <martin@ximian.com>
10574 * class.cs (TypeContainer.DoDefineMembers): We also need a default
10575 static constructor in static classes.
10577 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
10579 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
10580 sizeParamIndex is not specified.
10582 2005-03-01 Marek Safar <marek.safar@seznam.cz>
10585 * report.cs (WarningMessage.IsEnabled): Missing null check.
10587 2005-02-28 Marek Safar <marek.safar@seznam.cz>
10589 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
10590 in the fields and not in the properties.
10592 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
10594 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
10597 2005-02-28 Marek Safar <marek.safar@seznam.cz>
10599 * attribute.cs: Small refactoring (improved robustness).
10600 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
10601 (ValidateGuid): Removed.
10602 (Resolve): Removed referenced to above mentioned.
10603 (GetAttributeUsage): Made private and changed to work without
10605 (GetIndexerAttributeValue): Don't crash.
10606 (GetConditionalAttributeValue): Ditto.
10607 (GetClsCompliantAttributeValue): Ditto.
10608 (ExtractSecurityPermissionSet): All attributes exceptions are
10610 (GetPropertyValue): New helper.
10611 (GetMethodImplOptions): New method.
10612 (DefinePInvokeMethod): Reuse common code. Implemented handling of
10613 some missing properties.
10615 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
10616 (Method.ApplyAttributeBuilder): Updated.
10618 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
10621 2005-02-28 Raja R Harinath <rharinath@novell.com>
10624 * report.cs (Report.SymbolRelatedToPreviousError): Handle
10625 non-simple types (array, pointer, reference).
10627 2005-02-28 Marek Safar <marek.safar@seznam.cz>
10629 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
10631 * class.cs (MethodCore.IsDuplicateImplementation): Special error
10633 (Method.CheckBase): Catch wrong destructor here.
10634 (MethodData.Define): Add errors 550, 668.
10636 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
10638 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
10640 * pending.cs (VerifyPendingMethods): Add error 551.
10642 * typemanager.cs (CSharpName): Next error report helper.
10644 2005-02-25 Marek Safar <marek.safar@seznam.cz>
10646 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
10647 attributes. Removed useless attribute double check.
10648 It saves almost 2MBs for corlib.
10650 2005-02-25 Raja R Harinath <rharinath@novell.com>
10653 * statement.cs (ExpressionStatement.Resolve): Make robust to being
10654 called twice in case of error.
10656 2005-02-23 Chris Toshok <toshok@ximian.com>
10658 Fix compiler portions of #72827.
10659 * statement.cs (Block.Emit): call Begin/EndScope on the
10660 EmitContext instead of the ILGenerator.
10662 * codegen.cs (EmitContext.BeginScope): new method, call
10663 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
10665 (EmitContext.BeginScope): same, but EndScope and CloseScope
10667 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
10668 offset and call the superclass's OpenScope(int) with it.
10669 (SymbolWriter.CloseScope): get the current il
10670 offset and call superclass's CloseScope(int) with it.
10672 2005-02-23 Marek Safar <marek.safar@seznam.cz>
10674 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
10675 CS1677 for out and ref as well.
10677 * class.cs (Method.Define): Add error CS1599 detection.
10679 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
10681 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
10683 * delegate.cs (Delegate.Define): Add error CS1599 detection.
10685 * support.cs.cs (ModifierDesc): New helper method.
10687 2005-02-23 Raja R Harinath <rharinath@novell.com>
10688 Abin Thomas <projectmonokochi@rediffmail.com>
10689 Anoob V E <projectmonokochi@rediffmail.com>
10690 Harilal P R <projectmonokochi@rediffmail.com>
10692 Fix #57851, #72718.
10693 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
10694 MemberLookup (used for error reporting) actually returns a result.
10695 Fix error report number (122, not 112).
10697 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
10698 Anoob V E <projectmonokochi@rediffmail.com>
10699 Harilal P R <projectmonokochi@rediffmail.com>
10702 * pending.cs (PendingImplementation.GetAbstractMethods):
10703 Find NonPublic members too.
10705 2005-02-22 Marek Safar <marek.safar@seznam.cz>
10707 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
10710 * class.cs (MethodCore.CheckMethodAgainstBase):
10711 Add error 239 report.
10713 2005-02-21 Raja R Harinath <rharinath@novell.com>
10716 * expression.cs (Invocation.IsApplicable): Make public.
10717 (Invocation.IsParamsMethodApplicable): Likewise.
10718 * delegate.cs (Delegate.VerifyApplicability): Don't use
10719 Invocation.VerifyArgumentCompat for parameter applicability
10720 testing. Use Invocation.IsApplicable and
10721 Invocation.IsParamsMethodApplicable.
10723 2005-02-21 Marek Safar <marek.safar@seznam.cz>
10725 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
10727 * class.cs (Operator.Define): Add error 217 report.
10729 2005-02-21 Raja R Harinath <rharinath@novell.com>
10731 * namespace.cs (UsingEntry.Resolve): Undo change below.
10733 2005-02-21 Raja R Harinath <rharinath@novell.com>
10736 * ecore.cs (Expression.MemberLookupFailed): Add argument to
10737 disable the error message when the extended MemberLookup also
10739 (Expression.MemberLookupFinal): Update.
10740 (SimpleName.DoSimpleNameResolve): Update.
10741 * expression.cs (MemberAccess.ResolveNamespaceOrType):
10742 Don't use MemberLookupFinal.
10743 (New.DoResolve): Update.
10744 (BaseAccess.CommonResolve): Update.
10746 2005-02-21 Raja R Harinath <rharinath@novell.com>
10749 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
10750 occured previously, don't resolve again.
10752 2005-02-21 Marek Safar <marek.safar@seznam.cz>
10755 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
10756 argument. Call ResolveAttributeUsage for unresolved.
10757 when types doesn't match ctor arguments.
10759 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
10760 for nested attribute classes.
10761 (Class.attribute_usage): Removed.
10762 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
10763 for attribute class.
10765 * ecore.cs (IsAttribute): Removed.
10767 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
10769 * rootcontext.cs (RegisterAttribute): Removed, attributes are
10771 (attribute_types): Removed.
10772 (EmitCode): Global attributes are emited as the latest.
10774 2005-02-18 Marek Safar <marek.safar@seznam.cz>
10776 * class.cs (EmitFieldInitializers): Don't emit field initializer
10777 for default values when optimilization is on.
10779 * constant.cs (Constant.IsDefaultValue): New property.
10781 * driver.cs: Add /optimize handling.
10785 * literal.cs: Implement new IsDefaultValue property.
10787 * rootcontext.cs (Optimize): New field, holds /optimize option.
10789 2005-02-18 Raja R Harinath <rharinath@novell.com>
10791 Fix crasher in re-opened #72347.
10792 * namespace.cs (Namespace.Lookup): Return null if
10793 DeclSpace.DefineType returns null.
10796 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
10798 2005-02-18 Raja R Harinath <rharinath@novell.com>
10800 Fix remainder of #63202. Change semantics of DoResolveLValue: it
10801 now returns null if it cannot resolve to an lvalue.
10802 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
10803 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
10804 returned null. Remove check for SimpleName.
10805 (EventExpr.DoResolveLValue): New.
10806 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
10807 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
10809 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
10810 avoid CS0131 error.
10811 (Unary.ResolveOperator): Move CS0211 check ...
10812 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
10814 (Unary.DoResolveLValue): Simplify.
10815 (AddressOf.DoResolveLValue): New.
10816 (ArrayAccess.DoResolveLValue): New.
10818 2005-02-16 Marek Safar <marek.safar@seznam.cz>
10820 * attribute.cs (Attribute.Resolve): Add arguments casting for
10821 when types doesn't match ctor arguments.
10823 2005-02-16 Raja R Harinath <rharinath@novell.com>
10825 Fix parts of #63202.
10826 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
10827 lookup of operator in base type. Ensure that all checks happen
10828 when the operator resolves to an "op_..." method.
10830 2005-02-15 Raja R Harinath <rharinath@novell.com>
10833 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
10834 'ignore_cs0104' parameter. Pass it to ...
10835 (NamespaceEntry.Lookup): ... this.
10836 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
10837 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
10838 (TypeLookupExpression.DoResolveAsTypeStep): Update.
10839 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
10840 Update. Request that cs0104 errors be ignored.
10841 (ComposedCast.ResolveAsTypeStep): Update.
10843 2005-02-14 Raja R Harinath <rharinath@novell.com>
10846 * expression.cs (Invocation.BetterFunction): Remove support for
10847 comparing virtual functions and their overrides.
10848 (Invocation.IsOverride): New.
10849 (Invocation.OverloadResolve): Don't consider 'override' functions
10850 during candidate selection. Store them in a lookaside list.
10851 If the selected method is a 'virtual' function, use the list to
10852 find any overrides that are closer to the LHS type.
10854 2005-02-14 Marek Safar <marek.safar@seznam.cz>
10856 * expression.cs (New.DoResolve): Add complex core type reduction.
10857 (New.Constantify): Converts complex core type syntax like 'new int ()'
10858 to simple constant.
10860 2005-02-14 Raja R Harinath <rharinath@novell.com>
10862 * decl.cs (EntryType.EntryType): New constructor to create an
10863 updated copy of a cache entry.
10864 (MemberCache.AddMethods): Use it.
10865 (MemberCache.ClearDeclaredOnly): Remove.
10866 (MemberCache.MemberCache): Update.
10868 2005-02-11 Miguel de Icaza <miguel@novell.com>
10870 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
10871 variable. This one is represents the actual low-level declaration
10872 of the method, as opposed to the semantic level `IsStatic'.
10874 An anonymous method which is hosted into a static method might be
10875 actually an instance method. IsStatic would reflect the
10876 container, while MethodIsStatic represents the actual code
10879 * expression.cs (ParameterReference): Use the new MethodIsStatic
10880 instead of IsStatic.
10882 * anonymous.cs (AnonymousMethod.Compatible): Pass the
10883 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
10884 set on the current EmitContext.
10886 * expression.cs (Cast): Overload DoResolveLValue so we can pass
10887 resolve our casted expression as an LValue. This triggers the
10888 proper LValue processing that is later required by Assign.
10892 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
10894 2005-02-11 Marek Safar <marek.safar@seznam.cz>
10896 C# 2.0 Fixed buffer implementation
10898 * anonymous.cs: Update after RegisterHelperClass renaming.
10900 * attribute.cs (AttributeTester.fixed_buffer_cache):
10901 Cache of external fixed buffers.
10902 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
10903 implementation if field is fixed buffer else null.
10906 (TypeContainer.AddField): Accept FieldMember instead of Field.
10907 (FieldBase.IsFieldClsCompliant): Extracted code from
10908 VerifyClsCompliance descendant customization.
10909 (FixedField): New class handles fixed buffer fields.
10910 (FixedFieldExternal): Keeps information about imported fixed
10912 (IFixedField): Make access to internal or external fixed buffer
10915 * cs-parser.jay: Add fixed buffer parsing.
10917 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
10920 * expression.cs (Indirection): Extended implementation to accept
10921 fixed buffer field.
10922 (PointerArithmetic.Emit): Get element from fixed buffer as well.
10923 (ElementAccess.MakePointerAccess): Get type as parameter.
10924 (DoResolve): Add fixed buffer field expression conversion.
10925 (DoResolveLValue): Ditto.
10926 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
10927 (ArrayPtr): Derives from FixedBufferPtr.
10928 (ArrayPtr.Emit): Add extra emit for array elements.
10930 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
10932 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
10933 for compiler generated types.
10934 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
10936 * statement.cs (Fixed): Refactored to be easier add fixed buffer
10937 and consume less memory.
10938 (Fixed.Resolve): Add fixed buffer case.
10940 * typemanager.cs (compiler_generated_attr_ctor,
10941 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
10942 (HasElementType): Add our own implementation to work on every
10945 2005-02-11 Miguel de Icaza <miguel@novell.com>
10947 * anonymous.cs (CaptureContext): Track whether `this' has been
10950 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
10951 only captured `this' if it was implicitly done (instance
10952 methods/variables were used).
10954 * codegen.cs (EmitContext.CaptureThis): New method to flag that
10955 `this' must be captured.
10957 2005-01-30 Miguel de Icaza <miguel@novell.com>
10959 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
10960 is null it means that there has been no need to capture anything,
10961 so we just create a sibling.
10963 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
10965 Just a partial fix. The other half is fairly elusive.
10967 2005-02-10 Raja R Harinath <rharinath@novell.com>
10969 Fix #52586, cs0121-4.cs.
10970 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
10971 and return a hashtable.
10972 (MemberCache.ClearDeclaredOnly): New.
10973 (MemberCache.MemberCache): Update to change. Make a deep copy of
10974 the method_hash of a base type too.
10975 (MemberCache.AddMethods): Adapt to having a deep copy of the base
10976 type methods. Overwrite entries with the same MethodHandle so
10977 that the ReflectedType is correct. The process leaves in base
10978 virtual functions and their overrides as distinct entries.
10979 (CacheEntry): Now a class instead of a struct. It shouldn't alter
10980 matters since it was boxed in a ArrayList before.
10981 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
10983 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
10984 case of a virtual function and its override (choose the overload
10986 (Invocation.OverloadResolve): Avoid 'override' members during
10987 'applicable_type' calculation.
10989 2005-02-09 Raja R Harinath <rharinath@novell.com>
10991 Combine two near-redundant caches.
10992 * typemanager.cs (method_params): Rename from method_internal_params.
10993 (TypeManager.GetParameterData): New. Replace
10994 Invocation.GetParameterData.
10995 (TypeManager.LookupParametersByBuilder): Remove.
10996 * expression.cs (Invocation.method_parameter_cache): Remove.
10997 (Invocation.GetParameterData): Remove.
10999 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
11002 2005-02-08 Raja R Harinath <rharinath@novell.com>
11005 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
11006 TypeManager.multicast_delegate_type is null, resolve it by looking
11007 up "System.MulticastDelegate".
11008 * rootcontext.cs (RootContext.ResolveCore): Simplify.
11010 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
11011 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
11012 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
11015 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
11016 (LabeledStatement.AddReference): New. Set 'referenced'.
11017 (Goto.Resolve): Use it.
11019 2005-02-05 John Luke <john.luke@gmail.com>
11021 * driver.cs: remove duplicate -doc line in Usage ()
11023 2005-02-04 Raja R Harinath <rharinath@novell.com>
11025 * location.cs (Location.AddFile): Fix CS2002 error report.
11027 2005-02-02 Martin Baulig <martin@ximian.com>
11029 * delegate.cs (Delegate.DefineType): Report an internal error if
11030 TypeManager.multicast_delegate_type is null. See bug #72015 for
11033 2005-02-02 Raja R Harinath <rharinath@novell.com>
11035 Fix a crasher in a variant of #31984.
11036 * const.cs (Constant.CheckBase): New override that defers the
11037 new-or-override check in case the base type hasn't been populated
11039 (Constant.Define): Ensure the new-or-override check is performed.
11041 2005-02-01 Duncan Mak <duncan@ximian.com>
11043 * const.cs (LookupConstantValue): Check that `ce' is not null
11044 before calling GetValue ().
11046 2005-02-01 Raja R Harinath <rharinath@novell.com>
11048 Fix test-334.cs (#69519).
11049 * cs-parser.jay (using_alias_directive): Pass in an expression to
11050 NamespaceEntry.UsingAlias.
11051 (using_namespace_directive): Pass in an expression to
11052 NamespaceEntry.Using.
11053 (namespace_name): Don't flatten to a string.
11054 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
11055 (NamespaceEntry.AliasEntry.Resolve): Lookup using
11057 (NamespaceEntry.UsingEntry): Likewise.
11058 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
11060 (NamespaceEntry.LookupForUsing): Remove.
11061 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
11063 (NamespaceEntry.Lookup): Remove support for dotted names.
11065 2005-02-01 Raja R Harinath <rharinath@novell.com>
11067 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
11069 (NamespaceEntry.ImplicitParent): Compute on demand.
11070 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
11071 parallels the current.
11072 (NamespaceEntry.LookupForUsing): Use it.
11073 (NamespaceEntry.Lookup): If the current namespace-entry is
11074 implicit, don't search aliases and using tables.
11076 2005-02-01 Raja R Harinath <rharinath@novell.com>
11079 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
11081 (TypeContainer.BaseCache): Compute on demand.
11082 (TypeContainer.FindMembers): Define constants and types if they're
11083 not already created.
11084 (FieldMember.Define): Move resetting of ec.InUnsafe before error
11086 * const.cs (Constant.Define): Make idempotent.
11088 2005-01-29 Miguel de Icaza <miguel@novell.com>
11090 * pending.cs: Produce better code (no nops produced by using Ldarg
11093 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
11094 i - 1' it should be arg + 1.
11098 2005-01-28 Raja R Harinath <rharinath@novell.com>
11100 * attribute.cs (Attribute.CheckAttributeType): Make private
11102 (Attribute.ResolveType): Make virtual.
11103 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
11104 handling of RootContext.Tree.Types.
11106 2005-01-27 Raja R Harinath <rharinath@novell.com>
11108 Update attribute-handling to use the SimpleName/MemberAccess
11110 * cs-parser.jay (attribute): Pass in an expression to the
11111 constructors of Attribute and GlobalAttribute.
11112 * attribute.cs (Attribute): Take an expression for the name.
11113 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
11114 passed in attribute name expression.
11115 (Attribute.CheckAttributeType): Use it.
11116 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
11117 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
11118 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
11119 argument to prevent error messages if the lookup fails.
11121 2005-01-27 Marek Safar <marek.safar@seznam.cz>
11123 * expression.cs (Indirection): Implemented IVariable interface
11124 to support indirection in AddressOf operator.
11125 (PointerArithmetic.Emit): Add optimalization for case where
11126 result can be precomputed.
11128 2005-01-26 Martin Baulig <martin@ximian.com>
11130 * class.cs (TypeContainer.AttributeTargets): Return the correct
11131 AttributeTargets depending on our `Kind' instead of throwing an
11132 exception; fixes #71632.
11134 2005-01-26 Marek Safar <marek.safar@seznam.cz>
11137 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
11140 2005-01-25 Raja R Harinath <rharinath@novell.com>
11143 * expression.cs (MemberAccess.DoResolve): Don't complain with
11144 cs0572 when the LHS of a member access has identical name and type
11147 2005-01-25 Marek Safar <marek.safar@seznam.cz>
11150 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
11152 Create custom PermissionSet only for PermissionSetAttribute.
11154 2005-01-24 Marek Safar <marek.safar@seznam.cz>
11157 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
11158 delegates in static class.
11160 2005-01-24 Martin Baulig <martin@ximian.com>
11162 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
11163 merging an implicit block, just use its reachability.
11165 * statement.cs (Block.Resolve): Make the unreachable code check
11166 work wrt. implicit blocks; see test-337 from #63842.
11168 2005-01-21 Alp Toker <alp@atoker.com>
11170 * cs-parser.jay: destructor_declaration's container is PartialContainer
11171 not Class when partial types are used, so use Kind prop instead of
11174 2005-01-22 Miguel de Icaza <miguel@ximian.com>
11176 * cs-parser.jay: Improve error reporting when an interface
11177 declares new types.
11179 2005-01-20 Dick Porter <dick@ximian.com>
11181 * support.cs: SeekableStreamReader fix from Sandor Dobos
11182 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
11183 chars are read. Fixes bug 70369.
11185 2005-01-20 Raja R Harinath <rharinath@novell.com>
11187 * cs-parser.jay (catch_clause): Simplify current_block handling
11190 2005-01-17 Miguel de Icaza <miguel@ximian.com>
11192 * convert.cs (ImplicitStandardConversionExists): Synchronize the
11193 code with ImplicitStandardConversion to handle the implicit
11194 conversion of method groups into valid delegate invocations.
11196 The problem is that in parameter handling we were using this code
11197 path. Fixes bug #64698
11199 2005-01-19 Raja R Harinath <rharinath@novell.com>
11201 * cs-parser.jay: Fix several infelicities.
11202 - Avoid assigning to the parser value stack. Code like
11203 '$3 = null' is unclean. Synthesize a value for the code block
11205 - Avoid using oob_stack for storing location information. Use ...
11206 (_mark_): ... this. New (empty) rule. Saves the current location
11208 (foreach_statement): Avoid using oob_stack for current_block
11209 handling. Use technique used in for_statement and
11210 using_statement. Synthesize a value for the code block to store
11211 additional intermediate information.
11213 2005-01-13 Miguel de Icaza <miguel@ximian.com>
11215 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
11216 of a different type is only allowed to private fields of a
11217 containing type, not on fields of a base class.
11219 See test-174.cs and error cs0122-9.cs
11221 2005-01-13 Raja R Harinath <rharinath@novell.com>
11223 Fix test-335.cs (bug #58126).
11224 * cs-parser.jay (argument): Split out non-expression parts of the
11225 rule into 'non_simple_argument'.
11226 (invocation_expression): Support parenthesized invocations with
11227 multiple arguments, and with single non-simple arguments.
11229 2005-01-13 Raja R Harinath <rharinath@novell.com>
11231 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
11234 2005-01-12 Raja R Harinath <rharinath@novell.com>
11236 Fix cs0038-1.cs, cs1640-6.cs.
11237 * ecore.cs (Expression.Resolve): Remove special-case for
11238 SimpleName in error-handling.
11239 (Expression.almostMatchedMembers): Relax access permission to
11241 (Expression.MemberLookupFailed): Handle duplicates in
11242 almostMatchedMembers list.
11243 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
11244 * expression.cs (New.DoResolve): Report CS1540 for more cases.
11245 * typemanager.cs (GetFullNameSignature): Use the MethodBase
11246 overload if the passed in MemberInfo is a MethodBase.
11248 2005-01-12 Marek Safar <marek.safar@seznam.cz>
11251 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
11252 for non-CAS & merge permission sets properly.
11254 2005-01-11 Raja R Harinath <rharinath@novell.com>
11256 Improve standard-compliance of simple name and member access
11257 resolution. Fixes bugs #52697, #57200, #67520, #69519.
11258 * ecore.cs (FullNamedExpression): New abstract base class
11259 for Namespaces and TypeExpressions.
11260 (ResolveFlags.SimpleName): Remove.
11261 (SimpleName): Remove support for dotted names.
11262 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
11263 DeclSpace.FindType and DeclSpace.LookupType.
11264 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
11265 (Expression.ExprClassName): Make member function.
11266 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
11267 a namespace. Remove creation of dotted "SimpleName"s.
11268 (MemberAccess.DoResolve): Likewise.
11269 * decl.cs (DeclSpace.Cache): Make private.
11270 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
11271 (DeclSpace.FindType): Update.
11272 (DeclSpace.LookupType): Move here from RootContext. Return a
11273 FullNamedExpression.
11274 * namespace.cs (Namespace): Derive from FullNamedExpression
11275 so that it can be part of expression resolution.
11276 (Namespace.Lookup): Return an FullNamedExpression.
11277 (NamespaceEntry.LookupAlias): Lookup aliases only in current
11279 * rootcontext.cs (NamespaceLookup): Remove.
11280 (LookupType): Move to DeclSpace.
11281 * attribute.cs (CheckAttributeType): Update.
11282 * doc.cs (FindDocumentedType): Remove allowAlias argument.
11283 (FindDocumentedTypeNonArray): Likewise.
11285 2005-01-11 Raja R Harinath <rharinath@novell.com>
11287 Fix cs0509.cs, cs1632.cs.
11288 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
11289 is the same as IsInterface.
11290 (TypeContainer.GetClassBases): Likewise.
11291 * statement.cs (LabeledStatement.ig): New field.
11292 (LabeledStatement.LabelTarget): Save ILGenerator which created the
11294 (LabeledStatement.DoEmit): Check that the label was created with
11295 the same ILGenerator.
11297 2005-01-10 Marek Safar <marek.safar@seznam.cz>
11300 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
11301 accessors to its properties.
11303 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
11304 from accessors to property.
11306 2005-01-10 Marek Safar <marek.safar@seznam.cz>
11309 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
11310 only for overrides.
11312 2005-01-08 Miguel de Icaza <miguel@ximian.com>
11314 * attribute.cs: Check for null and empty strings.
11316 I have lost another battle to Paolo.
11318 2005-01-07 Marek Safar <marek.safar@seznam.cz>
11321 * class.cs (PropertyMethod): Set Parent field in ctors.
11322 (SetMethod.InternalParameters): Add unsafe switch hack.
11323 Override MarkForDuplicationCheck where it is appropriate.
11325 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
11326 It says whether container allows members with the same name.
11327 Base default is no.
11328 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
11329 Removed is_method parameter.
11331 2005-01-06 Duncan Mak <duncan@ximian.com>
11333 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
11334 because the previous change led to incorrect reporting of CS1032
11335 ("Cannot define/undefine preprocessor symbols after first token in
11336 file"). Instead of using `tokens_seen' as the only flag that
11337 triggers CS1040, introduce `comments_seen'. This new flag is used
11338 to signify having seen comments on the current line, so it is
11339 unset after a newline.
11341 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
11343 * doc.cs : When searching for a type, find nested type too.
11344 This fixes bug #71040.
11346 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
11349 - Warn missing member comment on those classes which also does not
11350 have doc comments. Fixed bug #71041.
11351 - Don't warn missing doc comment on default constructor.
11354 2005-01-06 Duncan Mak <duncan@ximian.com>
11356 * cs-tokenizer.cs (xtoken): After handling traditional C-style
11357 comments, set `tokens_seen' to true. This allows us to detect
11358 misplaced preprocessor directives (i.e. not at the beginning of
11359 the a line, nor after whitespaces). In that case, report error
11360 CS1040. This fixes bug #56460.
11362 * cs-parser.jay (interface_member_declaration): Add checks for
11363 IsExplicitImpl, and report CS0541 error if an interface member is
11364 defined as an explicit interface declaration.
11366 2005-01-06 Marek Safar <marek.safar@seznam.cz>
11369 * class.cs (PropertyMethod): Set Parent field in ctors.
11370 (SetMethod.InternalParameters): Add unsafe switch hack.
11372 * decl.cs (MemberCore.Parent): Cannot be readonly.
11374 2005-01-06 Raja R Harinath <rharinath@novell.com>
11376 * decl.cs (DeclSpace.ResolveType): Remove.
11377 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
11378 Merge in code from ...
11379 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
11380 * class.cs, enum.cs: Update to changes.
11382 2005-01-06 Miguel de Icaza <miguel@ximian.com>
11384 * anonymous.cs: Ensure that we init the scope of our parent if it
11385 has not been initialized yet.
11387 2004-12-30 Duncan Mak <duncan@ximian.com>
11389 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
11390 if field.FieldBuilder is null. Fixes #70758.
11392 * convert.cs: Fixed some typos and updated some of the comments.
11393 (ImplicitStandardConversionExists):
11394 (TryImplicitIntConversion): If `target_type' is an interface and
11395 the type of `ic' implements this interface, return true or a new
11396 BoxedCast instead of null. This fixes #70468.
11398 2004-12-29 Duncan Mak <duncan@ximian.com>
11400 * expression.cs (Argument.Emit): Check that Expr is
11401 IMemoryLocation before casting to it, and report CS1510 otherwise.
11405 2004-12-21 Ben Maurer <bmaurer@ximian.com>
11407 * statement.cs (Block.ThisVariable): remove the recursion here, to
11408 make the --profile more sane.
11410 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
11412 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
11413 assembly, by JB Evain.
11415 2004-12-17 Raja R Harinath <rharinath@novell.com>
11417 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
11418 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
11419 "parent" refers to enclosing type/class. "base" refers to superclass.
11421 2004-12-17 Raja R Harinath <rharinath@novell.com>
11423 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
11424 Ensure that we only have GlobalAttributes.
11425 * attribute.cs (Attribute.Emit): Make non-virtual.
11426 (GlobalAttribute.Emit): Remove.
11427 (Attribute.Resolve): Make virtual.
11428 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
11429 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
11430 the argument. Don't create one.
11431 (Attribute.GetObsoleteAttribute): Likewise.
11432 (Attribute.GetClsCompliantAttributeValue): Likewise.
11433 * class.cs, decl.cs: Update to changes.
11435 2004-12-17 Marek Safar <marek.safar@seznam.cz>
11437 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
11439 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
11441 * statement.cs (Foreach.Resolve): Add error 186 report.
11443 2004-12-16 Marek Safar <marek.safar@seznam.cz>
11445 * expression.cs (Conditional.DoResolve): Add warning 429.
11447 * statement.cs (If.Resolve): Add warning 665.
11449 2004-12-16 Raja R Harinath <rharinath@novell.com>
11451 New invariant: RootContext.Tree.Types.NamespaceEntry == null
11452 except when in the parser, and in GlobalAttribute.
11453 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
11454 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
11455 RootContext.Tree.Types.NamespaceEntry once work is done.
11456 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
11457 and resets RootContext.Tree.Types.NamespaceEntry.
11459 2004-12-15 Marek Safar <marek.safar@seznam.cz>
11461 * cs-parser.jay: Don't create a block for every variable.
11463 2004-12-14 Miguel de Icaza <miguel@ximian.com>
11465 * location.cs: Provide extra information.
11467 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
11468 variables from the captured environment, it is the ldarg_0.
11470 2004-12-14 Marek Safar <marek.safar@seznam.cz>
11472 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
11475 * class.cs: Changed warning level for 169 to avoid developer
11476 displeasure from warning flooding. It will be changed back when they
11477 fix most of current BCL warnings.
11479 * RootContext.cs: Pushed default WarningLevel to 3.
11481 * statement.cs: Removed unused variable.
11483 2004-12-14 Marek Safar <marek.safar@seznam.cz>
11485 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
11486 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
11487 Add error 502 report.
11488 (StaticClass.DefineType): Add error 441 report.
11489 (Class.AllowedModifiersProp): New virtual property as temporary
11490 extension to AllowedModifiers.
11491 (Class.DefineType): Add error 418 report. Moved ModFlags check here
11492 to share implementation with StaticClass and don't call virtual
11495 * driver.cs (MainDriver): Add error 1558 test.
11497 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
11498 report. Moved error 36 test here.
11500 * statement.cs (Throw.Resolve): Add error 724 report.
11502 * typemanager.cs: Add out_attribute_type core type.
11504 2004-12-13 Marek Safar <marek.safar@seznam.cz>
11506 * class.cs (TypeContainer.VerifyClsCompliance): Add error
11508 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
11510 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
11513 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
11515 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
11516 Add error 3023 report.
11517 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
11519 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
11522 2004-12-12 John Luke <john.luke@gmail.com>
11524 * driver.cs (AddArgs): take -- into account when
11525 adding arguments, fixes bug 65710
11527 2004-12-12 Martin Baulig <martin@ximian.com>
11529 * expression.cs (Unary.TryReduceNegative): Added support for
11530 SByteConstant and ByteConstant.
11531 (Unary.Reduce): Check error values from TryReduceNegative().
11533 2004-12-10 Marek Safar <marek.safar@seznam.cz>
11535 * attributes.cs (Attribute.Resolve): Avoid multiple error report
11536 and report exception as error 182.
11538 2004-12-10 Raja R Harinath <rharinath@novell.com>
11540 * driver.cs (Main): Fix message when there are warnings.
11542 2004-12-09 Miguel de Icaza <miguel@ximian.com>
11544 * delegate.cs: Fixed my fix from yesterday, sorry about that.
11546 2004-12-09 Marek Safar <marek.safar@seznam.cz>
11548 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
11549 Reduced number of warnings.
11551 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
11553 2004-12-08 Miguel de Icaza <miguel@ximian.com>
11555 * driver.cs: Removed message.
11557 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
11559 2004-12-08 <vargaz@freemail.hu>
11561 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
11563 2004-12-08 Martin Baulig <martin@ximian.com>
11565 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
11566 instead of a CS3002 for properties and indexer.
11568 2004-12-08 Martin Baulig <martin@ximian.com>
11570 * decl.cs (MemberName.ToString): Make this work again.
11572 2004-12-08 Marek Safar <marek.safar@seznam.cz>
11574 * attribute.cs (Resolve): Add error 591 detection.
11576 * class.cs (FieldMember.Define): Add error 1547 detection.
11577 (Indexer.Define): Add error 620 detection.
11578 (Operator.Define): Add error 590 detection.
11580 * ecore.cs: Missing argument for error 79.
11582 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
11585 2004-12-07 Marek Safar <marek.safar@seznam.cz>
11588 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
11591 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
11593 * cs-parser.jay : handle doc comments on implicit/explicit operators.
11594 Some operator comments were suppressed.
11595 * doc.cs : Implicit/explicit operator name in doc comments are like
11596 "op_Explicit(type)~returnType", so added suffix handling.
11598 2004-12-07 Martin Baulig <martin@ximian.com>
11601 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
11602 (MemberCore.GetClsCompliantAttributeValue): Likewise.
11603 (DeclSpace.ec): New protected field; store the EmitContext here.
11604 (DeclSpace.EmitContext): New public property; moved here from
11606 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
11609 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
11610 (Enum.Emit): Don't create a new EmitContext.
11612 * delegate.cs (Delegate.DefineType): Always create the
11615 * iterators.cs (Iterators.DefineIterator): Create a new
11616 EmitContext and store it in `ec'.
11618 2004-08-24 Martin Baulig <martin@ximian.com>
11621 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
11622 this for accessibility checks.
11623 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
11624 IsNestedFamilyAccessible.
11625 (TypeManager.IsSubclassOf): New method, do what the name actually
11628 2004-12-06 Raja R Harinath <rharinath@novell.com>
11630 Fix crash on cs0657-17.cs.
11631 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
11632 Use RootContext.Tree.Types, not 'new RootTypes ()'.
11633 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
11634 the case where the NamespaceEntry gets overwritten.
11636 2004-12-06 Marek Safar <marek.safar@seznam.cz>
11638 Fixed #69195, #56821
11639 * ecore.cs (ResolveBoolean): Tiny refactoring.
11641 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
11642 of right expression resolving when left is false constant and
11643 operator is LogicalAnd OR true constant and operator is LogicalOr.
11645 * statement.cs (ResolveUnreachable): Always reports warning.
11647 2004-12-05 Miguel de Icaza <miguel@ximian.com>
11649 * class.cs: Distinguish between 1721 and 1722 (just a little help
11650 for the programmer).
11652 2004-12-03 Miguel de Icaza <miguel@ximian.com>
11654 * delegate.cs: Only allow this on new versions of the language.
11656 2004-12-02 Duncan Mak <duncan@ximian.com>
11658 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
11660 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
11661 here as a static method. Take an additional bool out parameter
11662 `must_do_cs1540_check' for signaling to InstanceResolve.
11663 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
11664 member field from PropertyExpr class and made it an argument of
11665 the method instead.
11666 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
11667 check for MarshalByRefObject, and report CS0122 instead of CS1540.
11668 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
11669 and `remove_accessor' as well as InstanceResolve: report CS0122
11674 2004-12-03 Raja R Harinath <rharinath@novell.com>
11676 Fix test-327.cs, test-328.cs, and put in early infrastructure
11677 for eventually fixing #52697.
11678 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
11679 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
11680 from other methods.
11681 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
11682 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
11683 (VerifyUsing, error246): Update.
11684 * rootcontext.cs (RootContext.NamespaceLookup): Just use
11685 'NamespaceEntry.LookupNamespaceOrType'.
11687 2004-12-03 Martin Baulig <martin@ximian.com>
11689 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
11690 method as our child, call AnonymousMethod.Compatible() on it.
11692 2004-12-03 Raja R Harinath <rharinath@novell.com>
11694 Disable XML documentation support in 'basic' profile.
11695 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
11696 Redirect XmlElement to System.Object.
11697 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
11698 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
11699 * mcs.exe.sources: Add doc-bootstrap.cs.
11700 * doc-bootstrap.cs: New file. Contains empty stub implementation
11703 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
11705 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
11706 comments are allowed.
11708 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
11710 * delegate.cs: Add checks for subtypes in paramaters and return values
11711 in VerifyMethod () to add support for Covariance/Contravariance
11714 2004-12-02 Miguel de Icaza <miguel@ximian.com>
11716 * report.cs: Remove extra closing parenthesis.
11718 * convert.cs (Error_CannotImplicitConversion): If the name of the
11719 types are the same, provide some extra information.
11721 * class.cs (FieldBase): Use an unused bit field from the field to
11722 encode the `has_offset' property from the FieldMember. This saves
11723 a couple of Ks on bootstrap compilation.
11725 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
11726 method as our child, return the AnonymousMethod resolved
11729 * expression.cs (New.DoResolve): Allow return values from
11730 NewDelegate to also include AnonymousMethods.
11734 2004-12-02 Marek Safar <marek.safar@seznam.cz>
11737 * attribute.cs (Resolve): Improved implementation of params
11738 attribute arguments.
11740 * support.cs (ParameterData): Add HasParams to be faster.
11742 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
11744 all things are for /doc support:
11746 * doc.cs: new file that supports XML documentation generation.
11747 * mcs.exe.sources: added doc.cs.
11749 Handle /doc command line option.
11750 Report error 2006 instead of 5 for missing file name for /doc.
11751 Generate XML documentation when required, after type resolution.
11753 Added support for picking up documentation (/// and /** ... */),
11754 including a new XmlCommentState enumeration.
11756 Added lines to fill Documentation element for field, constant,
11757 property, indexer, method, constructor, destructor, operator, event
11758 and class, struct, interface, delegate, enum.
11759 Added lines to warn incorrect comment.
11761 Added Documentation field (passed only when /doc was specified).
11763 Added DocComment, DocCommentHeader, GenerateDocComment() and
11764 OnGenerateDocComment() and some supporting private members for
11765 /doc feature to MemberCore.
11767 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
11769 Added overriden DocCommentHeader.
11771 Added overriden DocCommentHeader and GenerateDocComment().
11773 2004-12-01 Miguel de Icaza <miguel@ximian.com>
11775 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
11776 unwrapping the enumeration values, chain to
11777 DoConstantNumericPromotions again, so we can promote things to the
11778 fundamental types (takes care of enums that are bytes, sbytes).
11782 2004-12-01 Raja R Harinath <rharinath@novell.com>
11784 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
11785 Fix long-standing bug in type-lookup. Use FindType instead of
11786 LookupType when ec.ResolvingTypeTree.
11787 (Attribute.ResolveType, Attribute.Resolve)
11788 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
11790 (Attributes.Search): Remove internal version. Update.
11791 (Attributes.SearchMulti): Update.
11792 (Attributes.GetClsCompliantAttribute): Remove.
11793 (Attributes.GetIndexerNameAttribute): Remove.
11794 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
11795 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
11796 * class.cs (Indexer.Define): Likewise.
11798 2004-12-01 Marek Safar <marek.safar@seznam.cz>
11801 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
11802 MarshallByReference members access.
11804 * expression.cs: Use CheckMarshallByRefAccess;
11805 Better error CS0197 message.
11807 * report.cs: Print whole related error message.
11809 2004-11-30 Raja R Harinath <rharinath@novell.com>
11811 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
11812 the current directory to help debugging.
11814 2004-11-29 Marek Safar <marek.safar@seznam.cz>
11816 * class (GetClassBases): Better error 60 report.
11817 (EventProperty): Disabled warning 67 detection.
11819 2004-11-29 Marek Safar <marek.safar@seznam.cz>
11822 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
11824 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
11827 2004-11-29 Marek Safar <marek.safar@seznam.cz>
11830 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
11832 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
11834 2004-11-26 Miguel de Icaza <miguel@ximian.com>
11836 * attribute.cs (Attribute.Resolve): Refine error reporting and
11837 report a cs0117 if the identifier does not exist, to distinguish
11838 from 0617 which is a miss-use of the actual identifier.
11840 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
11841 between cs0070 and cs0079.
11843 * class.cs (MemberBase.DoDefine): When reporting a wrong
11844 accessibility level, we use MethodCore to compare instead of
11845 Method (this was a regression in some refactoring effort).
11847 So now we correctly report cs0056 again.
11849 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
11850 testing the target_type (which was known to be object_type) and
11851 not the source type (which is anonymous_method).
11853 Fixed reporting of error cs1660.
11855 * expression.cs (UserCast.Source): Expose the underlying cast.
11857 * statement.cs (Switch.SwitchGoverningType): Sort the list of
11858 allowed types to find a match to int32 first (most common).
11860 In addition, it ignores any ImplicitUserConversions that did an
11861 internal implicit conversion (as the switch statement allows only
11862 one integral conversion to exist).
11864 * class.cs (PartialContainer.Create): rename `name' to
11865 `member_name' for clarity. Then replace the string calls with a
11866 call to MemberName.GetPartialName, as now using
11867 MemberName.ToString is an error (this is due to the side effects
11868 it had, that were fixed in the past).
11870 This will restore the error reporting on a number of partial class
11871 errors that were missusing this (and getting an exception as a
11872 results, which is now just a plain textual warning, because
11873 yyparse debug output would crash otherwise).
11875 2004-11-26 Raja R Harinath <rharinath@novell.com>
11877 * Makefile (PROGRAM_INSTALL_DIR): Remove.
11879 2004-11-25 Ben Maurer <bmaurer@ximian.com>
11881 * rootcontext.cs (LookupType): Make sure to cache lookups that
11882 don't give us a negative result. This saves about 5% of corlib
11885 2004-11-25 Miguel de Icaza <miguel@ximian.com>
11887 * report.cs (AbstractMessage.Print): messages are sent to stderr
11889 * class.cs (TypeContainer.GetClassBases): It is an error to have a
11890 non-interface in the list of interfaces (at this point, either
11891 parent was properly set, or a base class is being listed in the
11892 interfaces section).
11894 This flags error 1722, and resolves the crash from bug 69259.
11896 2004-11-25 Ben Maurer <bmaurer@ximian.com>
11898 * statement.cs (Using.EmitExpressionFinally): make this work right
11899 for valuetypes. Fixes 69926.
11901 2004-11-25 Miguel de Icaza <miguel@ximian.com>
11903 * const.cs (Const.ChangeType): Cope with the "0 literal can be
11904 converted to an enum" here, before we try to change the underlying
11905 type. This code exists, but it is a different code path than the
11906 one used while encoding constants.
11908 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
11909 old bug: when converting from the null literal to a pointer,
11910 return an EmptyCast, not the NullLiteral.
11912 This fixes #69921, the recent null_type changes probably made this
11913 bug more prominent.
11915 (ImplicitReferenceConversionExists): In addition, resynchronized
11916 the code here, so it matches the same code in
11917 ImplicitReferenceConversionExists for the `from any class-type S
11918 to any interface-type T'.
11921 2004-11-25 Marek Safar <marek.safar@seznam.cz>
11923 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
11925 2004-11-24 Miguel de Icaza <miguel@ximian.com>
11927 * cs-parser.jay: Use verbosity accordingly.
11929 2004-11-24 Marek Safar <marek.safar@seznam.cz>
11931 * expression.cs (Unary.ResolveOperator): Do not report warning;
11932 AddressOf reads from variable.
11934 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
11936 2004-11-24 Marek Safar <marek.safar@seznam.cz>
11940 * attribute.cs (Attributable): Removed CheckTargets.
11941 (Attributes.Emit): Explicit attribute targets are tested here.
11943 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
11944 not enabled for interfaces.
11946 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
11947 (GetAssemblyName): Ouch next bug there.
11949 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
11951 * expression.cs: Error 275 added.
11953 2004-11-23 Marek Safar <marek.safar@seznam.cz>
11955 Fix bug #69177 (Implemented decimal constant support)
11957 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
11958 (BinaryFold): Add DecimalConstant.
11960 * const.cs (Define): Decimal constant
11962 (ChangeType): Add decimal type handling.
11963 (LookupConstantValue): Don't set value for decimal type but
11964 emit DecimalConstantAttribute. Needed for constant optimization.
11966 * constant.cs (ToDecimal): New method.
11967 (ConvertToDecimal): New method.
11968 (IntConstant): Implemented ConvertToDecimal.
11969 (DecimalConstant.Emit): Emit optimized version for decimals in
11972 * expression.cs (ResolveOperator): Changed order of constant
11973 reduction to work correctly with native types which have
11974 overloaded operators.
11975 (ResolveMemberAccess): Extract constant value from attribute
11978 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
11980 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
11981 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
11982 (ChangeType): Decimal is special.
11983 (TypeToCoreType): Add decimal type.
11985 2004-11-22 Marek Safar <marek.safar@seznam.cz>
11987 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
11990 2004-11-22 Marek Safar <marek.safar@seznam.cz>
11992 * class.cs (EventField.ApplyAttributeBuilder): Fix error
11995 2004-11-19 Marek Safar <marek.safar@seznam.cz>
11997 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
11999 * pending.cs (PendingImplementation): Grab only interfaces.
12001 2004-11-19 Marek Safar <marek.safar@seznam.cz>
12003 * statement.cs (ForeachHelperMethods): Add location member and
12004 error 202 detection.
12006 2004-11-19 Raja R Harinath <rharinath@novell.com>
12008 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
12009 automatically handled by executable.make.
12010 (PROGRAM): Make profile-specific.
12012 2004-11-18 Marek Safar <marek.safar@seznam.cz>
12014 * expression.cs (DoResolveBase): Fixed wrong warning for out
12017 2004-11-18 Martin Baulig <martin@ximian.com>
12019 Merged latest changes into gmcs. Please keep this comment in
12020 here, it makes it easier for me to see what changed in MCS since
12021 the last time I merged.
12023 2004-11-17 Raja R Harinath <rharinath@novell.com>
12025 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
12026 (TypeHandle.GetMemberCache): New.
12027 (TypeHandle.TypeHandle): Update.
12028 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
12029 (TypeManager.LookupParentInterfacesCache):
12030 Rename from LookupInterfaceCache. Optimize slightly.
12031 (TypeManager.MemberLookup_FindMembers): Update.
12032 * decl.cs (MemberCache.MemberCache): Set Container to null in the
12033 multi-type variant.
12034 (AddCacheContents): Rename from AddHashtable.
12035 * class.cs (TypeContainer.parent_container): Remove.
12036 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
12037 (TypeContainer.DoDefineMembers): Don't initialize it.
12038 Update to name changes.
12040 2004-11-17 Miguel de Icaza <miguel@ximian.com>
12042 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
12043 that factors the code to check access modifiers on override.
12045 (PropertyBase): Use the code here.
12047 Patch from Lluis S'anchez, fixes bug #69361.
12049 2004-11-15 Miguel de Icaza <miguel@ximian.com>
12051 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
12052 routine that is used to report the use of a captured variable
12053 whose address has been taken.
12055 There are two checks: one when variables are being captured and
12056 the other check is when the address of a variable is taken.
12058 (because an anonymous methods might be resolved before *or* after
12059 the address has been taken) and
12061 * expression.cs (Conditional.DoResolve): Remove the special
12062 casing that Martin added to trueExpr and falseExpr being both
12063 NullLiteral. We get the right behavior now just by introducing
12064 the null_type into the compiler.
12066 * convert.cs (ExplicitConversion): Change the code to use
12067 null_type instead of testing `expr is NullLiteral'.
12068 (ImplicitConversionStandard): use null_type too.
12069 (ImplicitReferenceConversionExists): use null_type too.
12070 (ImplicitReferenceConversion): use null_type too.
12072 * literal.cs: The type of `NullLiteral' is now null_type instead
12074 (Resolve): Set the type here.
12076 * typemanager.cs: Introduce null_type.
12078 2004-11-17 Martin Baulig <martin@ximian.com>
12080 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
12081 direction, like FindMembers() does. Fixes #69546, testcase is in
12084 2004-11-16 Martin Baulig <martin@ximian.com>
12086 This is based on a patch from Marek Safar, see bug #69082.
12087 Fixes bugs #63705 and #67130.
12089 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
12090 method; create a MemberCache for an interface type and cache the
12093 * decl.cs (IMemberContainer.ParentContainer): Removed.
12094 (IMemberContainer.ParentCache): New property.
12095 (MemberCache.SetupCacheForInterface): Removed.
12096 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
12097 to create a cache for an interface's "parent".
12099 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
12102 2004-11-16 Martin Baulig <martin@ximian.com>
12104 Merged back from gmcs; these changes already went into gmcs a
12105 couple of weeks ago.
12108 (TypeManager.AddUserType): Removed the `ifaces' argument.
12109 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
12111 (TypeManager.AddUserInterface): Removed.
12112 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
12114 (TypeManager.GetInterfaces): Likewise.
12115 (TypeManager.GetExplicitInterfaces): Likewise.
12117 * ecore.cs (TypeExpr.GetInterfaces): Removed.
12119 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
12120 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
12122 2004-11-14 Ben Maurer <bmaurer@ximian.com>
12124 * statement.cs: Avoid adding bools to a hashtable.
12126 2004-11-07 Miguel de Icaza <miguel@ximian.com>
12128 * expression.cs (Invocation.OverloadResolve): Flag error if we are
12129 calling an unsafe method from a safe location.
12131 2004-11-06 Marek Safar <marek.safar@seznam.cz>
12134 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
12136 2004-11-06 Miguel de Icaza <miguel@ximian.com>
12138 * namespace.cs (VerifyUsing): use GetPartialName instead of
12141 2004-11-05 Miguel de Icaza <miguel@ximian.com>
12143 * statement.cs (Return.Resolve): Fix regression in typo: if
12144 `in_exc', we have to request a NeedReturnLabel, this was a typo
12145 introduced in the anonymous method check-in. Fixes #69131.
12147 * Indexers were using the ShortName when defining themselves,
12148 causing a regression in the compiler bootstrap when applying the
12149 patch from 2004-11-02 (first part), now they use their full name
12150 and the bug is gone.
12152 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
12154 * driver.cs: Strip the path from the names of embedded resources. Fixes
12157 2004-11-04 Raja R Harinath <rharinath@novell.com>
12159 Fix error message regression: cs0104-2.cs.
12160 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
12161 (AliasEntry.Resolve): Update.
12162 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
12164 (RootContext.LookupType): Update.
12166 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
12168 * cs-parser.jay: Add support for handling accessor modifiers
12169 * class: Add support port accessor modifiers and error checking,
12170 define PropertyMethod.Define as virtual (not abstract anymore)
12171 * ecore.cs: Add checking for proeprties access with access modifiers
12172 * iterators.cs: Modify Accessor constructor call based in the modified
12174 2004-11-02 Ben Maurer <bmaurer@ximian.com>
12176 * expression.cs (StringConcat): Handle being called twice,
12177 as when we have a concat in a field init with more than two
12180 2004-11-02 Miguel de Icaza <miguel@ximian.com>
12182 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
12183 special case explicit implementations, we should always produce
12184 the .property or .event declaration.
12186 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
12187 since it will not return correct data if people use this
12188 unresolved in the presence of using statements (see test-313).
12190 * class.cs (MethodData.Define): If we are an explicit interface
12191 implementation, set the method name to the full name of the
12192 interface plus the name of the method.
12194 Notice that using the method.MethodName.GetFullName() does not
12195 work, as it will only contain the name as declared on the source
12196 file (it can be a shorthand in the presence of using statements)
12197 and not the fully qualifed type name, for example:
12201 class D : ICloneable {
12202 object ICloneable.Clone () {
12206 Would produce a method called `ICloneable.Clone' instead of
12207 `System.ICloneable.Clone'.
12209 * namespace.cs (Alias.Resolve): Use GetPartialName.
12211 2004-11-01 Marek Safar <marek.safar@seznam.cz>
12213 * cs-parser.jay: Add error 1055 report.
12215 2004-11-01 Miguel de Icaza <miguel@ximian.com>
12217 * assign.cs (Assign.DoResolve): Only do the transform of
12218 assignment into a New if the types are compatible, if not, fall
12219 through and let the implicit code deal with the errors and with
12220 the necessary conversions.
12222 2004-11-01 Marek Safar <marek.safar@seznam.cz>
12224 * cs-parser.jay: Add error 1031 report.
12226 * cs-tokenizer.cs: Add location for error 1038.
12228 2004-10-31 Marek Safar <marek.safar@seznam.cz>
12230 * cs-parser.jay: Add error 1016 report.
12232 2004-10-31 Marek Safar <marek.safar@seznam.cz>
12234 * cs-parser.jay: Add errors 1575,1611 report.
12236 2004-10-31 Marek Safar <marek.safar@seznam.cz>
12238 * cs-parser.jay: Add error 1001 report.
12240 2004-10-31 Marek Safar <marek.safar@seznam.cz>
12243 * attribute.cs (GetMarshal): Add method argument for
12244 caller identification.
12246 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
12247 agument for GetMarshal and RuntimeMissingSupport.
12249 2004-10-31 Marek Safar <marek.safar@seznam.cz>
12251 * attribute.cs (ExtractSecurityPermissionSet): Removed
12252 TypeManager.code_access_permission_type.
12254 * typemanager.cs: Removed TypeManager.code_access_permission_type.
12256 2004-10-27 Miguel de Icaza <miguel@ximian.com>
12258 * expression.cs (LocalVariableReference.DoResolveLValue): Check
12259 for obsolete use of a variable here. Fixes regression on errors
12260 cs0619-25 and cs0619-26.
12262 2004-10-27 Marek Safar <marek.safar@seznam.cz>
12264 Fix #62358, implemented security attribute encoding.
12266 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
12267 Tests permitted SecurityAction for assembly or other types.
12268 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
12269 data from SecurityPermissionAttribute to PermisionSet class.
12271 * class.cs (ApplyAttributeBuilder): Added special handling
12272 for System.Security.Permissions.SecurityAttribute based types.
12274 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
12275 special handling for System.Security.Permissions.SecurityAttribute
12278 * enum.cs (ApplyAttributeBuilder): Added special handling
12279 for System.Security.Permissions.SecurityAttribute based types.
12281 * parameter.cs (ApplyAttributeBuilder): Added special handling
12282 for System.Security.Permissions.SecurityAttribute based types.
12284 * rootcontext.cs: Next 2 core types.
12286 * typemanager.cs (TypeManager.security_permission_attr_type):
12287 Built in type for the SecurityPermission Attribute.
12288 (code_access_permission_type): Build in type.
12290 2004-10-17 Miguel de Icaza <miguel@ximian.com>
12292 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
12293 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
12294 all of this information into
12295 EmitContext.EmitCapturedVariableInstance.
12297 * codegen.cs (EmitCapturedVariableInstance): move here the
12298 funcionality of emitting an ldarg.0 in the presence of a
12299 remapping. This centralizes the instance emit code.
12301 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
12302 then emit a load of this: it means that we have reached the
12303 topmost ScopeInfo: the one that contains the pointer to the
12304 instance of the class hosting the anonymous method.
12306 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
12307 captures to the topmost CaptureContext.
12309 2004-10-12 Miguel de Icaza <miguel@ximian.com>
12311 * expression.cs (LocalVariableReference): Move the knowledge about
12312 the iterators into codegen's EmitCapturedVariableInstance.
12314 2004-10-11 Miguel de Icaza <miguel@ximian.com>
12316 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
12317 all code paths return a value from an anonymous method (it is the
12318 same as the 161 error, but for anonymous methods).
12320 2004-10-08 Miguel de Icaza <miguel@ximian.com>
12322 The introduction of anonymous methods in the compiler changed
12323 various ways of doing things in the compiler. The most
12324 significant one is the hard split between the resolution phase
12325 and the emission phases of the compiler.
12327 For instance, routines that referenced local variables no
12328 longer can safely create temporary variables during the
12329 resolution phase: they must do so from the emission phase,
12330 since the variable might have been "captured", hence access to
12331 it can not be done with the local-variable operations from the runtime.
12335 (Block.Flags): New flag `IsTopLevel' to indicate that this block
12336 is a toplevel block.
12338 (ToplevelBlock): A new kind of Block, these are the blocks that
12339 are created by the parser for all toplevel method bodies. These
12340 include methods, accessors and anonymous methods.
12342 These contain some extra information not found in regular blocks:
12343 A pointer to an optional CaptureContext (for tracking captured
12344 local variables and parameters). A pointer to the parent
12347 (Return.Resolve): Catch missmatches when returning a value from an
12348 anonymous method (error 1662).
12349 Invoke NeedReturnLabel from the Resolve phase instead of the emit
12352 (Break.Resolve): ditto.
12354 (SwitchLabel): instead of defining the labels during the
12355 resolution phase, we now turned the public ILLabel and ILLabelCode
12356 labels into methods called GetILLabelCode() and GetILLabel() that
12357 only define the label during the Emit phase.
12359 (GotoCase): Track the SwitchLabel instead of the computed label
12360 (its contained therein). Emit the code by using
12361 SwitchLabel.GetILLabelCode ().
12363 (LocalInfo.Flags.Captured): A new flag has been introduce to track
12364 whether the Local has been captured or not.
12366 (LocalInfo.IsCaptured): New property, used to tell whether the
12367 local has been captured.
12369 * anonymous.cs: Vastly updated to contain the anonymous method
12372 The main classes here are: CaptureContext which tracks any
12373 captured information for a toplevel block and ScopeInfo used to
12374 track the activation frames for various local variables.
12376 Each toplevel block has an optional capture context associated
12377 with it. When a method contains an anonymous method both the
12378 toplevel method and the anonymous method will create a capture
12379 context. When variables or parameters are captured, they are
12380 recorded on the CaptureContext that owns them, for example:
12384 MyDelegate d = delegate {
12389 Here `a' will be recorded as captured on the toplevel
12390 CapturedContext, the inner captured context will not have anything
12391 (it will only have data if local variables or parameters from it
12392 are captured in a nested anonymous method.
12394 The ScopeInfo is used to track the activation frames for local
12395 variables, for example:
12397 for (int i = 0; i < 10; i++)
12398 for (int j = 0; j < 10; j++){
12399 MyDelegate d = delegate {
12404 At runtime this captures a single captured variable `i', but it
12405 captures 10 different versions of the variable `j'. The variable
12406 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
12407 recorded on a child.
12409 The toplevel ScopeInfo will also track information like the `this'
12410 pointer if instance variables were referenced (this is necessary
12411 as the anonymous method lives inside a nested class in the host
12412 type of the method).
12414 (AnonymousMethod): Expanded to track the Toplevel, implement
12415 `AnonymousMethod.Compatible' to tell whether an anonymous method
12416 can be converted to a target delegate type.
12418 The routine now also produces the anonymous method content
12420 (AnonymousDelegate): A helper class that derives from
12421 DelegateCreation, this is used to generate the code necessary to
12422 produce the delegate for the anonymous method that was created.
12424 * assign.cs: API adjustments for new changes in
12425 Convert.ImplicitStandardConversionExists.
12427 * class.cs: Adjustments to cope with the fact that now toplevel
12428 blocks are of type `ToplevelBlock'.
12430 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
12431 insteda of standard blocks.
12433 Flag errors if params arguments are passed to anonymous methods.
12435 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
12436 `CurrentAnonymousMethod' which points to the current Anonymous
12437 Method. The variable points to the AnonymousMethod class that
12438 holds the code being compiled. It is set in the new EmitContext
12439 created for the anonymous method.
12441 (EmitContext.Phase): Introduce a variable and an enumeration to
12442 assist in enforcing some rules about when and where we are allowed
12443 to invoke certain methods (EmitContext.NeedsReturnLabel is the
12444 only one that enfonces this right now).
12446 (EmitContext.HaveCaptureInfo): new helper method that returns
12447 whether we have a CapturedContext initialized.
12449 (EmitContext.CaptureVariable): New method used to register that a
12450 LocalInfo must be flagged for capturing.
12452 (EmitContext.CapturedParameter): New method used to register that a
12453 parameters must be flagged for capturing.
12455 (EmitContext.CapturedField): New method used to register that a
12456 field must be flagged for capturing.
12458 (EmitContext.HaveCapturedVariables,
12459 EmitContext.HaveCapturedFields): Return whether there are captured
12460 variables or fields.
12462 (EmitContext.EmitMethodHostInstance): This is used to emit the
12463 instance for the anonymous method. The instance might be null
12464 (static methods), this (for anonymous methods that capture nothing
12465 and happen to live side-by-side with the current method body) or a
12466 more complicated expression if the method has a CaptureContext.
12468 (EmitContext.EmitTopBlock): Routine that drives the emission of
12469 code: it will first resolve the top block, then emit any metadata
12470 and then emit the code. The split is done so that we can extract
12471 any anonymous methods and flag any captured variables/parameters.
12473 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
12474 during this phase, the ILGenerator should not be used as labels
12475 and local variables declared here might not be accessible to any
12476 code that is part of an anonymous method.
12478 Exceptions to this include the temporary variables that are
12479 created by some statements internally for holding temporary
12482 (EmitContext.EmitMeta): New routine, in charge of emitting all the
12485 (EmitContext.TemporaryReturn): This method is typically called
12486 from the Emit phase, and its the only place where we allow the
12487 ReturnLabel to be defined other than the EmitMeta. The reason is
12488 that otherwise we would have to duplicate a lot of logic in the
12489 Resolve phases of various methods that today is on the Emit
12492 (EmitContext.NeedReturnLabel): This no longer creates the label,
12493 as the ILGenerator is not valid during the resolve phase.
12495 (EmitContext.EmitThis): Extended the knowledge in this class to
12496 work in anonymous methods in addition to iterators.
12498 (EmitContext.EmitCapturedVariableInstance): This emits whatever
12499 code is necessary on the stack to access the instance to a local
12500 variable (the variable will be accessed as a field).
12502 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
12503 EmitContext.EmitAddressOfParameter): Routines to support
12504 parameters (not completed at this point).
12506 Removals: Removed RemapLocal and RemapLocalLValue. We probably
12507 will also remove the parameters.
12509 * convert.cs (Convert): Define a `ConstantEC' which points to a
12510 null. This is just to prefity some code that uses
12511 ImplicitStandardConversion code and do not have an EmitContext
12514 The idea is to flag explicitly that at that point in time, it is
12515 known that the conversion will not trigger the delegate checking
12516 code in implicit conversions (which requires a valid
12519 Everywhere: pass new EmitContext parameter since
12520 ImplicitStandardConversionExists now requires it to check for
12521 anonymous method conversions.
12523 (Convert.ImplicitStandardConversionExists): If the type of an
12524 expression is the anonymous_method_type, and the type is a
12525 delegate, we invoke the AnonymousMethod.Compatible method to check
12526 whether an implicit conversion is possible.
12528 (Convert.ImplicitConversionStandard): Only do implicit method
12529 group conversions if the language level is not ISO_1.
12531 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
12532 MethodInfo for the Invoke method. used by Delegate and
12535 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
12536 method conversions if the target type is a delegate.
12538 Removed extra debugging nops.
12540 (LocalVariableReference): Turn the `local_info' into a public
12543 Add `prepared' field, the same hack used for FieldExprs to cope
12544 with composed assignments, as Local variables do not necessarily
12545 operate purely on the stack as they used to: they can be captured
12548 Add `temp' for a temporary result, like fields.
12550 Refactor DoResolve and DoResolveLValue into DoResolveBase.
12552 It now copes with Local variables that are captured and emits the
12553 proper instance variable to load it from a field in the captured
12556 (ParameterReference.DoResolveBase): During the resolve phase,
12557 capture parameters if we are in an anonymous method.
12559 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
12560 anonymous method, use the EmitContext helper routines to emit the
12561 parameter reference.
12563 * iterators.cs: Set RemapToProxy to true/false during the
12566 * parameters.cs (GetParameterByName): New helper method.
12568 * typemanager.cs (anonymous_method_type) a new type that
12569 represents an anonyous method. This is always an internal type,
12570 used as a fencepost to test against the anonymous-methodness of an
12573 2004-10-20 Marek Safar <marek.safar@seznam.cz>
12575 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
12577 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
12579 2004-10-18 Martin Baulig <martin@ximian.com>
12581 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
12582 `Type' directly, but call ResolveType() on it.
12583 (Catch.Resolve): Likewise.
12584 (Foreach.Resolve): Likewise.
12586 2004-10-18 Martin Baulig <martin@ximian.com>
12588 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
12589 `Type' directly, but call ResolveType() on it.
12590 (Probe.DoResolve): Likewise.
12591 (ArrayCreation.LookupType): Likewise.
12592 (TypeOf.DoResolve): Likewise.
12593 (SizeOf.DoResolve): Likewise.
12595 2004-10-18 Martin Baulig <martin@ximian.com>
12597 * expression.cs (Invocation.BetterFunction): Put back
12598 TypeManager.TypeToCoreType().
12600 2004-10-18 Raja R Harinath <rharinath@novell.com>
12602 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
12605 2004-10-18 Martin Baulig <martin@ximian.com>
12607 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
12608 `Type' directly, but call ResolveType() on it.
12610 2004-10-18 Martin Baulig <martin@ximian.com>
12612 * class.cs (FieldMember.Define): Don't access the TypeExpr's
12613 `Type' directly, but call ResolveType() on it.
12614 (MemberBase.DoDefine): Likewise.
12616 * expression.cs (New.DoResolve): Don't access the TypeExpr's
12617 `Type' directly, but call ResolveType() on it.
12618 (ComposedCast.DoResolveAsTypeStep): Likewise.
12620 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
12621 `Type' directly, but call ResolveType() on it.
12623 2004-10-17 John Luke <john.luke@gmail.com>
12625 * class.cs (Operator.GetSignatureForError): use CSharpName
12627 * parameter.cs (Parameter.GetSignatureForError): Returns
12628 correct name even if was not defined.
12630 2004-10-13 Raja R Harinath <rharinath@novell.com>
12633 * class.cs (TypeContainer.EmitContext): New property.
12634 (DefineNestedTypes): Create an emitcontext for each part.
12635 (MethodCore.DoDefineParameters): Use container's emitcontext.
12636 Pass type array to InternalParameters.
12637 (MemberBase.DoDefine): Use container's emitcontext.
12638 (FieldMember.Define): Likewise.
12639 (Event.Define): Likewise.
12640 (SetMethod.GetParameterInfo): Change argument to EmitContext.
12641 Pass type array to InternalParameters.
12642 (SetIndexerMethod.GetParameterInfo): Likewise.
12643 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
12644 * delegate.cs (Define): Pass emitcontext to
12645 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
12646 array to InternalParameters.
12647 * expression.cs (ParameterReference.DoResolveBase): Pass
12648 emitcontext to GetParameterInfo.
12649 (ComposedCast.DoResolveAsTypeStep): Remove check on
12650 ec.ResolvingTypeTree.
12651 * parameter.cs (Parameter.Resolve): Change argument to
12652 EmitContext. Use ResolveAsTypeTerminal.
12653 (Parameter.GetSignature): Change argument to EmitContext.
12654 (Parameters.ComputeSignature): Likewise.
12655 (Parameters.ComputeParameterTypes): Likewise.
12656 (Parameters.GetParameterInfo): Likewise.
12657 (Parameters.ComputeAndDefineParameterTypes): Likewise.
12658 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
12659 * support.cs (InternalParameters..ctor): Remove variant that takes
12661 * typemanager.cs (system_intptr_expr): New.
12662 (InitExpressionTypes): Initialize it.
12664 2004-10-12 Chris Toshok <toshok@ximian.com>
12666 * cs-parser.jay: fix location for try_statement and catch_clause.
12668 2004-10-11 Martin Baulig <martin@ximian.com>
12670 * report.cs: Don't make --fatal abort on warnings, we have
12671 -warnaserror for that.
12673 2004-10-07 Raja R Harinath <rharinath@novell.com>
12675 More DeclSpace.ResolveType avoidance.
12676 * decl.cs (MemberCore.InUnsafe): New property.
12677 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
12678 with newly created EmitContext.
12679 (FieldMember.Define): Likewise.
12680 * delegate.cs (Delegate.Define): Likewise.
12681 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
12682 only if normal name-lookup fails.
12683 (TypeExpr.DoResolve): Enable error-checking.
12684 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
12685 (SizeOf.DoResolve): Likewise.
12686 (ComposedCast.DoResolveAsTypeStep): Likewise.
12687 (StackAlloc.DoResolve): Likewise.
12688 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
12689 (Block.Unsafe): New property.
12690 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
12691 (Unsafe): Set 'unsafe' flag of contained block.
12692 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
12693 (Fixed.Resolve): Likewise.
12694 (Catch.Resolve): Likewise.
12695 (Using.ResolveLocalVariableDecls): Likewise.
12696 (Foreach.Resolve): Likewise.
12698 2004-10-05 John Luke <john.luke@gmail.com>
12700 * cs-parser.jay: add location to error CS0175
12702 2004-10-04 Miguel de Icaza <miguel@ximian.com>
12704 * ecore.cs (Expression.Constantity): Add support for turning null
12707 * const.cs (Const.Define): Allow constants to be reference types
12708 as long as the value is Null.
12710 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
12712 * namespace.cs (NamespaceEntry.Using): No matter which warning
12713 level is set, check if this namespace name has already been added.
12715 2004-10-03 Ben Maurer <bmaurer@ximian.com>
12717 * expression.cs: reftype [!=]= null should always use br[true,false].
12720 2004-10-03 Marek Safar <marek.safar@seznam.cz>
12723 * attribute.cs: Enum conversion moved to
12724 GetAttributeArgumentExpression to be applied to the all
12727 2004-10-01 Raja R Harinath <rharinath@novell.com>
12729 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
12730 * class.c (TypeContainer.DefineType): Flag error if
12731 base types aren't accessible due to access permissions.
12732 * decl.cs (DeclSpace.ResolveType): Move logic to
12733 Expression.ResolveAsTypeTerminal.
12734 (DeclSpace.ResolveTypeExpr): Thin layer over
12735 Expression.ResolveAsTypeTerminal.
12736 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
12737 Refactor code into NestedAccess. Use it.
12738 (DeclSpace.NestedAccess): New.
12739 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
12740 argument to silence errors. Check access permissions.
12741 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
12742 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
12743 (Cast.DoResolve): Likewise.
12744 (New.DoResolve): Likewise.
12745 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
12746 (TypeOf.DoResolve): Likewise.
12748 * expression.cs (Invocation.BetterConversion): Return the Type of
12749 the better conversion. Implement section 14.4.2.3 more faithfully.
12750 (Invocation.BetterFunction): Make boolean. Make correspondence to
12751 section 14.4.2.2 explicit.
12752 (Invocation.OverloadResolve): Update.
12753 (Invocation): Remove is_base field.
12754 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
12755 (Invocation.Emit): Likewise.
12757 2004-09-27 Raja R Harinath <rharinath@novell.com>
12759 * README: Update to changes.
12761 2004-09-24 Marek Safar <marek.safar@seznam.cz>
12763 * cs-parser.jay: Reverted 642 warning fix.
12765 2004-09-23 Marek Safar <marek.safar@seznam.cz>
12768 * decl.cs (FindMemberWithSameName): Indexer can have more than
12771 2004-09-23 Marek Safar <marek.safar@seznam.cz>
12773 * expression.cs (LocalVariableReference.DoResolveLValue):
12774 Do not report warning 219 for out values.
12775 (EmptyExpression.Null): New member to avoid extra allocations.
12777 2004-09-23 Marek Safar <marek.safar@seznam.cz>
12779 * cs-parser.jay: Fix wrong warning 642 report.
12781 * cs-tokenizer.cs (CheckNextToken): New helper;
12782 Inspect next character if is same as expected.
12784 2004-09-23 Martin Baulig <martin@ximian.com>
12786 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
12787 (Convert.ImplicitReferenceConversionExists): Likewise.
12789 2004-09-23 Marek Safar <marek.safar@seznam.cz>
12791 * class.cs (Operator.Define): Add error 448 and 559 report.
12793 2004-09-22 Marek Safar <marek.safar@seznam.cz>
12795 * class.cs (MemberBase.IsTypePermitted): New protected
12796 method for checking error CS0610.
12798 2004-09-22 Marek Safar <marek.safar@seznam.cz>
12800 * class.cs (TypeContainer.HasExplicitLayout): New property
12801 Returns whether container has StructLayout attribute set Explicit.
12802 (FieldMember): New abstract class for consts and fields.
12803 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
12804 (Field): Reuse FieldMember.
12806 * const.cs (Const): Reuse FieldMember.
12808 * rootcontext.cs: EmitConstants call moved to class.
12810 2004-09-22 Martin Baulig <martin@ximian.com>
12812 Thanks to Peter Sestoft for this bug report.
12814 * expression.cs (Conditional): If both the `trueExpr' and the
12815 `falseExpr' is a NullLiteral, return a NullLiteral.
12817 2004-09-22 Martin Baulig <martin@ximian.com>
12819 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
12820 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
12821 for the "get_Current" call.
12823 2004-09-22 Martin Baulig <martin@ximian.com>
12825 Marek and me just fixed one of our oldest bugs: #28562 :-)
12827 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
12829 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
12830 we're an EnumConstant, just return that.
12831 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
12832 an EnumConstant. In this case, we need to use GetValueAsEnumType()
12833 to get the value which'll actually be written into the attribute.
12834 However, we have to use GetValue() to access the attribute's value
12837 2004-09-22 Marek Safar <marek.safar@seznam.cz>
12839 * constant.cs (Constant.IsNegative): New abstract property
12842 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
12843 (StackAlloc.DoResolve): Reused IsNegative.
12845 2004-09-21 Martin Baulig <martin@ximian.com>
12847 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
12848 if we're used in an iterator, we may be called from different
12851 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
12852 we actually have an exception block.
12854 2004-09-20 John Luke <jluke@cfl.rr.com>
12856 * class.cs, cs-parser.jay: Improve the error report for 1520:
12857 report the actual line where the error happens, not where the
12858 class was declared.
12860 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
12861 Pass location information that was available elsewhere.
12863 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
12865 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
12866 runtime to delay sign assemblies.
12868 2004-09-19 Miguel de Icaza <miguel@ximian.com>
12870 * cs-parser.jay: Do not report the stack trace, this is barely
12873 2004-08-22 John Luke <john.luke@gmail.com>
12875 * driver.cs : check that a resource id is not already used
12876 before adding it, report CS1508 if it is, bug #63637
12878 2004-09-19 Miguel de Icaza <miguel@ximian.com>
12880 * ecore.cs: Removed dead code.
12882 2004-09-18 Marek Safar <marek.safar@seznam.cz>
12884 * class.cs: Do not report warning CS0067 on the interfaces.
12886 2004-09-16 Marek Safar <marek.safar@seznam.cz>
12888 * cs-parser.jay: Add error 504 report.
12890 2004-09-16 Marek Safar <marek.safar@seznam.cz>
12892 * rootcontext.cs: WarningLevel is 4 by default now.
12894 * statement.cs (Fixed.Resolve): Do not null
12897 2004-09-16 Marek Safar <marek.safar@seznam.cz>
12900 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
12901 deep search when property is not virtual.
12902 (PropertyExpr.ResolveAccessors): Make one call for both
12905 2004-09-15 Marek Safar <marek.safar@seznam.cz>
12908 * statement.cs: Error 152 report constains also location.
12910 2004-09-15 Marek Safar <marek.safar@seznam.cz>
12913 * const.cs: Explicitly set constant as static.
12915 2004-09-15 Marek Safar <marek.safar@seznam.cz>
12918 * cs-parser.jay: Add error 1017 report.
12920 2004-09-15 Marek Safar <marek.safar@seznam.cz>
12922 Fixed bug #59980, #64224
12923 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
12925 * typemanager.cs (IsSpecialMethod): Simplified
12927 2004-09-14 Marek Safar <marek.safar@seznam.cz>
12929 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
12930 condition with better params.
12932 2004-09-14 Marek Safar <marek.safar@seznam.cz>
12935 * attribute.cs (Resolve): Property has to have both
12938 2004-09-14 Martin Baulig <martin@ximian.com>
12940 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
12942 2004-09-14 Marek Safar <marek.safar@seznam.cz>
12945 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
12946 called and is obsolete then this member suppress message
12947 when call is inside next [Obsolete] method or type.
12949 * expression.cs: Use TestObsoleteMethodUsage member.
12951 2004-09-14 Martin Baulig <martin@ximian.com>
12953 * cs-parser.jay: Sync a bit with the GMCS version.
12955 2004-09-14 Martin Baulig <martin@ximian.com>
12957 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
12958 (CSharpParser.yacc_verbose_flag): New public field.
12960 * genericparser.cs: Removed.
12962 2004-09-14 Raja R Harinath <rharinath@novell.com>
12964 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
12966 2004-09-13 Marek Safar <marek.safar@seznam.cz>
12968 * class.cs (MethodCore.CheckBase): Fix bug #65757.
12970 2004-09-10 Martin Baulig <martin@ximian.com>
12972 Backported my MemberName changes from GMCS into MCS.
12974 - we are now using a special `MemberName' class instead of using
12975 strings; in GMCS, the `MemberName' also contains the type
12978 - changed the grammar rules a bit:
12979 * the old `member_name' is now a `namespace_or_type_name':
12980 The rule is that we use `namespace_or_type_name' everywhere
12981 where we expect either a "member name" (GetEnumerator) or a
12982 "member name" with an explicit interface name
12983 (IEnumerable.GetEnumerator).
12984 In GMCS, the explicit interface name may include type arguments
12985 (IEnumerable<T>.GetEnumerator).
12986 * we use `member_name' instead of just `IDENTIFIER' for
12988 The rule is that we use `member_name' wherever a member may
12989 have type parameters in GMCS.
12991 * decl.cs (MemberName): New public class.
12992 (MemberCore.MemberName): New public readonly field.
12993 (MemberCore.ctor): Take a `MemberName' argument, not a string.
12994 (DeclSpace): Likewise.
12996 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
12997 * enum.cs (Enum.ctor): Likewise.
12999 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
13001 (AliasEntry.ctor): Take a MemberName, not an Expression.
13002 (AliasEntry.UsingAlias): Likewise.
13004 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
13005 (IMethodData.MemberName): Changed type from string to MemberName.
13006 (MemberBase.ExplicitInterfaceName): Likewise.
13007 (AbstractPropertyEventMethod.SetupName): Make this private.
13008 (AbstractPropertyEventMethod.ctor): Added `string prefix'
13009 argument; compute the member name here.
13010 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
13011 on the `member.MemberName' and the `prefix'.
13013 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
13015 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
13016 thus, we get a `MemberName' instead of a `string'. These
13017 declarations may have type parameters in GMCS.
13018 (interface_method_declaration, delegate_declaration): Likewise.
13019 (class_declaration, interface_declaration): Likewise.
13020 (method_header): Use `namespace_or_type_name' instead of
13021 `member_name'. We may be an explicit interface implementation.
13022 (property_declaration, event_declaration): Likewise.
13023 (member_name): This is now just an `IDENTIFIER', not a
13024 `namespace_or_type_name'.
13025 (type_name, interface_type): Removed.
13026 (namespace_or_type_name): Return a MemberName, not an Expression.
13027 (primary_expression): Use `member_name' instead of `IDENTIFIER';
13028 call GetTypeExpression() on the MemberName to get an expression.
13029 (IndexerDeclaration.interface_type): Changed type from string to
13031 (MakeName): Operate on MemberName's instead of string's.
13033 2004-09-13 Raja R Harinath <rharinath@novell.com>
13036 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
13037 (NamespaceEntry.Lookup): Add new argument to flag if we want the
13038 lookup to avoid symbols introduced by 'using'.
13039 * rootcontext.cs (NamespaceLookup): Update.
13041 2004-09-12 Marek Safar <marek.safar@seznam.cz>
13043 * class.cs (TypeContainer.DoDefineMembers): Do not call
13044 DefineDefaultConstructor for static classes.
13046 2004-09-12 Marek Safar <marek.safar@seznam.cz>
13048 * attribute.cs (Attribute.Resolve): Add error 653 report.
13050 * class.cs (Class.ApplyAttributeBuilder): Add error 641
13052 (Method.ApplyAttributeBuilder): Add error 685 report.
13053 (Operator.Define): Add error 564 report.
13055 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
13057 * expression.cs (Invocation.DoResolve): Add error
13058 245 and 250 report.
13060 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
13063 2004-09-11 Marek Safar <marek.safar@seznam.cz>
13065 * class.cs (ConstructorInitializer.Resolve):
13066 Wrong error number (515->516).
13068 2004-09-11 Marek Safar <marek.safar@seznam.cz>
13070 * class.cs (Indexer.Define): Add error 631 report.
13072 2004-09-11 Marek Safar <marek.safar@seznam.cz>
13074 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
13076 2004-09-11 Marek Safar <marek.safar@seznam.cz>
13078 * expression.cs (Probe.DoResolve): Add error CS0241 report.
13080 2004-09-10 Marek Safar <marek.safar@seznam.cz>
13082 * cs-parser.jay: Added error CS0241 report.
13084 2004-09-10 Raja R Harinath <rharinath@novell.com>
13086 * cs-parser.jay (fixed_statement): Introduce a scope for the
13087 declaration in the 'fixed' statement.
13089 2004-09-09 Marek Safar <marek.safar@seznam.cz>
13091 * cs-parser.jay: Added CS0230 error report.
13093 2004-09-09 Marek Safar <marek.safar@seznam.cz>
13095 * cs-parser.jay: Added errors CS0231 and CS0257 report.
13097 2004-09-09 Marek Safar <marek.safar@seznam.cz>
13099 * expression.cs (Argument.Resolve): Added error CS0192 and
13102 2004-09-09 Marek Safar <marek.safar@seznam.cz>
13104 C# 2.0 #pragma warning feature
13106 * cs-tokenizer.cs (PreProcessPragma): New method;
13107 Handles #pragma directive.
13109 * report.cs (WarningRegions): New class; Support
13110 class for #pragma warning directive. It tests whether
13111 warning is enabled for a given line.
13113 2004-09-08 Miguel de Icaza <miguel@ximian.com>
13115 * const.cs: Add more descriptive error report, tahnks to
13118 2004-09-08 Marek Safar <marek.safar@seznam.cz>
13120 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
13122 2004-09-07 Miguel de Icaza <miguel@ximian.com>
13124 * expression.cs: Apply patch from Ben: Remove dead code from
13125 ArrayCreation, and remove the TurnintoConstant call in const.cs,
13126 as that code just threw an exception anwyays.
13128 * const.cs: Remove the call to the turnintoconstant, for details
13131 * literal.cs: The type of the null-literal is the null type; So
13132 we use a placeholder type (literal.cs:System.Null, defined here)
13135 * expression.cs (Conditional.DoResolve): Remove some old code that
13136 is no longer needed, conversions have been fixed.
13138 (ArrayCreationExpression.DoResolve): Return false if we fail to
13139 resolve the inner expression.
13141 2004-09-07 Raja R Harinath <rharinath@novell.com>
13144 * cs-parser.jay (delegate_declaration): Record a delegate
13145 declaration as a type declaration.
13146 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
13148 2004-09-06 Miguel de Icaza <miguel@ximian.com>
13150 * parameter.cs: Do not crash if the type can not be resolved.
13152 * expression.cs: Report errors with unsafe pointers, fixes #64896
13154 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
13156 * expression.cs: Pointer arith always needs to do a conv.i
13157 if the operand is a long. fix 65320
13159 2004-09-04 Marek Safar <marek.safar@seznam.cz>
13161 Fixed cs0619-37.cs, cs0619-38.cs
13163 * enum.cs (GetObsoleteAttribute): Removed.
13165 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
13166 on Enum member is double staged. The first is tested member
13169 2004-09-04 Marek Safar <marek.safar@seznam.cz>
13171 Fixed #56986, #63631, #65231
13173 * class.cs: (TypeContainer.AddToMemberContainer): New method,
13174 adds member to name container.
13175 (TypeContainer.AddToTypeContainer): New method, adds type to
13177 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
13178 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
13179 AddOperator): Simplified by reusing AddToMemberContainer.
13180 (TypeContainer.UserDefinedStaticConstructor): Changed to property
13182 (Method.CheckForDuplications): Fixed implementation to test all
13184 (MemberBase): Detection whether member is explicit interface
13185 implementation is now in constructor.
13186 (MemberBase.UpdateMemberName): Handles IndexerName.
13187 (Accessor): Changed to keep also location information.
13188 (AbstractPropertyEventMethod): Is derived from MemberCore.
13189 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
13190 will be emited or not.
13191 (PropertyBase.AreAccessorsDuplicateImplementation):
13192 Tests whether accessors are not in collision with some method.
13193 (Operator): Is derived from MethodCore to simplify common
13196 * decl.cs (Flags.TestMethodDuplication): Test for duplication
13198 (DeclSpace.AddToContainer): Adds the member to defined_names
13199 table. It tests for duplications and enclosing name conflicts.
13201 * enum.cs (EnumMember): Clean up to reuse the base structures
13203 2004-09-03 Martin Baulig <martin@ximian.com>
13205 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
13206 into TypeContainer, to make partial classes work again.
13208 2004-09-03 Martin Baulig <martin@ximian.com>
13210 * rootcontext.cs (RootContext.V2): Removed.
13212 2004-03-23 Martin Baulig <martin@ximian.com>
13214 * expression.cs (Invocation.OverloadResolve): Added `bool
13215 may_fail' argument and use it instead of the Location.IsNull() hack.
13217 2004-09-03 Martin Baulig <martin@ximian.com>
13219 Merged latest changes into gmcs. Please keep this comment in
13220 here, it makes it easier for me to see what changed in MCS since
13221 the last time I merged.
13223 2004-09-03 Raja R Harinath <rharinath@novell.com>
13226 * expression.cs (BetterConversion): Don't allow either conversion
13227 to be null. Remove redundant implicit conversion test when 'q ==
13228 null' -- when this function is invoked, we already know that the
13229 implicit conversion exists.
13230 (BetterFunction): Assume that 'best' is non-null. Remove
13231 redundant reimplementation of IsApplicable when 'best' is null.
13232 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
13233 number of arguments.
13234 (IsAncestralType): Extract from OverloadResolve.
13235 (OverloadResolve): Make robust to the MethodGroupExpr being
13236 unsorted. Implement all the logic of Section 14.5.5.1, and
13237 support overloading of methods from multiple applicable types.
13238 Clean up logic somewhat. Don't pass null methods to BetterFunction.
13240 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
13241 (RealError, Warning): Append type of report to related symbol.
13243 2004-09-03 Marek Safar <marek.safar@seznam.cz>
13245 * enum.cs: Fixed CLS-Compliance checks for enum members.
13246 Error tests cs3008-8.cs, cs3014-8.cs
13248 2004-09-02 Marek Safar <marek.safar@seznam.cz>
13250 Fixed bug #62342, #63102
13251 * class.cs: ImplementIndexer uses member.IsExplicitImpl
13252 like ImplementMethod.
13254 2004-09-02 Marek Safar <marek.safar@seznam.cz>
13256 * attribute.cs (Attribute.GetAttributeArgumentExpression):
13259 2004-09-02 Martin Baulig <martin@ximian.com>
13261 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
13262 TypeManager.GetArgumentTypes() rather than calling GetParameters()
13265 2004-09-01 Marek Safar <marek.safar@seznam.cz>
13267 C# 2.0 Static classes implemented
13269 * class.cs (TypeContainer): instance_constructors,
13270 initialized_fields, initialized_static_fields,
13271 default_constructor, base_inteface_types are protected to be
13272 accessible from StaticClass.
13273 (TypeContainer.DefineDefaultConstructor): New virtual method
13274 for custom default constructor generating
13275 (StaticClass): New class to handle "Static classes" feature.
13277 * cs-parser.jay: Handle static keyword on class like instance
13280 * driver.cs: Added "/langversion" command line switch with two
13281 options (iso-1, default).
13283 2004-08-31 Marek Safar <marek.safar@seznam.cz>
13285 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
13287 2004-08-31 Miguel de Icaza <miguel@ximian.com>
13289 * delegate.cs: Style.
13291 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
13293 * delegate.cs: Add seperate instance expr field for miguel.
13295 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
13297 * PointerArithmetic (Resolve): make sure we are not doing
13298 pointer arith on void*. Also, make sure we are resolved
13299 by not setting eclass until resolve.
13301 All callers: Make sure that PointerArithmetic gets resolved.
13303 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
13305 * ArrayCreation (LookupType): If the type does not resolve
13306 to an array, give an error.
13308 2004-08-27 Marek Safar <marek.safar@seznam.cz>
13310 * statement.cs (Try.Resolve): Fixed bug #64222
13312 2004-08-27 Martin Baulig <martin@ximian.com>
13315 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
13318 2004-08-26 Marek Safar <marek.safar@seznam.cz>
13320 * ecore.cs (Constantify): Get underlying type via
13321 System.Enum.GetUnderlyingType to avoid StackOverflow on the
13322 Windows in special cases.
13324 2004-08-26 Marek Safar <marek.safar@seznam.cz>
13326 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
13327 for obtaining also private methods.
13328 (GetRemoveMethod): Used GetRemoveMethod (true)
13329 for obtaining also private methods.
13331 2004-08-24 Martin Baulig <martin@ximian.com>
13333 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
13334 MethodAttributes.HideBySig for operators.
13336 2004-08-23 Martin Baulig <martin@ximian.com>
13338 Back to the old error reporting system :-)
13340 * report.cs (Message): Removed.
13341 (Report.MessageData, ErrorData, WarningData): Removed.
13342 (Report.Error, Warning): Back to the old system.
13344 2004-08-23 Martin Baulig <martin@ximian.com>
13346 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
13348 * class.cs (TypeContainer.ParentContainer): New public virtual
13349 method; replaces the explicit interface implementation.
13350 (ClassPart.ParentContainer): Override.
13352 2004-08-23 Martin Baulig <martin@ximian.com>
13354 * statement.cs (Switch): Added support for constant switches; see
13355 #59428 or test-285.cs.
13357 2004-08-22 Marek Safar <marek.safar@seznam.cz>
13360 * statement.cs (GetEnumeratorFilter): Removed useless
13361 logic because C# specs is strict. GetEnumerator must be
13364 2004-08-22 Martin Baulig <martin@ximian.com>
13366 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
13367 a switch and may break, reset the barrier. Fixes #59867.
13369 2004-08-22 Marek Safar <marek.safar@seznam.cz>
13371 CLS-Compliance speed up (~5% for corlib)
13373 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
13374 New method. Tests container for CLS-Compliant names
13376 * class.cs (TypeContainer.VerifyClsName): New method.
13377 Checks whether container name is CLS Compliant.
13378 (Constructor): Implements IMethodData.
13380 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
13381 low-case table for CLS Compliance test.
13382 (MemberCache.VerifyClsParameterConflict): New method.
13383 Checks method parameters for CS3006 error.
13385 * enum.cs (EnumMember): Is derived from MemberCore.
13386 (Enum.VerifyClsName): Optimized for better performance.
13388 2004-08-06 Marek Safar <marek.safar@seznam.cz>
13390 * report.cs: Renamed Error_T to Error and changed all
13393 2004-08-06 Marek Safar <marek.safar@seznam.cz>
13395 * class.cs (TypeContainer.IndexerArrayList): New inner class
13396 container for indexers.
13397 (TypeContainer.DefaultIndexerName): New constant for default
13398 indexer name. Replaced all "Item" with this constant.
13399 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
13401 * typemanager.cs (TypeManager.default_member_ctor): Cache here
13402 DefaultMemberAttribute constructor.
13404 2004-08-05 Martin Baulig <martin@ximian.com>
13406 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
13409 2004-08-05 Marek Safar <marek.safar@seznam.cz>
13411 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
13412 multi platforms problem.
13414 * compiler.csproj: Included shared files.
13416 2004-08-04 Marek Safar <marek.safar@seznam.cz>
13418 Fix bug 60333, 55971 in the more general way
13419 * attribute.cs (Attribute.GetAttributeArgumentExpression):
13420 Added arg_type argument for constant conversion.
13421 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
13423 2004-08-04 Marek Safar <marek.safar@seznam.cz>
13426 * class.cs (TypeContainer ): New inner classes MethodArrayList,
13427 OperatorArrayList, MethodCoreArrayList for typecontainer
13428 containers. Changed class member types to these new types.
13429 (MethodArrayList.DefineMembers): Added test for CS0659.
13431 2004-08-04 Miguel de Icaza <miguel@ximian.com>
13433 * cfold.cs: Synchronize the folding with the code in expression.cs
13434 Binary.DoNumericPromotions for uint operands.
13436 * attribute.cs: Revert patch from Raja, it introduced a regression
13437 while building Blam-1.2.1 (hard to isolate a test case).
13439 2004-08-04 Marek Safar <marek.safar@seznam.cz>
13443 (TypeContainer.Define): Renamed to DefineContainerMembers because of
13445 (MethodCore.parent_method): New member. The method we're overriding
13446 if this is an override method.
13447 (MethodCore.CheckBase): Moved from Method class and made common.
13448 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
13450 (MethodCore.CheckForDuplications): New abstract method. For custom
13451 member duplication search in a container
13452 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
13453 method and its return type.
13454 (Event.conflict_symbol): New member. Symbol with same name in the
13458 (MemberCache.FindMemberWithSameName): New method. The method
13459 is looking for conflict with inherited symbols.
13461 2004-08-04 Martin Baulig <martin@ximian.com>
13463 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
13465 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
13467 2004-08-03 Marek Safar <marek.safar@seznam.cz>
13469 * report.cs (Message): New enum for better error, warning reference in
13471 (MessageData): New inner abstract class. It generally handles printing of
13472 error and warning messages.
13473 Removed unused Error, Warning, Message methods.
13475 2004-08-03 Marek Safar <marek.safar@seznam.cz>
13477 Fix for cs0592-8.cs test
13479 (Attributable.ValidAttributeTargets): Made public.
13480 (Attribute.ExplicitTarget): New member for explicit target value.
13481 (Attribute.CheckTargets): Now we translate explicit attribute
13482 target to Target here.
13484 2004-08-03 Ben Maurer <bmaurer@ximian.com>
13486 * ecore.cs (MethodGroupExpr): new IsBase property.
13488 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
13490 * delegate.cs (DelegateCreation): store a MethodGroupExpr
13491 rather than an instance expr.
13493 (DelegateCreation.Emit): Use the method group rather than
13494 the instance expression. Also, if you have base.Foo as the
13495 method for a delegate, make sure to emit ldftn, not ldftnvirt.
13497 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
13499 (NewDelegate.DoResolve): Only check for the existance of Invoke
13500 if the method is going to be needed. Use MethodGroupExpr.
13502 (NewDelegate.Emit): Remove, DelegateCreation implements this.
13504 * expression.cs: For pointer arith., make sure to use
13505 the size of the type, not the size of the pointer to
13508 2004-08-03 Marek Safar <marek.safar@seznam.cz>
13511 * class.cs (Class): Added error CS0502 test.
13513 2004-08-03 John Luke <jluke@cfl.rr.com>
13514 Raja R Harinath <rharinath@novell.com>
13517 * attribute.cs (Attribute.complained_before): New flag.
13518 (Attribute.ResolveType, Attribute.Resolve),
13519 (Attribute.DefinePInvokeMethod): Set it.
13520 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
13522 2004-08-03 Martin Baulig <martin@ximian.com>
13524 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
13525 use a user-defined operator; we still need to do numeric
13526 promotions in case one argument is a builtin type and the other
13527 one has an implicit conversion to that type. Fixes #62322.
13529 2004-08-02 Martin Baulig <martin@ximian.com>
13531 * statement.cs (LocalInfo.Flags): Added `IsThis'.
13532 (LocalInfo.IsThis): New public property.
13533 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
13535 2004-08-01 Martin Baulig <martin@ximian.com>
13537 * class.cs (TypeContainer.GetClassBases): Don't set the default
13538 here since we may get called from GetPartialBases().
13539 (TypeContainer.DefineType): If GetClassBases() didn't return a
13540 parent, use the default one.
13542 2004-07-30 Duncan Mak <duncan@ximian.com>
13544 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
13546 2004-07-30 Martin Baulig <martin@ximian.com>
13548 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
13550 * class.cs (SourceMethod): New public class, derive from the
13551 symbol writer's ISourceMethod.
13552 (Method): Use the new symbol writer API.
13554 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
13555 as argument and use the new symbol writer.
13558 (SourceFile): Implement the symbol writer's ISourceFile.
13559 (Location.SymbolDocument): Removed.
13560 (Location.SourceFile): New public property.
13562 * symbolwriter.cs: Use the new symbol writer API.
13564 2004-07-30 Raja R Harinath <rharinath@novell.com>
13566 * Makefile (install-local): Remove. Functionality moved to
13569 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
13571 * Makefile: Install mcs.exe.config file together with mcs.exe.
13572 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
13573 correct runtime version.
13575 2004-07-25 Martin Baulig <martin@ximian.com>
13578 (TypeContainer.RegisterOrder): Removed, this was unused.
13579 (TypeContainer, interface_order): Removed.
13580 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
13581 TypeContainer as argument since we can also be called with a
13582 `PartialContainer' for a partial class/struct/interface.
13583 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
13584 of checking whether we're an `Interface' - we could be a
13585 `PartialContainer'.
13586 (PartialContainer.Register): Override; call
13587 AddClass()/AddStruct()/AddInterface() on our parent.
13589 * cs-parser.jay (interface_member_declaration): Add things to the
13590 `current_container', not the `current_class'.
13592 * rootcontext.cs (RegisterOrder): The overloaded version which
13593 takes an `Interface' was unused, removed.
13595 * typemanager.cs (TypeManager.LookupInterface): Return a
13596 `TypeContainer', not an `Interface'.
13597 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
13598 contain a `PartialContainer' for an interface, so check it's
13599 `Kind' to figure out what it is.
13601 2004-07-25 Martin Baulig <martin@ximian.com>
13603 * class.cs (Class.DefaultTypeAttributes): New public constant.
13604 (Struct.DefaultTypeAttributes): Likewise.
13605 (Interface.DefaultTypeAttributes): Likewise.
13606 (PartialContainer.TypeAttr): Override this and add the
13607 DefaultTypeAttributes.
13609 2004-07-25 Martin Baulig <martin@ximian.com>
13611 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
13612 we can just use the `Parent' field instead.
13614 2004-07-25 Martin Baulig <martin@ximian.com>
13616 * class.cs (TypeContainer.Emit): Renamed to EmitType().
13618 2004-07-25 Martin Baulig <martin@ximian.com>
13620 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
13621 our parts before defining any methods.
13622 (TypeContainer.VerifyImplements): Make this virtual.
13623 (ClassPart.VerifyImplements): Override and call VerifyImplements()
13624 on our PartialContainer.
13626 2004-07-25 Martin Baulig <martin@ximian.com>
13628 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
13630 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
13631 argument, we can just use the `Parent' field instead.
13634 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
13635 (MemberBase.DoDefine): Likewise.
13637 2004-07-24 Martin Baulig <martin@ximian.com>
13639 * decl.cs (MemberCore.Parent): New public field.
13640 (DeclSpace.Parent): Moved to MemberCore.
13642 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
13643 (MemberBase.ctor): Added TypeContainer argument, pass it to our
13645 (FieldBase, Field, Operator): Likewise.
13646 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
13647 (EventField, Event): Likewise.
13649 2004-07-23 Martin Baulig <martin@ximian.com>
13651 * class.cs (PartialContainer): New public class.
13652 (ClassPart): New public class.
13653 (TypeContainer): Added support for partial classes.
13654 (TypeContainer.GetClassBases): Splitted some of the functionality
13655 out into GetNormalBases() and GetPartialBases().
13657 * cs-tokenizer.cs (Token.PARTIAL): New token.
13658 (Tokenizer.consume_identifier): Added some hacks to recognize
13659 `partial', but only if it's immediately followed by `class',
13660 `struct' or `interface'.
13662 * cs-parser.jay: Added support for partial clases.
13664 2004-07-23 Martin Baulig <martin@ximian.com>
13666 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
13667 a `DeclSpace' and also made it readonly.
13668 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
13669 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
13670 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
13672 * cs-parser.jay: Pass the `current_class', not the
13673 `current_container' (at the moment, this is still the same thing)
13674 to a new Method, Property, Event, Indexer or Constructor.
13676 2004-07-23 Martin Baulig <martin@ximian.com>
13678 * cs-parser.jay (CSharpParser): Added a new `current_class' field
13679 and removed the `current_interface' one.
13680 (struct_declaration, class_declaration, interface_declaration):
13681 Set `current_class' to the newly created class/struct/interface;
13682 set their `Bases' and call Register() before parsing their body.
13684 2004-07-23 Martin Baulig <martin@ximian.com>
13686 * class.cs (Kind): New public enum.
13687 (TypeContainer): Made this class abstract.
13688 (TypeContainer.Kind): New public readonly field.
13689 (TypeContainer.CheckDef): New public method; moved here from
13691 (TypeContainer.Register): New public abstract method.
13692 (TypeContainer.GetPendingImplementations): New public abstract
13694 (TypeContainer.GetClassBases): Removed the `is_class' and
13695 `is_iface' parameters.
13696 (TypeContainer.DefineNestedTypes): Formerly known as
13698 (ClassOrStruct): Made this class abstract.
13700 * tree.cs (RootTypes): New public type.
13702 2004-07-20 Martin Baulig <martin@ximian.com>
13704 * tree.cs (Tree.RecordNamespace): Removed.
13705 (Tree.Namespaces): Removed.
13707 * rootcontext.cs (RootContext.IsNamespace): Removed.
13709 * cs-parser.jay (namespace_declaration): Just create a new
13710 NamespaceEntry here.
13712 2004-07-20 Martin Baulig <martin@ximian.com>
13714 * statement.cs (ExceptionStatement): New abstract class. This is
13715 now used as a base class for everyone who's using `finally'.
13716 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
13717 our local variables before using them.
13719 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
13720 virtual method. This is used by Yield.Resolve() to "steal" an
13721 outer block's `finally' clauses.
13722 (FlowBranchingException): The .ctor now takes an ExceptionStatement
13725 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
13726 version which takes an ExceptionStatement. This version must be
13727 used to create exception branchings.
13730 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
13731 (Iterator.EmitMoveNext): Added exception support; protect the
13732 block with a `fault' clause, properly handle 'finally' clauses.
13733 (Iterator.EmitDispose): Run all the `finally' clauses here.
13735 2004-07-20 Martin Baulig <martin@ximian.com>
13737 * iterator.cs: This is the first of a set of changes in the
13738 iterator code. Match the spec more closely: if we're an
13739 IEnumerable, then GetEnumerator() must be called. The first time
13740 GetEnumerator() is called, it returns the current instance; all
13741 subsequent invocations (if any) must create a copy.
13743 2004-07-19 Miguel de Icaza <miguel@ximian.com>
13745 * expression.cs: Resolve the constant expression before returning
13748 2004-07-19 Martin Baulig <martin@ximian.com>
13750 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
13751 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
13752 the return type of the new EmitContext.
13754 2004-07-18 Martin Baulig <martin@ximian.com>
13756 * class.cs (Property.Define): Fix iterators.
13758 * iterators.cs (Iterator.Define): Moved the
13759 `container.AddInterator (this)' call here from the .ctor; only do
13760 it if we resolved successfully.
13762 2004-07-17 Miguel de Icaza <miguel@ximian.com>
13764 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
13765 `true' for preprocessing directives that we parse. The return
13766 value indicates whether we should return to regular tokenizing or
13767 not, not whether it was parsed successfully.
13769 In the past if we were in: #if false ... #line #endif, we would
13770 resume parsing after `#line'. See bug 61604.
13772 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
13773 building: IsEnumType should return true only for enums, not for
13774 enums or System.Enum itself. This fixes #61593.
13776 Likely what happened is that corlib was wrong: mcs depended on
13777 this bug in some places. The bug got fixed, we had to add the
13778 hack, which caused bug 61593.
13780 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
13781 that was a workaround for the older conditions.
13783 2004-07-16 Ben Maurer <bmaurer@ximian.com>
13785 * assign.cs: IAssignMethod has a new interface, as documented
13786 inline. All assignment code now uses this new api.
13788 * ecore.cs, expression.cs: All classes which implement
13789 IAssignMethod now use the new interface.
13791 * expression.cs (Invocation): add a hack to EmitCall so that
13792 IndexerAccess can be the target of a compound assignment without
13793 evaluating its arguments twice.
13795 * statement.cs: Handle changes in Invocation api.
13797 2004-07-16 Martin Baulig <martin@ximian.com>
13799 * iterators.cs: Rewrote this. We're now using one single Proxy
13800 class for both the IEnumerable and the IEnumerator interface and
13801 `Iterator' derives from Class so we can use the high-level API.
13803 * class.cs (TypeContainer.AddIterator): New method.
13804 (TypeContainer.DoDefineType): New protected virtual method, which
13805 is called from DefineType().
13806 (TypeContainer.DoDefineMembers): Call DefineType() and
13807 DefineMembers() on all our iterators.
13808 (TypeContainer.Emit): Call Emit() on all our iterators.
13809 (TypeContainer.CloseType): Call CloseType() on all our iterators.
13811 * codegen.cs (EmitContext.CurrentIterator): New public field.
13813 2004-07-15 Martin Baulig <martin@ximian.com>
13816 (TypeManager.not_supported_exception_type): New type.
13818 2004-07-14 Martin Baulig <martin@ximian.com>
13820 * iterators.cs: Use real error numbers.
13822 2004-07-14 Martin Baulig <martin@ximian.com>
13824 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
13825 requires this to be a System.Collection.IEnumerable and not a
13826 class implementing that interface.
13827 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
13829 2004-07-13 Marek Safar <marek.safar@seznam.cz>
13831 * class.cs: Fixed previous fix, it broke some error tests.
13833 2004-07-12 Martin Baulig <martin@ximian.com>
13835 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
13838 2004-07-09 Miguel de Icaza <miguel@ximian.com>
13840 * assign.cs (LocalTemporary): Add new argument: is_address,If
13841 `is_address' is true, then the value that we store is the address
13842 to the real value, and not the value itself.
13844 * ecore.cs (PropertyExpr): use the new local temporary
13845 stuff to allow us to handle X.Y += z (where X is a struct)
13847 2004-07-08 Martin Baulig <martin@ximian.com>
13849 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
13850 not always return, just like we're doing in Using.Resolve().
13852 2004-07-07 Miguel de Icaza <miguel@ximian.com>
13854 * cs-parser.jay (fixed_statement): flag this as Pinned.
13856 2004-07-06 Miguel de Icaza <miguel@ximian.com>
13858 * typemanager.cs (TypeManager): Removed MakePinned method, this
13859 mechanism is replaced with the .NET 2.x compatible mechanism of
13860 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
13862 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
13863 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
13864 `IsFixed' property which has a different meaning.
13866 2004-07-02 Raja R Harinath <rharinath@novell.com>
13868 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
13869 visible from inside a nested class, not just the names of the
13870 immediately enclosing class.
13871 Fix for bug #60730.
13873 2004-06-24 Raja R Harinath <rharinath@novell.com>
13875 * expression.cs (BetterConversion): Remove buggy special-case
13876 handling of "implicit constant expression conversions". At this
13877 point, we already know that the conversion is possible -- we're
13878 only checking to see which is better.
13880 2004-06-24 Marek Safar <marek.safar@seznam.cz>
13882 * cs-parser.jay: Added error CS0210 test.
13884 2004-06-24 Marek Safar <marek.safar@seznam.cz>
13886 * cs-parser.jay: Added error CS0134 test.
13888 2004-06-24 Marek Safar <marek.safar@seznam.cz>
13891 * cs-parser.jay: Added error CS0145 test.
13893 2004-06-24 Marek Safar <marek.safar@seznam.cz>
13895 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
13897 2004-06-23 Ben Maurer <bmaurer@ximian.com>
13899 * expression.cs (StackAlloc.Resolve): The argument may not
13900 be a constant; deal with this case.
13902 2004-06-23 Marek Safar <marek.safar@seznam.cz>
13904 * attribute.cs (IndexerName_GetIndexerName): Renamed to
13905 GetIndexerAttributeValue.
13906 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
13908 * class.cs (Indexer.Define): Added error tests for CS0415,
13911 2004-06-23 Miguel de Icaza <miguel@ximian.com>
13913 * attribute.cs (Attribute.Resolve): Keep field code in sync with
13916 2004-06-23 Martin Baulig <martin@ximian.com>
13918 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
13919 neither return nor throw, reset the barrier as well. Fixes #60457.
13921 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
13923 * class.cs : EventAttributes is now set to None by default.
13924 This fixes bug #60459.
13926 2004-06-18 Marek Safar <marek.safar@seznam.cz>
13929 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
13930 Don't throw exception but return null (it's sufficient now).
13932 2004-06-18 Marek Safar <marek.safar@seznam.cz>
13934 * typemanager.cs (GetArgumentTypes): Faster implementation.
13936 2004-06-18 Martin Baulig <martin@ximian.com>
13938 * attribute.cs (Attribute.Resolve): Check whether we're an
13939 EmptyCast which a Constant child. Fixes #60333.
13941 2004-06-17 Ben Maurer <bmaurer@ximian.com>
13943 * statement.cs (EmitCollectionForeach): Account for the fact that
13944 not all valuetypes are in areas which we can take the address of.
13945 For these variables, we store to a temporary variable. Also, make
13946 sure that we dont emit a `callvirt' on a valuetype method.
13948 2004-06-15 Marek Safar <marek.safar@seznam.cz>
13950 * expression.cs (StackAlloc.DoReSolve): Added test for
13951 negative parameter (CS0247).
13953 2004-06-15 Marek Safar <marek.safar@seznam.cz>
13956 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
13958 2004-06-15 Marek Safar <marek.safar@seznam.cz>
13961 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
13964 2004-06-14 Marek Safar <marek.safar@seznam.cz>
13966 Fix bug #58254 & cs1555.cs, cs1556.cs
13967 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
13969 2004-06-14 Marek Safar <marek.safar@seznam.cz>
13971 * cs-parser.jay: Added error CS1669 test for indexers.
13973 2004-06-11 Martin Baulig <martin@ximian.com>
13975 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
13976 call this twice: for params and varargs methods.
13978 2004-06-11 Marek Safar <marek.safar@seznam.cz>
13981 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
13983 2004-06-11 Marek Safar <marek.safar@seznam.cz>
13985 * attribute.cs (Attribute.GetValidTargets): Made public.
13988 (AbstractPropertyEventMethod): New class for better code sharing.
13989 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
13991 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
13993 2004-06-11 Raja R Harinath <rharinath@novell.com>
13996 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
13997 that the call to Resolve is part of a MemberAccess.
13998 (Expression.Resolve): Use it for SimpleName resolution.
13999 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
14000 Add 'intermediate' boolean argument.
14001 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
14002 error message when the SimpleName can be resolved ambiguously
14003 between an expression and a type.
14004 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
14006 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
14007 call on the left-side.
14009 2004-06-11 Marek Safar <marek.safar@seznam.cz>
14012 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
14014 2004-06-11 Marek Safar <marek.safar@seznam.cz>
14016 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
14018 2004-06-11 Martin Baulig <martin@ximian.com>
14020 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
14021 varargs methods if applicable.
14023 2004-06-11 Martin Baulig <martin@ximian.com>
14025 * expression.cs (Invocation.EmitCall): Don't use
14026 `method.CallingConvention == CallingConventions.VarArgs' since the
14027 method could also have `CallingConventions.HasThis'.
14029 2004-06-11 Marek Safar <marek.safar@seznam.cz>
14031 * class.cs (Event.GetSignatureForError): Implemented.
14032 Fixed crash in error test cs3010.cs
14034 2004-06-10 Miguel de Icaza <miguel@ximian.com>
14036 * cs-tokenizer.cs: Change the way we track __arglist to be
14037 consistent with the other keywords.
14039 2004-06-09 Miguel de Icaza <miguel@ximian.com>
14041 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
14044 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
14046 * codegen.cs: Check that all referenced assemblies have a strongname
14047 before strongnaming the compiled assembly. If not report error CS1577.
14048 Fix bug #56563. Patch by Jackson Harper.
14049 * typemanager.cs: Added a method to return all referenced assemblies.
14050 Fix bug #56563. Patch by Jackson Harper.
14052 2004-06-08 Marek Safar <marek.safar@seznam.cz>
14055 (Method.ApplyAttributeBuilder): Moved and added conditional
14056 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
14059 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
14061 2004-06-08 Marek Safar <marek.safar@seznam.cz>
14064 * class.cs: (EventField.attribute_targets): Changed default target.
14066 2004-06-08 Martin Baulig <martin@ximian.com>
14068 * expression.cs (Invocation.EmitCall): Enable varargs methods.
14070 2004-06-08 Martin Baulig <martin@ximian.com>
14072 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
14074 2004-06-07 Martin Baulig <martin@ximian.com>
14076 Added support for varargs methods.
14078 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
14081 * cs-parser.jay: Added support for `__arglist'.
14083 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
14085 * expression.cs (Argument.AType): Added `ArgList'.
14086 (Invocation): Added support for varargs methods.
14087 (ArglistAccess): New public class.
14088 (Arglist): New public class.
14090 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
14092 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
14093 a method's top-level block if the method has varargs.
14095 * support.cs (ReflectionParameters, InternalParameters): Added
14096 support for varargs methods.
14098 2004-06-07 Miguel de Icaza <miguel@ximian.com>
14100 * class.cs: Provide location in indexer error report.
14102 * driver.cs: Use standard names.
14104 * namespace.cs: Catch the use of using after a namespace has been
14105 declared also on using aliases.
14107 2004-06-03 Raja R Harinath <rharinath@novell.com>
14110 * typemanager.cs (closure_private_ok, closure_invocation_type)
14111 (closure_qualifier_type, closure_invocation_assembly)
14112 (FilterWithClosure): Move to ...
14113 (Closure): New internal nested class.
14114 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
14115 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
14116 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
14117 (MemberLookup, MemberLookupFailed): Use it.
14118 * expression.cs (New.DoResolve): Treat the lookup for the
14119 constructor as being qualified by the 'new'ed type.
14120 (Indexers.GetIndexersForTypeOrInterface): Update.
14122 2004-06-03 Marek Safar <marek.safar@seznam.cz>
14125 (GetConditionalAttributeValue): New method. Returns
14126 condition of ConditionalAttribute.
14127 (SearchMulti): New method. Returns all attributes of type 't'.
14128 Use it when attribute is AllowMultiple = true.
14129 (IsConditionalMethodExcluded): New method.
14132 (Method.IsExcluded): Implemented. Returns true if method has conditional
14133 attribute and the conditions is not defined (method is excluded).
14134 (IMethodData): Extended interface for ConditionalAttribute support.
14135 (PropertyMethod.IsExcluded): Implemented.
14138 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
14141 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
14144 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
14146 * expression.cs (ArrayCreationExpression): Make this just an
14147 `expression'. It can't be a statement, so the code here was
14150 2004-06-02 Marek Safar <marek.safar@seznam.cz>
14153 * typemanager.cs (GetFullNameSignature): New method for
14156 2004-06-02 Marek Safar <marek.safar@seznam.cz>
14159 * class.cs (MemberBase.GetSignatureForError): New virtual method.
14160 Use this method when MethodBuilder is null.
14161 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
14162 Added test for error CS0626 (MONO reports error for this situation).
14163 (IMethodData.GetSignatureForError): Extended interface.
14165 2004-06-01 Marek Safar <marek.safar@seznam.cz>
14168 (AttributeTester.GetObsoleteAttribute): Returns instance of
14169 ObsoleteAttribute when type is obsolete.
14172 (TypeContainer.VerifyObsoleteAttribute): Override.
14173 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
14174 (MethodCode.VerifyObsoleteAttribute): Override.
14175 (MemberBase.VerifyObsoleteAttribute): Override.
14178 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
14179 and report proper error.
14182 Delegate.VerifyObsoleteAttribute): Override.
14185 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
14186 and report proper error.
14187 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
14190 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
14194 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
14195 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
14196 Added test for ObsoleteAttribute.
14199 (Catch): Derived from Statement.
14201 2004-06-01 Marek Safar <marek.safar@seznam.cz>
14203 Fixed bug #59071 & cs0160.cs
14205 * statement.cs (Try.Resolve): Check here whether order of catch
14206 clauses matches their dependencies.
14208 2004-05-31 Miguel de Icaza <miguel@ximian.com>
14210 * Reverted patch to namespace.cs (Use lookuptypedirect). This
14211 caused a regression: #59343. Referencing nested classes from an
14212 assembly stopped working.
14214 2004-05-31 Martin Baulig <martin@ximian.com>
14216 MCS is now frozen for beta 2.
14218 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
14220 * convert.cs: add a trivial cache for overload operator resolution.
14222 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
14224 * decl.cs: If possible, use lookuptypedirect here. We can only do
14225 this if there is no `.' after the namespace. Avoids using
14226 LookupType, which does lots of slow processing.
14227 (FindNestedType) New method, does what it says :-).
14228 * namespace.cs: use LookupTypeDirect.
14229 * rootcontext.cs: use membercache, if possible.
14230 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
14232 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
14235 According to the spec,
14237 In a member access of the form E.I, if E is a single identifier,
14238 and if the meaning of E as a simple-name (§7.5.2) is a constant,
14239 field, property, localvariable, or parameter with the same type as
14240 the meaning of E as a type-name (§3.8), then both possible
14241 meanings of E are permitted.
14243 We did not check that E as a simple-name had the same type as E as
14246 This trivial check gives us 5-7% on bootstrap time.
14248 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
14250 * expression.cs (Invocation.OverloadResolve): Avoid the
14251 use of hashtables and boxing here by allocating on demand.
14253 2004-05-30 Martin Baulig <martin@ximian.com>
14255 * rootcontext.cs (RootContext.LookupType): Don't cache things if
14256 we're doing a silent lookup. Don't try to lookup nested types in
14257 TypeManager.object_type (thanks to Ben Maurer).
14259 2004-05-30 Martin Baulig <martin@ximian.com>
14261 Committing a patch from Ben Maurer.
14263 * rootcontext.cs (RootContext.LookupType): Cache negative results.
14265 2004-05-29 Martin Baulig <martin@ximian.com>
14267 * class.cs (IMethodData.ShouldIgnore): New method.
14269 * typemanager.cs (TypeManager.MethodFlags): Don't take a
14270 `Location' argument, we don't need it anywhere. Use
14271 `IMethodData.ShouldIgnore ()' instead of
14272 `MethodData.GetMethodFlags ()'.
14273 (TypeManager.AddMethod): Removed.
14274 (TypeManager.AddMethod2): Renamed to AddMethod.
14276 2004-05-29 Martin Baulig <martin@ximian.com>
14278 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
14280 * convert.cs (Convert.ImplicitReferenceConversion): If we're
14281 converting from a class type S to an interface type and we already
14282 have an object on the stack, don't box it again. Fixes #52578.
14284 2004-05-29 Martin Baulig <martin@ximian.com>
14286 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
14287 Added support for `params' parameters. Fixes #59267.
14289 2004-05-29 Martin Baulig <martin@ximian.com>
14291 * literal.cs (NullPointer): Provide a private .ctor which sets
14292 `type' to TypeManager.object_type. Fixes #59048.
14294 2004-05-29 Martin Baulig <martin@ximian.com>
14296 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
14297 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
14299 * ecore.cs (EventExpr.instance_expr): Make the field private.
14301 2004-05-26 Marek Safar <marek.safar@seznam.cz>
14303 Fixed bug #50080 & cs0214-2.cs
14304 * expression.cs (Cast.DoResolve): Check unsafe context here.
14306 * statement.cs (Resolve.DoResolve): Likewise.
14308 2004-05-26 Martin Baulig <martin@ximian.com>
14310 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
14312 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
14313 (RootContext.LookupType): Pass down the `silent' flag.
14315 2004-05-25 Martin Baulig <martin@ximian.com>
14318 (MethodGroupExpr.IdenticalTypeName): New public property.
14319 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
14320 expression actually refers to a type.
14322 2004-05-25 Martin Baulig <martin@ximian.com>
14324 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
14325 for #56176 and made it actually work.
14327 2004-05-25 Martin Baulig <martin@ximian.com>
14329 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
14330 (FieldExpr, PropertyExpr): Override and implement
14331 CacheTemporaries. Fixes #52279.
14333 2004-05-25 Miguel de Icaza <miguel@ximian.com>
14335 * location.cs: In the new compiler listing a file twice is a
14336 warning, not an error.
14338 2004-05-24 Martin Baulig <martin@ximian.com>
14340 * enum.cs (Enum.DefineType): For the `BaseType' to be a
14341 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
14343 2004-05-24 Martin Baulig <martin@ximian.com>
14345 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
14346 walking the `using' list. Fixes #53921.
14348 2004-05-24 Martin Baulig <martin@ximian.com>
14350 * const.cs (Const.LookupConstantValue): Added support for
14351 EmptyCast's; fixes #55251.
14353 2004-05-24 Martin Baulig <martin@ximian.com>
14355 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
14356 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
14357 which does the CS0135 check. The reason is that we first need to
14358 check whether the variable actually exists.
14360 2004-05-24 Martin Baulig <martin@ximian.com>
14362 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
14363 than RootContext.LookupType() to find the explicit interface
14364 type. Fixes #58584.
14366 2004-05-24 Raja R Harinath <rharinath@novell.com>
14368 * Makefile: Simplify. Use executable.make.
14369 * mcs.exe.sources: New file. List of sources of mcs.exe.
14371 2004-05-24 Anders Carlsson <andersca@gnome.org>
14375 Use the invariant culture when doing String.Compare for CLS case
14378 2004-05-23 Martin Baulig <martin@ximian.com>
14380 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
14381 don't have any dots. Fixes #52622, added cs0246-8.cs.
14383 * namespace.cs (NamespaceEntry.Lookup): Likewise.
14385 2004-05-23 Marek Safar <marek.safar@seznam.cz>
14387 * class.cs (MemberBase.Define): Reuse MemberType member for
14388 resolved type. Other methods can use it too.
14390 2004-05-23 Martin Baulig <martin@ximian.com>
14392 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
14393 the variable also exists in the current block (otherwise, we need
14394 to report a CS0103). Fixes #58670.
14396 2004-05-23 Martin Baulig <martin@ximian.com>
14398 * flowanalysis.cs (Reachability.Reachable): Compute this
14399 on-the-fly rather than storing it as a field.
14401 2004-05-23 Martin Baulig <martin@ximian.com>
14403 * flowanalysis.cs (Reachability.And): Manually compute the
14404 resulting `barrier' from the reachability.
14406 2004-05-23 Marek Safar <marek.safar@seznam.cz>
14409 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
14410 instance of ObsoleteAttribute when symbol is obsolete.
14413 (IMethodData): Extended interface for ObsoleteAttribute support.
14415 2004-05-22 Marek Safar <marek.safar@seznam.cz>
14417 * attribute.cs: Fix bug #55970
14419 2004-05-22 Marek Safar <marek.safar@seznam.cz>
14423 (GetObsoleteAttribute): New method. Creates the instance of
14425 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
14426 ObsoleteAttribute when member is obsolete.
14427 (AttributeTester.Report_ObsoleteMessage): Common method for
14428 Obsolete error/warning reporting.
14431 (TypeContainer.base_classs_type): New member for storing parent type.
14434 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
14435 for this MemberCore.
14437 2004-05-21 Marek Safar <marek.safar@seznam.cz>
14439 * attribute.cs, const.cs: Fix bug #58590
14441 2004-05-21 Martin Baulig <martin@ximian.com>
14443 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
14444 out parameters if the end of the method is unreachable. Fixes
14447 2004-05-21 Marek Safar <marek.safar@seznam.cz>
14449 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
14450 Hari was right, why extra method.
14452 2004-05-21 Marek Safar <marek.safar@seznam.cz>
14454 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
14456 2004-05-20 Martin Baulig <martin@ximian.com>
14458 Merged this back from gmcs to keep the differences to a minumum.
14460 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
14461 instead of a Declspace.
14462 (Attribute.ResolveType): Likewise.
14463 (Attributes.Search): Likewise.
14464 (Attributes.Contains): Likewise.
14465 (Attributes.GetClsCompliantAttribute): Likewise.
14467 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
14469 (MethodData.ApplyAttributes): Take an EmitContext instead of a
14472 2004-05-19 Marek Safar <marek.safar@seznam.cz>
14474 Fix bug #58688 (MCS does not report error when the same attribute
14477 * attribute.cs (Attribute.Emit): Distinction between null and default.
14479 2004-05-19 Raja R Harinath <rharinath@novell.com>
14481 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
14482 of a top-level attribute without an attribute target.
14483 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
14485 (Attribute.Conditional_GetConditionName),
14486 (Attribute.Obsolete_GetObsoleteMessage): Update.
14487 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
14488 part of ScanForIndexerName.
14489 (Attribute.CanIgnoreInvalidAttribute): New function.
14490 (Attribute.ScanForIndexerName): Move to ...
14491 (Attributes.ScanForIndexerName): ... here.
14492 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
14493 (Attributes.Search): New internal variant that can choose not to
14494 complain if types aren't resolved. The original signature now
14496 (Attributes.GetClsCompliantAttribute): Use internal variant, with
14497 complaints suppressed.
14498 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
14499 only if it not useful.
14500 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
14501 top-level for attributes that are shared between the assembly
14502 and a top-level class.
14503 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
14504 * class.cs: Update to reflect changes.
14505 (DefineIndexers): Fuse loops.
14506 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
14507 a couple more variants of attribute names.
14509 2004-05-18 Marek Safar <marek.safar@seznam.cz>
14511 Fix bug #52585 (Implemented explicit attribute declaration)
14514 (Attributable.ValidAttributeTargets): New abstract method. It gets
14515 list of valid attribute targets for explicit target declaration.
14516 (Attribute.Target): It holds target itself.
14517 (AttributeSection): Removed.
14518 (Attribute.CheckTargets): New method. It checks whether attribute
14519 target is valid for the current element.
14522 (EventProperty): New class. For events that are declared like
14523 property (with add and remove accessors).
14524 (EventField): New class. For events that are declared like field.
14527 * cs-parser.jay: Implemented explicit attribute target declaration.
14529 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
14530 Override ValidAttributeTargets.
14533 (ReturnParameter): Class for applying custom attributes on
14535 (ParameterAtribute): New class. Class for applying custom
14536 attributes on the parameter type.
14538 2004-05-17 Miguel de Icaza <miguel@ximian.com>
14540 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
14543 (Method): Allow UNSAFE here.
14545 * modifiers.cs: Support unsafe reporting.
14547 2004-05-17 Marek Safar <marek.safar@seznam.cz>
14549 * decl.cs: Fix bug #58478.
14551 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14553 * statement.cs: When checking for unreachable code on an EmptyStatement,
14554 set the location. Fixes bug #58488.
14556 2004-05-13 Miguel de Icaza <miguel@ximian.com>
14558 * driver.cs: Add -pkg handling.
14560 From Gonzalo: UseShelLExecute=false
14562 2004-05-12 Marek Safar <marek.safar@seznam.cz>
14565 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
14567 (Attribute.IsClsCompliaceRequired): Moved to base for better
14569 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
14570 when attribute is AttributeUsageAttribute.
14571 (Attribute.GetValidTargets): Simplified.
14572 (Attribute.GetAttributeUsage): New method returns AttributeUsage
14573 attribute for this type.
14574 (Attribute.ApplyAttributes): Method renamed to Emit and make
14576 (GlobalAttributeSection): New class for special handling of global
14577 attributes (assembly, module).
14578 (AttributeSection.Emit): New method.
14580 * class.cs: Implemented Attributable abstract methods.
14581 (MethodCore.LabelParameters): Moved to Parameter class.
14582 (Accessor): Is back simple class.
14583 (PropertyMethod): Implemented Attributable abstract class.
14584 (DelegateMethod): Implemented Attributable abstract class.
14585 (Event): New constructor for disctintion between normal Event
14586 and Event with accessors.
14588 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
14590 * codegen.cs, const.cs, decl.cs, delegate.cs:
14591 (CommonAssemblyModulClass): Implemented Attributable abstract class
14594 * enum.cs: Implement IAttributeSupport interface.
14595 (EnumMember): New class for emum members. Implemented Attributable
14599 (ParameterBase): Is abstract.
14600 (ReturnParameter): New class for easier [return:] attribute handling.
14602 * typemanager.cs: Removed builder_to_attr.
14604 2004-05-11 Raja R Harinath <rharinath@novell.com>
14607 * attribute.cs (Attribute.GetPositionalValue): New function.
14608 * class.cs (TypeContainer.VerifyMembers): New function.
14609 (TypeContainer.Emit): Use it.
14610 (ClassOrStruct): New base class for Class and Struct.
14611 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
14612 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
14614 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
14615 then each non-static field should have a FieldOffset attribute.
14616 Otherwise, none of the fields should have a FieldOffset attribute.
14617 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
14618 and FieldOffset attributes.
14619 * typemanager.cs (TypeManager.struct_layout_attribute_type)
14620 (TypeManager.field_offset_attribute_type): New core types.
14621 (TypeManager.InitCoreTypes): Initialize them.
14623 2004-05-11 Michal Moskal <malekith@pld-linux.org>
14625 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
14626 Return correct type.
14629 2004-05-09 Miguel de Icaza <miguel@ximian.com>
14631 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
14632 be implicitly converted to ulong.
14634 * expression.cs: The logic for allowing operator &, | and ^ worked
14635 was wrong, it worked before because we did not report an error in
14636 an else branch. Fixes 57895.
14638 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
14639 allow volatile fields to be reference types.
14641 2004-05-07 Miguel de Icaza <miguel@ximian.com>
14643 * driver.cs: Add support for /debug-
14645 2004-05-07 Raja R Harinath <rharinath@novell.com>
14647 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
14648 Add a 'complain' parameter to silence errors.
14649 (Attribute.Resolve): Update to changes. Put in sanity check to catch
14650 silently overlooked type-resolutions.
14651 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
14652 to reflect changes.
14653 (Attributes.Search): New function.
14654 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
14655 (Attributes.GetAttributeFullName): Remove hack.
14656 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
14657 Update to reflect changes.
14658 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
14659 Use Attributes.Search instead of nested loops.
14661 2004-05-07 Marek Safar <marek.safar@seznam.cz>
14664 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
14665 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
14666 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
14668 * report.cs: (Report.Warning): Renamed to Warning_T because of
14669 parameter collision.
14671 2004-05-05 Raja R Harinath <rharinath@novell.com>
14673 * expression.cs (MemberAccess.ResolveMemberAccess):
14674 Exit with non-zero status after Report.Error.
14675 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
14677 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
14679 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
14681 * support.cs: Don't hang when the file is empty.
14683 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
14685 * support.cs: In SeekableStreamReader, compute the preamble size of the
14686 underlying stream. Position changes should take into account that initial
14689 2004-05-03 Todd Berman <tberman@sevenl.net>
14691 * driver.cs: remove unused GetSysVersion function.
14693 2004-05-03 Todd Berman <tberman@sevenl.net>
14695 * driver.cs: Remove the hack from saturday, as well as the hack
14696 from jackson (LoadAssemblyFromGac), also adds the CWD to the
14697 link_paths to get that bit proper.
14699 2004-05-01 Todd Berman <tberman@sevenl.net>
14701 * driver.cs: Try a LoadFrom before a Load, this checks the current
14702 path. This is currently a bug in mono that is be fixed, however, this
14703 provides a workaround for now. This will be removed when the bug
14706 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
14708 * CryptoConvert.cs: Updated to latest version. Fix issue with
14709 incomplete key pairs (#57941).
14711 2004-05-01 Todd Berman <tberman@sevenl.net>
14713 * driver.cs: Remove '.' from path_chars, now System.* loads properly
14716 2004-04-30 Jackson Harper <jackson@ximian.com>
14718 * codegen.cs: Open keys readonly.
14720 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14722 * typemanager.cs: don't report cyclic struct layout when a struct
14723 contains 2 or more fields of the same type. Failed for Pango.AttrShape
14724 which has 2 Pango.Rectangle fields.
14726 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
14728 * expression.cs: Handle IntPtr comparisons with IL code
14729 rather than a method call.
14731 2004-04-29 Martin Baulig <martin@ximian.com>
14733 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
14734 the list of PropertyInfo's in class hierarchy and find the
14735 accessor. Fixes #56013.
14737 2004-04-29 Martin Baulig <martin@ximian.com>
14739 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
14741 2004-04-29 Martin Baulig <martin@ximian.com>
14743 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
14745 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
14747 2004-04-29 Martin Baulig <martin@ximian.com>
14749 * class.cs (ConstructorInitializer.Resolve): Check whether the
14750 parent .ctor is accessible. Fixes #52146.
14752 2004-04-29 Martin Baulig <martin@ximian.com>
14754 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
14756 * statement.cs (Using.EmitLocalVariableDecls): Use
14757 TypeManager.idisposable_type, not typeof (IDisposable).
14758 (Foreach.EmitCollectionForeach): Added support for valuetypes.
14760 2004-04-29 Martin Baulig <martin@ximian.com>
14762 * class.cs (Event.Define): Don't emit the field and don't set
14763 RTSpecialName and SpecialName for events on interfaces. Fixes
14766 2004-04-29 Raja R Harinath <rharinath@novell.com>
14768 Refactor Attribute.ApplyAttributes.
14769 * attribute.cs (Attributable): New base class for objects that can
14770 have Attributes applied on them.
14771 (Attribute): Make AttributeUsage fields public.
14772 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
14773 (Attribute.IsInternalCall): New property.
14774 (Attribute.UsageAttr): Convert to a public read-only property.
14775 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
14776 (Attribute.ResolveType, Attribute.Resolve)
14777 (Attribute.ScanForIndexerName): Update to reflect changes.
14778 (Attribute.CheckAttributeTarget): Re-format.
14779 (Attribute.ApplyAttributes): Refactor, to various
14780 Attributable.ApplyAttributeBuilder methods.
14781 * decl.cs (MemberCore): Make Attributable.
14782 * class.cs (Accessor): Make Attributable.
14783 (MethodData.ApplyAttributes): Use proper attribute types, not
14785 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
14786 (TypeContainer.ApplyAttributeBuilder)
14787 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
14788 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
14789 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
14790 (Operator.ApplyAttributeBuilder): New factored-out methods.
14791 * const.cs (Const.ApplyAttributeBuilder): Likewise.
14792 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
14793 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
14794 * parameter.cs (ParameterBase): New Attributable base class
14795 that can also represent Return types.
14796 (Parameter): Update to the changes.
14798 2004-04-29 Jackson Harper <jackson@ximian.com>
14800 * driver.cs: Prefer the corlib system version when looking for
14801 assemblies in the GAC. This is still a hack, but its a better hack
14804 2004-04-29 Marek Safar <marek.safar@seznam.cz>
14806 * decl.cs, enum.cs: Improved error 3005 reporting.
14808 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
14809 (related_symbols): New private member for list of symbols
14810 related to reported error/warning.
14812 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
14814 2004-04-29 Martin Baulig <martin@ximian.com>
14816 * ecore.cs (Expression.Constantify): If we're an enum and
14817 TypeManager.TypeToCoreType() doesn't give us another type, use
14818 t.UnderlyingSystemType. Fixes #56178.
14820 2004-04-29 Martin Baulig <martin@ximian.com>
14822 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
14823 interfaces and for each interface, only add members directly
14824 declared in that interface. Fixes #53255.
14826 2004-04-28 Martin Baulig <martin@ximian.com>
14828 * expression.cs (ConditionalLogicalOperator): Use a temporary
14829 variable for `left' to avoid that we evaluate it more than once;
14832 2004-04-28 Martin Baulig <martin@ximian.com>
14834 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
14837 2004-04-28 Martin Baulig <martin@ximian.com>
14839 * statement.cs (LocalInfo.Resolve): Check whether the type is not
14842 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
14843 whether the type is not void (CS1547).
14845 2004-04-28 Martin Baulig <martin@ximian.com>
14847 * expression.cs (Unary.DoResolveLValue): Override this and report
14848 CS0131 for anything but Operator.Indirection.
14850 2004-04-28 Martin Baulig <martin@ximian.com>
14852 Committing a patch from Ben Maurer; see bug #50820.
14854 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
14857 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
14860 2004-04-28 Martin Baulig <martin@ximian.com>
14862 Committing a patch from Ben Maurer; see bug #50820.
14864 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
14867 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
14870 2004-04-28 Martin Baulig <martin@ximian.com>
14872 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
14873 (Block.AddLabel): Call DoLookupLabel() to only search in the
14876 2004-04-28 Martin Baulig <martin@ximian.com>
14878 * cfold.cs (ConstantFold.BinaryFold): Added special support for
14879 comparing StringConstants and NullLiterals in Equality and Inequality.
14881 2004-04-28 Jackson Harper <jackson@ximian.com>
14883 * driver.cs: Attempt to load referenced assemblies from the
14884 GAC. This is the quick and dirty version of this method that
14885 doesnt take into account versions and just takes the first
14886 canidate found. Will be good enough for now as we will not have more
14887 then one version installed into the GAC until I update this method.
14889 2004-04-28 Martin Baulig <martin@ximian.com>
14891 * typemanager.cs (TypeManager.CheckStructCycles): New public
14892 static method to check for cycles in the struct layout.
14894 * rootcontext.cs (RootContext.PopulateTypes): Call
14895 TypeManager.CheckStructCycles() for each TypeContainer.
14896 [Note: We only need to visit each type once.]
14898 2004-04-28 Martin Baulig <martin@ximian.com>
14900 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
14902 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
14903 success and added `out object value'. Use a `bool resolved' field
14904 to check whether we've already been called rather than
14905 `ConstantValue != null' since this breaks for NullLiterals.
14907 2004-04-28 Raja R Harinath <rharinath@novell.com>
14909 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
14910 setting of this flag, since the 'set' method may be non-public.
14912 2004-04-28 Raja R Harinath <rharinath@novell.com>
14914 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
14915 check on current_vector.Block.
14917 2004-04-27 Martin Baulig <martin@ximian.com>
14919 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
14920 a field initializer. Fixes #56459.
14922 2004-04-27 Martin Baulig <martin@ximian.com>
14924 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
14925 we're not attempting to use an indexer. Fixes #52154.
14927 2004-04-27 Martin Baulig <martin@ximian.com>
14929 * statement.cs (Return): Don't create a return label if we don't
14930 need it; reverts my change from January 20th. Thanks to Ben
14933 2004-04-27 Martin Baulig <martin@ximian.com>
14935 According to the spec, `goto' can only leave a nested scope, but
14938 * statement.cs (Block.LookupLabel): Only lookup in the current
14939 block, don't recurse into parent or child blocks.
14940 (Block.AddLabel): Check in parent and child blocks, report
14941 CS0140/CS0158 if we find a duplicate.
14942 (Block): Removed this indexer for label lookups.
14943 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
14944 this already does the error reporting for us.
14947 (FlowBranching.UsageVector.Block): New public variable; may be null.
14948 (FlowBranching.CreateSibling): Added `Block' argument.
14949 (FlowBranching.LookupLabel): New public virtual method. Lookup a
14950 label for the target of a `goto' and check whether we're not
14951 leaving a `finally'.
14953 2004-04-27 Martin Baulig <martin@ximian.com>
14955 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
14956 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
14959 2004-04-27 Martin Baulig <martin@ximian.com>
14961 * statement.cs (Block.AddLabel): Also check for implicit blocks
14962 and added a CS0158 check.
14964 2004-04-27 Martin Baulig <martin@ximian.com>
14966 * flowanalysis.cs (FlowBranchingLoop): New class.
14967 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
14968 UsageVector's instead of an ArrayList.
14969 (FlowBranching.Label): Likewise.
14970 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
14971 (FlowBranching.AddBreakVector): New method.
14973 2004-04-27 Miguel de Icaza <miguel@ximian.com>
14975 * attribute.cs: Small regression fix: only convert the type if we
14976 the type is different, fixes System.Drawing build.
14978 2004-04-27 Martin Baulig <martin@ximian.com>
14980 * attribute.cs (Attribute.Resolve): If we have a constant value
14981 for a named field or property, implicity convert it to the correct
14984 2004-04-27 Raja R Harinath <rharinath@novell.com>
14986 * statement.cs (Block.Block): Implicit blocks share
14987 'child_variable_names' fields with parent blocks.
14988 (Block.AddChildVariableNames): Remove.
14989 (Block.AddVariable): Mark variable as "used by a child block" in
14990 every surrounding block.
14991 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
14992 been used in a child block, complain about violation of "Invariant
14993 meaning in blocks" rule.
14994 * cs-parser.jay (declare_local_variables): Don't use
14995 AddChildVariableNames.
14996 (foreach_statement): Don't create an implicit block: 'foreach'
14997 introduces a scope.
14999 2004-04-23 Miguel de Icaza <miguel@ximian.com>
15001 * convert.cs (ImplicitNumericConversion): 0 is also positive when
15002 converting from 0L to ulong. Fixes 57522.
15004 2004-04-22 Marek Safar <marek.safar@seznam.cz>
15006 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
15007 derived class hides via 'new' keyword field from base class (test-242.cs).
15008 TODO: Handle this in the more general way.
15010 * class.cs (CheckBase): Ditto.
15012 2004-04-22 Marek Safar <marek.safar@seznam.cz>
15014 * decl.cs (caching_flags): New member for storing cached values
15016 (MemberCore.Flags): New enum where bit flags for caching_flags
15018 (MemberCore.cls_compliance): Moved to caching_flags.
15019 (DeclSpace.Created): Moved to caching_flags.
15021 * class.cs: Use caching_flags instead of DeclSpace.Created
15023 2004-04-21 Miguel de Icaza <miguel@ximian.com>
15025 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
15026 if we are only a derived class, not a nested class.
15028 * typemanager.cs: Same as above, but do this at the MemberLookup
15029 level (used by field and methods, properties are handled in
15030 PropertyExpr). Allow for the qualified access if we are a nested
15033 2004-04-21 Marek Safar <marek.safar@seznam.cz>
15035 * class.cs: Refactoring.
15036 (IMethodData): New inteface; Holds links to parent members
15037 to avoid member duplication (reduced memory allocation).
15038 (Method): Implemented IMethodData interface.
15039 (PropertyBase): New inner classes for get/set methods.
15040 (PropertyBase.PropertyMethod): Implemented IMethodData interface
15041 (Event): New inner classes for add/remove methods.
15042 (Event.DelegateMethod): Implemented IMethodData interface.
15044 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
15045 EmitContext (related to class.cs refactoring).
15047 2004-04-21 Raja R Harinath <rharinath@novell.com>
15049 * delegate.cs (Delegate.VerifyApplicability): If the number of
15050 arguments are the same as the number of parameters, first try to
15051 verify applicability ignoring any 'params' modifier on the last
15055 2004-04-16 Raja R Harinath <rharinath@novell.com>
15057 * class.cs (TypeContainer.AddIndexer): Use
15058 'ExplicitInterfaceName' to determine if interface name was
15059 explicitly specified. 'InterfaceType' is not initialized at this time.
15060 (TypeContainer.DefineIndexers): Remove use of temporary list. The
15061 Indexers array is already in the required order. Initialize
15062 'IndexerName' only if there are normal indexers.
15063 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
15064 (TypeContainer.Emit): Emit DefaultMember attribute only if
15065 IndexerName is initialized.
15068 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
15070 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
15073 2004-04-15 Raja R Harinath <rharinath@novell.com>
15075 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
15079 * attribute.cs (Attribute.Resolve): Check for duplicate named
15083 2004-04-15 Miguel de Icaza <miguel@ximian.com>
15085 * iterators.cs (MarkYield): track whether we are in an exception,
15086 and generate code accordingly. Use a temporary value to store the
15087 result for our state.
15089 I had ignored a bit the interaction of try/catch with iterators
15090 since their behavior was not entirely obvious, but now it is
15091 possible to verify that our behavior is the same as MS .NET 2.0
15095 2004-04-14 Miguel de Icaza <miguel@ximian.com>
15097 * iterators.cs: Avoid creating temporaries if there is no work to
15100 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
15101 Enumerations, use TypeManager.EnumToUnderlying and call
15104 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
15107 (This.Emit): Use EmitContext.EmitThis to emit our
15110 (This.EmitAssign): Ditto.
15112 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
15113 codepaths, we will move all the functionality into
15116 (FieldExpr.EmitAssign): Ditto.
15118 This fixes several hidden bugs that I uncovered while doing a code
15119 review of this today.
15121 * codegen.cs (EmitThis): reworked so the semantics are more clear
15122 and also support value types "this" instances.
15124 * iterators.cs: Changed so that for iterators in value types, we
15125 do not pass the value type as a parameter.
15127 Initialization of the enumerator helpers is now done in the caller
15128 instead of passing the parameters to the constructors and having
15129 the constructor set the fields.
15131 The fields have now `assembly' visibility instead of private.
15133 2004-04-11 Miguel de Icaza <miguel@ximian.com>
15135 * expression.cs (Argument.Resolve): Check if fields passed as ref
15136 or out are contained in a MarshalByRefObject.
15138 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
15139 another compiler type.
15141 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
15143 * class.cs (Indexer.Define): use the new name checking method.
15144 Also, return false on an error.
15145 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
15146 (is_identifier_[start/part]_character): make static.
15148 2004-04-10 Miguel de Icaza <miguel@ximian.com>
15150 * expression.cs (Binary.ResolveOperator): Do no append strings
15151 twice: since we can be invoked more than once (array evaluation)
15152 on the same concatenation, take care of this here. Based on a fix
15153 from Ben (bug #56454)
15155 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
15157 * codegen.cs: Fix another case where CS1548 must be reported (when
15158 delay-sign isn't specified and no private is available #56564). Fix
15159 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
15160 error when MCS is used on the MS runtime and we need to delay-sign
15161 (which seems unsupported by AssemblyBuilder - see #56621).
15163 2004-04-08 Marek Safar <marek.safar@seznam.cz>
15165 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
15166 (TypeManager.ComputeNamespaces): Faster implementation for
15169 * compiler.csproj: Updated AssemblyName to mcs.
15171 2004-04-07 Miguel de Icaza <miguel@ximian.com>
15173 * rootcontext.cs: Add new types to the boot resolution.
15175 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
15176 MulticastDelegate is not allowed.
15178 * typemanager.cs: Add new types to lookup: System.TypedReference
15181 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
15182 check for TypedReference or ArgIterator, they are not allowed.
15184 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
15185 makes us properly catch 1510 in some conditions (see bug 56016 for
15188 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
15190 * CryptoConvert.cs: update from corlib version
15193 2004-04-05 Miguel de Icaza <miguel@ximian.com>
15195 * class.cs (Indexer.Define): Check indexername declaration
15197 2004-04-05 Marek Safar <marek.safar@seznam.cz>
15199 * attribute.cs (IsClsCompliant): Fixed problem with handling
15200 all three states (compliant, not-compliant, undetected).
15202 2004-03-30 Marek Safar <marek.safar@seznam.cz>
15204 * attribute.cs (Attribute): Location is now public.
15205 (Resolve): Store resolved arguments (pos_values) in attribute class.
15206 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
15207 (GetClsCompliantAttributeValue): New method that gets
15208 CLSCompliantAttribute value.
15209 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
15210 if exists else null.
15211 (AttributeTester): New class for CLS-Compliant verification routines.
15213 * class.cs (Emit): Add CLS-Compliant verification.
15214 (Method.GetSignatureForError): Implemented.
15215 (Constructor.GetSignatureForError): Implemented
15216 (Constructor.HasCompliantArgs): Returns if constructor has
15217 CLS-Compliant arguments.
15218 (Constructor.Emit): Override.
15219 (Construcor.IsIdentifierClsCompliant): New method; For constructors
15220 is needed to test only parameters.
15221 (FieldBase.GetSignatureForError): Implemented.
15222 (TypeContainer): New member for storing base interfaces.
15223 (TypeContainer.FindMembers): Search in base interfaces too.
15225 * codegen.cs (GetClsComplianceAttribute): New method that gets
15226 assembly or module CLSCompliantAttribute value.
15227 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
15229 (ModuleClass.Emit): Add error 3012 test.
15231 * const.cs (Emit): Override and call base for CLS-Compliant tests.
15233 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
15234 state for all decl types.
15235 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
15236 if CLS-Compliant tests are required.
15237 (IsClsCompliaceRequired): New method. Analyze whether code
15238 must be CLS-Compliant.
15239 (IsExposedFromAssembly): New method. Returns true when MemberCore
15240 is exposed from assembly.
15241 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
15242 value or gets cached value.
15243 (HasClsCompliantAttribute): New method. Returns true if MemberCore
15244 is explicitly marked with CLSCompliantAttribute.
15245 (IsIdentifierClsCompliant): New abstract method. This method is
15246 used to testing error 3005.
15247 (IsIdentifierAndParamClsCompliant): New method. Common helper method
15248 for identifier and parameters CLS-Compliant testing.
15249 (VerifyClsCompliance): New method. The main virtual method for
15250 CLS-Compliant verifications.
15251 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
15252 null. I don't know why is null (too many public members !).
15253 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
15254 and get value of first CLSCompliantAttribute that found.
15256 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
15257 (VerifyClsCompliance): Override and add extra tests.
15259 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
15260 clscheck- disable CLS-Compliant verification event if assembly is has
15261 CLSCompliantAttribute(true).
15263 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
15264 ApllyAttribute is now called in emit section as in the other cases.
15265 Possible future Emit integration.
15266 (IsIdentifierClsCompliant): New override.
15267 (VerifyClsCompliance): New override.
15268 (GetEnumeratorName): Returns full enum name.
15270 * parameter.cs (GetSignatureForError): Implemented.
15272 * report.cs (WarningData): New struct for Warning message information.
15273 (LocationOfPreviousError): New method.
15274 (Warning): New method. Reports warning based on the warning table.
15275 (Error_T): New method. Reports error based on the error table.
15277 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
15278 verifications are done here.
15280 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
15282 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
15283 CLSCompliantAttribute.
15284 (all_imported_types): New member holds all imported types from other
15286 (LoadAllImportedTypes): New method fills static table with exported types
15287 from all referenced assemblies.
15288 (Modules): New property returns all assembly modules.
15290 2004-03-30 Miguel de Icaza <miguel@ximian.com>
15292 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
15293 throwing a parser error.
15295 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
15296 which removes the hardcoded get_/set_ prefixes for properties, as
15297 IL allows for the properties to be named something else.
15301 * expression.cs: Do not override operand before we know if it is
15302 non-null. Fix 56207
15304 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
15306 * typemanager.cs: support for pinned variables.
15308 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
15310 * decl.cs, typemanager.cs: Avoid using an arraylist
15311 as a buffer if there is only one result set.
15313 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
15315 * expression.cs: Make sure you cant call a static method
15316 with an instance expression, bug #56174.
15318 2004-03-29 Miguel de Icaza <miguel@ximian.com>
15320 * class.cs (IsDuplicateImplementation): Improve error reporting to
15321 flag 663 (method only differs in parameter modifier).
15323 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
15324 in preprocessor directives.
15326 * location.cs (LookupFile): Allow for the empty path.
15328 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
15329 better approach for some of that patch, but its failing with the
15330 CharSet enumeration. For now try/catch will do.
15332 * typemanager.cs: Do not crash if a struct does not have fields.
15335 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
15337 * expression.cs: cs0213, cant fix a fixed expression.
15340 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
15342 * cs-parser.jay: detect invalid embeded statements gracefully.
15345 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
15347 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
15350 the invocation type may not be a subclass of the tye of the item/
15351 The type of the item must be a subclass of the invocation item.
15356 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
15358 * attribute.cs: Added methods to get a string and a bool from an
15359 attribute. Required to information from AssemblyKeyFileAttribute,
15360 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
15361 * codegen.cs: Modified AssemblyName creation to include support for
15362 strongnames. Catch additional exceptions to report them as CS1548.
15363 * compiler.csproj: Updated include CryptoConvert.cs.
15364 * compiler.csproj.user: Removed file - user specific configuration.
15365 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
15366 Mono.Security assembly. The original class is maintained and tested in
15367 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
15368 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
15369 like CSC 8.0 (C# v2) supports.
15370 * Makefile: Added CryptoConvert.cs to mcs sources.
15371 * rootcontext.cs: Added new options for strongnames.
15373 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
15375 * driver.cs: For --expect-error, report error code `2'
15376 if the program compiled with no errors, error code `1' if
15377 it compiled with an error other than the one expected.
15379 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
15381 * compiler.csproj: Updated for Visual Studio .NET 2003.
15382 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
15383 * compiler.sln: Updated for Visual Studio .NET 2003.
15385 2004-03-24 Ravi Pratap M <ravi@ximian.com>
15387 * expression.cs: Fix bug #47234. We basically need to apply the
15388 rule that we prefer the conversion of null to a reference type
15389 when faced with a conversion to 'object' (csc behaviour).
15391 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
15393 * statement.cs: Shorter form for foreach, eliminates
15394 a local variable. r=Martin.
15396 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
15398 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
15399 checks if we can use brtrue/brfalse to test for 0.
15400 * expression.cs: use the above in the test for using brtrue/brfalse.
15401 cleanup code a bit.
15403 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
15405 * expression.cs: Rewrite string concat stuff. Benefits:
15407 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
15408 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
15409 rather than a concat chain.
15411 * typemanager.cs: Add lookups for more concat overloads.
15413 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
15415 * expression.cs: Emit shorter il code for array init.
15432 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
15434 * statement.cs: Before, two switch blocks would be merged if the
15435 total size of the blocks (end_item - begin_item + 1) was less than
15436 two times the combined sizes of the blocks.
15438 Now, it will only merge if after the merge at least half of the
15443 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
15445 * class.cs : csc build fix for GetMethods(). See bug #52503.
15447 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
15449 * expression.cs: Make sure fp comparisons work with NaN.
15450 This fixes bug #54303. Mig approved this patch a long
15451 time ago, but we were not able to test b/c the runtime
15454 2004-03-19 Miguel de Icaza <miguel@ximian.com>
15456 * ecore.cs (TypExpr.GetHashCode): implement this overload.
15458 2004-03-19 Martin Baulig <martin@ximian.com>
15460 * class.cs (MemberCore.IsDuplicateImplementation): Report the
15461 error here and not in our caller.
15463 2004-03-19 Martin Baulig <martin@ximian.com>
15465 * interface.cs: Completely killed this file.
15466 (Interface): We're now a TypeContainer and live in class.cs.
15468 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
15469 argument; we're now also called for interfaces.
15470 (TypeContainer.DefineMembers): Allow this method being called
15472 (TypeContainer.GetMethods): New public method; formerly known as
15473 Interface.GetMethod(). This is used by PendingImplementation.
15474 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
15475 it's now private and non-static.
15476 (Interface): Moved this here; it's now implemented similar to
15478 (Method, Property, Event, Indexer): Added `bool is_interface'
15479 argument to their .ctor's.
15480 (MemberBase.IsInterface): New public field.
15482 * cs-parser.jay: Create normal Method, Property, Event, Indexer
15483 instances instead of InterfaceMethod, InterfaceProperty, etc.
15484 (opt_interface_base): Removed; we now use `opt_class_base' instead.
15485 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
15487 2004-03-19 Martin Baulig <martin@ximian.com>
15489 * class.cs (MethodCore.IsDuplicateImplementation): New private
15490 method which does the CS0111 checking.
15491 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
15492 Use IsDuplicateImplementation().
15494 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
15496 * decl.cs (FindMemberToOverride): New method to find the correct
15497 method or property to override in the base class.
15499 - Make Method/Property use the above method to find the
15500 version in the base class.
15501 - Remove the InheritableMemberSignatureCompare as it is now
15504 This patch makes large code bases much faster to compile, as it is
15505 O(n) rather than O(n^2) to do this validation.
15507 Also, it fixes bug 52458 which is that nested classes are not
15508 taken into account when finding the base class member.
15510 Reviewed/Approved by Martin.
15512 2004-03-17 Marek Safar <marek.safar@seznam.cz>
15514 * interface.cs: In all interface classes removed redundant
15515 member initialization.
15517 2004-03-16 Martin Baulig <martin@ximian.com>
15519 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
15521 2004-03-15 Miguel de Icaza <miguel@ximian.com>
15523 * decl.cs (DefineTypeAndParents): New helper method to define a
15524 type's containers before the type itself is defined; This is a
15525 bug exposed by the recent changes to Windows.Forms when an
15526 implemented interface was defined inside a class that had not been
15529 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
15531 (Check): Loop correctly to report errors modifiers
15532 (UNSAFE was not in the loop, since it was the same as TOP).
15534 * interface.cs: Every interface member now takes a ModFlags,
15535 instead of a "is_new" bool, which we set on the base MemberCore.
15537 Every place where we called "UnsafeOk" in the interface, now we
15538 call the proper member (InterfaceMethod.UnsafeOK) instead to get
15539 the unsafe settings from the member declaration instead of the
15540 container interface.
15542 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
15544 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
15545 `set_indexer_name' to the pending bits (one per type).
15547 We fixed a bug today that was picking the wrong method to
15548 override, since for properties the existing InterfaceMethod code
15549 basically ignored the method name. Now we make sure that the
15550 method name is one of the valid indexer names.
15552 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
15554 * support.cs (SeekableStreamReader): Keep track of stream byte
15555 positions and don't mix them with character offsets to the buffer.
15557 Patch from Gustavo Giráldez
15559 2004-03-15 Marek Safar <marek.safar@seznam.cz>
15561 * interface.cs (InterfaceSetGetBase): Removed double member
15562 initialization, base class does it as well.
15564 2004-03-13 Martin Baulig <martin@ximian.com>
15566 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
15567 when compiling corlib.
15569 2004-03-13 Miguel de Icaza <miguel@ximian.com>
15571 * convert.cs (ExplicitConversion): We were reporting an error on
15572 certain conversions (object_type source to a value type, when the
15573 expression was `null') before we had a chance to pass it through
15574 the user defined conversions.
15576 * driver.cs: Replace / and \ in resource specifications to dots.
15579 * class.cs: Add check for duplicate operators. Fixes 52477
15581 2004-03-11 Miguel de Icaza <miguel@ximian.com>
15583 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
15584 that are in the middle of the statements, not only at the end.
15587 * class.cs (TypeContainer.AddField): No longer set the
15588 `HaveStaticConstructor' flag, now we call it
15589 `UserDefineStaticConstructor' to diferentiate the slightly
15590 semantic difference.
15592 The situation is that we were not adding BeforeFieldInit (from
15593 Modifiers.TypeAttr) to classes that could have it.
15594 BeforeFieldInit should be set to classes that have no static
15599 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
15601 And most importantly Zoltan's comment:
15603 http://bugzilla.ximian.com/show_bug.cgi?id=44229
15605 "I think beforefieldinit means 'it's ok to initialize the type sometime
15606 before its static fields are used', i.e. initialization does not need
15607 to be triggered by the first access to the type. Setting this flag
15608 helps the JIT to compile better code, since it can run the static
15609 constructor at JIT time, and does not need to generate code to call it
15610 (possibly lots of times) at runtime. Unfortunately, mcs does not set
15611 this flag for lots of classes like String.
15613 csc sets this flag if the type does not have an explicit static
15614 constructor. The reasoning seems to be that if there are only static
15615 initalizers for a type, and no static constructor, then the programmer
15616 does not care when this initialization happens, so beforefieldinit
15619 This bug prevents the AOT compiler from being usable, since it
15620 generates so many calls to mono_runtime_class_init that the AOT code
15621 is much slower than the JITted code. The JITted code is faster,
15622 because it does not generate these calls if the vtable is type is
15623 already initialized, which is true in the majority of cases. But the
15624 AOT compiler can't do this."
15626 2004-03-10 Miguel de Icaza <miguel@ximian.com>
15628 * class.cs (MethodData.Emit): Refactor the code so symbolic
15629 information is generated for destructors; For some reasons we
15630 were taking a code path that did not generate symbolic information
15633 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
15635 * class.cs: Create a Constructor.CheckBase method that
15636 takes care of all validation type code. The method
15637 contains some code that was moved from Define.
15639 It also includes new code that checks for duplicate ctors.
15640 This fixes bug #55148.
15642 2004-03-09 Joshua Tauberer <tauberer@for.net>
15644 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
15645 a { ... }-style array creation invokes EmitStaticInitializers
15646 which is not good for reference-type arrays. String, decimal
15647 and now null constants (NullCast) are not counted toward
15648 static initializers.
15650 2004-03-05 Martin Baulig <martin@ximian.com>
15652 * location.cs (SourceFile.HasLineDirective): New public field;
15653 specifies whether the file contains or is referenced by a "#line"
15655 (Location.DefineSymbolDocuments): Ignore source files which
15656 either contain or are referenced by a "#line" directive.
15658 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
15660 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
15661 direct access to our parent, so check the method inline there.
15663 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
15665 * expression.cs (Invocation.EmitCall): Miguel's last commit
15666 caused a regression. If you had:
15671 In Foo the implict this would be null.
15673 2004-02-27 Miguel de Icaza <miguel@ximian.com>
15675 * expression.cs (Invocation.EmitCall): If the method is not
15676 virtual, do not emit a CallVirt to it, use Call.
15678 * typemanager.cs (GetFullNameSignature): Improve the method to
15679 cope with ".ctor" and replace it with the type name.
15681 * class.cs (ConstructorInitializer.Resolve): Now the method takes
15682 as an argument the ConstructorBuilder where it is being defined,
15683 to catch the recursive constructor invocations.
15685 2004-02-26 Miguel de Icaza <miguel@ximian.com>
15687 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
15688 routines to check if a type is an enumerable/enumerator allow
15689 classes that implement the IEnumerable or IEnumerator interfaces.
15691 * class.cs (Property, Operator): Implement IIteratorContainer, and
15692 implement SetYields.
15694 (Property.Define): Do the block swapping for get_methods in the
15695 context of iterators. We need to check if Properties also
15696 include indexers or not.
15698 (Operator): Assign the Block before invoking the
15699 OperatorMethod.Define, so we can trigger the Iterator code
15702 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
15703 Property and Operator classes are not created when we parse the
15704 declarator but until we have the block completed, so we use a
15705 singleton SimpleIteratorContainer.Simple to flag whether the
15706 SetYields has been invoked.
15708 We propagate this setting then to the Property or the Operator to
15709 allow the `yield' to function.
15711 2004-02-25 Marek Safar <marek.safar@seznam.cz>
15713 * codegen.cs: Implemented attribute support for modules.
15714 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
15715 Assembly/Module functionality.
15717 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
15718 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
15719 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
15721 2004-02-16 Marek Safar <marek.safar@seznam.cz>
15723 * interface.cs (FindMembers): The operation is performed on all base
15724 interfaces and not only on the first. It is required for future CLS Compliance patch.
15726 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
15728 * statement.cs, codegen.cs:
15729 This patch deals with patterns such as:
15731 public class List : IEnumerable {
15733 public MyEnumerator GetEnumerator () {
15734 return new MyEnumerator(this);
15737 IEnumerator IEnumerable.GetEnumerator () {
15741 public struct MyEnumerator : IEnumerator {
15746 Before, there were a few things we did wrong:
15747 1) we would emit callvirt on a struct, which is illegal
15748 2) we emited ldarg when we needed to emit ldarga
15749 3) we would mistakenly call the interface methods on an enumerator
15750 type that derived from IEnumerator and was in another assembly. For example:
15752 public class MyEnumerator : IEnumerator
15754 Would have the interface methods called, even if there were public impls of the
15755 method. In a struct, this lead to invalid IL code.
15757 2004-02-11 Marek Safar <marek.safar@seznam.cz>
15759 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
15762 * delegate.cs (Define): Fixed crash when delegate type is undefined.
15764 2004-02-11 Miguel de Icaza <miguel@ximian.com>
15766 * cs-parser.jay: Fix small regression: we were not testing V2
15767 compiler features correctly.
15769 * interface.cs: If the emit context is null, then create one
15771 2004-02-09 Marek Safar <marek.safar@seznam.cz>
15773 * decl.cs (GetSignatureForError): New virtual method to get full name
15774 for error messages.
15776 * attribute.cs (IAttributeSupport): New interface for attribute setting.
15777 Now it is possible to rewrite ApplyAttributes method to be less if/else.
15779 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
15780 Duplicated members and code in these classes has been removed.
15781 Better encapsulation in these classes.
15783 2004-02-07 Miguel de Icaza <miguel@ximian.com>
15785 * assign.cs (Assign.DoResolve): When dealing with compound
15786 assignments, there is a new rule in ECMA C# 2.4 (might have been
15787 there before, but it is documented here) that states that in:
15791 If b is of type int, and the `op' is a shift-operator, then the
15792 above is evaluated as:
15796 * expression.cs (Binary.ResolveOperator): Instead of testing for
15797 int/uint/long/ulong, try to implicitly convert to any of those
15798 types and use that in pointer arithmetic.
15800 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
15801 method to print information for from the type, not from the
15802 null-method we were given.
15804 2004-02-01 Duncan Mak <duncan@ximian.com>
15806 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
15807 parsing for cmd, fixes bug #53694.
15809 2004-02-04 Marek Safar <marek.safar@seznam.cz>
15811 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
15812 in the member name duplication tests. Property and operator name duplication
15813 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
15815 2004-02-03 Marek Safar <marek.safar@seznam.cz>
15817 * interface.cs (PopulateMethod): Fixed crash when interface method
15818 returns not existing type (error test cs0246-3.cs).
15820 2004-02-02 Ravi Pratap M <ravi@ximian.com>
15822 * cs-parser.jay (interface_accessors): Re-write actions to also
15823 store attributes attached to get and set methods. Fix spelling
15826 (inteface_property_declaration): Modify accordingly.
15828 (InterfaceAccessorInfo): New helper class to store information to pass
15829 around between rules that use interface_accessors.
15831 * interface.cs (Emit): Apply attributes on the get and set
15832 accessors of properties and indexers too.
15834 * attribute.cs (ApplyAttributes): Modify accordingly to use the
15835 right MethodBuilder when applying attributes to the get and set accessors.
15837 2004-01-31 Miguel de Icaza <miguel@ximian.com>
15839 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
15841 2004-01-26 Miguel de Icaza <miguel@ximian.com>
15843 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
15845 2004-01-25 Miguel de Icaza <miguel@ximian.com>
15847 * cs-parser.jay: Remove YIELD token, instead use the new grammar
15848 changes that treat `yield' specially when present before `break'
15849 or `return' tokens.
15851 * cs-tokenizer.cs: yield is no longer a keyword.
15853 2004-01-23 Marek Safar <marek.safar@seznam.cz>
15855 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
15856 setting for default constructors.
15857 For default constructors are almost every time set wrong Modifier. The
15858 generated IL code has been alright. But inside mcs this values was
15859 wrong and this was reason why several of my CLS Compliance tests
15862 2004-01-22 Martin Baulig <martin@ximian.com>
15864 * cs-parser.jay (namespace_or_type_name): Return an Expression,
15865 not a QualifiedIdentifier. This is what `type_name_expression'
15866 was previously doing.
15867 (type_name_expression): Removed; the code is now in
15868 `namespace_or_type_name'.
15869 (qualified_identifier): Removed, use `namespace_or_type_name'
15871 (QualifiedIdentifier): Removed this class.
15873 2004-01-22 Martin Baulig <martin@ximian.com>
15875 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
15876 not a string as alias name.
15878 2004-01-21 Miguel de Icaza <miguel@ximian.com>
15880 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
15881 #52730 bug, and instead compute correctly the need to use a
15882 temporary variable when requesting an address based on the
15883 static/instace modified of the field and the constructor.
15885 2004-01-21 Martin Baulig <martin@ximian.com>
15887 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
15888 class and namespace before looking up aliases. Fixes #52517.
15890 2004-01-21 Martin Baulig <martin@ximian.com>
15892 * flowanalysis.cs (UsageVector.Merge): Allow variables being
15893 assinged in a 'try'; fixes exception4.cs.
15895 2004-01-21 Marek Safar <marek.safar@seznam.cz>
15896 * class.cs : Implemented parameter-less constructor for TypeContainer
15898 * decl.cs: Attributes are now stored here. New property OptAttributes
15900 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
15902 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
15904 2004-01-21 Marek Safar <marek.safar@seznam.cz>
15906 * typemanager.cs (CSharpSignature): Now reports also inner class name.
15907 (CSharpSignature): New method for indexer and property signature.
15909 2004-01-21 Marek Safar <marek.safar@seznam.cz>
15911 * pending.cs (IsVirtualFilter): Faster implementation.
15913 2004-01-21 Marek Safar <marek.safar@seznam.cz>
15915 * typemanager.cs: Avoid inclusion of same assembly more than once.
15917 2004-01-21 Marek Safar <marek.safar@seznam.cz>
15919 * cs-parser.jay: Fixed problem where the last assembly attribute
15920 has been applied also to following declaration (class, struct, etc.)
15922 2004-01-21 Marek Safar <marek.safar@seznam.cz>
15924 * class.cs: Added error CS0538, CS0539 reporting.
15925 Fixed crash on Microsoft runtime when field type is void.
15927 * cs-parser.jay: Added error CS0537 reporting.
15929 * pending.cs: Added error CS0535 reporting.
15930 Improved error report for errors CS0536, CS0534.
15932 2004-01-20 Miguel de Icaza <miguel@ximian.com>
15934 Merge a few bits from the Anonymous Method MCS tree.
15936 * statement.cs (ToplevelBlock): New class for toplevel methods,
15937 will hold anonymous methods, lifted variables.
15939 * cs-parser.jay: Create toplevel blocks for delegates and for
15940 regular blocks of code.
15942 2004-01-20 Martin Baulig <martin@ximian.com>
15944 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
15945 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
15946 and `NeedExplicitReturn'; added `IsLastStatement'.
15947 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
15948 have a `ReturnLabel' or we're not unreachable.
15950 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
15951 child's reachability; don't just override ours with it. Fixes
15952 #58058 (lluis's example).
15953 (FlowBranching): Added public InTryOrCatch(), InCatch(),
15954 InFinally(), InLoop(), InSwitch() and
15955 BreakCrossesTryCatchBoundary() methods.
15957 * statement.cs (Return): Do all error checking in Resolve().
15958 Unless we are the last statement in a top-level block, always
15959 create a return label and jump to it.
15960 (Break, Continue): Do all error checking in Resolve(); also make
15961 sure we aren't leaving a `finally'.
15962 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
15963 statement in a top-level block.
15964 (Block.Flags): Added `IsDestructor'.
15965 (Block.IsDestructor): New public property.
15967 2004-01-20 Martin Baulig <martin@ximian.com>
15969 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
15971 2004-01-20 Martin Baulig <martin@ximian.com>
15973 * statement.cs (Statement.ResolveUnreachable): New public method.
15974 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
15975 (Block.Resolve): Resolve unreachable statements.
15977 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
15979 * expression.cs: We need to fix the case where we do
15980 not have a temp variable here.
15982 * assign.cs: Only expression compound assignments need
15983 temporary variables.
15985 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
15987 * flowanalysis.cs: Reduce memory allocation in a few ways:
15988 - A block with no variables should not allocate a bit
15990 - A method with no out parameters does not need any tracking
15991 for assignment of the parameters, so we need not allocate
15994 public readonly Type[] VariableTypes;
15995 public readonly string[] VariableNames;
15996 Are redundant. The data is already stored in the variable
15997 map, so we need not allocate another array for it.
15998 - We need to add alot of checks for if (params | locals) == null
15999 due to the first two changes.
16001 2004-01-18 Miguel de Icaza <miguel@ximian.com>
16003 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
16004 implement IMemoryLocation, we store a copy on a local variable and
16005 take the address of it. Patch from Benjamin Jemlich
16007 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
16008 to use a special "type_name_expression" rule which reduces the
16009 number of "QualifiedIdentifier" classes created, and instead
16010 directly creates MemberAccess expressions.
16012 2004-01-17 Miguel de Icaza <miguel@ximian.com>
16014 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
16015 that fixes #52853. Null literal assignment to ValueType
16017 * class.cs (MethodData.Emit): Instead of checking the name of the
16018 method to determine if its a destructor, create a new derived
16019 class from Method called Destructor, and test for that.
16021 * cs-parser.jay: Create a Destructor object instead of a Method.
16023 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
16027 2004-01-16 Miguel de Icaza <miguel@ximian.com>
16029 * expression.cs (Binary.ResolveOperator): Perform an implicit
16030 conversion from MethodGroups to their delegate types on the
16031 Addition operation.
16033 * delegate.cs: Introduce a new class DelegateCreation that is the
16034 base class for `NewDelegate' and `ImplicitDelegateCreation',
16035 factor some code in here.
16037 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
16038 conversion from MethodGroups to compatible delegate types.
16040 * ecore.cs (Expression.Resolve): Do not flag error 654
16041 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
16042 we allow conversions from MethodGroups to delegate types now.
16044 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
16045 assignments in v2 either.
16047 2004-01-10 Miguel de Icaza <miguel@ximian.com>
16049 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
16050 static read-only fields in ctors.
16052 Applied patch from Benjamin Jemlich
16054 * expression.cs (UnaryMutator): Avoid leaking local variables.
16056 2004-01-09 Miguel de Icaza <miguel@ximian.com>
16058 * cs-tokenizer.cs (IsCastToken): Allow the various native types
16059 here to return true, as they can be used like this:
16061 (XXX) int.MEMBER ()
16063 Fixed 49836 and all the other dups
16065 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
16067 * driver.cs: Implement /win32res and /win32icon.
16069 2004-01-08 Miguel de Icaza <miguel@ximian.com>
16071 * cs-parser.jay: Add a rule to improve error handling for the
16072 common mistake of placing modifiers after the type.
16074 2004-01-07 Miguel de Icaza <miguel@ximian.com>
16076 * cs-parser.jay (interface_event_declaration): Catch
16077 initialization of events on interfaces, and report cs0068
16079 * cs-parser.jay (interface_event_declaration): Catch
16080 initialization of events.
16082 * ecore.cs: Better report missing constructors.
16084 * expression.cs (Binary.ResolveOperator): My previous bug fix had
16085 the error reporting done in the wrong place. Fix.
16087 * expression.cs (Binary.ResolveOperator): Catch the
16088 operator + (E x, E y) error earlier, and later allow for implicit
16089 conversions in operator +/- (E e, U x) from U to the underlying
16092 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
16093 52596, if the container class is abstract, the default constructor
16094 is protected otherwise its public (before, we were always public).
16096 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
16099 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
16100 Jemlich that fixes bug #52597, MCS was generating invalid code for
16101 idisposable structs. Thanks to Ben for following up with this
16104 2004-01-06 Miguel de Icaza <miguel@ximian.com>
16106 * driver.cs: Allow assemblies without code to be generated, fixes
16109 2004-01-07 Nick Drochak <ndrochak@gol.com>
16111 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
16113 2004-01-05 Miguel de Icaza <miguel@ximian.com>
16115 * cs-parser.jay: Add rules to improve error reporting if fields or
16116 methods are declared at the namespace level (error 116)
16118 * Add rules to catch event add/remove
16120 2004-01-04 David Sheldon <dave-mono@earth.li>
16122 * expression.cs: Added matching ")" to error message for
16125 2004-01-03 Todd Berman <tberman@gentoo.org>
16127 * ecore.cs, attribute.cs:
16128 Applying fix from #52429.
16130 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
16132 * ecore.cs, expression.cs, statement.cs:
16133 Total rewrite of how we handle branching. We
16134 now handle complex boolean expressions with fewer
16135 jumps. As well if (x == 0) no longer emits a ceq.
16137 if (x is Foo) is much faster now, because we generate
16140 Overall, we get a pretty big improvement on our benchmark
16141 tests. The code we generate is smaller and more readable.
16143 I did a full two-stage bootstrap. The patch was reviewed
16144 by Martin and Miguel.
16146 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
16148 * cs-parser.jay: Make primary_expression not take a QI.
16149 we dont need this because the member_access rule covers
16150 us here. So we replace the rule with just IDENTIFIER.
16152 This has two good effects. First, we remove a s/r conflict.
16153 Second, we allocate many fewer QualifiedIdentifier objects.
16155 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
16157 * attribute.cs: Handle MarshalAs attributes as pseudo, and
16158 set the correct information via SRE. This prevents
16159 hanging on the MS runtime. Fixes #29374.
16161 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
16163 * convert.cs: correctly handle conversions to value types
16164 from Enum and ValueType as unboxing conversions.
16166 Fixes bug #52569. Patch by Benjamin Jemlich.
16168 2004-01-02 Ravi Pratap <ravi@ximian.com>
16170 * expression.cs (BetterConversion): Prefer int -> uint
16171 over int -> ulong (csc's behaviour). This fixed bug #52046.
16173 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
16175 * decl.cs (MemberCache.FindMembers): now returns a
16178 * typemanager.cs: In general, go with with ^^.
16179 (CopyNewMethods): take an IList.
16180 (RealMemberLookup): Only allocate an arraylist
16181 if we copy from two sets of methods.
16183 This change basically does two things:
16184 1) Fewer array lists allocated due to CopyNewMethods.
16185 2) the explicit cast in MemberList costed ALOT.
16187 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
16189 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
16190 a hashtable to avoid needless string allocations when an identifier is
16191 used more than once (the common case).
16193 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
16195 * pending.cs: MS's TypeBuilder.GetInterfaces ()
16196 is broken, it will not return anything. So, we
16197 have to use the information we have in mcs to
16200 * typemanager.cs: Add a cache for GetInterfaces,
16201 since this will now be used more often (due to ^^)
16203 (GetExplicitInterfaces) New method that gets the
16204 declared, not effective, interfaces on a type
16205 builder (eg, if you have interface IFoo, interface
16206 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
16209 This patch makes MCS able to bootstrap itself on
16212 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
16214 * expression.cs: Remove the Nop's that Miguel put
16217 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
16219 * report.cs, codegen.cs: Give the real stack trace to
16220 the error when an exception is thrown.
16222 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
16224 * decl.cs: only allocate hashtables for ifaces if
16227 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
16229 * expression.cs: fix the error from cs0121-2.cs
16230 (a parent interface has two child interfaces that
16231 have a function with the same name and 0 params
16232 and the function is called through the parent).
16234 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
16236 * class.cs, rootcontext.cs, typmanager.cs: do not
16239 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
16241 * codegen.cs: remove stack for the ec flow branching.
16242 It is already a linked list, so no need.
16244 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
16246 * Makefile: Allow custom profiler here.
16248 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
16250 * typemanager.cs (LookupType):
16251 - Use a static char [], because split takes
16252 a param array for args, so it was allocating
16254 - Do not store true in a hashtable, it boxes.
16256 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
16258 * flowanalysis.cs: bytify common enums.
16260 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
16262 * modifiers.cs: Add a new set of flags for the
16263 flags allowed on explicit interface impls.
16264 * cs-parser.jay: catch the use of modifiers in
16265 interfaces correctly.
16266 * class.cs: catch private void IFoo.Blah ().
16268 All related to bug #50572.
16270 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
16272 * decl.cs: Rewrite the consistant accessability checking.
16273 Accessability is not linear, it must be implemented in
16274 a tableish way. Fixes #49704.
16276 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
16278 * expression.cs: Handle negation in a checked context.
16279 We must use subtraction from zero. Fixes #38674.
16281 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
16283 * class.cs: Ignore static void main in DLLs.
16284 * rootcontext.cs: Handle the target type here,
16285 since we are have to access it from class.cs
16286 * driver.cs: account for the above.
16288 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
16290 * report.cs: Give line numbers and files if available.
16292 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
16294 * driver.cs: Implement /addmodule.
16296 * typemanager.cs: Change 'modules' field so it now contains Modules not
16299 2003-12-20 Martin Baulig <martin@ximian.com>
16301 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
16302 (FieldBase.IsAssigned): Removed this field.
16303 (FieldBase.SetAssigned): New public method.
16304 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
16306 2003-12-20 Martin Baulig <martin@ximian.com>
16308 * expression.cs (LocalVariableReference.DoResolve): Don't set
16309 `vi.Used' if we're called from DoResolveLValue().
16311 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
16312 returns the usage vector it just merged into the current one -
16313 pass this one to UsageWarning().
16314 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
16315 of the `EmitContext', don't call this recursively on our children.
16317 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
16319 * driver.cs: Implement /target:module.
16321 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
16323 * support.cs (CharArrayHashtable): New helper class.
16325 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
16326 char arrays, not strings, so we can avoid creating a string in
16327 consume_identifier if the identifier is a keyword.
16329 2003-12-16 Martin Baulig <martin@ximian.com>
16331 * statement.cs (LocalInfo.Assigned): Removed this property.
16332 (LocalInfo.Flags): Removed `Assigned'.
16333 (LocalInfo.IsAssigned): New public method; takes the EmitContext
16334 and uses flow analysis.
16335 (Block.UsageWarning): Made this method private.
16336 (Block.Resolve): Call UsageWarning() if appropriate.
16338 * expression.cs (LocalVariableReference.DoResolve): Always set
16339 LocalInfo.Used here.
16341 2003-12-13 Martin Baulig <martin@ximian.com>
16343 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
16344 any value here; we're now using flow analysis to figure out
16345 whether a statement/block returns a value.
16347 2003-12-13 Martin Baulig <martin@ximian.com>
16349 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
16351 (FlowBranching.MergeFinally): Don't call
16352 `branching.CheckOutParameters()' here, this is called in
16354 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
16355 when adding the `finally' vector.
16357 2003-12-13 Martin Baulig <martin@ximian.com>
16360 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
16361 actually work and also fix #48962.
16363 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
16365 * decl.cs: Do not check System.Object for nested types,
16366 since we know it does not have any. Big bang for buck:
16369 Run 1: 8.35 seconds
16370 Run 2: 8.32 seconds
16371 corlib: 17.99 seconds
16373 Run 1: 8.17 seconds
16374 Run 2: 8.17 seconds
16375 corlib: 17.39 seconds
16377 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
16379 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
16380 time we are returning 0 members, so we save alot here.
16382 2003-12-11 Martin Baulig <martin@ximian.com>
16384 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
16385 `MergeChild()', also just take the `FlowBranching' as argument;
16386 call Merge() on it and return the result.
16387 (FlowBranching.Merge): We don't need to do anything if we just
16390 2003-12-11 Martin Baulig <martin@ximian.com>
16392 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
16393 them in an `ArrayList' to reduce memory usage. Thanks to Ben
16394 Maurer for this idea.
16396 2003-12-11 Martin Baulig <martin@ximian.com>
16398 * flowanalysis.cs (MergeResult): This class is now gone; we now
16399 use the `UsageVector' for this. The reason for this is that if a
16400 branching just has one sibling, we don't need to "merge" them at
16401 all - that's the next step to do.
16402 (FlowBranching.Merge): We now return a `UsageVector' instead of a
16405 2003-12-11 Martin Baulig <martin@ximian.com>
16407 Reworked flow analyis and made it more precise and bug-free. The
16408 most important change is that we're now using a special `Reachability'
16409 class instead of having "magic" meanings of `FlowReturns'. I'll
16410 do some more cleanups and optimizations and also add some more
16411 documentation this week.
16413 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
16414 largely reworked this class.
16415 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
16416 the new `Reachability' class instead of having "magic" values here.
16417 (FlowBranching): We're now using an instance of `Reachability'
16418 instead of having separate `Returns', `Breaks' etc. fields.
16420 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
16421 based on flow analysis; ignore the return value of block.Emit ().
16423 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
16425 * driver.cs typemanager.cs: Find the mono extensions to corlib even
16426 if they are private.
16428 2003-12-09 Martin Baulig <martin@ximian.com>
16430 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
16431 call them directly on the UsageVector.
16433 2003-12-09 Martin Baulig <martin@ximian.com>
16435 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
16436 Changed return type from `FlowReturns' to `Reachability'.
16438 2003-12-09 Martin Baulig <martin@ximian.com>
16440 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
16441 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
16442 `Reachable' fields with a single `Reachability' one.
16444 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
16446 * class.cs (FindMembers): Remove foreach's.
16451 Run 1: 8.74 seconds
16452 Run 2: 8.71 seconds
16455 Run 1: 8.64 seconds
16456 Run 2: 8.58 seconds
16459 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
16464 This patch does a few things:
16465 1. EmptyStatement is now a singleton, so it is never reallocated.
16466 2. All blah is EmptyStatement constructs have been changed to
16467 blah == EmptyStatement.Value, which is much faster and valid
16468 now that EmptyStatement is a singleton.
16469 3. When resolving a block, rather than allocating a new array for
16470 the non-empty statements, empty statements are replaced with
16471 EmptyStatement.Value
16472 4. Some recursive functions have been made non-recursive.
16473 Mainly the performance impact is from (3), however (1) and (2) are needed for
16474 this to work. (4) does not make a big difference in normal situations, however
16475 it makes the profile look saner.
16480 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
16481 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
16482 Total memory allocated: 56397 KB
16485 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
16486 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
16487 Total memory allocated: 55666 KB
16489 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
16491 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
16492 than the hashtable in a hashtable version
16494 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
16495 we always end up concating a string. This results in a huge perf
16496 loss, because many strings have to be tracked by the GC. In this
16497 patch, we first use a hashtable that works with two keys, so that
16498 the strings do not need to be concat'ed.
16502 Run 1: 8.74 seconds
16503 Run 2: 8.71 seconds
16506 Run 1: 8.65 seconds
16507 Run 2: 8.56 seconds
16509 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
16511 * Makefile: Add a new target `do-time' that does a quick and simple
16512 profile, leaving easy to parse output.
16514 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
16516 * codegen.cs (Init): Create the dynamic assembly with
16517 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
16519 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
16521 * support.cs: Make the PtrHashtable use only one
16522 instance of its comparer.
16524 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
16526 * typemanager.cs: Fix lookup of GetNamespaces.
16528 2003-11-29 Miguel de Icaza <miguel@ximian.com>
16530 * expression.cs: Removed redundant line.
16532 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
16533 ArrayLists, use for loops with bounds.
16535 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
16538 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
16539 arraylists, use for loop with bounds.
16541 The above three changes give us a 0.071 second performance
16542 improvement out of 3.294 seconds down to 3.223. On my machine
16543 the above changes reduced the memory usage by 1,387 KB during
16544 compiler bootstrap.
16546 * cs-parser.jay (QualifiedIdentifier): New class used to represent
16547 QualifiedIdentifiers. Before we created a new string through
16548 concatenation, and mostly later on, the result would be
16549 manipulated by DecomposeQI through string manipulation.
16551 This reduced the compiler memory usage for bootstrapping from
16552 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
16553 compile times in 0.05 seconds.
16555 2003-11-28 Dick Porter <dick@ximian.com>
16557 * support.cs: Do string compares with the Invariant culture.
16565 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
16566 the comparison is done with the Invariant culture.
16568 2003-11-27 Miguel de Icaza <miguel@ximian.com>
16570 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
16571 GetEnumerator method.
16573 (ProbeCollectionType): Iterate starting at the most specific type
16574 upwards looking for a GetEnumerator
16576 * expression.cs: Shift count can be up to 31 for int/uint and 63
16579 2003-11-26 Miguel de Icaza <miguel@ximian.com>
16581 * statement.cs (Block.LookupLabel): Also look for the label on the
16582 children blocks. Use a hash table to keep track of visited
16585 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
16586 we actually did transform the other operand, otherwise fall back
16587 to the common codepath that casts to long.
16589 * cs-tokenizer.cs: Use the same code pattern as the int case.
16590 Maybe I should do the parsing myself, and avoid depending on the
16591 Parse routines to get this done.
16593 2003-11-25 Miguel de Icaza <miguel@ximian.com>
16595 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
16596 which fixes bug 51347. This time test it.
16598 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
16599 attributes for example can not tell the difference between these.
16600 The difference was only a syntax feature of the language.
16602 * attribute.cs: Apply attributes to delegates.
16604 * delegate.cs: Call the apply attributes method.
16606 2003-11-24 Miguel de Icaza <miguel@ximian.com>
16608 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
16609 comparing 0 vs Byte.MinValue, not the value
16611 (ImplicitConversionRequired): When reporting a conversion error,
16612 use error 31 to print out the constant error instead of the
16615 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
16616 which fixes bug 51347.
16618 2003-11-22 Miguel de Icaza <miguel@ximian.com>
16620 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
16621 which fixes the -warnaserror command line option.
16623 2003-11-21 Miguel de Icaza <miguel@ximian.com>
16625 * cfold.cs (DoNumericPromotions): During constant folding of
16626 additions on UIntConstant, special case intconstants with
16627 IntConstants like we do on the expression binary operator.
16629 2003-11-12 Miguel de Icaza <miguel@ximian.com>
16631 * convert.cs (ImplicitReferenceConversion): We were missing a case
16632 (System.Enum are not value types or class types, so we need to
16633 classify them separatedly).
16635 * driver.cs: We do not support error 2007.
16637 2003-11-12 Jackson Harper <jackson@ximian.com>
16639 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
16640 system directory. Also use the full file name so users can
16641 libraries names mscorlib-o-tron.dll in a non system dir.
16643 2003-11-10 Martin Baulig <martin@ximian.com>
16645 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
16646 (TypeManager.InitCoreTypes): Initialize them here, but instead of
16647 calling `ResolveType()' on them, directly assign their `Type'.
16649 2003-11-08 Martin Baulig <martin@ximian.com>
16651 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
16652 return value and the `out parent' parameter.
16653 (TypeContainer.DefineType): Moved the CS0644 check into
16654 GetClassBases(). Don't pass the interface types to the
16655 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
16656 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
16658 * ecore.cs (TypeExpr.IsAttribute): New property.
16659 (TypeExpr.GetInterfaces): New method.
16661 * interface.cs (Interface.GetInterfaceTypeByName): Return a
16662 TypeExpr instead of a Type.
16663 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
16664 (Interface.DefineType): Don't pass the interface types to the
16665 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
16666 them later and then call `TypeBulider.AddInterfaceImplementation()'.
16668 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
16669 instead of a `Type[]'.
16670 (TypeManager.RegisterBuilder): Likewise.
16671 (TypeManager.AddUserInterface): Likewise.
16672 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
16673 `Type[]' and also return a `TypeExpr[]'.
16674 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
16676 2003-11-08 Martin Baulig <martin@ximian.com>
16678 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
16681 2003-11-08 Martin Baulig <martin@ximian.com>
16683 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
16684 TypeManager.ResolveExpressionTypes().
16686 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
16687 instead of an Expression.
16688 (TypeExpr): This is now an abstract base class for `TypeExpression'.
16689 (TypeExpression): New public class; formerly known as `TypeExpr'.
16691 * expression.cs (ComposedCast): Derive from TypeExpr.
16693 * typemanager.cs (TypeManager.system_*_expr): These are now
16694 TypExpr's instead of Expression's.
16695 (TypeManager.ResolveExpressionTypes): New public static function;
16696 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
16699 2003-11-06 Miguel de Icaza <miguel@ximian.com>
16701 * expression.cs (New.DoResolve): Do not dereference value that
16702 might be a null return.
16704 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
16705 sure that the constant value has the right type. Fixes an
16706 unreported bug, similar to 50425.
16708 * const.cs (Const.LookupConstantValue): Call
16709 ImplicitStandardConversionExists before doing a conversion to
16710 avoid havng the TypeManager.ChangeType do conversions.
16712 Reduced the number of casts used
16714 (Const.ChangeType): New routine to enable reuse of the constant
16715 type changing code from statement.
16717 * typemanager.cs (ChangeType): Move common initialization to
16718 static global variables.
16722 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
16723 every value type to go through, even if it was void. Fix that.
16725 * cs-tokenizer.cs: Use is_identifier_start_character on the start
16726 character of the define, and the is_identifier_part_character for
16727 the rest of the string.
16729 2003-11-05 Miguel de Icaza <miguel@ximian.com>
16731 * expression.cs (UnaryMutator.EmitCode): When I updated
16732 LocalVariableReference.DoResolve, I overdid it, and dropped an
16733 optimization done on local variable references.
16735 2003-11-04 Miguel de Icaza <miguel@ximian.com>
16737 * ecore.cs: Convert the return from Ldlen into an int.
16739 2003-10-20 Miguel de Icaza <miguel@ximian.com>
16741 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
16742 the accessibility, this is a special case for toplevel non-public
16743 classes (internal for instance).
16745 2003-10-20 Nick Drochak <ndrochak@gol.com>
16747 * ecore.cs: Fix typo and build. Needed another right paren.
16749 2003-10-19 Miguel de Icaza <miguel@ximian.com>
16751 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
16752 `internal' case regular and protected, but not allowing protected
16753 to be evaluated later. Bug 49840
16755 2003-10-15 Miguel de Icaza <miguel@ximian.com>
16757 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
16758 to kb.Nlast, and not the kb.nFirst to isolate the switch
16761 Extract the underlying type, so enumerations of long/ulong are
16762 treated like long/ulong.
16764 2003-10-14 Miguel de Icaza <miguel@ximian.com>
16766 * expression.cs (New): Overload the meaning of RequestedType to
16767 track the possible creation of the NewDelegate type, since
16768 DoResolve is invoked more than once for new constructors on field
16771 See bugs: #48800 and #37014
16773 * cs-parser.jay (declare_local_constants): Take an arraylist
16774 instead of a single constant.
16776 (local_constant_declaration): It should take a
16777 constant_declarators, not a constant_declarator. Fixes 49487
16779 * convert.cs: Fix error report.
16781 2003-10-13 Jackson Harper <jackson@ximian.com>
16783 * typemanager.cs (TypeToCoreType): Add float and double this fixes
16786 2003-10-09 Martin Baulig <martin@ximian.com>
16788 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
16790 (MethodCore.DoDefineParameters): Removed the TypeContainer
16791 argument; use the DeclSpace which was passed to the .ctor instead.
16792 (MethodCore.CheckParameter): Take a DeclSpace instead of a
16793 TypeContainer; we only need a DeclSpace here.
16795 2003-10-09 Martin Baulig <martin@ximian.com>
16797 * class.cs (MethodData): Added additional `DeclSpace ds' argument
16799 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
16800 EmitContext's .ctor.
16802 2003-10-09 Martin Baulig <martin@ximian.com>
16804 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
16805 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
16806 AsAccessible(), moved them as well.
16808 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
16810 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
16812 * cs-parser.jay : Renamed yyName to yyNames related to jay.
16814 2003-10-07 Miguel de Icaza <miguel@ximian.com>
16816 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
16817 generation for >=, as spotted by Paolo, bug 48679.
16818 Patch from David Waite.
16820 * cs-tokenizer.cs: Add handling for #pragma.
16822 * cs-parser.jay: Allow for both yield and yield return in the
16823 syntax. The anti-cobolization of C# fight will go on!
16825 * class.cs (TypeBuilder.DefineType): Catch error condition here
16826 (Parent.DefineType erroring out and returning null).
16828 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
16829 coping with enumerations variables, we were mistakenly processing
16830 them as a regular value type instead of built-in types. Fixes the
16833 * typemanager.cs (IsBuiltinOrEnum): New method.
16835 2003-09-30 Miguel de Icaza <miguel@ximian.com>
16837 * cs-parser.jay: Upgrade: yield now needs the return clause.
16839 2003-09-19 Martin Baulig <martin@ximian.com>
16841 * decl.cs (MemberCache.SetupCacheForInterface): Take a
16842 `MemberCache parent' argument. Normally, an interface doesn't
16843 have a parent type except System.Object, but we use this in gmcs
16844 for generic type parameters.
16846 2003-09-18 Martin Baulig <martin@ximian.com>
16848 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
16849 on `type.IsInterface'; don't check whether the type has a parent
16850 to determine whether it's an interface.
16852 2003-09-15 Martin Baulig <martin@ximian.com>
16854 * class.cs (TypeContainer.DefineType): Added an error flag to
16855 avoid reporting duplicate CS0146's ("class definition is
16858 * driver.cs (Driver.MainDriver): Abort if
16859 RootContext.ResolveTree() reported any errors.
16861 2003-09-07 Martin Baulig <martin@ximian.com>
16863 * report.cs (Error, Warning): Added overloaded versions which take
16864 a `params object[] args' and call String.Format().
16866 2003-09-07 Martin Baulig <martin@ximian.com>
16868 * decl.cs (DeclSpace..ctor): Don't call
16869 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
16870 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
16871 (DeclSpace.RecordDecl): New method.
16873 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
16875 2003-09-02 Ravi Pratap <ravi@ximian.com>
16877 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
16878 value attributes to be applied to ParameterBuilders.
16880 * class.cs (MethodCore.LabelParameters): Make static and more
16881 generic so that it can be used from other places - like interface
16882 methods, for instance.
16884 * interface.cs (Interface.Emit): Call LabelParameters before
16885 emitting attributes on the InterfaceMethod.
16887 2003-08-26 Martin Baulig <martin@ximian.com>
16889 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
16890 resolving aliases; fixes #47927.
16892 2003-08-26 Martin Baulig <martin@ximian.com>
16894 * statement.cs (Using.DoResolve): This is internally emitting a
16895 try/finally clause, so we need to set ec.NeedExplicitReturn if we
16896 do not always return. Fixes #47681.
16898 2003-08-26 Martin Baulig <martin@ximian.com>
16900 * decl.cs (MemberCore): Moved WarningNotHiding(),
16901 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
16903 (AdditionResult): Make this nested in DeclSpace.
16904 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
16905 argument; call NamespaceEntry.Define() unless we're nested in a
16908 * namespace.cs (Namespace.DefineName): New public function. This
16909 is called from DeclSpace's .ctor to add
16910 (Namespace.Lookup): Include DeclSpaces in the lookup.
16912 * class.cs (Operator): Derive from MemberBase, not MemberCore.
16914 * const.cs (Const): Derive from MemberBase, not MemberCore.
16916 2003-08-25 Martin Baulig <martin@ximian.com>
16918 * convert.cs (Convert.ExplicitReferenceConversion): When
16919 converting from an interface type to a class, unbox if the target
16920 type is a struct type. Fixes #47822.
16922 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16924 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
16927 2003-08-22 Martin Baulig <martin@ximian.com>
16929 * class.cs (TypeManager.DefineType): When defining a nested type,
16930 call DefineType() on our parent; fixes #47801.
16932 2003-08-22 Martin Baulig <martin@ximian.com>
16934 * class.cs (MethodData.Define): While checking if a method is an
16935 interface implementation, improve the test a bit more to fix #47654.
16937 2003-08-22 Martin Baulig <martin@ximian.com>
16939 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
16940 correctly; fixes #47722.
16942 2003-08-22 Martin Baulig <martin@ximian.com>
16944 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
16945 LocalVariableReference, ensure it's not read-only. Fixes #47536.
16947 * statement.cs (Fixed.DoResolve): Make all variables read-only.
16949 2003-08-22 Martin Baulig <martin@ximian.com>
16951 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
16952 can only be assigned in static constructors. Fixes #47161.
16954 2003-08-22 Martin Baulig <martin@ximian.com>
16956 Rewrote and improved the flow analysis code.
16958 * flowbranching.cs (FlowBranching): Make this class abstract.
16959 (FlowBranching.CreateBranching): New static function to create a
16960 new flow branching.
16961 (FlowBranchingBlock, FlowBranchingException): New classes.
16962 (FlowBranching.UsageVector.Type): New public readonly field.
16963 (FlowBranching.UsageVector.Breaks): Removed the setter.
16964 (FlowBranching.UsageVector.Returns): Removed the setter.
16965 (FlowBranching.UsageVector): Added Break(), Return(),
16966 NeverReachable() and Throw() methods to modify the reachability.
16967 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
16968 done by FlowBranching.Merge().
16969 (FlowBranching.UsageVector.MergeChild): New method; merges the
16970 merge result into the current vector.
16971 (FlowBranching.Merge): New abstract method to merge a branching.
16973 2003-08-12 Martin Baulig <martin@ximian.com>
16975 * expression.cs (Indirection.CacheTemporaries): Create the
16976 LocalTemporary with the pointer type, not its element type.
16978 2003-08-10 Miguel de Icaza <miguel@ximian.com>
16980 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
16981 token was a keyword or not.
16983 Add `error' options where an IDENTIFIER was expected; Provide
16984 CheckToken and CheckIdentifierToken convenience error reporting
16987 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
16989 * decl.cs: Rename `NamespaceEntry Namespace' public field into
16990 NameSpaceEntry NameSpaceEntry.
16992 (LookupInterfaceOrClass): Avoid creating a full qualified name
16993 from namespace and name: avoid doing lookups when we know the
16994 namespace is non-existant. Use new Tree.LookupByNamespace which
16995 looks up DeclSpaces based on their namespace, name pair.
16997 * driver.cs: Provide a new `parser verbose' to display the
16998 exception thrown during parsing. This is turned off by default
16999 now, so the output of a failure from mcs is more graceful.
17001 * namespace.cs: Track all the namespaces defined in a hashtable
17004 (IsNamespace): New method
17006 2003-08-09 Miguel de Icaza <miguel@ximian.com>
17008 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
17009 we know that we need to concatenate (full typename can never be
17014 * statement.cs: Use a bitfield; Do not initialize to null things
17015 which are done by the constructor by default.
17017 * cs-parser.jay: bug fix, parameter was 4, not 3.
17019 * expression.cs: Just use the property;
17021 * statement.cs: No need for GetVariableInfo method.
17023 2003-08-08 Martin Baulig <martin@ximian.com>
17025 * flowanalysis.cs (FlowReturns): This is now nested in the
17026 `FlowBranching' class.
17027 (MyBitVector): Moved this here from statement.cs.
17028 (FlowBranching.SiblingType): New enum type.
17029 (FlowBranching.CreateSibling): Added `SiblingType' argument.
17031 2003-08-07 Martin Baulig <martin@ximian.com>
17033 * flowanalysis.cs (FlowBranchingType): This is now nested in the
17034 `FlowBranching' class and called `BranchingType'.
17036 2003-08-07 Martin Baulig <martin@ximian.com>
17038 * flowanalysis.cs: Moved all the control flow analysis code into
17041 2003-08-07 Martin Baulig <martin@ximian.com>
17043 * assign.cs (Assign.DoResolve): `target' must either be an
17044 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
17047 2003-08-07 Miguel de Icaza <miguel@ximian.com>
17049 * expression.cs (BinaryMethod): This kind of expression is created by the
17050 Binary class if it determines that the operator has to be handled
17053 (BinaryDelegate): This kind of expression is created if we are
17054 dealing with a + or - operator on delegates.
17056 (Binary): remove method, argumetns, and DelegateOperator: when
17057 dealing with methods,
17059 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
17061 * statement.cs (Block): use bitfields for the three extra booleans
17062 we had in use. Remove unused topblock parameter.
17064 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
17066 * assign.cs: Drop extra unneeded tests.
17068 2003-08-06 Miguel de Icaza <miguel@ximian.com>
17070 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
17072 * statement.cs (Foreach): Use VariableStorage instead of
17075 * codegen.cs (VariableStorage): New class used by clients that
17076 require a variable stored: locals or fields for variables that
17077 need to live across yield.
17079 Maybe provide a convenience api for EmitThis+EmitLoad?
17081 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
17084 2003-08-05 Miguel de Icaza <miguel@ximian.com>
17086 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
17087 RemapParameterLValue): New methods that are used to turn a
17088 precomputed FieldInfo into an expression like this:
17092 The idea is to use this instead of making LocalVariableReference
17093 have more than one meaning.
17095 * cs-parser.jay: Add error production to BASE.
17097 * ecore.cs: Deal with TypeManager.GetField returning null, which
17098 is now a valid return value.
17100 (FieldExprNoAddress): New expression for Fields whose address can
17103 * expression.cs (LocalVariableReference): During the resolve
17104 phases, create new expressions if we are in a remapping context.
17105 Remove code that dealt with remapping here.
17107 (ParameterReference): same.
17109 (ProxyInstance): New expression, like the `This' expression, but
17110 it is born fully resolved. We know what we are doing, so remove
17111 the errors that are targeted to user-provided uses of `this'.
17113 * statement.cs (Foreach): our variable is now stored as an
17114 Expression; During resolution, follow the protocol, dont just
17115 assume it will return this.
17117 2003-08-06 Martin Baulig <martin@ximian.com>
17119 * support.cs (SeekableStreamReader.cs): New public class.
17121 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
17122 SeekableStreamReader instead of the normal StreamReader.
17124 2003-08-04 Martin Baulig <martin@ximian.com>
17126 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
17127 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
17128 deambiguate casts and delegate invocations.
17129 (parenthesized_expression): Use the new tokens to ensure this is
17130 not a cast of method invocation.
17132 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
17133 when reading a `)' and Deambiguate_CloseParens () was previously
17136 * expression.cs (ParenthesizedExpression): New class. This is
17137 just used for the CS0075 test.
17138 (Binary.DoResolve): Check for CS0075.
17140 2003-07-29 Ravi Pratap <ravi@ximian.com>
17142 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
17143 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
17144 reference comparison.
17146 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
17147 examine the ReturnType for equality - this is necessary in the
17148 cases of implicit and explicit operators whose signature also
17149 includes the return type.
17151 2003-07-26 Miguel de Icaza <miguel@ximian.com>
17153 * namespace.cs: Cache the result of the namespace computation,
17154 instead of computing it every time.
17156 2003-07-24 Miguel de Icaza <miguel@ximian.com>
17158 * decl.cs: Use a global arraylist that we reuse over invocations
17159 to avoid excesive memory consumption. Reduces memory usage on an
17160 mcs compile by one meg (45 average).
17162 * typemanager.cs (LookupTypeReflection): In .NET pointers are
17163 private, work around that.
17165 2003-07-23 Miguel de Icaza <miguel@ximian.com>
17167 * literal.cs (IntLiteral): Define Zero and One static literals.
17169 * cs-parser.jay (integer_literal): use static literals to reduce
17170 memory usage for the most used literals (0, 1 and -1). 211kb
17171 reduced in memory usage.
17173 Replace all calls to `new ArrayList' with `new
17174 ArrayList(4)' which is a good average number for most allocations,
17175 and also requires only 16 bytes of memory for its buffer by
17178 This reduced MCS memory usage in seven megabytes for the RSS after
17181 2003-07-28 Ravi Pratap <ravi@ximian.com>
17183 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
17184 handle params methods the correct way by forming only one
17185 applicable set with params and normal methods in them. Earlier we
17186 were looking at params methods only if we found no normal methods
17187 which was not the correct thing to do.
17189 (Invocation.BetterFunction): Take separate arguments indicating
17190 when candidate and the best method are params methods in their
17193 This fixes bugs #43367 and #46199.
17195 * attribute.cs: Documentation updates.
17197 (CheckAttribute): Rename to CheckAttributeTarget.
17198 (GetValidPlaces): Rename to GetValidTargets.
17200 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
17201 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
17205 2003-07-28 Martin Baulig <martin@ximian.com>
17207 * class.cs (TypeContainer.DefineMembers): Use the base type's full
17208 name when looking up the base class of a nested class. Fixes #46977.
17210 2003-07-26 Martin Baulig <martin@ximian.com>
17212 * expression.cs (Indexers.Indexer): New nested struct; contains
17213 getter, setter and the indexer's type.
17214 (Indexers.Properties): This is now an ArrayList of
17215 Indexers.Indexer's.
17216 (IndexerAccess.DoResolveLValue): Correctly set the type if the
17217 indexer doesn't have any getters.
17219 * assign.cs (Assign.DoResolve): Also do the implicit conversions
17220 for embedded property and indexer assignments.
17222 2003-07-26 Martin Baulig <martin@ximian.com>
17224 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
17225 preprocessor directive is not the first non-whitespace character
17228 2003-07-26 Martin Baulig <martin@ximian.com>
17230 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
17231 namespace parsing, follow the spec more closely.
17233 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
17234 NamespaceEntry.Lookup().
17236 2003-07-25 Martin Baulig <martin@ximian.com>
17238 * MethodCore.cs (OverridesSomething): New public field; it's set
17239 from TypeContainer.DefineMembers if this method overrides
17240 something (which doesn't need to be a method). Fix #39462.
17242 2003-07-25 Ravi Pratap <ravi@ximian.com>
17244 * typemanager.cs (GetMembers): Ensure that the list of members is
17245 reversed. This keeps things in sync.
17247 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
17248 find an AttributeUsage attribute.
17250 * expression.cs (Invocation.OverloadResolve): Perform the check
17251 which disallows Invoke to be directly called on a Delegate.
17253 (Error_InvokeOnDelegate): Report error cs1533.
17255 2003-07-25 Martin Baulig <martin@ximian.com>
17257 * expression.cs (Indexers.GetIndexersForType): Only look in the
17258 interface hierarchy if the requested type is already an
17259 interface. Fixes #46788 while keeping #46502 fixed.
17261 2003-07-25 Martin Baulig <martin@ximian.com>
17263 * class.cs (TypeContainer.DefineMembers): Check whether all
17264 readonly fields have been assigned and report warning CS0649 if
17267 * statement.cs (LocalInfo.IsFixed): Always return true if this is
17270 2003-07-24 Ravi Pratap <ravi@ximian.com>
17272 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
17273 returned from GetMethods to make things consistent with the
17274 assumptions MCS makes about ordering of methods.
17276 This should comprehensively fix bug #45127 and it does :-)
17278 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
17279 ordering is actually reverse.
17281 * Clean up some debug messages I left lying around.
17283 * interface.cs (Populate*): Get rid of code which emits attributes
17284 since the stage in which we emit attributes is the 'Emit' stage,
17285 not the define stage.
17287 (Emit): Move attribute emission for interface members here.
17289 2003-07-22 Ravi Pratap <ravi@ximian.com>
17291 * expression.cs (Invocation.OverloadResolve): Follow the spec more
17292 closely: we eliminate methods in base types when we have an
17293 applicable method in a top-level type.
17295 Please see section 14.5.5.1 for an exact description of what goes
17298 This fixes bug #45127 and a host of other related to corlib compilation.
17300 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
17301 array is the method corresponding to the top-level type (this is
17302 because of the changes made to icall.c) so we change this
17305 (MethodGroupExpr.Name): This too.
17307 * typemanager.cs (GetElementType): New method which does the right
17308 thing when compiling corlib.
17310 * everywhere: Make use of the above in the relevant places.
17312 2003-07-22 Martin Baulig <martin@ximian.com>
17314 * cs-parser.jay (invocation_expression): Moved
17315 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
17316 `cast_expression', but create a InvocationOrCast which later
17317 resolves to either an Invocation or a Cast.
17319 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
17320 method; call this before EmitStatement() to make sure that this
17321 expression can be used as a statement.
17323 * expression.cs (InvocationOrCast): New class; resolves to either
17324 an Invocation or a Cast.
17326 * statement.cs (StatementExpression): Call ResolveStatement() on
17327 the ExpressionStatement before emitting it.
17329 2003-07-21 Martin Baulig <martin@ximian.com>
17331 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
17332 `ref' and `out' attributes match; fixes #46220.
17333 (MemberAccess.ResolveMemberAccess): You can't reference a type
17334 through an expression; fixes #33180.
17335 (Indexers.GetIndexersForType): Don't return the indexers from
17336 interfaces the class implements; fixes #46502.
17338 2003-07-21 Martin Baulig <martin@ximian.com>
17340 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
17341 CS0661 checks; fixes bug #30442.
17343 2003-07-21 Martin Baulig <martin@ximian.com>
17345 * decl.cs (AdditionResult): Added `Error'.
17347 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
17349 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
17350 makes cs0031.cs actually work.
17352 2003-07-20 Martin Baulig <martin@ximian.com>
17354 * namespace.cs: Fixed that bug which caused a crash when compiling
17355 the debugger's GUI.
17357 2003-07-20 Miguel de Icaza <miguel@ximian.com>
17359 * typemanager.cs (LookupTypeReflection): Never expose types which
17360 are NotPublic, NestedPrivate, NestedAssembly, or
17361 NestedFamANDAssem. We used to return these, and later do a check
17362 that would report a meaningful error, but the problem is that we
17363 would not get the real match, if there was a name override.
17365 2003-07-18 Miguel de Icaza <miguel@ximian.com>
17367 * namespace.cs (Namespace, Name): Do not compute the namespace
17368 name dynamically, compute it in the constructor. This reduced
17369 memory usage by 1697 KB.
17371 * driver.cs: Use --pause to pause at the end.
17373 2003-07-17 Peter Williams <peter@newton.cx>
17375 * Makefile: Change the name of the test target so that it doesn't
17376 conflict with the recursive test target.
17378 2003-07-17 Miguel de Icaza <miguel@ximian.com>
17380 * expression.cs (LocalVariableReference.Emit, EmitAssign,
17381 AddressOf): Do not use EmitThis, that was wrong, use the actual
17384 2003-07-15 Miguel de Icaza <miguel@ximian.com>
17386 * class.cs (MethodData.Define): While checking if a method is an
17387 interface implementation, improve the test: If we are not public
17388 (use new test here: use the computed MethodAttributes directly,
17389 instead of the parsed modifier flags) check if the `implementing'
17390 method comes from an interface or not.
17392 * pending.cs (VerifyPendingMethods): Slightly better error
17395 * makefile: add test target that does the mcs bootstrap.
17397 2003-07-16 Ravi Pratap <ravi@ximian.com>
17399 * interface.cs (Define): Do nothing here since there are no
17400 members to populate etc. Move the attribute emission out of here
17401 since this was just totally the wrong place to put it. Attribute
17402 application happens during the 'Emit' phase, not in the 'Define'
17405 (Emit): Add this method and move the attribute emission here
17407 * rootcontext.cs (EmitCode): Call the Emit method on interface
17410 2003-07-14 Ravi Pratap M <ravi@ximian.com>
17412 * expression.cs (OverloadResolve): Report error only if Location
17413 is not 'Null' which means that there was a probe going on.
17415 2003-07-14 Martin Baulig <martin@ximian.com>
17417 * expression.cs (ConditionalLogicalOperator): New public class to
17418 implement user defined conditional logical operators.
17419 This is section 14.11.2 in the spec and bug #40505.
17421 2003-07-14 Martin Baulig <martin@ximian.com>
17423 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
17425 2003-07-14 Martin Baulig <martin@ximian.com>
17427 * codegen.cs (EmitContext.InFixedInitializer): New public field.
17429 * ecore.cs (IVariable.VerifyFixed): New interface method.
17431 * expression.cs (Unary.ResolveOperator): When resolving the `&'
17432 operator, check whether the variable is actually fixed. Fixes bug
17433 #36055. Set a variable definitely assigned when taking its
17434 address as required by the spec.
17436 * statement.cs (LocalInfo.IsFixed): New field.
17437 (LocalInfo.MakePinned): Set `IsFixed' to true.
17439 2003-07-14 Ravi Pratap M <ravi@ximian.com>
17441 * attribute.cs (Attribute.Resolve): While doing a Member lookup
17442 for .ctors, ensure that we only ask for members declared in the
17443 attribute type (BindingFlags.DeclaredOnly).
17447 * expression.cs (Error_WrongNumArguments): Report error 1501
17448 correctly the way CSC does.
17450 2003-07-13 Martin Baulig <martin@ximian.com>
17452 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
17453 lookup on the fully qualified name, to make things like "X.X" work
17454 where "X.X" is a fully qualified type name, but we also have a
17455 namespace "X" in the using list. Fixes #41975.
17457 2003-07-13 Martin Baulig <martin@ximian.com>
17459 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
17460 function. If we're a CompoundAssign, we need to create an embedded
17461 CompoundAssign, not an embedded Assign.
17462 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
17465 2003-07-13 Martin Baulig <martin@ximian.com>
17467 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
17468 work to fix bug #46088.
17470 2003-07-13 Ravi Pratap <ravi@ximian.com>
17472 * class.cs (Operator.Emit): Do not emit attributes here - it is
17473 taken care of by the Method class that we delegate too. This takes
17474 care of bug #45876.
17476 2003-07-10 Martin Baulig <martin@ximian.com>
17478 * expression.cs (TypeOfVoid): New class.
17479 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
17481 2003-07-10 Martin Baulig <martin@ximian.com>
17483 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
17486 2003-07-10 Martin Baulig <martin@ximian.com>
17488 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
17489 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
17491 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
17493 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
17495 2003-07-10 Martin Baulig <martin@ximian.com>
17497 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
17498 of decimal. Fixes #42850.
17500 NOTE: I also fixed the created byte blob, but this doesn't work on
17501 the MS runtime and csc never produces any byte blobs for decimal
17504 2003-07-10 Martin Baulig <martin@ximian.com>
17506 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
17507 structs; fixes #32068.
17508 (Block.AddChildVariableNames): Fixed #44302.
17510 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17512 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
17514 2003-07-07 Miguel de Icaza <miguel@ximian.com>
17516 * attribute.cs: And this test is onger needed.
17518 2003-07-08 Martin Baulig <martin@ximian.com>
17520 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
17521 inaccessible types. Fixes #36313.
17523 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
17525 * namespace.cs (NamespaceEntry): Create implicit entries for all
17526 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
17527 implicit entries for N1.N2 and N1.
17529 2003-07-08 Martin Baulig <martin@ximian.com>
17531 Rewrote the handling of namespaces to fix a lot of the issues
17532 wrt. `using' aliases etc.
17534 * namespace.cs (Namespace): Splitted this class into a
17535 per-assembly `Namespace' and a per-file `NamespaceEntry'.
17537 * typemanager.cs (TypeManager.IsNamespace): Removed.
17538 (TypeManager.ComputeNamespaces): Only compute namespaces from
17539 loaded assemblies here, not the namespaces from the assembly we're
17540 currently compiling.
17542 2003-07-08 Martin Baulig <martin@ximian.com>
17544 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
17546 2003-07-07 Miguel de Icaza <miguel@ximian.com>
17548 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
17551 I thought about the memory savings here, but LookupTypeReflection
17552 is used under already very constrained scenarios. Compiling
17553 corlib or mcs only exposes one hit, so it would not really reduce
17554 any memory consumption.
17556 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17558 * typemanager.cs: fixes bug #45889 by only adding public types from
17559 other assemblies to the list of known types.
17561 2003-07-07 Miguel de Icaza <miguel@ximian.com>
17563 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
17564 on the type we resolved.
17566 2003-07-05 Martin Baulig <martin@ximian.com>
17568 * pending.cs (PendingImplementation.ParentImplements): Don't
17569 create the proxy if the parent is abstract.
17571 * class.cs (TypeContainer.DefineIndexers): Process explicit
17572 interface implementations first. Fixes #37714.
17574 2003-07-04 Miguel de Icaza <miguel@ximian.com>
17576 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
17577 defined recursively; but since we modify the input parameters
17578 (left is set to `this' temporarily), we reset this value if the
17579 left_is_explicit is false, which gives the original semantics to
17582 * literal.cs (NullPointer): new class used to represent a null
17583 literal in a pointer context.
17585 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
17586 type is a pointer, use a NullPointer object instead of a
17587 NullLiteral. Closes 43687
17589 (ExplicitConversion): Convert pointer values using
17590 the conv opcode to the proper type.
17592 * ecore.cs (New): change ValueTypeVariable property into a method,
17593 that returns whether the valuetype is suitable for being used.
17595 * expression.cs (Binary.DoNumericPromotions): Only return if we
17596 the int constant was a valid uint, and we can return both left and
17597 right as uints. If not, we continue processing, to trigger the
17598 type conversion. This fixes 39018.
17600 * statement.cs (Block.EmitMeta): During constant resolution, set
17601 the CurrentBlock property on the emitcontext, so that we resolve
17602 constants propertly.
17604 2003-07-02 Martin Baulig <martin@ximian.com>
17606 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
17607 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
17609 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
17610 than emitting it here.
17612 * statement.cs: Fixed some more flow analysis bugs.
17614 2003-07-02 Martin Baulig <martin@ximian.com>
17616 * class.cs (MethodData.Define): When implementing interface
17617 methods, set Final unless we're Virtual.
17619 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
17620 check work for interface methods.
17622 2003-07-01 Martin Baulig <martin@ximian.com>
17624 * ecore.cs (EmitContext.This): Replaced this property with a
17625 GetThis() method which takes a Location argument. This ensures
17626 that we get the correct error location for a CS0188.
17628 2003-07-01 Miguel de Icaza <miguel@ximian.com>
17630 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
17631 ImplicitStandardConversion.
17633 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
17635 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
17637 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
17640 2003-06-30 Miguel de Icaza <miguel@ximian.com>
17642 * class.cs (Constructor.Define): Turn off initlocals for unsafe
17645 (MethodData.Define): Turn off initlocals for unsafe methods.
17647 2003-06-29 Miguel de Icaza <miguel@ximian.com>
17649 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
17650 complete; Fixes #37521.
17652 * delegate.cs: Use Modifiers.TypeAttr to compute the
17653 TypeAttributes, instead of rolling our own. This makes the flags
17654 correct for the delegates.
17656 2003-06-28 Miguel de Icaza <miguel@ximian.com>
17658 * class.cs (Constructor.Define): Set the private flag for static
17659 constructors as well.
17661 * cs-parser.jay (statement_expression): Set the return value to
17662 null, to avoid a crash when we catch an error.
17664 2003-06-24 Miguel de Icaza <miguel@ximian.com>
17666 * cs-parser.jay: Applied patch from Jackson that adds support for
17667 extern and unsafe modifiers to destructor declarations.
17669 * expression.cs: Report error 21 if the user is trying to index a
17672 * driver.cs: Add an error message, suggested by the bug report.
17674 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
17675 if we do not have a ": this ()" constructor initializer. Fixes 45149
17677 2003-06-14 Miguel de Icaza <miguel@ximian.com>
17679 * namespace.cs: Add some information to reduce FAQs.
17681 2003-06-13 Miguel de Icaza <miguel@ximian.com>
17683 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
17684 underlying enumeration types. Fixes #43915.
17686 * expression.cs: Treat ushort/short as legal values to be used in
17687 bitwise operations.
17689 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
17691 * delegate.cs: transfer custom attributes for paramenters from
17692 the delegate declaration to Invoke and BeginInvoke.
17694 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
17696 * attribute.cs: handle custom marshalers and emit marshal info
17699 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
17701 * makefile.gnu: Added anonymous.cs to the compiler sources.
17703 2003-05-28 Miguel de Icaza <miguel@ximian.com>
17705 * iterators.cs: Change the name of the proxy class to include two
17708 * cs-parser.jay: Update grammar to include anonymous methods.
17710 * anonymous.cs: new file.
17712 2003-05-27 Miguel de Icaza <miguel@ximian.com>
17714 * class.cs (Field.Define): Add missing test for pointers and
17717 2003-05-27 Ravi Pratap <ravi@ximian.com>
17719 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
17720 we use the stobj opcode.
17722 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
17723 since it wasn't the correct fix.
17725 It still is puzzling that we are required to use stobj for IntPtr
17726 which seems to be a ValueType.
17728 2003-05-26 Miguel de Icaza <miguel@ximian.com>
17730 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
17731 during regular simple name resolution. Now, the trick is that
17732 instead of returning for processing the simplename, we do a
17733 TypeManager.LookupType (ie, a rooted lookup as opposed to a
17734 contextual lookup type). If a match is found, return that, if
17735 not, return for further composition.
17737 This fixes long-standing 30485.
17739 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
17740 using the address to initialize an object, do an Stobj instead of
17741 using the regular Stelem.
17743 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
17744 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
17745 Because if we are a BaseIndexerAccess that value will be true.
17748 * statement.cs (GotoCase.Resolve): Return after reporting an
17749 error, do not attempt to continue.
17751 * expression.cs (PointerArithmetic.Emit): If our operand is a
17752 long, convert our constants to match the operand before
17753 multiplying. Convert to I type before adding. Fixes 43670.
17755 2003-05-14 Ravi Pratap <ravi@ximian.com>
17757 * enum.cs (ImplicitConversionExists) : Rename to
17758 ImplicitEnumConversionExists to remove ambiguity.
17760 * ecore.cs (NullCast): New type of cast expression class which
17761 basically is very similar to EmptyCast with the difference being
17762 it still is a constant since it is used only to cast a null to
17764 (eg. (string) null)
17766 * convert.cs (ImplicitReferenceConversion): When casting a null
17767 literal, we return a NullCast.
17769 * literal.cs (NullLiteralTyped): Remove - I don't see why this
17770 should be around anymore.
17772 The renaming (reported was slightly wrong). Corrections:
17774 ConvertImplicitStandard -> ImplicitConversionStandard
17775 ConvertExplicitStandard -> ExplicitConversionStandard
17777 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
17778 before passing them in !
17780 * convert.cs (ImplicitConversionStandard): When comparing for
17781 equal expr and target types, ensure that expr is not a
17784 In general, we must not be checking (expr_type ==
17785 target_type) in the top level conversion methods
17786 (ImplicitConversion, ExplicitConversion etc). This checking is
17787 done in the methods that they delegate to.
17789 2003-05-20 Miguel de Icaza <miguel@ximian.com>
17791 * convert.cs: Move Error_CannotConvertType,
17792 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
17793 ImplicitNumericConversion, ImplicitConversionExists,
17794 ImplicitUserConversionExists, StandardConversionExists,
17795 FindMostEncompassedType, FindMostSpecificSource,
17796 FindMostSpecificTarget, ImplicitUserConversion,
17797 ExplicitUserConversion, GetConversionOperators,
17798 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
17799 TryImplicitIntConversion, Error_CannotConvertImplicit,
17800 ConvertImplicitRequired, ConvertNumericExplicit,
17801 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
17802 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
17805 Perform the following renames:
17807 StandardConversionExists -> ImplicitStandardConversionExists
17808 ConvertImplicit -> ImplicitConversion
17809 ConvertImplicitStandard -> ImplicitStandardConversion
17810 TryImplicitIntConversion -> ImplicitIntConversion
17811 ConvertImplicitRequired -> ImplicitConversionRequired
17812 ConvertNumericExplicit -> ExplicitNumericConversion
17813 ConvertReferenceExplicit -> ExplicitReferenceConversion
17814 ConvertExplicit -> ExplicitConversion
17815 ConvertExplicitStandard -> ExplicitStandardConversion
17817 2003-05-19 Martin Baulig <martin@ximian.com>
17819 * statement.cs (TypeInfo.StructInfo): Made this type protected.
17820 (TypeInfo): Added support for structs having structs as fields.
17822 * ecore.cs (FieldExpr): Implement IVariable.
17823 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
17824 VariableInfo for the field.
17826 2003-05-18 Martin Baulig <martin@ximian.com>
17828 * expression.cs (This.DoResolve): Report a CS0027 if we're
17829 emitting a field initializer.
17831 2003-05-18 Martin Baulig <martin@ximian.com>
17833 * expression.cs (This.ResolveBase): New public function.
17834 (This.DoResolve): Check for CS0188.
17836 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
17839 * ecore.cs (MethodGroupExpr.DoResolve): Set the
17840 `instance_expression' to null if we don't have any non-static
17843 2003-05-18 Martin Baulig <martin@ximian.com>
17845 Reworked the way how local variables and parameters are handled by
17846 the flow analysis code.
17848 * statement.cs (TypeInfo, VariableMap): New public classes.
17849 (VariableInfo): New public class. This is now responsible for
17850 checking whether a variable has been assigned. It is used for
17851 parameters and local variables.
17852 (Block.EmitMeta): Take the InternalParameters as argument; compute
17853 the layout of the flow vectors here.
17854 (Block.LocalMap, Block.ParameterMap): New public properties.
17855 (FlowBranching): The .ctor doesn't get the InternalParameters
17856 anymore since Block.EmitMeta() now computes the layout of the flow
17858 (MyStructInfo): This class is now known as `StructInfo' and nested
17859 in `TypeInfo'; we don't access this directly anymore.
17861 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
17862 property and removed IsAssigned(), IsFieldAssigned(),
17863 SetAssigned() and SetFieldAssigned(); we now call them on the
17864 VariableInfo so we don't need to duplicate this code everywhere.
17866 * expression.cs (ParameterReference): Added `Block block' argument
17868 (LocalVariableReference, ParameterReference, This): The new
17869 VariableInfo class is now responsible for all the definite
17872 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
17873 IsParameterAssigned, SetParameterAssigned): Removed.
17875 2003-05-18 Martin Baulig <martin@ximian.com>
17877 * typemanager.cs (InitCoreTypes): Try calling
17878 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
17879 the 3-args-version. Corlib now also needs our `void_type'.
17880 (GetMethod): Added overloaded version which takes an optional
17881 `bool report_errors' to allow lookups of optional methods.
17883 2003-05-12 Martin Baulig <martin@ximian.com>
17885 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
17886 only used for locals and not for parameters.
17888 2003-05-12 Miguel de Icaza <miguel@ximian.com>
17890 * support.cs (InternalParameters.ParameterType): Return the
17891 ExternalType of the parameter.
17893 * parameter.cs (Parameter.ExternalType): drop the two arguments,
17896 2003-05-11 Miguel de Icaza <miguel@ximian.com>
17898 * class.cs (MethodData.Define): Do not set the `newslot' on
17899 interface members, if they are also flagged as "override".
17901 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
17902 better code for ++i and i++. This only works for static fields
17903 and local variables.
17905 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
17906 want to pull the DeclSpace out of the builder_to_declspace instead
17907 of the TypeBuilder (like in TypeContainer.FindMembers).
17909 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
17910 instead of LookupTypeContainer. Fixes the crash on .NET for
17911 looking up interface members.
17913 * const.cs: Create our own emit context during the Definition
17914 stage, so that constants are evaluated in the proper context, when
17915 a recursive definition happens.
17917 2003-05-11 Martin Baulig <martin@ximian.com>
17919 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
17920 new block for a switch section.
17921 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
17922 the adding/lookup in the switch block. Fixes #39828.
17924 2003-05-09 Miguel de Icaza <miguel@ximian.com>
17926 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
17927 functionality: I needed to convert the data after I had performed
17928 the add/sub operation into the operands type size.
17930 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
17931 pass the type for the box operation, otherwise the resulting
17932 object would have been of type object.
17934 (BoxedCast): Add constructor to specify the type to box as.
17936 2003-05-07 Miguel de Icaza <miguel@ximian.com>
17938 * iterators.cs: I was reusing the `count' variable inadvertently,
17939 take steps to not allow this to happen.
17941 2003-05-06 Miguel de Icaza <miguel@ximian.com>
17943 * attribute.cs (Attribute.Resolve): Params attributes are encoded
17944 by creating an array at the point where the params starts and
17945 putting all those arguments there, then adjusting the size of the
17948 2003-05-05 Miguel de Icaza <miguel@ximian.com>
17950 * expression.cs (New.AddressOf): Implement interface
17951 IMemoryLocation. This is used when the `new' operator is used in
17952 the context of an invocation to a method on a value type.
17954 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
17957 * namespace.cs: Also check the using aliases here.
17959 * driver.cs: Move the test for using validity after the types have
17960 been entered, so we do a single pass that also includes the using
17963 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
17964 in the regular case. CreateSiblingForFinally is doing extra
17967 * attribute.cs (GetAttributeArgumentExpression): Store the result
17968 on an out value, and use the return value to indicate failure
17969 instead of using null (which is a valid return for Constant.GetValue).
17971 * statement.cs: Perform the analysis flow for the increment
17972 portion after the statement, because this will be the real flow of
17973 execution. Fixes #42385
17975 * codegen.cs (EmitContext.EmitArgument,
17976 EmitContext.EmitStoreArgument): New helper functions when the
17977 RemapToProxy flag is set.
17979 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
17982 Add support for remapping parameters.
17984 * iterators.cs: Propagate parameter values; Store parameter
17985 values in the proxy classes.
17987 2003-05-04 Miguel de Icaza <miguel@ximian.com>
17989 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
17990 need a proxy reference; I do not know what I was thinking
17992 * cs-parser.jay (constructor_initializer): catch another error,
17993 and display nice message.
17995 (field_declaration): catch void field declaration
17996 to flag a better error.
17998 * class.cs (MemberBase.CheckBase): Report an error instead of a
17999 warning if a new protected member is declared in a struct.
18000 (Field.Define): catch the error of readonly/volatile.
18002 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
18004 (FieldExpr.AddressOf): ditto. Catch error where the address of a
18005 volatile variable is taken
18007 2003-05-02 Miguel de Icaza <miguel@ximian.com>
18009 * statement.cs (Fixed.Resolve): Report an error if we are not in
18012 2003-05-01 Miguel de Icaza <miguel@ximian.com>
18014 * typemanager.cs: reuse the code that handles type clashes for
18015 delegates and enumerations.
18017 * class.cs (Report28): Always report.
18019 * expression.cs (EncodeAsAttribute): Allow nulls here.
18021 2003-04-28 Miguel de Icaza <miguel@ximian.com>
18023 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
18024 the functionality for testing whether an expression is valid for
18025 an attribute here. Also handle the case of arrays of elements
18028 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
18029 encoding a linear array into an array of objects that are suitable
18030 to be passed to an CustomAttributeBuilder.
18032 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
18034 * ecore.cs: (FieldExpr): Handle field remapping here.
18036 * iteratators.cs: Pass the instance variable (if the method is an
18037 instance method) to the constructors, so we can access the field
18038 variables on the class.
18040 TODO: Test this with structs. I think the THIS variable on
18041 structs might have to be a pointer, and not a refenrece
18043 2003-04-27 Miguel de Icaza <miguel@ximian.com>
18045 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
18046 local variables to fields in a proxy class.
18048 * iterators.cs (PopulateProxy): Rename our internal fields to
18050 Create a <THIS> field if we are an instance method, so we can
18051 reference our parent container variables.
18052 (MapVariable): Called back from the EmitContext code to enter a
18053 new variable to field mapping into the proxy class (we just create
18057 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
18058 for using the remapped locals to fields.
18060 I placed the code here, because that gives the same semantics to
18061 local variables, and only changes the Emit code.
18063 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
18064 statements inside iterators.
18065 (VariableInfo): Add a FieldBuilder for the cases when we are
18066 remapping local variables to fields in a proxy class
18068 * ecore.cs (SimpleNameResolve): Avoid testing two times for
18069 current_block != null.
18071 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
18072 not cope with strings, as it has been moved to the
18073 TableSwitchEmit. Fixed bug in switch generation.
18075 * expression.cs (New.DoResolve): Provide more context for the user
18076 when reporting an error.
18078 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
18081 * expression.cs (MemberAccess.DoResolve): When we get a type back,
18082 check the permissions for it. Note than in a type-resolution
18083 context the check was already present in DeclSpace.ResolveType,
18084 but was missing from the MemberAccess.
18086 (ArrayCreation.CheckIndices): warn if the user has
18087 more nested levels of expressions, but there are no more
18088 dimensions specified. Avoids crash on bug 41906.
18090 2003-04-26 Miguel de Icaza <miguel@ximian.com>
18092 * statement.cs (Block): replace Implicit bool, for a generic
18094 New flag: `Unchecked'. This is used during the EmitMeta phase
18095 (which is out-of-line with the regular Resolve/Emit process for a
18096 statement, as this is done ahead of time, but still gets a chance
18097 to call constant resolve).
18099 (Block.Flags): new enum for adding a new flag.
18101 (Block.EmitMeta): track the state of unchecked.
18103 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
18104 to enable constant resolution to work there as well.
18106 2003-04-22 Miguel de Icaza <miguel@ximian.com>
18108 * typemanager.cs (ienumerable_type): Also look up
18109 System.Collections.IEnumerable.
18111 2003-04-21 Miguel de Icaza <miguel@ximian.com>
18113 TODO: Test more than one conditional per method.
18115 * class.cs (Indexer.Define): Report the location where the user is
18116 referencing the unsupported feature.
18118 (MethodData): Overload the use of `conditionals' to
18119 minimize the creation of needless ArrayLists. This saves roughly
18120 212kb on my machine.
18122 (Method): Implement the new IIteratorContainer interface.
18123 (Method.SetYields): Implement the method by setting the ModFlags
18124 to contain METHOD_YIELDS.
18126 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
18127 which just got set to null.
18129 * iterators.cs: New file.
18131 (Yield, YieldBreak): New statements.
18133 * statement.cs (Return.Resolve): Flag an error if we are used in
18134 an iterator method.
18136 * codegen.cs (InIterator): New flag set if the code is being
18137 compiled in an iterator method.
18139 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
18140 internal modifier, and we just use it to avoid adding extra
18141 fields, as this is seldom used.
18143 * cs-parser.jay: Add yield_statement (yield and yield break).
18145 * driver.cs: New flag -v2 to turn on version 2 features.
18147 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
18148 hashtable when v2 is enabled.
18150 2003-04-20 Miguel de Icaza <miguel@ximian.com>
18152 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
18153 there is already a namespace defined with this name.
18155 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
18156 people upgraded their corlibs.
18158 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
18159 always use fully qualified types, no need to use the compiler
18162 (TypeManager.IsNamespace): Use binarysearch.
18164 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
18165 AddDelegate): I did not quite use the new IsValid API properly: I
18166 have to pass the short-name and the fullname. I was passing only
18167 the basename instead of the fullname sometimes.
18169 (TypeContainer.DefineType): call NamespaceClash.
18171 * interface.cs (Interface.DefineType): use NamespaceClash before
18174 * delegate.cs (Delegate.DefineType): use NamespaceClash before
18177 * enum.cs: (Enum.DefineType): use NamespaceClash before
18180 * typemanager.cs (: 3-line patch that gives us some tasty 11%
18181 speed increase. First, use the negative_hits cache when we get a
18182 negative. Second, add the type with its full original name
18183 instead of the new . and + encoded name (reflection uses + to
18184 separate type from a nested type). Use LookupTypeReflection
18185 directly which bypasses the type->name hashtable (that we already
18186 know does not contain the type.
18188 * decl.cs (DeclSpace.ResolveTypeExpr): track the
18189 location/container type.
18191 * driver.cs: When passing utf8, use directly the UTF8Encoding.
18193 2003-04-19 Miguel de Icaza <miguel@ximian.com>
18195 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
18197 * delegate.cs (NewDelegate.Resolve): Test whether an instance
18198 method is being referenced in the method group from a static
18199 context, and report error 120 if so.
18201 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
18204 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
18205 is created, we create the A namespace).
18207 * cs-parser.jay: A namespace also introduces a DeclarationFound.
18210 2003-04-18 Miguel de Icaza <miguel@ximian.com>
18212 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
18213 invocation to ModuleBuilder.GetType with the same values will
18214 return a new type instance, so we need to cache its return
18217 * expression.cs (Binary.ResolveOperator): Only allow the compare
18218 operators on enums if they are of the same type.
18220 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
18221 types of ValueType on their own case. Before we were giving them
18222 the same treatment as objects.
18224 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
18225 fullname. Short name is used to compare against container name.
18226 Fullname is used to check against defined namespace names.
18228 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
18229 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
18231 (Method.CheckBase): Call parent.
18232 (MemberBase.CheckBase): Check for protected members on sealed
18234 (PropertyBase.CheckBase): Call parent.
18235 (Field.Define): Call parent.
18237 * report.cs: Negative error codes are now mapped to 8000 - code,
18238 so that the display is render more nicely.
18240 * typemanager.cs: Do not use try/catch, instead report a regular
18243 (GetPointerType, GetReferenceType): These methods provide
18244 mechanisms to obtain the T* and T& from a T. We had the code
18245 previously scattered around the code base, and it also used
18246 TypeManager.LookupType that would go through plenty of caches.
18247 This one goes directly to the type source.
18249 In some places we did the Type.GetType followed by
18250 ModuleBuilder.GetType, but not in others, so this unifies the
18251 processing as well.
18253 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
18254 statements now that we have namespace information.
18256 * typemanager.cs (IsNamespace): New method, returns whether the
18257 string presented is a namespace or not.
18259 (ComputeNamespaces): New public entry point, computes the list of
18260 available namespaces, using the GetNamespaces API call in Mono, or
18261 the slower version in MS.NET.
18263 Now before we start the semantic analysis phase, we have a
18264 complete list of namespaces including everything that the user has
18267 Deleted old code to cache namespaces in .nsc files.
18269 2003-04-17 Miguel de Icaza <miguel@ximian.com>
18271 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
18272 class/struct location definition Location for the implicit
18273 constructor location.
18275 (Operator.Define): Use the location of the operator for the
18276 implicit Method definition.
18278 (Constructor.Emit): use the constructor location for the implicit
18279 base initializer constructor.
18281 * ecore.cs: Remove ITypeExpression. This interface is now gone,
18282 and the Expression class now contains two new methods:
18284 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
18285 isolate type lookup from the rest of the resolution process.
18287 Since we use Expressions to hold type definitions due to the way
18288 we parse the input we have historically overloaded Resolve to
18289 perform the Type lookups if a special flag is passed. Now this is
18290 eliminated and two methods take their place.
18292 The differences in the two methods between xStep and xTerminal is
18293 that xStep is involved in our current lookup system that uses
18294 SimpleNames to compose a name, while xTerminal is used just to
18295 catch the case where the simplename lookup failed.
18297 2003-04-16 Miguel de Icaza <miguel@ximian.com>
18299 * expression.cs (ResolveMemberAccess): Remove redundant code.
18300 TypeExpr expressions are always born fully resolved.
18302 * interface.cs (PopulateMethod): Do not lookup the types twice.
18303 We were doing it once during SemanticAnalysis and once during
18306 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
18307 in local variable type definitions, were being returned as a
18308 SimpleName (we decomposed everything into a string), that is
18309 because primary_expression was being used instead of a type in the
18310 grammar (reduce/reduce conflicts).
18312 The part that was wrong is that we converted the expression into a
18313 string (an oversimplification in one hand, compounded with primary
18314 expressions doing string concatenation).
18320 Would return "A.B.C[]" as a SimpleName. This stopped things like
18321 using clauses from working on this particular context. And a type
18322 was being matched directly against "A.B.C[]".
18324 We now use the correct approach, and allow for ComposedCast to be
18325 part of the unary expression. So the "A.B.C []" become a composed
18326 cast of "A.B.C" (as a nested group of MemberAccess with a
18327 SimpleName at the end) plus the rank composition "[]".
18331 2003-04-10 Miguel de Icaza <miguel@ximian.com>
18333 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
18334 for the access level checking.
18336 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
18337 `TypeContainer container', because I kept getting confused when I
18338 was debugging this code.
18340 * expression.cs (Indexers): Instead of tracking getters/setters,
18341 we now track them in parallel. We create one arraylist less, but
18342 most importantly it is possible now for the LValue code to find a
18343 matching get for a set.
18345 (IndexerAccess.DoResolveLValue): Update the code.
18346 GetIndexersForType has been modified already to extract all the
18347 indexers from a type. The code assumed it did not.
18349 Also make the code set the correct return type for the indexer.
18350 This was fixed a long time ago for properties, but was missing for
18351 indexers. It used to be void_type.
18353 (Binary.Emit): Test first for doubles instead of
18354 floats, as they are more common.
18356 (Binary.EmitBranchable): Use the .un version of the branch opcodes
18357 when dealing with floats and the <=, >= operators. This fixes bug
18360 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
18361 to load the array value by emitting a load on the foreach variable
18362 type. This was incorrect.
18364 We now emit the code to load an element using the the array
18365 variable type, and then we emit the conversion operator.
18369 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
18371 * attribute.cs: Avoid allocation of ArrayLists in the common case.
18373 2003-04-09 Miguel de Icaza <miguel@ximian.com>
18375 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
18376 test for protection before we test for signatures.
18378 (MethodSignature.ToString): implement.
18380 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
18381 to the case where we reduced into a LongConstant.
18383 * decl.cs (CheckAccessLevel): If the type is an array, we can not
18384 depend on whether the information is acurrate, because the
18385 Microsoft runtime will always claim that the array type is public,
18386 regardless of the real state.
18388 If the type is a pointer, another problem happens: the type is
18389 reported as non-public in Microsoft.
18391 In both cases we have to call CheckAccessLevel recursively with
18392 the underlying type as the argument to be tested.
18394 2003-04-08 Miguel de Icaza <miguel@ximian.com>
18396 * assign.cs (Assign.Emit): If we are dealing with a compound
18397 assignment expression, we should use the code path that stores the
18398 intermediate result in a temporary value. This fixes #40903.
18400 *expression.cs (Indirection.ToString): Provide ToString method for
18403 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
18405 * class.cs: Null out fields holding references to Block objects so
18406 they can be garbage collected.
18408 * expression.cs (OverloadResolve): Remove unused local.
18410 2003-04-07 Martin Baulig <martin@ximian.com>
18412 * codegen.cs (EmitContext.CurrentFile): New public field.
18413 (EmitContext.Mark): Use the CurrentFile to check whether the
18414 location is in the correct file.
18415 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
18417 2003-04-07 Martin Baulig <martin@ximian.com>
18419 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
18421 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
18422 location. [FIXME: The location argument which gets passed to this
18423 method is sometimes wrong!]
18425 2003-04-07 Nick Drochak <ndrochak@gol.com>
18427 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
18429 2003-04-07 Miguel de Icaza <miguel@ximian.com>
18431 * expression.cs (Indirection.EmitAssign): We were using the
18432 temporary, but returning immediately instead of continuing the
18435 2003-04-06 Martin Baulig <martin@ximian.com>
18437 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
18438 if it's a nested child, but also deriving from the outer class.
18441 * typemanager.cs (IsNestedChildOf): Make this work if it's a
18442 nested child, but also deriving from the outer class. See
18444 (FilterWithClosure): We may access private members of the outer
18445 class if we're a nested child and deriving from the outer class.
18446 (RealMemberLookup): Only set `closure_private_ok' if the
18447 `original_bf' contained BindingFlags.NonPublic.
18449 2003-04-05 Martin Baulig <martin@ximian.com>
18451 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
18453 2003-04-02 Miguel de Icaza <miguel@ximian.com>
18455 * class.cs (Event.Define): Do not allow abstract events to have
18458 2003-04-01 Miguel de Icaza <miguel@ximian.com>
18460 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
18461 block in event declarations.
18463 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
18464 value type, get its address.
18466 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
18467 leaving a class on the stack instead of a boolean value (int
18468 0/1). Change the code so we compare against null, and then the
18469 result against zero.
18471 * class.cs (TypeContainer.GetClassBases): We were checking for the
18472 parent class being sealed too late.
18474 * expression.cs (Binary.Emit): For <= and >= when dealing with
18475 floating point values, use cgt.un and clt.un instead of cgt and
18478 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
18480 * statement.cs: Apply the same optimization as MS: skip the
18481 GetEnumerator returning an IEnumerator, and use the one returning a
18482 CharEnumerator instead. This allows us to avoid the try-finally block
18485 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
18487 * cs-parser.jay: Attributes cannot be applied to
18488 namespaces. Fixes #40473
18490 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18493 (Add*): check if the name is valid using the full name for constants,
18494 fields, properties and events.
18496 2003-03-28 Miguel de Icaza <miguel@ximian.com>
18498 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
18499 char constants to be part of the enumeration.
18501 * expression.cs (Conditional.DoResolve): Add support for operator
18502 true. Implements the missing functionality from 14.12
18504 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
18505 operator true/false as required by the spec.
18507 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
18508 implicit conversion to boolean.
18510 * statement.cs (Statement.ResolveBoolean): A boolean expression is
18511 also one where the type implements `operator true'.
18513 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
18514 get an expression that will invoke operator true based on an
18517 (GetConversionOperators): Removed the hack that called op_True
18520 (Expression.ResolveBoolean): Move this from Statement.
18522 2003-03-17 Miguel de Icaza <miguel@ximian.com>
18524 * ecore.cs (FieldExpr): do not allow initialization of initonly
18525 fields on derived classes
18527 2003-03-13 Martin Baulig <martin@ximian.com>
18529 * statement.cs (Block.Emit): Call ig.BeginScope() and
18530 ig.EndScope() when compiling with debugging info; call
18531 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
18533 2003-03-08 Miguel de Icaza <miguel@ximian.com>
18535 * expression.cs (Indexers): Do not construct immediately, allow
18536 for new members to be appended as we go. Fixes 38143
18538 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18540 * expression.cs: save/restore context when resolving an unchecked
18543 2003-03-05 Miguel de Icaza <miguel@ximian.com>
18545 * cfold.cs: Catch division by zero in modulus operator during
18548 2003-03-03 Miguel de Icaza <miguel@ximian.com>
18550 * interface.cs (Interface.DefineMembers): Avoid defining members
18553 2003-02-27 Miguel de Icaza <miguel@ximian.com>
18555 * driver.cs: handle the +/- options for -noconfig
18557 * statement.cs (Unckeched.Resolve): Also track the state of
18558 unchecked in the Resolve phase.
18560 2003-02-27 Martin Baulig <martin@ximian.com>
18562 * ecore.cs (Expression.MemberLookup): Don't create a
18563 MethodGroupExpr for something which is not a method. Fixes #38291.
18565 2003-02-25 Miguel de Icaza <miguel@ximian.com>
18567 * class.cs (MemberBase.CheckParameters): Also check that the type
18568 is unmanaged if it is a pointer.
18570 * expression.cs (SizeOf.Resolve): Add location information.
18572 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
18573 a managed type is declared.
18575 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
18576 parameter modifiers as well. Fixes bug 38606
18578 * class.cs: Very sad. Am backing out the speed up changes
18579 introduced by the ArrayList -> Array in the TypeContainer, as they
18580 were not actually that much faster, and introduced a bug (no error
18581 reports on duplicated methods).
18583 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
18584 source first, this will guarantee that we have a valid expression
18585 before calling in lower levels functions that will require a
18586 resolved object. Then use this original_source in the
18587 target.ResolveLValue instead of the original source that was
18590 Another change. Use target.Resolve instead of LValueResolve.
18591 Although we are resolving for LValues, we will let the Assign code
18592 take care of that (it will be called again from Resolve). This
18593 basically allows code like this:
18595 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
18596 class Y { void A (X x) { x [0] += o; }
18598 The problem was that the indexer was trying to resolve for
18599 set_Item (idx, object o) and never finding one. The real set_Item
18600 was set_Item (idx, X). By delaying the process we get the right
18605 2003-02-23 Martin Baulig <martin@ximian.com>
18607 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
18608 while calling DoEmit ().
18610 * codegen.cs (EmitContext.Mark): Don't mark locations in other
18611 source files; if you use the #line directive inside a method, the
18612 compiler stops emitting line numbers for the debugger until it
18613 reaches the end of the method or another #line directive which
18614 restores the original file.
18616 2003-02-23 Martin Baulig <martin@ximian.com>
18618 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
18620 2003-02-23 Martin Baulig <martin@ximian.com>
18622 * statement.cs (Block.AddChildVariableNames): We need to call this
18623 recursively, not just for our immediate children.
18625 2003-02-23 Martin Baulig <martin@ximian.com>
18627 * class.cs (Event.Define): Always make the field private, like csc does.
18629 * typemanager.cs (TypeManager.RealMemberLookup): Make events
18630 actually work, fixes bug #37521.
18632 2003-02-23 Miguel de Icaza <miguel@ximian.com>
18634 * delegate.cs: When creating the various temporary "Parameters"
18635 classes, make sure that we call the ComputeAndDefineParameterTypes
18636 on those new parameters (just like we do with the formal ones), to
18637 allow them to be resolved in the context of the DeclSpace.
18639 This fixes the bug that Dick observed in Bugzilla #38530.
18641 2003-02-22 Miguel de Icaza <miguel@ximian.com>
18643 * expression.cs (ResolveMemberAccess): When resolving a constant,
18644 do not attempt to pull a constant if the value was not able to
18645 generate a valid constant.
18647 * const.cs (LookupConstantValue): Do not report more errors than required.
18649 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18651 * expression.cs: fixes bug #38328.
18653 2003-02-18 Miguel de Icaza <miguel@ximian.com>
18655 * class.cs: Changed all the various members that can be part of a
18656 class from being an ArrayList to be an Array of the right type.
18657 During the DefineType type_list, interface_list, delegate_list and
18658 enum_list are turned into types, interfaces, delegates and enums
18661 And during the member population, indexer_list, event_list,
18662 constant_list, field_list, instance_constructor_list, method_list,
18663 operator_list and property_list are turned into their real arrays.
18665 Although we could probably perform this operation earlier, for
18666 good error reporting we need to keep the lists and remove the
18667 lists for longer than required.
18669 This optimization was triggered by Paolo profiling the compiler
18670 speed on the output of `gen-sample-program.pl' perl script.
18672 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
18673 not crash in methods like MemberLookupFailed that use this field.
18675 This problem arises when the compiler fails to resolve a type
18676 during interface type definition for example.
18678 2003-02-18 Miguel de Icaza <miguel@ximian.com>
18680 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
18681 inherit from System.Object, so we have to stop at null, not only
18682 when reaching System.Object.
18684 2003-02-17 Miguel de Icaza <miguel@ximian.com>
18686 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
18687 DeclaredOnly because the parent indexer might have had a different
18688 name, but did not loop until the top of the hierarchy was reached.
18690 The problem this one fixes is 35492: when a class implemented an
18691 indexer from an interface, we were getting the interface method
18692 (which was abstract) and we were flagging an error (can not invoke
18695 This also keeps bug 33089 functioning, and test-148 functioning.
18697 * typemanager.cs (IsSpecialMethod): The correct way of figuring
18698 out if a method is special is to see if it is declared in a
18699 property or event, or whether it is one of the predefined operator
18700 names. This should fix correctly #36804.
18702 2003-02-15 Miguel de Icaza <miguel@ximian.com>
18704 The goal here is to remove the dependency on EmptyCast.Peel ().
18705 Killing it completely.
18707 The problem is that currently in a number of places where
18708 constants are expected, we have to "probe" for an EmptyCast, and
18709 Peel, which is not the correct thing to do, as this will be
18710 repetitive and will likely lead to errors.
18712 The idea is to remove any EmptyCasts that are used in casts that
18713 can be reduced to constants, so we only have to cope with
18716 This bug hunt was triggered by Bug 37363 and the desire to remove
18717 the duplicate pattern where we were "peeling" emptycasts to check
18718 whether they were constants. Now constants will always be
18721 * ecore.cs: Use an enumconstant here instead of wrapping with
18724 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
18725 throwing me off. By handling this we can get rid of a few hacks.
18727 * statement.cs (Switch): Removed Peel() code.
18729 2003-02-14 Miguel de Icaza <miguel@ximian.com>
18731 * class.cs: Location information for error 508
18733 * expression.cs (New.DoResolve): Add a guard against double
18734 resolution of an expression.
18736 The New DoResolve might be called twice when initializing field
18737 expressions (see EmitFieldInitializers, the call to
18738 GetInitializerExpression will perform a resolve on the expression,
18739 and later the assign will trigger another resolution
18741 This leads to bugs (#37014)
18743 * delegate.cs: The signature for EndInvoke should contain any ref
18744 or out parameters as well. We were not doing this in the past.
18746 * class.cs (Field.Define): Do not overwrite the type definition
18747 inside the `volatile' group. Turns out that volatile enumerations
18748 were changing the type here to perform a validity test, which
18751 2003-02-12 Miguel de Icaza <miguel@ximian.com>
18753 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
18754 and structs, we do not want to load the instance variable
18756 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
18757 enum_type has to be handled like an object reference (implicit
18758 conversions exists from this to object), but the regular IsClass
18759 and IsValueType tests will never return true for this one.
18761 Also we use TypeManager.IsValueType instead of type.IsValueType,
18762 just for consistency with the rest of the code (this is only
18763 needed if we ever use the construct exposed by test-180.cs inside
18764 corlib, which we dont today).
18766 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
18768 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
18771 2003-02-09 Martin Baulig <martin@ximian.com>
18773 * namespace.cs (Namespace..ctor): Added SourceFile argument.
18774 (Namespace.DefineNamespaces): New static public method; this is
18775 called when we're compiling with debugging to add all namespaces
18776 to the symbol file.
18778 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
18779 pass it to the Namespace's .ctor.
18781 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
18782 and MethodBase arguments; pass the namespace ID to the symwriter;
18783 pass the MethodBase instead of the token to the symwriter.
18784 (SymbolWriter.DefineNamespace): New method to add a namespace to
18787 2003-02-09 Martin Baulig <martin@ximian.com>
18789 * symbolwriter.cs: New file. This is a wrapper around
18790 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
18791 methods here in near future.
18793 2003-02-09 Martin Baulig <martin@ximian.com>
18795 * codegen.cs (EmitContext.Mark): Just pass the arguments to
18796 ILGenerator.MarkSequencePoint() which are actually used by the
18799 2003-02-09 Martin Baulig <martin@ximian.com>
18801 * location.cs (SourceFile): New public sealed class. This
18802 contains the name and an index which is used in the location's token.
18803 (Location): Reserve an appropriate number of bits in the token for
18804 the source file instead of walking over that list, this gives us a
18805 really huge performance improvement when compiling with debugging.
18807 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
18808 `SourceFile' argument instead of a string.
18809 (Driver.ProcessFile): Add all the files via Location.AddFile(),
18810 but don't parse/tokenize here, we need to generate the list of all
18811 source files before we do that.
18812 (Driver.ProcessFiles): New static function. Parses/tokenizes all
18815 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
18816 instead of a string.
18818 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
18821 2003-02-09 Martin Baulig <martin@ximian.com>
18823 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
18824 filename on `#line default'.
18826 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
18828 * statement.cs: don't clear the pinned var when the fixed statement
18829 returns from the method (fixes bug#37752).
18831 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
18833 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
18836 2003-02-07 Martin Baulig <martin@ximian.com>
18838 * driver.cs: Removed the `--debug-args' command line argument.
18840 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
18841 automatically by the AsssemblyBuilder.
18842 (CodeGen.InitializeSymbolWriter): We don't need to call any
18843 initialization function on the symbol writer anymore. This method
18844 doesn't take any arguments.
18846 2003-02-03 Miguel de Icaza <miguel@ximian.com>
18848 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
18849 from referenced assemblies as well.
18851 2003-02-02 Martin Baulig <martin@ximian.com>
18853 * class.cs (MethodData.Emit): Generate debugging info for external methods.
18855 2003-02-02 Martin Baulig <martin@ximian.com>
18857 * class.cs (Constructor.Emit): Open the symbol writer before
18858 emitting the constructor initializer.
18859 (ConstructorInitializer.Emit): Call ec.Mark() to allow
18860 single-stepping through constructor initializers.
18862 2003-01-30 Miguel de Icaza <miguel@ximian.com>
18864 * class.cs: Handle error 549: do not allow virtual methods in
18867 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
18869 * decl.cs: Check access levels when resolving types
18871 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
18873 * statement.cs: Add parameters and locals set in catch blocks that might
18874 return to set vector
18876 2003-01-29 Miguel de Icaza <miguel@ximian.com>
18878 * class.cs (Operator): Set the SpecialName flags for operators.
18880 * expression.cs (Invocation.DoResolve): Only block calls to
18881 accessors and operators on SpecialName methods.
18883 (Cast.TryReduce): Handle conversions from char constants.
18886 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
18888 * statement.cs: small memory and time optimization in FlowBranching.
18890 2003-01-28 Pedro Mart <yoros@wanadoo.es>
18892 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
18893 problem that the last fix but in the other sid (Set).
18895 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
18896 access when there is no indexer in the hierarchy.
18898 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
18900 * class.cs: Combine some if statements.
18902 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18904 * driver.cs: fixed bug #37187.
18906 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
18908 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
18909 any indexer, it's needed to build a list with all the indexers in the
18910 hierarchy (AllGetters), else we have problems. Fixes #35653.
18912 2003-01-23 Miguel de Icaza <miguel@ximian.com>
18914 * class.cs (MethodData.Define): It is wrong for an interface
18915 implementation to be static in both cases: explicit and implicit.
18916 We were only handling this in one case.
18918 Improve the if situation there to not have negations.
18920 * class.cs (Field.Define): Turns out that we do not need to check
18921 the unsafe bit on field definition, only on usage. Remove the test.
18923 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18925 * driver.cs: use assembly.Location instead of Codebase (the latest
18926 patch made mcs fail when using MS assemblies).
18928 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
18930 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
18931 get the path to *corlib.dll.
18933 2003-01-21 Nick Drochak <ndrochak@gol.com>
18937 * typemanager.cs: Remove compiler warnings
18939 2003-01-20 Duncan Mak <duncan@ximian.com>
18941 * AssemblyInfo.cs: Bump the version number to 0.19.
18943 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18945 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
18947 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
18949 * class.cs (Constructor::Emit): Emit debugging info for constructors.
18951 2003-01-17 Miguel de Icaza <miguel@ximian.com>
18953 * cs-parser.jay: Small fix: we were not comparing the constructor
18954 name correctly. Thanks to Zoltan for the initial pointer.
18956 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
18958 * cs-tokenizer.cs: Set file name when specified with #line
18960 2003-01-15 Miguel de Icaza <miguel@ximian.com>
18962 * cs-parser.jay: Only perform the constructor checks here if we
18963 are named like the class; This will help provider a better
18964 error. The constructor path is taken when a type definition is
18965 not found, but most likely the user forgot to add the type, so
18966 report that rather than the constructor error.
18968 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
18970 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
18973 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
18975 * cs-parser.jay: Add cleanup call.
18977 2003-01-13 Duncan Mak <duncan@ximian.com>
18979 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
18980 consistent with other methods.
18982 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
18984 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
18986 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
18988 * attribute.cs: only set GuidAttr to true when we have a
18991 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18995 * typemanager.cs: fixes to allow mcs compile corlib with the new
18996 Type.IsSubclassOf fix.
18998 2003-01-08 Miguel de Icaza <miguel@ximian.com>
19000 * expression.cs (LocalVariableReference.DoResolve): Classify a
19001 constant as a value, not as a variable. Also, set the type for
19004 * cs-parser.jay (fixed_statement): take a type instead of a
19005 pointer_type, so we can produce a better error message later.
19007 * statement.cs (Fixed.Resolve): Flag types that are not pointers
19010 (For.DoEmit): Make inifinite loops have a
19011 non-conditional branch back.
19013 (Fixed.DoEmit): First populate the pinned variables, then emit the
19014 statement, then clear the variables. Before I was emitting the
19015 code once for each fixed piece.
19018 2003-01-08 Martin Baulig <martin@ximian.com>
19020 * statement.cs (FlowBranching.MergeChild): A break in a
19021 SWITCH_SECTION does not leave a loop. Fixes #36155.
19023 2003-01-08 Martin Baulig <martin@ximian.com>
19025 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
19026 lives in the same number space than `param_map'. Fixes #36154.
19028 2003-01-07 Miguel de Icaza <miguel@ximian.com>
19030 * cs-parser.jay (constructor_declaration): Set the
19031 Constructor.ModFlags before probing for it. This makes the
19032 compiler report 514, 515 and 132 (the code was there, but got
19035 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
19036 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
19037 (GotoCase.Resolve): Set `Returns' to ALWAYS.
19039 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
19041 * enum.cs: create the enum static fields using the enum type.
19043 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
19045 * class.cs: don't try to create the ParamBuilder for the return
19046 type if it's not needed (and handle it breaking for the ms runtime
19049 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
19051 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
19053 2002-12-29 Miguel de Icaza <miguel@ximian.com>
19055 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
19056 the command. This showed up while compiling the JANET source
19057 code, which used \r as its only newline separator.
19059 2002-12-28 Miguel de Icaza <miguel@ximian.com>
19061 * class.cs (Method.Define): If we are an operator (because it
19062 reuses our code), then set the SpecialName and HideBySig. #36128
19064 2002-12-22 Miguel de Icaza <miguel@ximian.com>
19066 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
19067 exception, report error 120 `object reference required'.
19069 * driver.cs: Add --pause option, used during to measure the size
19070 of the process as it goes with --timestamp.
19072 * expression.cs (Invocation.DoResolve): Do not allow methods with
19073 SpecialName to be invoked.
19075 2002-12-21 Miguel de Icaza <miguel@ximian.com>
19077 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
19078 number before adding it.
19080 2002-12-21 Ravi Pratap <ravi@ximian.com>
19082 * ecore.cs (StandardImplicitConversion): When in an unsafe
19083 context, we allow conversion between void * to any other pointer
19084 type. This fixes bug #35973.
19086 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
19088 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
19089 is not thrown when extensionless outputs are used
19091 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19093 * rootcontext.cs: fixed compilation of corlib.
19095 2002-12-19 Miguel de Icaza <miguel@ximian.com>
19097 * attribute.cs (Attributes.Contains): Add new method.
19099 * class.cs (MethodCore.LabelParameters): if the parameter is an
19100 `out' parameter, check that no attribute `[In]' has been passed.
19102 * enum.cs: Handle the `value__' name in an enumeration.
19104 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
19106 * decl.cs: Added special case to allow overrides on "protected
19109 2002-12-18 Ravi Pratap <ravi@ximian.com>
19111 * attribute.cs (Attributes.AddAttributeSection): Rename to this
19112 since it makes much more sense.
19114 (Attributes.ctor): Don't require a Location parameter.
19116 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
19118 * attribute.cs (ApplyAttributes): Remove extra Location parameters
19119 since we already have that information per attribute.
19121 * everywhere : make appropriate changes.
19123 * class.cs (LabelParameters): Write the code which actually
19124 applies attributes to the return type. We can't do this on the MS
19125 .NET runtime so we flag a warning in the case an exception is
19128 2002-12-18 Miguel de Icaza <miguel@ximian.com>
19130 * const.cs: Handle implicit null conversions here too.
19132 2002-12-17 Ravi Pratap <ravi@ximian.com>
19134 * class.cs (MethodCore.LabelParameters): Remove the extra
19135 Type [] parameter since it is completely unnecessary. Instead
19136 pass in the method's attributes so that we can extract
19137 the "return" attribute.
19139 2002-12-17 Miguel de Icaza <miguel@ximian.com>
19141 * cs-parser.jay (parse): Use Report.Error to flag errors instead
19142 of ignoring it and letting the compile continue.
19144 * typemanager.cs (ChangeType): use an extra argument to return an
19145 error condition instead of throwing an exception.
19147 2002-12-15 Miguel de Icaza <miguel@ximian.com>
19149 * expression.cs (Unary.TryReduce): mimic the code for the regular
19150 code path. Perform an implicit cast in the cases where we can
19151 implicitly convert to one of the integral types, and then reduce
19152 based on that constant. This fixes bug #35483.
19154 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19156 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
19158 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19160 * namespace.cs: fixed bug #35489.
19162 2002-12-12 Miguel de Icaza <miguel@ximian.com>
19164 * class.cs: Remove some dead code.
19166 * cs-parser.jay: Estimate the number of methods needed
19167 (RootContext.MethodCount);
19169 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
19170 numbers instead of StringBuilders.
19172 * support.cs (PtrHashtable): Add constructor with initial size;
19173 We can now reduce reallocations of the method table.
19175 2002-12-10 Ravi Pratap <ravi@ximian.com>
19177 * attribute.cs (ApplyAttributes): Keep track of the emitted
19178 attributes on a per-target basis. This fixes bug #35413.
19180 2002-12-10 Miguel de Icaza <miguel@ximian.com>
19182 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
19183 default to the Windows 1252 encoding.
19185 (UnixParseOption): Support version, thanks to Alp for the missing
19188 * AssemblyInfo.cs: Add nice assembly information.
19190 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
19193 * cs-parser.jay: Allow a trailing comma before the close bracked
19194 in the attribute_section production.
19196 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
19197 address of the instance was being taken, I will take this out,
19198 because we take the address of the object immediately here.
19200 2002-12-09 Ravi Pratap <ravi@ximian.com>
19202 * typemanager.cs (AreMultipleAllowed): Take care of the most
19203 obvious case where attribute type is not in the current assembly -
19206 2002-12-08 Miguel de Icaza <miguel@ximian.com>
19208 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
19209 definitions, instead of doing that afterwards.
19211 Also we use a nice little hack, depending on the constructor, we
19212 know if we are a "composed" name or a simple name. Hence, we
19213 avoid the IndexOf test, and we avoid
19215 * codegen.cs: Add code to assist in a bug reporter to track down
19216 the source of a compiler crash.
19218 2002-12-07 Ravi Pratap <ravi@ximian.com>
19220 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
19221 types have been emitted for a given element and flag an error
19222 if something which does not have AllowMultiple set is used more
19225 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
19226 attribute types and their corresponding AllowMultiple properties
19228 (AreMultipleAllowed): Check the property for a given type.
19230 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
19231 property in the case we have a TypeContainer.
19233 (Attributes.AddAttribute): Detect duplicates and just skip on
19234 adding them. This trivial fix catches a pretty gross error in our
19235 attribute emission - global attributes were being emitted twice!
19237 Bugzilla bug #33187 is now fixed.
19239 2002-12-06 Miguel de Icaza <miguel@ximian.com>
19241 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
19242 instead of pp_and).
19244 * expression.cs (Binary.ResolveOperator): I can only use the
19245 Concat (string, string, string) and Concat (string, string,
19246 string, string) if the child is actually a concatenation of
19249 2002-12-04 Miguel de Icaza <miguel@ximian.com>
19251 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
19252 context where we need a 2-character lookahead.
19254 * pending.cs (PendingImplementation): Rework so we can keep track
19255 of interface types all the time, and flag those which were
19256 implemented by parents as optional.
19258 2002-12-03 Miguel de Icaza <miguel@ximian.com>
19260 * expression.cs (Binary.ResolveOperator): Use
19261 String.Concat(string,string,string) or
19262 String.Concat(string,string,string,string) when possible.
19264 * typemanager: More helper methods.
19267 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
19269 * pending.cs: remove the bogus return from GetMissingInterfaces()
19270 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
19272 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19274 * namespace.cs: avoid duplicated 'using xxx' being added to
19275 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
19276 when we get more than one 'using' statement for the same namespace.
19277 Report a CS0105 warning for it.
19279 2002-11-30 Miguel de Icaza <miguel@ximian.com>
19281 * cs-tokenizer.cs (consume_identifier): use read directly, instead
19282 of calling getChar/putback, uses internal knowledge of it.
19284 (xtoken): Reorder tokenizer so most common patterns are checked
19285 first. This reduces the compilation time in another 5% (from 8.11s
19286 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
19288 The parsing time is 22% of the compilation in mcs, and from that
19289 64% is spent on the tokenization process.
19291 I tried using a binary search for keywords, but this is slower
19292 than the hashtable. Another option would be to do a couple of
19295 * Not use a StringBuilder, instead use an array of chars,
19296 with a set value. Notice that this way we could catch
19297 the 645 error without having to do it *afterwards*.
19299 * We could write a hand-parser to avoid the hashtable
19300 compares altogether.
19302 The identifier consumption process takes 37% of the tokenization
19303 time. Another 15% is spent on is_number. 56% of the time spent
19304 on is_number is spent on Int64.Parse:
19306 * We could probably choose based on the string length to
19307 use Int32.Parse or Int64.Parse and avoid all the 64-bit
19310 Another 3% is spend on wrapping `xtoken' in the `token' function.
19312 Handle 0xa0 as whitespace (#34752)
19314 2002-11-26 Miguel de Icaza <miguel@ximian.com>
19316 * typemanager.cs (IsCLRType): New routine to tell whether a type
19317 is one of the builtin types.
19319 Maybe it needs to use TypeCodes to be faster. Maybe we could use
19320 typecode in more places instead of doing pointer comparissions.
19321 We could leverage some knowledge about the way the typecodes are
19324 New code to cache namespaces in assemblies, it is currently not
19325 invoked, to be used soon.
19327 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
19329 * expression.cs (Binary.ResolveOperator): specially handle
19330 strings, and do not perform user-defined operator overloading for
19333 2002-11-24 Miguel de Icaza <miguel@ximian.com>
19335 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
19336 internalcall as it is a pretty simple operation; Avoid whenever
19337 possible to call Char.IsLetter.
19339 (consume_identifier): Cut by half the number of
19340 hashtable calls by merging the is_keyword and GetKeyword behavior.
19342 Do not short-circuit, because if we do, we
19343 report errors (ie, #if false && true would produce an invalid
19347 2002-11-24 Martin Baulig <martin@ximian.com>
19349 * expression.cs (Cast.TryReduce): If we're in checked syntax,
19350 check constant ranges and report a CS0221. Fixes #33186.
19352 2002-11-24 Martin Baulig <martin@ximian.com>
19354 * cs-parser.jay: Make this work for uninitialized variable
19355 declarations in the `for' initializer. Fixes #32416.
19357 2002-11-24 Martin Baulig <martin@ximian.com>
19359 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
19360 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
19362 2002-11-24 Martin Baulig <martin@ximian.com>
19364 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
19365 argument; if true, we also check for user-defined conversions.
19366 This is only needed if both arguments are of a user-defined type.
19367 Fixes #30443, added test-175.cs.
19368 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
19370 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
19372 2002-11-24 Martin Baulig <martin@ximian.com>
19374 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
19375 function to get the store opcode.
19376 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
19377 only emit the Ldelema if the store opcode is Stobj. You must run
19378 both test-34 and test-167 to test this. Fixes #34529.
19380 2002-11-23 Martin Baulig <martin@ximian.com>
19382 * ecore.cs (Expression.MemberLookup): Added additional
19383 `qualifier_type' argument which is used when we're being called
19384 from MemberAccess.DoResolve() and null if we're called from a
19386 (Expression.MemberLookupFailed): New method to report errors; this
19387 does the CS1540 check and reports the correct error message.
19389 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
19390 argument for the CS1540 check and redone the way how we're dealing
19391 with private members. See the comment in the source code for details.
19392 (FilterWithClosure): Reverted this back to revision 1.197; renamed
19393 `closure_start_type' to `closure_qualifier_type' and check whether
19394 it's not null. It was not this filter being broken, it was just
19395 being called with the wrong arguments.
19397 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
19398 and pass it the correct `qualifier_type'; this also does the error
19401 2002-11-22 Miguel de Icaza <miguel@ximian.com>
19403 * expression.cs (Invocation.EmitParams): If the we are dealing
19404 with a non-built-in value type, load its address as well.
19406 (ArrayCreation): Use a a pretty constant instead
19407 of the hardcoded value 2. Use 6 instead of 2 for the number of
19408 static initializers.
19410 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
19411 because they are not really value types, just glorified integers.
19413 * driver.cs: Do not append .exe, the CSC compiler does not do it.
19415 * ecore.cs: Remove redundant code for enumerations, make them use
19416 the same code path as everything else, fixes the casting issue
19417 with enumerations in Windows.Forms.
19419 * attribute.cs: Do only cast to string if it is a string, the
19420 validation happens later.
19422 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
19423 people upgrade their corlibs.
19425 * ecore.cs: Oops, enumerations were not following the entire code path
19427 2002-11-21 Miguel de Icaza <miguel@ximian.com>
19429 * typemanager.cs (FilterWithClosure): Commented out the test for
19430 1540 in typemanager.cs, as it has problems when accessing
19431 protected methods from a parent class (see test-174.cs).
19433 * attribute.cs (Attribute.ValidateGuid): new method.
19434 (Attribute.Resolve): Use above.
19436 2002-11-19 Miguel de Icaza <miguel@ximian.com>
19438 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
19440 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
19441 handling for enumerations, as we only needed the TypeContainer
19442 functionality to begin with (this is required for the fix below to
19443 work for enums that reference constants in a container class for
19446 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
19448 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
19449 a valid TypeBuilder to perform lookups on.o
19451 * class.cs (InheritableMemberSignatureCompare): Use true in the
19452 call to GetGetMethod and GetSetMethod, because we are comparing
19453 the signature, and we need to get the methods *even* if they are
19456 (PropertyBase.CheckBase): ditto.
19458 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
19459 GotoCase.Resolve): Use Peel on EmpytCasts.
19461 * ecore.cs (EmptyCast): drop child, add Peel method.
19463 2002-11-17 Martin Baulig <martin@ximian.com>
19465 * ecore.cs (EmptyCast.Child): New public property.
19467 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
19468 label resolved to an EmptyCast. Fixes #34162.
19469 (GotoCase.Resolve): Likewise.
19470 (Block.EmitMeta): Likewise.
19472 2002-11-17 Martin Baulig <martin@ximian.com>
19474 * expression.cs (Invocation.BetterConversion): Prefer int over
19475 uint; short over ushort; long over ulong for integer literals.
19476 Use ImplicitConversionExists instead of StandardConversionExists
19477 since we also need to check for user-defined implicit conversions.
19478 Fixes #34165. Added test-173.cs.
19480 2002-11-16 Martin Baulig <martin@ximian.com>
19482 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
19483 with the `true' and `false' literals. Fixes #33151.
19485 2002-11-16 Martin Baulig <martin@ximian.com>
19487 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
19488 October 22nd; don't do the cs1540 check for static members.
19490 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
19491 now using our own filter here and doing the cs1540 check again.
19493 2002-11-16 Martin Baulig <martin@ximian.com>
19495 * support.cs (InternalParameters): Don't crash if we don't have
19496 any fixed parameters. Fixes #33532.
19498 2002-11-16 Martin Baulig <martin@ximian.com>
19500 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
19501 when looking up static methods to make this work on Windows.
19504 2002-11-16 Martin Baulig <martin@ximian.com>
19506 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
19507 a setter rather than using PropertyInfo.CanWrite.
19509 2002-11-15 Nick Drochak <ndrochak@gol.com>
19511 * class.cs: Allow acces to block member by subclasses. Fixes build
19514 2002-11-14 Martin Baulig <martin@ximian.com>
19516 * class.cs (Constructor.Emit): Added the extern/block check.
19519 2002-11-14 Martin Baulig <martin@ximian.com>
19521 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
19522 iteration while looking for indexers, this is needed because the
19523 indexer may have a different name in our base classes. Fixed the
19524 error reporting (no indexers at all, not get accessor, no
19525 overloaded match). Fixes bug #33089.
19526 (IndexerAccess.DoResolveLValue): Likewise.
19528 2002-11-14 Martin Baulig <martin@ximian.com>
19530 * class.cs (PropertyBase.CheckBase): Make this work for multiple
19531 indexers. Fixes the first part of bug #33089.
19532 (MethodSignature.InheritableMemberSignatureCompare): Added support
19535 2002-11-13 Ravi Pratap <ravi@ximian.com>
19537 * attribute.cs (Attribute.Resolve): Catch the
19538 NullReferenceException and report it since it isn't supposed to
19541 2002-11-12 Miguel de Icaza <miguel@ximian.com>
19543 * expression.cs (Binary.EmitBranchable): Also handle the cases for
19544 LogicalOr and LogicalAnd that can benefit from recursively
19545 handling EmitBranchable. The code now should be nice for Paolo.
19547 2002-11-08 Miguel de Icaza <miguel@ximian.com>
19549 * typemanager.cs (LookupType): Added a negative-hit hashtable for
19550 the Type lookups, as we perform quite a number of lookups on
19551 non-Types. This can be removed once we can deterministically tell
19552 whether we have a type or a namespace in advance.
19554 But this might require special hacks from our corlib.
19558 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
19559 and double which avoids a conversion from an integer to a double.
19561 * expression.cs: tiny optimization, avoid calling IsConstant,
19562 because it effectively performs the lookup twice.
19564 2002-11-06 Miguel de Icaza <miguel@ximian.com>
19566 But a bogus return here to keep the semantics of the old code
19567 until the Mono runtime is fixed.
19569 * pending.cs (GetMissingInterfaces): New method used to remove all
19570 the interfaces that are already implemented by our parent
19571 classes from the list of pending methods.
19573 * interface.cs: Add checks for calls after ResolveTypeExpr.
19575 2002-11-05 Miguel de Icaza <miguel@ximian.com>
19577 * class.cs (Class.Emit): Report warning 67: event not used if the
19578 warning level is beyond 3.
19580 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
19581 being a NullLiteral.
19583 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
19586 * class.cs (TypeContainer.GetClassBases): Cover a missing code
19587 path that might fail if a type can not be resolved.
19589 * expression.cs (Binary.Emit): Emit unsigned versions of the
19592 * driver.cs: use error 5.
19594 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
19596 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
19598 2002-11-01 Miguel de Icaza <miguel@ximian.com>
19600 * cs-parser.jay (switch_section): A beautiful patch from Martin
19601 Baulig that fixed 33094.
19603 2002-10-31 Miguel de Icaza <miguel@ximian.com>
19605 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
19606 Check whether the base is abstract and report an error if so.
19608 * expression.cs (IndexerAccess.DoResolveLValue,
19609 IndexerAccess.DoResolve): ditto.
19611 (Invocation.DoResolve): ditto.
19613 (Invocation.FullMethodDesc): Improve the report string.
19615 * statement.cs (Block): Eliminate IsVariableDefined as it is
19616 basically just a wrapper for GetVariableInfo.
19618 * ecore.cs (SimpleName): Use new
19620 * support.cs (ReflectionParamter.ParameterType): We unwrap the
19621 type, as we return the actual parameter ref/unref state on a
19624 2002-10-30 Miguel de Icaza <miguel@ximian.com>
19626 * support.cs: Return proper flags REF/OUT fixing the previous
19629 * expression.cs: Reverted last patch, that was wrong. Is_ref is
19630 not used to mean `ref' but `ref or out' in ParameterReference
19632 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
19633 full type signature instead of calling TypeManger.CSharpName
19636 * support.cs (InternalParameters.ParameterDesc): Do not compare
19637 directly to the modflags, because REF/OUT will actually be bitsets
19640 * delegate.cs (VerifyMethod): Check also the modifiers.
19642 * cs-tokenizer.cs: Fix bug where floating point values with an
19643 exponent where a sign was missing was ignored.
19645 * driver.cs: Allow multiple assemblies to be specified in a single
19648 2002-10-28 Miguel de Icaza <miguel@ximian.com>
19650 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
19651 because identifiers after a parenthesis would end up in this kind
19652 of production, and we needed to desamiguate it for having casts
19655 (UserDefinedType *) xxx
19657 2002-10-24 Miguel de Icaza <miguel@ximian.com>
19659 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
19660 we should set on the Bindingflags.NonPublic, but not turn on
19661 private_ok. private_ok controls whether a Private member is
19662 returned (this is chekced on the filter routine), while the
19663 BindingFlags.NonPublic just controls whether private/protected
19664 will be allowed. This fixes the problem part of the problem of
19665 private properties being allowed to be used in derived classes.
19667 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
19668 so we can call the children DoResolveLValue method (this will
19669 properly signal errors on lvalue assignments to base properties)
19671 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
19672 getter are null, and we have a property info, we know that this
19673 happened because the lookup failed, so we report an error 122 for
19674 protection level violation.
19676 We also silently return if setter and getter are null in the
19677 resolve functions, this condition only happens if we have flagged
19678 the error before. This is the other half of the problem.
19680 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
19681 not have accessibility information, that is why we were returning
19682 true in the filter function in typemanager.cs.
19684 To properly report 122 (property is inaccessible because of its
19685 protection level) correctly, we report this error in ResolveAccess
19686 by failing if both the setter and the getter are lacking (ie, the
19689 DoResolve and DoLResolve have been modified to check for both
19690 setter/getter being null and returning silently, the reason being
19691 that I did not want to put the knowledge about this error in upper
19694 int old = Report.Errors;
19695 x = new PropertyExpr (...);
19696 if (old != Report.Errors)
19701 So the property expr is returned, but it is invalid, so the error
19702 will be flagged during the resolve process.
19704 * class.cs: Remove InheritablePropertySignatureCompare from the
19705 class, as we no longer depend on the property signature to compute
19706 whether it is possible to implement a method or not.
19708 The reason is that calling PropertyInfo.GetGetMethod will return
19709 null (in .NET, in Mono it works, and we should change this), in
19710 cases where the Get Method does not exist in that particular
19715 class X { public virtual int A { get { return 1; } } }
19717 class Z : Y { public override int A { get { return 2; } } }
19719 Would fail in Z because the parent (Y) would not have the property
19720 defined. So we avoid this completely now (because the alternative
19721 fix was ugly and slow), and we now depend exclusively on the
19724 (PropertyBase.CheckBase): Use a method-base mechanism to find our
19725 reference method, instead of using the property.
19727 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
19728 routines are gone now.
19730 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
19731 names, they were incorrectly named.
19733 * cs-tokenizer.cs: Return are more gentle token on failure.
19735 * pending.cs (PendingImplementation.InterfaceMethod): This routine
19736 had an out-of-sync index variable, which caused it to remove from
19737 the list of pending methods the wrong method sometimes.
19739 2002-10-22 Miguel de Icaza <miguel@ximian.com>
19741 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
19742 CanWrite, because those refer to this particular instance of the
19743 property, and do not take into account the fact that we can
19744 override single members of a property.
19746 Constructor requires an EmitContext. The resolution process does
19747 not happen here, but we need to compute the accessors before,
19748 because the resolution does not always happen for properties.
19750 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
19751 subclass, before we did not update this flag, but we did update
19754 (GetAccessors): Drop this routine, as it did not work in the
19755 presence of partially overwritten set/get methods.
19757 Notice that this broke the cs1540 detection, but that will require
19760 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19764 * driver.cs: issue a warning instead of an error if we don't support
19765 debugging for the platform. Also ignore a couple of errors that may
19766 arise when trying to write the symbols. Undo my previous patch.
19768 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19770 * driver.cs: ignore /debug switch except for Unix platforms.
19772 2002-10-23 Nick Drochak <ndrochak@gol.com>
19774 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
19776 2002-10-21 Miguel de Icaza <miguel@ximian.com>
19778 * driver.cs: Do not make mcs-debug conditional, so we do not break
19779 builds that use it.
19781 * statement.cs (UsageVector.MergeChildren): I would like Martin to
19782 review this patch. But basically after all the children variables
19783 have been merged, the value of "Breaks" was not being set to
19784 new_breaks for Switch blocks. I think that it should be set after
19785 it has executed. Currently I set this to the value of new_breaks,
19786 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
19787 conservative, but I do not understand this code very well.
19789 I did not break anything in the build, so that is good ;-)
19791 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
19793 2002-10-20 Mark Crichton <crichton@gimp.org>
19795 * cfold.cs: Fixed compile blocker. Really fixed it this time.
19797 2002-10-20 Nick Drochak <ndrochak@gol.com>
19799 * cfold.cs: Fixed compile blocker.
19801 2002-10-20 Miguel de Icaza <miguel@ximian.com>
19803 * driver.cs: I was chekcing the key, not the file.
19805 2002-10-19 Ravi Pratap <ravi@ximian.com>
19807 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
19808 message that we were generating - we just need to silently return
19811 2002-10-19 Miguel de Icaza <miguel@ximian.com>
19813 * class.cs (Event.Define): Change my previous commit, as this
19814 breaks the debugger. This is a temporary hack, as it seems like
19815 the compiler is generating events incorrectly to begin with.
19817 * expression.cs (Binary.ResolveOperator): Added support for
19818 "U operator - (E x, E y)"
19820 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
19823 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
19824 init-only variables, but this path did not take into account that
19825 there might be also instance readonly variables. Correct this
19828 This fixes bug 32253
19830 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
19833 * driver.cs: Change the extension for modules to `netmodule'
19835 * cs-parser.jay: Improved slightly the location tracking for
19836 the debugger symbols.
19838 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
19839 modifiers that were specified instead of the hardcoded value
19840 (FamAndAssem). This was basically ignoring the static modifier,
19841 and others. Fixes 32429.
19843 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
19844 fixed a bug in the process (32476)
19846 * expression.cs (ArrayAccess.EmitAssign): Patch from
19847 hwang_rob@yahoo.ca that fixes bug 31834.3
19849 2002-10-18 Miguel de Icaza <miguel@ximian.com>
19851 * driver.cs: Make the module extension .netmodule.
19853 2002-10-16 Miguel de Icaza <miguel@ximian.com>
19855 * driver.cs: Report an error if the resource file is not found
19856 instead of crashing.
19858 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
19859 false, like Emit does.
19861 2002-10-16 Nick Drochak <ndrochak@gol.com>
19863 * typemanager.cs: Remove unused private member. Also reported mcs
19864 bug to report this as a warning like csc.
19866 2002-10-15 Martin Baulig <martin@gnome.org>
19868 * statement.cs (Statement.Emit): Made this a virtual method; emits
19869 the line number info and calls DoEmit().
19870 (Statement.DoEmit): New protected abstract method, formerly knows
19871 as Statement.Emit().
19873 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
19875 2002-10-11 Miguel de Icaza <miguel@ximian.com>
19877 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
19878 have fixed a remaining problem: not every AddXXXX was adding a
19879 fully qualified name.
19881 Now everyone registers a fully qualified name in the DeclSpace as
19882 being defined instead of the partial name.
19884 Downsides: we are slower than we need to be due to the excess
19885 copies and the names being registered this way.
19887 The reason for this is that we currently depend (on the corlib
19888 bootstrap for instance) that types are fully qualified, because
19889 we dump all the types in the namespace, and we should really have
19890 types inserted into the proper namespace, so we can only store the
19891 basenames in the defined_names array.
19893 2002-10-10 Martin Baulig <martin@gnome.org>
19895 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
19896 from bug #31834, see the bug report for a testcase which is
19899 2002-10-10 Martin Baulig <martin@gnome.org>
19901 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
19902 flow analysis code for this.
19904 * statement.cs (Do, While, For): Tell the flow analysis code about
19906 (FlowBranching.UsageVector): Added support for infinite loops.
19907 (Block.Resolve): Moved the dead code elimination here and use flow
19910 2002-10-09 Miguel de Icaza <miguel@ximian.com>
19912 * class.cs (Field.Define): Catch cycles on struct type
19915 * typemanager.cs (IsUnmanagedtype): Do not recursively check
19916 fields if the fields are static. We only need to check instance
19919 * expression.cs (As.DoResolve): Test for reference type.
19921 * statement.cs (Using.ResolveExpression): Use
19922 ConvertImplicitRequired, not ConvertImplicit which reports an
19924 (Using.ResolveLocalVariableDecls): ditto.
19926 * expression.cs (Binary.ResolveOperator): Report errors in a few
19927 places where we had to.
19929 * typemanager.cs (IsUnmanagedtype): Finish implementation.
19931 2002-10-08 Miguel de Icaza <miguel@ximian.com>
19933 * expression.cs: Use StoreFromPtr instead of extracting the type
19934 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
19936 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
19937 an enumeration value to a System.Enum, but System.Enum is not a
19938 value type, but an class type, so we need to box.
19940 (Expression.ConvertExplicit): One codepath could return
19941 errors but not flag them. Fix this. Fixes #31853
19943 * parameter.cs (Resolve): Do not allow void as a parameter type.
19945 2002-10-06 Martin Baulig <martin@gnome.org>
19947 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
19948 if it's a class type and not a struct. Fixes #31815.
19950 2002-10-06 Martin Baulig <martin@gnome.org>
19952 * statement.cs: Reworked the flow analysis code a bit to make it
19953 usable for dead code elimination.
19955 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19957 * cs-parser.jay: allow empty source files. Fixes bug #31781.
19959 2002-10-04 Miguel de Icaza <miguel@ximian.com>
19961 * expression.cs (ComposedCast.DoResolveType): A quick workaround
19962 to fix the test 165, will investigate deeper.
19964 2002-10-04 Martin Baulig <martin@gnome.org>
19966 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
19967 finally blocks actually work.
19968 (Try.Resolve): We don't need to create a sibling for `finally' if
19969 there is no finally block.
19971 2002-10-04 Martin Baulig <martin@gnome.org>
19973 * class.cs (Constructor.Define): The default accessibility for a
19974 non-default constructor is private, not public.
19976 2002-10-04 Miguel de Icaza <miguel@ximian.com>
19978 * class.cs (Constructor): Make AllowedModifiers public, add
19981 * cs-parser.jay: Perform the modifiers test here, as the
19982 constructor for the Constructor class usually receives a zero
19983 because of the way we create it (first we create, later we
19984 customize, and we were never checking the modifiers).
19986 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
19987 is a version of LookupTypeReflection that includes the type-name
19988 cache. This can be used as a fast path for functions that know
19989 the fully qualified name and are only calling into *.GetType() to
19990 obtain a composed type.
19992 This is also used by TypeManager.LookupType during its type
19995 (LookupType): We now also track the real type name, as sometimes
19996 we can get a quey for the real type name from things like
19997 ComposedCast. This fixes bug 31422.
19999 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
20000 complete type fullname, it does not have to go through the type
20001 resolution system to obtain the composed version of the type (for
20002 obtaining arrays or pointers).
20004 (Conditional.Emit): Use the EmitBoolExpression to
20005 generate nicer code, as requested by Paolo.
20007 (ArrayCreation.CheckIndices): Use the patch from
20008 hwang_rob@yahoo.ca to validate the array initializers.
20010 2002-10-03 Miguel de Icaza <miguel@ximian.com>
20012 * class.cs (ConstructorInitializer.Emit): simplify code by using
20013 Invocation.EmitCall, and at the same time, fix the bugs in calling
20014 parent constructors that took variable arguments.
20016 * ecore.cs (Expression.ConvertNumericExplicit,
20017 Expression.ImplicitNumericConversion): Remove the code that
20018 manually wrapped decimal (InternalTypeConstructor call is now gone
20021 * expression.cs (Cast.TryReduce): Also handle decimal types when
20022 trying to perform a constant fold on the type.
20024 * typemanager.cs (IsUnmanagedtype): Partially implemented.
20026 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
20027 that only turned off an error report, and did nothing else.
20029 2002-10-02 Miguel de Icaza <miguel@ximian.com>
20031 * driver.cs: Handle and ignore /fullpaths
20033 2002-10-01 Miguel de Icaza <miguel@ximian.com>
20035 * expression.cs (Binary.ResolveOperator): Catch the case where
20036 DoNumericPromotions returns true,
20038 (Binary.DoNumericPromotions): Simplify the code, and the tests.
20040 2002-09-27 Miguel de Icaza <miguel@ximian.com>
20042 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
20045 2002-09-26 Miguel de Icaza <miguel@ximian.com>
20047 * ecore.cs (ConvertNumericExplicit): It is not enough that the
20048 conversion exists, but it is also required that the conversion be
20049 performed. This manifested in "(Type64Enum) 2".
20051 * class.cs (TypeManager.AddMethod): The fix is not to change
20052 AddEnum, because that one was using a fully qualified name (every
20053 DeclSpace derivative does), but to change the AddMethod routine
20054 that was using an un-namespaced name. This now correctly reports
20055 the duplicated name.
20057 Revert patch until I can properly fix it. The issue
20058 is that we have a shared Type space across all namespaces
20059 currently, which is wrong.
20061 Options include making the Namespace a DeclSpace, and merge
20062 current_namespace/current_container in the parser.
20064 2002-09-25 Miguel de Icaza <miguel@ximian.com>
20066 * cs-parser.jay: Improve error reporting when we get a different
20067 kind of expression in local_variable_type and
20068 local_variable_pointer_type.
20070 Propagate this to avoid missleading errors being reported.
20072 * ecore.cs (ImplicitReferenceConversion): treat
20073 TypeManager.value_type as a target just like object_type. As
20078 Is valid, and needs to result in the int 1 being boxed before it
20079 is assigned to the value type v.
20081 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
20082 to validate the enumeration name.
20084 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
20085 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
20086 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
20088 * ecore.cs (TryImplicitIntConversion): When doing an
20089 implicit-enumeration-conversion, check if the type is 64-bits and
20090 perform a conversion before passing to EnumConstant.
20092 2002-09-23 Miguel de Icaza <miguel@ximian.com>
20094 * decl.cs (Error_AmbiguousTypeReference); New routine used to
20095 report ambiguous type references. Unlike the MS version, we
20096 report what the ambiguity is. Innovation at work ;-)
20098 (DeclSpace.FindType): Require a location argument to
20099 display when we display an ambiguous error.
20101 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
20103 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
20105 * expression.cs (EmitDynamicInitializers): Apply patch from
20106 hwang_rob@yahoo.ca that fixes the order in which we emit our
20109 2002-09-21 Martin Baulig <martin@gnome.org>
20111 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
20112 delegate takes no arguments.
20114 2002-09-20 Miguel de Icaza <miguel@ximian.com>
20116 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
20119 * expression.cs: Extract the underlying type.
20121 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
20123 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
20125 2002-09-19 Miguel de Icaza <miguel@ximian.com>
20127 * class.cs (TypeContainer.DefineType): We can not use the nice
20128 PackingSize with the size set to 1 DefineType method, because it
20129 will not allow us to define the interfaces that the struct
20132 This completes the fixing of bug 27287
20134 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
20135 means also structs. This fixes part of the problem.
20136 (Expresion.ImplicitReferenceConversionExists): ditto.
20138 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
20139 error if there were no errors reported during the type lookup
20140 process, to avoid duplicates or redundant errors. Without this
20141 you would get an ambiguous errors plus a type not found. We have
20142 beaten the user enough with the first error.
20144 (DeclSparce.FindType): Emit a warning if we have an ambiguous
20147 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
20148 during the resolution process, stop the lookup, this avoids
20149 repeated error reports (same error twice).
20151 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
20153 * typemanager.cs (LookupType): Redo the type lookup code to match
20154 the needs of System.Reflection.
20156 The issue is that System.Reflection requires references to nested
20157 types to begin with a "+" sign instead of a dot. So toplevel
20158 types look like: "NameSpace.TopLevelClass", and nested ones look
20159 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
20162 2002-09-19 Martin Baulig <martin@gnome.org>
20164 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
20165 says that a method always returns or always throws an exception,
20166 don't report the CS0161.
20168 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
20169 set `Returns = new_returns'.
20171 2002-09-19 Martin Baulig <martin@gnome.org>
20173 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
20174 to an enum constant, check for a CS0176.
20176 2002-09-18 Miguel de Icaza <miguel@ximian.com>
20178 * class.cs (TypeContainer.CheckPairedOperators): Now we check
20179 for operators that must be in pairs and report errors.
20181 * ecore.cs (SimpleName.DoResolveType): During the initial type
20182 resolution process, when we define types recursively, we must
20183 check first for types in our current scope before we perform
20184 lookups in the enclosing scopes.
20186 * expression.cs (MakeByteBlob): Handle Decimal blobs.
20188 (Invocation.VerifyArgumentsCompat): Call
20189 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
20190 I thought we were supposed to always call this, but there are a
20191 few places in the code where we dont do it.
20193 2002-09-17 Miguel de Icaza <miguel@ximian.com>
20195 * driver.cs: Add support in -linkres and -resource to specify the
20196 name of the identifier.
20198 2002-09-16 Miguel de Icaza <miguel@ximian.com>
20200 * ecore.cs (StandardConversionExists): Sync with the conversion
20201 code: allow anything-* to void* conversions.
20203 (FindMostSpecificSource): Use an Expression argument
20204 instead of a Type, because we might be handed over a Literal which
20205 gets a few more implicit conversions that plain types do not. So
20206 this information was being lost.
20208 Also, we drop the temporary type-holder expression when not
20211 2002-09-17 Martin Baulig <martin@gnome.org>
20213 * class.cs (PropertyBase.CheckBase): Don't check the base class if
20214 this is an explicit interface implementation.
20216 2002-09-17 Martin Baulig <martin@gnome.org>
20218 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
20219 different `IndexerName' attributes.
20221 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
20222 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
20223 virtual CommonResolve().
20225 2002-09-16 Miguel de Icaza <miguel@ximian.com>
20227 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
20228 and convert that to the UnderlyingType.
20230 * statement.cs (Foreach.Resolve): Indexers are just like variables
20231 or PropertyAccesses.
20233 * cs-tokenizer.cs (consume_string): Track line numbers and columns
20234 inside quoted strings, we were not doing this before.
20236 2002-09-16 Martin Baulig <martin@gnome.org>
20238 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
20239 resolve it. This is needed for the definite assignment check of the
20240 instance expression, fixes bug #29846.
20241 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
20243 2002-09-16 Nick Drochak <ndrochak@gol.com>
20245 * parameter.cs: Fix compile error. Cannot reference static member
20246 from an instance object. Is this an mcs bug?
20248 2002-09-14 Martin Baulig <martin@gnome.org>
20250 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
20251 multiple times. Fixes bug #30295, added test-166.cs.
20253 2002-09-14 Martin Baulig <martin@gnome.org>
20255 * statement.cs (Block.Emit): Don't emit unreachable code.
20256 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
20257 `break' statements.
20258 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
20260 2002-09-14 Martin Baulig <martin@gnome.org>
20262 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
20265 2002-09-14 Martin Baulig <martin@gnome.org>
20267 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
20268 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
20269 be false on the ms runtime.
20271 2002-09-13 Martin Baulig <martin@gnome.org>
20273 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
20274 the CS0038 error message.
20276 2002-09-12 Miguel de Icaza <miguel@ximian.com>
20278 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
20279 constant inside, return it.
20281 2002-09-12 Martin Baulig <martin@gnome.org>
20283 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
20284 implicit conversion can be done between enum types.
20286 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
20287 check whether an implicit conversion to the current enum's UnderlyingType
20288 exists and report an error if not.
20290 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
20291 without debugging support.
20293 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
20294 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
20296 2002-09-12 Martin Baulig <martin@gnome.org>
20298 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
20300 * ecore.cs (IMemberExpr.DeclaringType): New property.
20301 (SimpleName.SimpleNameResolve): Check whether we're accessing a
20302 nonstatic member of an outer type (CS0038).
20304 2002-09-11 Miguel de Icaza <miguel@ximian.com>
20306 * driver.cs: Activate the using-error detector at warning level
20307 4 (at least for MS-compatible APIs).
20309 * namespace.cs (VerifyUsing): Small buglett fix.
20311 * pending.cs (PendingImplementation): pass the container pointer.
20313 * interface.cs (GetMethods): Allow for recursive definition. Long
20314 term, I would like to move every type to support recursive
20315 definitions, not the current ordering mechanism that we have right
20318 The situation is this: Attributes are handled before interfaces,
20319 so we can apply attributes to interfaces. But some attributes
20320 implement interfaces, we will now handle the simple cases
20321 (recursive definitions will just get an error).
20323 * parameter.cs: Only invalidate types at the end if we fail to
20326 2002-09-09 Martin Baulig <martin@gnome.org>
20328 * ecore.cs (PropertyExpr.Emit): Also check for
20329 TypeManager.system_int_array_get_length so this'll also work when
20330 compiling corlib. Fixes #30003.
20332 2002-09-09 Martin Baulig <martin@gnome.org>
20334 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
20335 and throw an exception if we can't get the type's size. Fixed #30040,
20338 2002-09-09 Martin Baulig <martin@gnome.org>
20340 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
20342 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
20343 context. Fixes bug #30027.
20345 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
20346 virtual functions. Fixes bug #30043, added test-164.cs.
20348 2002-09-08 Ravi Pratap <ravi@ximian.com>
20350 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
20352 2002-09-08 Nick Drochak <ndrochak@gol.com>
20354 * driver.cs: Use an object to get the windows codepage since it's not a
20357 2002-09-08 Miguel de Icaza <miguel@ximian.com>
20359 * statement.cs (For.Emit): for infinite loops (test == null)
20360 return whether there is a break inside, not always "true".
20362 * namespace.cs (UsingEntry): New struct to hold the name of the
20363 using definition, the location where it is defined, and whether it
20364 has been used in a successful type lookup.
20366 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
20371 2002-09-06 Ravi Pratap <ravi@ximian.com>
20373 * attribute.cs : Fix incorrect code which relied on catching
20374 a NullReferenceException to detect a null being passed in
20375 where an object was expected.
20377 2002-09-06 Miguel de Icaza <miguel@ximian.com>
20379 * statement.cs (Try): flag the catch variable as assigned
20381 * expression.cs (Cast): Simplified by using ResolveType instead of
20382 manually resolving.
20384 * statement.cs (Catch): Fix bug by using ResolveType.
20386 2002-09-06 Ravi Pratap <ravi@ximian.com>
20388 * expression.cs (BetterConversion): Special case for when we have
20389 a NullLiteral as the argument and we have to choose between string
20390 and object types - we choose string the way csc does.
20392 * attribute.cs (Attribute.Resolve): Catch the
20393 NullReferenceException and report error #182 since the Mono
20394 runtime no more has the bug and having this exception raised means
20395 we tried to select a constructor which takes an object and is
20398 2002-09-05 Ravi Pratap <ravi@ximian.com>
20400 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
20401 message (1502, 1503) when we can't locate a method after overload
20402 resolution. This is much more informative and closes the bug
20405 * interface.cs (PopulateMethod): Return if there are no argument
20406 types. Fixes a NullReferenceException bug.
20408 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
20409 expressions too. Previously we were checking only in one place for
20410 positional arguments leaving out named arguments.
20412 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
20413 type to the enum type is not allowed. Remove code corresponding to
20416 (ConvertNumericExplicit): Allow explicit conversions from
20417 the underlying type to enum type. This precisely follows the spec
20418 and closes a bug filed by Gonzalo.
20420 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20423 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
20425 2002-09-03 Miguel de Icaza <miguel@ximian.com>
20427 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
20428 it was important that we stored the right value after the
20429 reduction in `converted'.
20431 2002-09-04 Martin Baulig <martin@gnome.org>
20433 * location.cs (Location.SymbolDocument): Use full pathnames for the
20436 2002-08-30 Miguel de Icaza <miguel@ximian.com>
20438 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
20439 of the expression resolve mechanism, because that will catch the
20440 SimpleName error failures.
20442 (Conditional): If we can not resolve the
20443 expression, return, do not crash.
20445 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20448 (location): display token name instead of its number.
20450 2002-08-28 Martin Baulig <martin@gnome.org>
20452 * expression.cs (Binary.ResolveOperator): Don't silently return
20453 but return an error if an operator cannot be applied between two
20456 2002-08-28 Martin Baulig <martin@gnome.org>
20458 * class.cs (Constructor.Define): Set the permission attributes
20459 correctly instead of making all constructors public.
20461 2002-08-28 Martin Baulig <martin@gnome.org>
20463 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
20464 for private members before reporting a CS0103; if we find anything,
20467 2002-08-28 Martin Baulig <martin@gnome.org>
20469 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
20470 to check whether `closure_start_type == closure_invocation_type',
20471 we also need to check whether `m.DeclaringType == closure_invocation_type'
20472 before bypassing the permission checks. We might be accessing
20473 protected/private members from the base class.
20474 (TypeManager.RealMemberLookup): Only set private_ok if private
20475 members were requested via BindingFlags.NonPublic.
20477 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
20479 * expression.cs (MemberAccess.ResolveMemberAccess): Set
20480 MethodGroupExpr.IsExplicitImpl if appropriate.
20481 (Invocation.DoResolve): Don't report the CS0120 for explicit
20482 interface implementations.
20484 2002-08-27 Martin Baulig <martin@gnome.org>
20486 * expression.cs (Invocation.DoResolve): If this is a static
20487 method and we don't have an InstanceExpression, we must report
20490 2002-08-25 Martin Baulig <martin@gnome.org>
20492 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
20493 `==' between a valuetype and an object.
20495 2002-08-25 Miguel de Icaza <miguel@ximian.com>
20497 * ecore.cs (TypeExpr): Provide a ToString method.
20499 2002-08-24 Martin Baulig <martin@gnome.org>
20501 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
20502 now called proggie.dbg and it's a binary file.
20504 2002-08-23 Martin Baulig <martin@gnome.org>
20506 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
20508 2002-08-23 Martin Baulig <martin@gnome.org>
20510 * struct.cs (MyStructInfo.ctor): Make this work with empty
20511 structs; it's not allowed to use foreach() on null.
20513 2002-08-23 Martin Baulig <martin@gnome.org>
20515 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
20516 writer the full pathname of the generated assembly.
20518 2002-08-23 Martin Baulig <martin@gnome.org>
20520 * statements.cs (FlowBranching.UsageVector.MergeChildren):
20521 A `finally' block never returns or breaks; improved handling of
20524 2002-08-23 Martin Baulig <martin@gnome.org>
20526 * statement.cs (Throw.Resolve): Allow `throw null'.
20528 2002-08-23 Martin Baulig <martin@gnome.org>
20530 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
20531 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
20532 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
20533 MemberLookup would return a wrong event if this is an explicit
20534 interface implementation and the class has an event with the same
20537 2002-08-23 Martin Baulig <martin@gnome.org>
20539 * statement.cs (Block.AddChildVariableNames): New public method.
20540 (Block.AddChildVariableName): Likewise.
20541 (Block.IsVariableNameUsedInChildBlock): Likewise.
20542 (Block.AddVariable): Check whether a variable name has already
20543 been used in a child block.
20545 * cs-parser.jay (declare_local_variables): Mark all variable names
20546 from the current block as being used in a child block in the
20549 2002-08-23 Martin Baulig <martin@gnome.org>
20551 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
20552 find the symbol writer.
20554 * driver.cs: csc also allows the arguments to /define being
20555 separated by commas, not only by semicolons.
20557 2002-08-23 Martin Baulig <martin@gnome.org>
20559 * interface.cs (Interface.GetMembers): Added static check for events.
20561 2002-08-15 Martin Baulig <martin@gnome.org>
20563 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
20564 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
20566 * ecore.cs (Expression.MemberLookup): Added documentation and explained
20567 why the MethodData.EmitDestructor() change was necessary.
20569 2002-08-20 Martin Baulig <martin@gnome.org>
20571 * class.cs (TypeContainer.FindMembers): Added static check for events.
20573 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
20575 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
20576 use Type.GetEvents(), not Type.FindMembers().
20578 2002-08-20 Martin Baulig <martin@gnome.org>
20580 * decl.cs (MemberCache): Added a special method cache which will
20581 be used for method-only searched. This ensures that a method
20582 search will return a MethodInfo with the correct ReflectedType for
20585 2002-08-20 Martin Baulig <martin@gnome.org>
20587 * decl.cs (DeclSpace.FindMembers): Made this public.
20589 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20591 * delegate.cs: fixed build on windows.
20592 [FIXME: Filed as bug #29150: MCS must report these errors.]
20594 2002-08-19 Ravi Pratap <ravi@ximian.com>
20596 * ecore.cs (StandardConversionExists): Return a false
20597 if we are trying to convert the void type to anything else
20598 since that is not allowed.
20600 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
20601 we flag error 70 in the event an event is trying to be accessed
20602 directly from outside the declaring type.
20604 2002-08-20 Martin Baulig <martin@gnome.org>
20606 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
20607 MemberCache from typemanager.cs to decl.cs.
20609 2002-08-19 Martin Baulig <martin@gnome.org>
20611 * class.cs (TypeContainer): Implement IMemberContainer.
20612 (TypeContainer.DefineMembers): Create the MemberCache.
20613 (TypeContainer.FindMembers): Do better BindingFlags checking; only
20614 return public members if BindingFlags.Public was given, check
20615 whether members are static.
20617 2002-08-16 Martin Baulig <martin@gnome.org>
20619 * decl.cs (DeclSpace.Define): Splitted this in Define and
20620 DefineMembers. DefineMembers is called first and initializes the
20623 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
20624 DefineMembers() on all our DeclSpaces.
20626 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
20627 but call DefineMembers() on all nested interfaces. We call their
20628 Define() in our new Define() function.
20630 * interface.cs (Interface): Implement IMemberContainer.
20631 (Interface.Define): Moved all code except the attribute stuf to
20633 (Interface.DefineMembers): Initialize the member cache.
20635 * typemanager.cs (IMemberFinder): Removed this interface, we don't
20636 need this anymore since we can use MemberCache.FindMembers directly.
20638 2002-08-19 Martin Baulig <martin@gnome.org>
20640 * typemanager.cs (MemberCache): When creating the cache for an
20641 interface type, add all inherited members.
20642 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
20643 to `out bool used_cache' and documented it.
20644 (TypeManager.MemberLookup): If we already used the cache in the first
20645 iteration, we don't need to do the interfaces check.
20647 2002-08-19 Martin Baulig <martin@gnome.org>
20649 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
20650 here from IMemberFinder and don't implement this interface anymore.
20651 (DeclSpace.MemberCache): Moved here from IMemberFinder.
20653 * typemanager.cs (IMemberFinder): This interface is now only used by
20654 classes which actually support the member cache.
20655 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
20656 since we only put DeclSpaces into this Hashtable.
20657 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
20658 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
20660 2002-08-16 Martin Baulig <martin@gnome.org>
20662 * typemanager.cs (ICachingMemberFinder): Removed.
20663 (IMemberFinder.MemberCache): New property.
20664 (TypeManager.FindMembers): Merged this with RealFindMembers().
20665 This function will never be called from TypeManager.MemberLookup()
20666 so we can't use the cache here, just the IMemberFinder.
20667 (TypeManager.MemberLookup_FindMembers): Check whether the
20668 IMemberFinder has a MemberCache and call the cache's FindMembers
20670 (MemberCache): Rewrote larger parts of this yet another time and
20671 cleaned it up a bit.
20673 2002-08-15 Miguel de Icaza <miguel@ximian.com>
20675 * driver.cs (LoadArgs): Support quoting.
20677 (Usage): Show the CSC-like command line arguments.
20679 Improved a few error messages.
20681 2002-08-15 Martin Baulig <martin@gnome.org>
20683 * typemanager.cs (IMemberContainer.Type): New property.
20684 (IMemberContainer.IsInterface): New property.
20686 The following changes are conditional to BROKEN_RUNTIME, which is
20687 defined at the top of the file.
20689 * typemanager.cs (MemberCache.MemberCache): Don't add the base
20690 class'es members, but add all members from TypeHandle.ObjectType
20691 if we're an interface.
20692 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
20693 is the current type.
20694 (MemberCache.CacheEntry.Container): Removed this field.
20695 (TypeHandle.GetMembers): Include inherited members.
20697 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20699 * typemanager.cs: fixed compilation and added a comment on a field that
20702 2002-08-15 Martin Baulig <martin@gnome.org>
20704 * class.cs (ConstructorInitializer.Resolve): In the
20705 Expression.MemberLookup call, use the queried_type as
20708 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
20709 declared' attribute, it's always true.
20710 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
20711 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
20712 temporary wrapper for FindMembers which tells MemberLookup whether
20713 members from the base classes are included in the return value.
20714 This will go away soon.
20715 (TypeManager.MemberLookup): Use this temporary hack here; once the
20716 new MemberCache is completed, we don't need to do the DeclaredOnly
20717 looping here anymore since the MemberCache will take care of this.
20718 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
20719 (MemberCache): When creating the MemberCache for a class, get
20720 members from the current class and all its base classes.
20721 (MemberCache.CacheEntry.Container): New field. This is a
20722 temporary hack until the Mono runtime is fixed to distinguish
20723 between ReflectedType and DeclaringType. It allows us to use MCS
20724 with both the MS runtime and the unfixed Mono runtime without
20725 problems and without accecting performance.
20726 (MemberCache.SearchMembers): The DeclaredOnly looping from
20727 TypeManager.MemberLookup is now done here.
20729 2002-08-14 Martin Baulig <martin@gnome.org>
20731 * statement.cs (MyStructInfo.MyStructInfo): Don't call
20732 Type.GetFields on dynamic types but get the fields from the
20733 corresponding TypeContainer.
20734 (MyStructInfo.GetStructInfo): Added check for enum types.
20736 * typemanager.cs (MemberList.IsSynchronized): Implemented.
20737 (MemberList.SyncRoot): Implemented.
20738 (TypeManager.FilterWithClosure): No need to check permissions if
20739 closure_start_type == closure_invocation_type, don't crash if
20740 closure_invocation_type is null.
20742 2002-08-13 Martin Baulig <martin@gnome.org>
20744 Rewrote TypeContainer.FindMembers to use a member cache. This
20745 gives us a speed increase of about 35% for the self-hosting MCS
20746 build and of about 15-20% for the class libs (both on GNU/Linux).
20748 * report.cs (Timer): New class to get enhanced profiling. This
20749 whole class is "TIMER" conditional since it remarkably slows down
20752 * class.cs (MemberList): New class. This is an IList wrapper
20753 which we're now using instead of passing MemberInfo[]'s around to
20754 avoid copying this array unnecessarily.
20755 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
20756 (ICachingMemberFinder, IMemberContainer): New interface.
20757 (TypeManager.FilterWithClosure): If `criteria' is null, the name
20758 has already been checked, otherwise use it for the name comparision.
20759 (TypeManager.FindMembers): Renamed to RealMemberFinder and
20760 provided wrapper which tries to use ICachingMemberFinder.FindMembers
20761 if possible. Returns a MemberList, not a MemberInfo [].
20762 (TypeHandle): New class, implements IMemberContainer. We create
20763 one instance of this class per type, it contains a MemberCache
20764 which is used to do the member lookups.
20765 (MemberCache): New class. Each instance of this class contains
20766 all members of a type and a name-based hash table.
20767 (MemberCache.FindMembers): This is our new member lookup
20768 function. First, it looks up all members of the requested name in
20769 the hash table. Then, it walks this list and sorts out all
20770 applicable members and returns them.
20772 2002-08-13 Martin Baulig <martin@gnome.org>
20774 In addition to a nice code cleanup, this gives us a performance
20775 increase of about 1.4% on GNU/Linux - not much, but it's already
20776 half a second for the self-hosting MCS compilation.
20778 * typemanager.cs (IMemberFinder): New interface. It is used by
20779 TypeManager.FindMembers to call FindMembers on a TypeContainer,
20780 Enum, Delegate or Interface.
20781 (TypeManager.finder_to_member_finder): New PtrHashtable.
20782 (TypeManager.finder_to_container): Removed.
20783 (TypeManager.finder_to_delegate): Removed.
20784 (TypeManager.finder_to_interface): Removed.
20785 (TypeManager.finder_to_enum): Removed.
20787 * interface.cs (Interface): Implement IMemberFinder.
20789 * delegate.cs (Delegate): Implement IMemberFinder.
20791 * enum.cs (Enum): Implement IMemberFinder.
20793 * class.cs (TypeContainer): Implement IMemberFinder.
20795 2002-08-12 Martin Baulig <martin@gnome.org>
20797 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
20799 2002-08-12 Martin Baulig <martin@gnome.org>
20801 * ecore.cs (ITypeExpression): New interface for expressions which
20803 (TypeExpression): Renamed to TypeLookupExpression.
20804 (Expression.DoResolve): If we're doing a types-only lookup, the
20805 expression must implement the ITypeExpression interface and we
20806 call DoResolveType() on it.
20807 (SimpleName): Implement the new ITypeExpression interface.
20808 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
20809 hack, the situation that we're only looking up types can't happen
20810 anymore when this method is called. Moved the type lookup code to
20811 DoResolveType() and call it.
20812 (SimpleName.DoResolveType): This ITypeExpression interface method
20813 is now doing the types-only lookup.
20814 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
20815 (ResolveFlags): Added MaskExprClass.
20817 * expression.cs (MemberAccess): Implement the ITypeExpression
20819 (MemberAccess.DoResolve): Added support for a types-only lookup
20820 when we're called via ITypeExpression.DoResolveType().
20821 (ComposedCast): Implement the ITypeExpression interface.
20823 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
20824 Expression.Resolve() with ResolveFlags.Type instead.
20826 2002-08-12 Martin Baulig <martin@gnome.org>
20828 * interface.cs (Interface.Define): Apply attributes.
20830 * attribute.cs (Attribute.ApplyAttributes): Added support for
20831 interface attributes.
20833 2002-08-11 Martin Baulig <martin@gnome.org>
20835 * statement.cs (Block.Emit): Only check the "this" variable if we
20836 do not always throw an exception.
20838 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
20839 whether the property has a set accessor.
20841 2002-08-11 Martin Baulig <martin@gnome.org>
20843 Added control flow analysis support for structs.
20845 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
20846 with control flow analysis turned off.
20847 (IVariable): New interface.
20848 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
20849 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
20850 (FieldExpr.DoResolve): Resolve the instance expression with flow
20851 analysis turned off and do the definite assignment check after the
20852 resolving when we know what the expression will resolve to.
20854 * expression.cs (LocalVariableReference, ParameterReference):
20855 Implement the new IVariable interface, only call the flow analysis
20856 code if ec.DoFlowAnalysis is true.
20857 (This): Added constructor which takes a Block argument. Implement
20858 the new IVariable interface.
20859 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
20860 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
20861 This does the definite assignment checks for struct members.
20863 * class.cs (Constructor.Emit): If this is a non-static `struct'
20864 constructor which doesn't have any initializer, call
20865 Block.AddThisVariable() to tell the flow analysis code that all
20866 struct elements must be initialized before control returns from
20869 * statement.cs (MyStructInfo): New public class.
20870 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
20871 argument to this indexer. If non-zero, check an individual struct
20872 member, not the whole struct.
20873 (FlowBranching.CheckOutParameters): Check struct members.
20874 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
20875 overloaded versions of these methods which take an additional
20876 `int field_idx' argument to check struct members.
20877 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
20878 overloaded versions of these methods which take an additional
20879 `string field_name' argument to check struct member.s
20880 (VariableInfo): Implement the IVariable interface.
20881 (VariableInfo.StructInfo): New public property. Returns the
20882 MyStructInfo instance of the variable if it's a struct or null.
20883 (Block.AddThisVariable): New public method. This is called from
20884 Constructor.Emit() for non-static `struct' constructor which do
20885 not have any initializer. It creates a special variable for the
20886 "this" instance variable which will be checked by the flow
20887 analysis code to ensure that all of the struct's fields are
20888 initialized before control returns from the constructor.
20889 (UsageVector): Added support for struct members. If a
20890 variable/parameter is a struct with N members, we reserve a slot
20891 in the usage vector for each member. A struct is considered fully
20892 initialized if either the struct itself (slot 0) or all its
20893 members are initialized.
20895 2002-08-08 Martin Baulig <martin@gnome.org>
20897 * driver.cs (Driver.MainDriver): Only report an error CS5001
20898 if there were no compilation errors.
20900 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
20901 `UnsafeContext' property to determine whether the parent is in
20902 unsafe context rather than checking the parent's ModFlags:
20903 classes nested in an unsafe class are unsafe as well.
20905 2002-08-08 Martin Baulig <martin@gnome.org>
20907 * statement.cs (UsageVector.MergeChildren): Distinguish between
20908 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
20909 we return. Added test17() and test18() to test-154.cs.
20911 2002-08-08 Martin Baulig <martin@gnome.org>
20913 * typemanager.cs (TypeManager.FilterWithClosure): If we have
20914 Family access, make sure the invoking type isn't a subclass of the
20915 queried type (that'd be a CS1540).
20917 * ecore.cs (Expression.MemberLookup): Added overloaded version of
20918 this method which takes an additional `Type invocation_type'.
20920 * expression.cs (BaseAccess.DoResolve): Use the base type as
20921 invocation and query type.
20922 (MemberAccess.DoResolve): If the lookup failed and we're about to
20923 report a CS0122, try a lookup with the ec.ContainerType - if this
20924 succeeds, we must report a CS1540.
20926 2002-08-08 Martin Baulig <martin@gnome.org>
20928 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
20929 (MethodGroupExpr): Implement the IMemberExpr interface.
20931 * expression (MemberAccess.ResolveMemberAccess): No need to have
20932 any special code for MethodGroupExprs anymore, they're now
20935 2002-08-08 Martin Baulig <martin@gnome.org>
20937 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
20938 Family, FamANDAssem and FamORAssem permissions.
20939 (TypeManager.IsSubclassOrNestedChildOf): New public method.
20941 2002-08-08 Martin Baulig <martin@gnome.org>
20943 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
20944 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
20947 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
20949 * driver.cs: implemented /resource option to embed managed resources.
20951 2002-08-07 Martin Baulig <martin@gnome.org>
20953 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
20954 (FieldBase.HasFieldInitializer): New public property.
20955 (FieldBase.GetInitializerExpression): New public method. Resolves and
20956 returns the field initializer and makes sure it is only resolved once.
20957 (TypeContainer.EmitFieldInitializers): Call
20958 FieldBase.GetInitializerExpression to get the initializer, this ensures
20959 that it isn't resolved multiple times.
20961 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
20962 the resolving process (SimpleName/MemberLookup) that we're currently
20963 emitting a field initializer (which must not access any instance members,
20964 this is an error CS0236).
20966 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
20967 argument, if the `IsFieldInitializer' flag is set, we must report and
20968 error CS0236 and not an error CS0120.
20970 2002-08-07 Martin Baulig <martin@gnome.org>
20972 * ecore.cs (IMemberExpr): New public interface.
20973 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
20974 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
20975 if the expression is an IMemberExpr.
20977 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
20978 to be null, implicitly default to `this' if we're non-static in
20979 this case. Simplified the code a lot by using the new IMemberExpr
20980 interface. Also fixed bug #28176 here.
20982 2002-08-06 Martin Baulig <martin@gnome.org>
20984 * cs-parser.jay (SimpleLookup): Removed. We need to create
20985 ParameterReferences during semantic analysis so that we can do a
20986 type-only search when resolving Cast, TypeOf and SizeOf.
20987 (block): Pass the `current_local_parameters' to the Block's
20990 * class.cs (ConstructorInitializer): Added `Parameters parameters'
20991 argument to the constructor.
20992 (ConstructorInitializer.Resolve): Create a temporary implicit
20993 block with the parameters.
20995 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
20996 references here if we aren't doing a type-only search.
20998 * statement.cs (Block): Added constructor which takes a
20999 `Parameters parameters' argument.
21000 (Block.Parameters): New public property.
21002 * support.cs (InternalParameters.Parameters): Renamed `parameters'
21003 to `Parameters' and made it public readonly.
21005 2002-08-06 Martin Baulig <martin@gnome.org>
21007 * ecore.cs (Expression.Warning): Made this public as well.
21009 * report.cs (Report.Debug): Print the contents of collections.
21011 2002-08-06 Martin Baulig <martin@gnome.org>
21013 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
21014 used to tell Resolve() which kinds of expressions it may return.
21015 (Expression.Resolve): Added overloaded version of this method which
21016 takes a `ResolveFlags flags' argument. This can be used to tell
21017 Resolve() which kinds of expressions it may return. Reports a
21019 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
21020 ResolveFlags.SimpleName.
21021 (Expression.Error118): Added overloaded version of this method which
21022 takes a `ResolveFlags flags' argument. It uses the flags to determine
21023 which kinds of expressions are allowed.
21025 * expression.cs (Argument.ResolveMethodGroup): New public method.
21026 Resolves an argument, but allows a MethodGroup to be returned.
21027 This is used when invoking a delegate.
21029 * TODO: Updated a bit.
21031 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21033 Fixed compilation with csc.
21035 * ecore.cs: Expression.Error made public. Is this correct? Should
21036 Warning be made public too?
21038 * expression.cs: use ea.Location instead of ea.loc.
21039 [FIXME: Filed as bug #28607: MCS must report these errors.]
21041 2002-08-06 Martin Baulig <martin@gnome.org>
21043 * ecore.cs (Expression.loc): Moved the location here instead of
21044 duplicating it in all derived classes.
21045 (Expression.Location): New public property.
21046 (Expression.Error, Expression.Warning): Made them non-static and
21047 removed the location argument.
21048 (Expression.Warning): Added overloaded version which takes an
21049 `int level' argument.
21050 (Expression.Error118): Make this non-static and removed the
21051 expression and location arguments.
21052 (TypeExpr): Added location argument to the constructor.
21054 * expression.cs (StaticCallExpr): Added location argument to
21056 (Indirection, PointerArithmetic): Likewise.
21057 (CheckedExpr, UnCheckedExpr): Likewise.
21058 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
21059 (StringPtr): Likewise.
21062 2002-08-05 Martin Baulig <martin@gnome.org>
21064 * expression.cs (BaseAccess.DoResolve): Actually report errors.
21066 * assign.cs (Assign.DoResolve): Check whether the source
21067 expression is a value or variable.
21069 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
21070 while resolving the corresponding blocks.
21072 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
21073 an error, don't silently return null.
21075 * statement.cs (Block.AddVariable): Do the error reporting here
21076 and distinguish between CS0128 and CS0136.
21077 (Block.DoResolve): Report all unused labels (warning CS0164).
21078 (LabeledStatement): Pass the location to the constructor.
21079 (LabeledStatement.HasBeenReferenced): New property.
21080 (LabeledStatement.Resolve): Set it to true here.
21082 * statement.cs (Return.Emit): Return success even after reporting
21083 a type mismatch error (CS0126 or CS0127), this is what csc does and
21084 it avoids confusing the users with any consecutive errors.
21086 2002-08-05 Martin Baulig <martin@gnome.org>
21088 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
21090 * const.cs (Const.LookupConstantValue): Catch circular definitions.
21092 * expression.cs (MemberAccess.DoResolve): Silently return if an
21093 error has already been reported.
21095 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
21096 error has already been reported.
21098 2002-08-05 Martin Baulig <martin@gnome.org>
21100 * statement.cs (UsageVector): Only initialize the `parameters'
21101 vector if we actually have any "out" parameters.
21103 2002-08-05 Martin Baulig <martin@gnome.org>
21105 * expression.cs (Binary.ResolveOperator): When combining delegates,
21106 they must have the same type.
21108 2002-08-05 Martin Baulig <martin@gnome.org>
21110 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
21111 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
21112 work with the ms runtime and we also don't need it: if we're a
21113 PropertyBuilder and not in the `indexer_arguments' hash, then we
21114 are a property and not an indexer.
21116 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
21117 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
21118 since the latter one doesn't work with the ms runtime.
21120 2002-08-03 Martin Baulig <martin@gnome.org>
21122 Fixed bugs #27998 and #22735.
21124 * class.cs (Method.IsOperator): New public field.
21125 (Method.CheckBase): Report CS0111 if there's already a method
21126 with the same parameters in the current class. Report CS0508 when
21127 attempting to change the return type of an inherited method.
21128 (MethodData.Emit): Report CS0179 if a method doesn't have a body
21129 and it's not marked abstract or extern.
21130 (PropertyBase): New abstract base class for Property and Indexer.
21131 (PropertyBase.CheckBase): Moved here from Property and made it work
21133 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
21134 the same so we can reuse it there.
21135 (Property, Indexer): Derive from PropertyBase.
21136 (MethodSignature.inheritable_property_signature_filter): New delegate
21137 to find properties and indexers.
21139 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
21140 argument and improved error reporting.
21142 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
21143 EmptyReadOnlyParameters and made it a property.
21145 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
21146 version of this method which takes a `PropertyInfo indexer'.
21147 (TypeManager.RegisterIndexer): New method.
21149 * class.cs: Added myself as author of this file :-)
21151 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21153 * class.cs: fixed compilation on windoze.
21155 2002-08-03 Martin Baulig <martin@gnome.org>
21157 * interface.cs (Interface.GetInterfaceBases): Check whether all
21158 base interfaces are at least as accessible than the current one.
21160 * class.cs (TypeContainer.GetClassBases): Check whether base types
21161 are at least as accessible than the current type.
21162 (TypeContainer.AsAccessible): Implemented and made non-static.
21163 (MemberBase.CheckParameters): Report errors if the accessibility
21166 * delegate.cs (Delegate.Delegate): The default visibility is
21167 internal for top-level types and private for nested types.
21168 (Delegate.Define): Report errors if the accessibility checks fail.
21170 * enum.cs (Enum.Enum): The default visibility is internal for
21171 top-level types and private for nested types.
21172 (Enum.DefineType): Compute the correct visibility.
21174 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
21175 function which takes a `bool is_toplevel' instead of a TypeContainer.
21177 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
21180 2002-08-02 Martin Baulig <martin@gnome.org>
21182 * expression.cs (LocalVariableReferenc): Added constructor which
21183 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
21184 (LocalVariableReference.IsReadOnly): New property.
21185 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
21186 variable is readonly, use our own readonly flag to do this; you can
21187 use the new constructor to get a writable reference to a read-only
21190 * cs-parser.jay (foreach_statement, using_statement): Get a writable
21191 reference to the local variable.
21193 2002-08-01 Miguel de Icaza <miguel@ximian.com>
21195 * rootcontext.cs (ResolveCore): Also include System.Exception
21197 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
21198 we reach an EmptyStatement.
21200 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
21203 * expression.cs (Binary.ResolveOperator): Check error result in
21206 use brtrue/brfalse directly and avoid compares to null.
21208 2002-08-02 Martin Baulig <martin@gnome.org>
21210 * class.cs (TypeContainer.Define): Define all nested interfaces here.
21211 Fixes bug #28407, added test-155.cs.
21213 2002-08-01 Martin Baulig <martin@gnome.org>
21215 * class.cs (Event.EmitDefaultMethod): Make this work with static
21216 events. Fixes #28311, added verify-3.cs.
21218 2002-08-01 Martin Baulig <martin@gnome.org>
21220 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
21221 `is_disposable' fields.
21222 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
21223 `hm.is_disposable' if we're using the collection pattern.
21224 (Foreach.EmitCollectionForeach): Use the correct type for the
21225 enumerator's local variable, only emit the try/finally block if
21226 necessary (fixes #27713).
21228 2002-08-01 Martin Baulig <martin@gnome.org>
21230 * ecore.cs (Expression.report118): Renamed to Error118 and made
21233 * statement.cs (Throw.Resolve): Check whether the expression is of
21234 the correct type (CS0118) and whether the type derives from
21235 System.Exception (CS0155).
21236 (Catch.Resolve): New method. Do the type lookup here and check
21237 whether it derives from System.Exception (CS0155).
21238 (Catch.CatchType, Catch.IsGeneral): New public properties.
21240 * typemanager.cs (TypeManager.exception_type): Added.
21242 2002-07-31 Miguel de Icaza <miguel@ximian.com>
21244 * driver.cs: Updated About function.
21246 2002-07-31 Martin Baulig <martin@gnome.org>
21248 Implemented Control Flow Analysis.
21250 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
21251 (EmitContext.CurrentBranching): Added.
21252 (EmitContext.StartFlowBranching): Added.
21253 (EmitContext.EndFlowBranching): Added.
21254 (EmitContext.KillFlowBranching): Added.
21255 (EmitContext.IsVariableAssigned): Added.
21256 (EmitContext.SetVariableAssigned): Added.
21257 (EmitContext.IsParameterAssigned): Added.
21258 (EmitContext.SetParameterAssigned): Added.
21259 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
21260 Added control flow analysis stuff here.
21262 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
21263 resolve the expression as lvalue.
21264 (LocalVariableReference.DoResolve): Check whether the variable has
21265 already been assigned.
21266 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
21267 the parameter as assigned here.
21268 (ParameterReference.DoResolve): Check whether the parameter has already
21270 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
21271 expression as lvalue.
21273 * statement.cs (FlowBranching): New class for the flow analysis code.
21274 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
21275 (LabeledStatement.IsDefined): New public property.
21276 (LabeledStatement.AddUsageVector): New public method to tell flow
21277 analyis that the label may be reached via a forward jump.
21278 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
21280 (VariableInfo.Number): New public field. This is used by flow analysis
21281 to number all locals of a block.
21282 (Block.CountVariables): New public property. This is the number of
21283 local variables in this block (including the locals from all parent
21285 (Block.EmitMeta): Number all the variables.
21287 * statement.cs: Added flow analysis support to all classes.
21289 2002-07-31 Martin Baulig <martin@gnome.org>
21291 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
21292 To get debugging messages, compile mcs with /define:MCS_DEBUG and
21293 then use this argument.
21295 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
21297 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
21298 use this to specify /define options.
21300 2002-07-29 Martin Baulig <martin@gnome.org>
21302 * statement.cs (Fixed): Moved all code that does variable lookups
21303 and resolvings from Emit to Resolve.
21305 * statement.cs (For): Moved all code that does variable lookups
21306 and resolvings from Emit to Resolve.
21308 * statement.cs (Using): Moved all code that does variable lookups
21309 and resolvings from Emit to Resolve.
21311 2002-07-29 Martin Baulig <martin@gnome.org>
21313 * attribute.cs (Attribute.Resolve): Explicitly catch a
21314 System.NullReferenceException when creating the
21315 CustromAttributeBuilder and report a different warning message.
21317 2002-07-29 Martin Baulig <martin@gnome.org>
21319 * support.cs (ParameterData.ParameterName): Added method to
21320 get the name of a parameter.
21322 * typemanager.cs (TypeManager.IsValueType): New public method.
21324 2002-07-29 Martin Baulig <martin@gnome.org>
21326 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
21327 is a flag which specifies that it's either ref or out.
21328 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
21329 the out parameter to `out Parameter.Modifier mod', also set the
21330 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
21332 * support.cs (InternalParameters.ParameterModifier): Distinguish
21333 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
21334 Parameter.Modifier.ISBYREF flag if it's either ref or out.
21336 * expression.cs (Argument.GetParameterModifier): Distinguish
21337 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
21338 Parameter.Modifier.ISBYREF flag if it's either ref or out.
21340 2002-07-29 Martin Baulig <martin@gnome.org>
21342 * expression.cs (ParameterReference.ParameterReference): Added
21343 `Location loc' argument to the constructor.
21345 * cs-parser.jay: Pass location to ParameterReference.
21347 2002-07-28 Miguel de Icaza <miguel@ximian.com>
21349 * statement.cs (Try): Initialize the location.
21351 * cs-parser.jay: pass location to Try.
21353 * expression.cs (Unary.Reduce): Change the prototype to return
21354 whether a constant fold could be performed or not. The result is
21355 returned in an out parameters. In the case of Indirection and
21356 AddressOf, we want to perform the full tests.
21358 2002-07-26 Miguel de Icaza <miguel@ximian.com>
21360 * statement.cs (Statement.Emit): Flag dead code.
21362 2002-07-27 Andrew Birkett <andy@nobugs.org>
21364 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
21366 2002-07-27 Martin Baulig <martin@gnome.org>
21368 * class.cs (MethodData.Define): Put back call to
21369 TypeManager.AddMethod(), accidentally commented this out.
21371 * report.cs (Debug): New public method to print debugging information,
21372 this is `[Conditional ("DEBUG")]'.
21374 2002-07-26 Martin Baulig <martin@gnome.org>
21376 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
21377 (switch_statement): Push the current_block to the switch_stack and
21378 pop it again when we're done with the switch.
21379 (switch_section): The new block is a child of the current_block.
21380 Fixes bug #24007, added test-152.cs.
21382 2002-07-27 Martin Baulig <martin@gnome.org>
21384 * expression.cs (Invocation.EmitArguments): When calling a varargs
21385 function with only its fixed arguments, we need to pass an empty
21388 2002-07-27 Martin Baulig <martin@gnome.org>
21390 Mono 0.13 has been released.
21392 2002-07-25 Miguel de Icaza <miguel@ximian.com>
21394 * driver.cs: Rename --resource to --linkres, because that is what
21395 we do currently, we dont support --resource yet.
21397 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
21399 2002-07-25 Martin Baulig <martin@gnome.org>
21401 * class.cs (MethodData): New public class. This is a `method builder'
21402 class for a method or one accessor of a Property/Indexer/Event.
21403 (MethodData.GetMethodFlags): Moved here from MemberBase.
21404 (MethodData.ApplyAttributes): Likewise.
21405 (MethodData.ApplyObsoleteAttribute): Likewise.
21406 (MethodData.ApplyConditionalAttribute): Likewise.
21407 (MethodData.ApplyDllImportAttribute): Likewise.
21408 (MethodData.CheckAbstractAndExternal): Likewise.
21409 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
21410 (MethodData.Emit): Formerly known as Method.Emit().
21411 (MemberBase): Moved everything which was specific to a single
21412 accessor/method to MethodData.
21413 (Method): Create a new MethodData and call Define() and Emit() on it.
21414 (Property, Indexer, Event): Create a new MethodData objects for each
21415 accessor and call Define() and Emit() on them.
21417 2002-07-25 Martin Baulig <martin@gnome.org>
21419 Made MethodCore derive from MemberBase to reuse the code from there.
21420 MemberBase now also checks for attributes.
21422 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
21423 (MemberBase.GetMethodFlags): Moved here from class Method and marked
21425 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
21426 `CallingConventions cc' and `Attributes opt_attrs' arguments.
21427 (MemberBase.ApplyAttributes): New virtual method; applies the
21428 attributes to a method or accessor.
21429 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
21430 (MemberBase.ApplyConditionalAttribute): Likewise.
21431 (MemberBase.ApplyDllImportAttribute): Likewise.
21432 (MemberBase.CheckAbstractAndExternal): Likewise.
21433 (MethodCore.ParameterTypes): This is now a property instead of a
21434 method, it's initialized from DoDefineParameters().
21435 (MethodCore.ParameterInfo): Removed the set accessor.
21436 (MethodCore.DoDefineParameters): New protected virtual method to
21437 initialize ParameterTypes and ParameterInfo.
21438 (Method.GetReturnType): We can now simply return the MemberType.
21439 (Method.GetMethodFlags): Override the MemberBase version and add
21440 the conditional flags.
21441 (Method.CheckBase): Moved some code from Define() here, call
21442 DoDefineParameters() here.
21443 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
21444 here to avoid some larger code duplication.
21445 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
21446 ensure that abstract and external accessors don't declare a body.
21448 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
21449 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
21450 lookup in the attribute's parent classes, so we need to abort as soon
21451 as we found the first match.
21452 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
21453 the attribute has no arguments.
21455 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
21458 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21460 * cs-parser.jay: reverted previous patch.
21462 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21464 * cs-parser.jay: fixed bug #22119.
21466 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21468 * attribute.cs: fixed compilation. The error was:
21469 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
21470 be assigned to before control leaves the current method."
21471 [FIXME: Filed as bug #28186: MCS must report this error.]
21473 2002-07-25 Martin Baulig <martin@gnome.org>
21475 * attribute.cs (Attribute.Conditional_GetConditionName): New static
21476 method to pull the condition name ouf of a Conditional attribute.
21477 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
21478 the obsolete message and error flag out of an Obsolete attribute.
21480 * class.cs (Method.GetMethodFlags): New public method to get the
21481 TypeManager.MethodFlags for this method.
21482 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
21484 (Method.Define): Get and apply the Obsolete and Conditional attributes;
21485 if we're overriding a virtual function, set the new private variable
21486 `parent_method'; call the new TypeManager.AddMethod().
21488 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
21489 the MethodBuilder and the Method in a PtrHashtable.
21490 (TypeManager.builder_to_method): Added for this purpose.
21491 (TypeManager.MethodFlags): Added IsObsoleteError.
21492 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
21493 Obsolete and Conditional arguments in MethodBuilders. If we discover
21494 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
21495 the message from the attribute.
21497 2002-07-24 Martin Baulig <martin@gnome.org>
21499 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
21500 preprocessor directives, ensure that the argument to #define/#undef is
21501 exactly one identifier and that it's actually an identifier.
21503 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
21506 2002-07-24 Martin Baulig <martin@gnome.org>
21508 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
21509 initialize it to TypeManager.object_type in the constructor.
21510 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
21511 of the `hm.get_current' method if we're using the collection pattern.
21512 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
21513 for the explicit conversion to make it work when we're using the collection
21514 pattern and the `Current' property has a different return type than `object'.
21517 2002-07-24 Martin Baulig <martin@gnome.org>
21519 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
21520 does not match, but don't report any errors. This method is called in
21521 order for all methods in a MethodGroupExpr until a matching method is
21522 found, so we don't want to bail out if the first method doesn't match.
21523 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
21524 matches, report the 123. Fixes #28070.
21526 2002-07-24 Martin Baulig <martin@gnome.org>
21528 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
21529 TypeManager.TypeToCoreType() to the top of the method so the
21530 following equality checks will work. Fixes #28107.
21532 2002-07-24 Martin Baulig <martin@gnome.org>
21534 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
21535 operand is of type uint, and the other operand is of type sbyte,
21536 short or int, the operands are converted to type long." -
21537 Actually do what this comment already told us. Fixes bug #28106,
21540 2002-07-24 Martin Baulig <martin@gnome.org>
21542 * class.cs (MethodBase): New abstract class. This is now a base
21543 class for Property, Indexer and Event to avoid some code duplication
21544 in their Define() and DefineMethods() methods.
21545 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
21546 generic methods for Define() and DefineMethods().
21547 (FieldBase): Derive from MemberBase, not MemberCore.
21548 (Property): Derive from MemberBase, not MemberCore.
21549 (Property.DefineMethod): Moved all the code from this method to the
21550 new MethodBase.DefineAccessor(), just call it with appropriate
21552 (Property.Define): Call the new Property.DoDefine(), this does some
21553 sanity checks and we don't need to duplicate the code everywhere.
21554 (Event): Derive from MemberBase, not MemberCore.
21555 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
21556 accessors, this will also make them work with interface events.
21557 (Indexer): Derive from MemberBase, not MemberCore.
21558 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
21559 (Indexer.Define): Use the new MethodBase functions.
21561 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
21562 argument to the constructor.
21563 (Interface.FindMembers): Added support for interface events.
21564 (Interface.PopluateEvent): Implemented.
21566 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
21568 2002-07-22 Miguel de Icaza <miguel@ximian.com>
21570 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
21571 but this is required to check for a method name being the same as
21572 the containing class.
21576 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21578 * interface.cs: initialize variable.
21580 2002-07-23 Martin Baulig <martin@gnome.org>
21582 Implemented the IndexerName attribute in interfaces.
21584 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
21585 name if this is an explicit interface implementation.
21586 (Indexer.InterfaceIndexerName): New public variable. If we're
21587 implementing an interface indexer, this is the IndexerName in that
21588 interface. Otherwise, it's the IndexerName.
21589 (Indexer.DefineMethod): If we're implementing interface indexer,
21590 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
21591 and Pending.ImplementIndexer methods.
21592 (Indexer.Define): Also define the PropertyBuilder if we're
21593 implementing an interface indexer and this is neither an explicit
21594 interface implementation nor do the IndexerName match the one in
21597 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
21598 If a method is defined here, then we always need to create a proxy
21599 for it. This is used when implementing interface indexers.
21600 (Pending.IsInterfaceIndexer): New public method.
21601 (Pending.ImplementIndexer): New public method.
21602 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
21603 This is used when implementing interface indexers to define a proxy
21605 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
21606 define a proxy if necessary.
21608 * interface.cs (Interface.IndexerName): New public variable.
21609 (Interface.PopulateIndexer): Set the IndexerName.
21610 (Interface.DefineIndexers): New private method. Populate all the
21611 indexers and make sure their IndexerNames match.
21613 * typemanager.cs (IndexerPropertyName): Added support for interface
21616 2002-07-22 Martin Baulig <martin@gnome.org>
21618 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
21619 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
21620 ret if HasReturnLabel.
21621 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
21624 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
21625 and set the ec.LoopBeginTryCatchLevel.
21626 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
21627 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
21628 the current ec.TryCatchLevel, the branch goes out of an exception
21629 block. In this case, we need to use Leave and not Br.
21631 2002-07-22 Martin Baulig <martin@gnome.org>
21633 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
21634 block unless the block does not always return or it is contained in
21635 another try { ... } catch { ... } block. Fixes bug #26506.
21636 Added verify-1.cs to the test suite.
21638 2002-07-22 Martin Baulig <martin@gnome.org>
21640 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
21641 then we do not always return. Fixes bug #24985.
21643 2002-07-22 Martin Baulig <martin@gnome.org>
21645 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
21646 lookup on a per-class level; ie. walk up the class hierarchy until we
21647 found at least one applicable method, then choose the best among them.
21648 Fixes bug #24463 and test-29.cs.
21650 2002-07-22 Martin Baulig <martin@gnome.org>
21652 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
21653 return types of the methods. The return type is not part of the
21654 signature and we must not check it to make the `new' modifier work.
21655 Fixes bug #27999, also added test-147.cs.
21656 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
21658 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
21659 on the method's return type.
21661 2002-07-21 Martin Baulig <martin@gnome.org>
21663 * assign.cs: Make this work if the rightmost source is a constant and
21664 we need to do an implicit type conversion. Also adding a few more tests
21665 to test-38.cs which should have caught this.
21667 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
21668 target in the makefile for this. The makefile.gnu is primarily intended
21669 for end-users who don't want to debug the compiler.
21671 2002-07-21 Martin Baulig <martin@gnome.org>
21673 * assign.cs: Improved the Assign class so it can now handle embedded
21674 assignments (X = Y = Z = something). As a side-effect this'll now also
21675 consume less local variables. test-38.cs now passes with MCS, added
21676 a few new test cases to that test.
21678 2002-07-20 Martin Baulig <martin@gnome.org>
21680 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
21681 instructions. Fixes bug #27977, also added test-146.cs.
21683 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21685 * cs-tokenizer.cs: fixed getHex ().
21687 2002-07-19 Martin Baulig <martin@gnome.org>
21689 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
21690 not Type.GetType() to lookup the array type. This is needed when
21691 we're constructing an array of a user-defined type.
21692 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
21693 single-dimensional arrays, but also for single-dimensial arrays of
21696 2002-07-19 Martin Baulig <martin@gnome.org>
21698 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
21699 this function is called, it's not allowed to share LocalBuilders
21700 among ILGenerators.
21702 2002-07-19 Martin Baulig <martin@gnome.org>
21704 * expression.cs (Argument.Resolve): Report an error 118 when trying
21705 to pass a type as argument.
21707 2002-07-18 Martin Baulig <martin@gnome.org>
21709 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
21710 Conv_R_Un for the signed `long' type.
21712 2002-07-15 Miguel de Icaza <miguel@ximian.com>
21714 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
21715 `expr' for the temporary result, as that will fail if we do
21716 multiple resolves on the same expression.
21718 2002-07-05 Miguel de Icaza <miguel@ximian.com>
21720 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
21721 ec.TypeContainer for looking up aliases.
21723 * class.cs (TypeContainer): Remove LookupAlias from here.
21725 * decl.cs (DeclSpace); Move here.
21727 2002-07-01 Miguel de Icaza <miguel@ximian.com>
21729 * class.cs (FindMembers): Only call filter if the constructor
21730 bulider is not null.
21732 Also handle delegates in `NestedTypes' now. Now we will perform
21733 type lookups using the standard resolution process. This also
21736 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
21737 This uses Expressions (the limited kind that can be parsed by the
21738 tree) instead of strings.
21740 * expression.cs (ComposedCast.ToString): Implement, used to flag
21741 errors since now we have to render expressions.
21743 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
21746 * ecore.cs (SimpleName.ToString): ditto.
21748 * cs-parser.jay: Instead of using strings to assemble types, use
21749 Expressions to assemble the type (using SimpleName, ComposedCast,
21750 MemberAccess). This should fix the type lookups in declarations,
21751 because we were using a different code path for this.
21753 * statement.cs (Block.Resolve): Continue processing statements
21754 even when there is an error.
21756 2002-07-17 Miguel de Icaza <miguel@ximian.com>
21758 * class.cs (Event.Define): Also remove the `remove' method from
21759 the list of pending items.
21761 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
21762 generate more compact code.
21764 2002-07-17 Martin Baulig <martin@gnome.org>
21766 * const.cs (Const.LookupConstantValue): Add support for constant
21767 `unchecked' and `checked' expressions.
21768 Also adding test case test-140.cs for this.
21770 2002-07-17 Martin Baulig <martin@gnome.org>
21772 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
21773 check whether mi.ReturnType implements the IEnumerator interface; the
21774 `==' and the IsAssignableFrom() will fail in this situation.
21776 2002-07-16 Ravi Pratap <ravi@ximian.com>
21778 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
21781 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21783 * expression.cs: fixed bug #27811.
21785 2002-07-14 Miguel de Icaza <miguel@ximian.com>
21787 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
21788 Molaro: when we are a ref, the value already contains a pointer
21789 value, do not take the address of it.
21791 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
21792 * removed mb-parser.jay and mb-tokenizer.cs
21794 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
21796 * expression.cs: check against the building corlib void type.
21798 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
21800 * ecore.cs: fix for valuetype static readonly fields: when
21801 initializing them, we need their address, not the address of a copy.
21803 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
21805 * typemanager.cs: register also enum_type in corlib.
21807 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
21809 * class.cs: allow calling this (but not base) initializers in structs.
21811 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
21813 * ecore.cs: make sure we compare against the building base types
21816 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
21818 * typemanager.cs: fix TypeToCoreType() to handle void and object
21819 (corlib gets no more typerefs after this change).
21821 2002-07-12 Miguel de Icaza <miguel@ximian.com>
21823 * expression.cs (ArrayCreation.EmitArrayArguments): use
21824 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
21826 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
21827 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
21828 array indexes, the runtime actually forbids them.
21830 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
21831 for array arguments here.
21833 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
21834 instead of the default for ValueTypes.
21836 (New.DoEmit): Use IsValueType instead of
21837 IsSubclassOf (value_type)
21838 (New.DoResolve): ditto.
21839 (Invocation.EmitCall): ditto.
21841 * assign.cs (Assign): ditto.
21843 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
21844 Statements *are* currently doing part of their resolution during
21847 Expressions do always resolve during resolve, but statements are
21848 only required to propagate resolution to their children.
21850 2002-07-11 Miguel de Icaza <miguel@ximian.com>
21852 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
21854 (LoadAssembly): Do not add the dll if it is already specified
21856 (MainDriver): Add the System directory to the link path at the end,
21857 after all the other -L arguments.
21859 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
21860 wrong opcode for loading bytes and bools (ldelem.i1 instead of
21861 ldelem.u1) and using the opposite for sbytes.
21863 This fixes Digger, and we can finally run it.
21865 * driver.cs (UnixParseOption): Move the option parsing here.
21866 (CSCParseOption): Implement CSC-like parsing of options.
21868 We now support both modes of operation, the old Unix way, and the
21869 new CSC-like way. This should help those who wanted to make cross
21870 platform makefiles.
21872 The only thing broken is that /r:, /reference: and /lib: are not
21873 implemented, because I want to make those have the same semantics
21874 as the CSC compiler has, and kill once and for all the confussion
21875 around this. Will be doing this tomorrow.
21877 * statement.cs (Unsafe.Resolve): The state is checked during
21878 resolve, not emit, so we have to set the flags for IsUnsfe here.
21880 2002-07-10 Miguel de Icaza <miguel@ximian.com>
21882 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
21883 not catch the Error_ObjectRefRequired in SimpleName (as it is
21884 possible to have a class/instance variable name that later gets
21885 deambiguated), we have to check this here.
21887 2002-07-10 Ravi Pratap <ravi@ximian.com>
21889 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
21890 make static and put into Expression.
21892 (Event.Define): Register the private field of the event with the
21893 TypeManager so that GetFieldFromEvent can get at it.
21895 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
21896 keep track of the private field associated with an event which
21899 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
21902 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
21904 2002-07-10 Miguel de Icaza <miguel@ximian.com>
21906 * expression.cs (Binary.EmitBranchable): this routine emits the
21907 Binary expression in a branchable context. This basically means:
21908 we need to branch somewhere, not just get the value on the stack.
21910 This works together with Statement.EmitBoolExpression.
21912 * statement.cs (Statement.EmitBoolExpression): Use
21915 2002-07-09 Miguel de Icaza <miguel@ximian.com>
21917 * statement.cs (For): Reduce the number of jumps in loops.
21919 (For): Implement loop inversion for the For statement.
21921 (Break): We can be breaking out of a Try/Catch controlled section
21922 (foreach might have an implicit try/catch clause), so we need to
21923 use Leave instead of Br.
21925 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
21926 now). If the instace expression supports IMemoryLocation, we use
21927 the AddressOf method from the IMemoryLocation to extract the
21928 address instead of emitting the instance.
21930 This showed up with `This', as we were emitting the instance
21931 always (Emit) instead of the Address of This. Particularly
21932 interesting when This is a value type, as we dont want the Emit
21933 effect (which was to load the object).
21935 2002-07-08 Miguel de Icaza <miguel@ximian.com>
21937 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
21939 * statement.cs (Checked): Set the CheckedState during the resolve
21940 process too, as the ConvCast operations track the checked state on
21941 the resolve process, and not emit.
21943 * cs-parser.jay (namespace_member_declaration): Flag that we have
21944 found a declaration when we do. This is used to flag error 1529
21946 * driver.cs: Report ok when we display the help only.
21948 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
21950 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
21952 2002-07-04 Miguel de Icaza <miguel@ximian.com>
21954 * cs-tokenizer.cs (define): We also have to track locally the
21955 defines. AllDefines is just used for the Conditional Attribute,
21956 but we also need the local defines for the current source code.
21958 2002-07-03 Miguel de Icaza <miguel@ximian.com>
21960 * statement.cs (While, For, Do): These loops can exit through a
21961 Break statement, use this information to tell whether the
21962 statement is the last piece of code.
21964 (Break): Flag that we break.
21966 * codegen.cs (EmitContexts): New `Breaks' state variable.
21968 2002-07-03 Martin Baulig <martin@gnome.org>
21970 * class.cs (TypeContainer.MethodModifiersValid): Allow override
21971 modifiers in method declarations in structs. Otherwise, you won't
21972 be able to override things like Object.Equals().
21974 2002-07-02 Miguel de Icaza <miguel@ximian.com>
21976 * class.cs (Method, Property, Indexer): Do not allow the public
21977 modifier to be used in explicit interface implementations.
21979 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
21980 override modifiers in method declarations in structs
21982 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
21984 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
21985 integer or real overflow, report an error
21987 2002-07-02 Martin Baulig <martin@gnome.org>
21989 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
21990 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
21991 to tell the runtime about our newly created System.Object and
21992 System.ValueType types.
21994 2002-07-02 Miguel de Icaza <miguel@ximian.com>
21996 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
21997 struct instead of Ldarg/Starg.
21999 2002-07-02 Martin Baulig <martin@gnome.org>
22001 * expression.cs (Indirection.Indirection): Call
22002 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
22004 2002-07-02 Martin Baulig <martin@gnome.org>
22006 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
22007 ValueType, call TypeManager.TypeToCoreType() on it.
22008 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
22009 the OpCodes.Newarr argument.
22011 2002-07-02 Martin Baulig <martin@gnome.org>
22013 * expression.cs (Invocation.EmitCall): When compiling corlib,
22014 replace all calls to the system's System.Array type to calls to
22015 the newly created one.
22017 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
22018 System.Array methods.
22019 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
22020 from the system's System.Array type which must be replaced.
22022 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
22024 * typemanager.cs: load unverifiable_code_ctor so we can build
22025 corlib using the correct type. Avoid using GetTypeCode() with
22027 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
22028 TypeManager.object_type to allow building corlib.
22030 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
22032 * ecore.cs: handle System.Enum separately in LoadFromPtr().
22034 2002-07-01 Martin Baulig <martin@gnome.org>
22036 * class.cs: Make the last change actually work, we need to check
22037 whether `ifaces != null' to avoid a crash.
22039 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
22041 * class.cs: when we build structs without fields that implement
22042 interfaces, we need to add the interfaces separately, since there is
22043 no API to both set the size and add the interfaces at type creation
22046 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
22048 * expression.cs: the dimension arguments to the array constructors
22049 need to be converted if they are a long.
22051 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
22053 * class.cs: don't emit ldarg.0 if there is no parent constructor
22054 (fixes showstopper for corlib).
22056 2002-06-29 Martin Baulig <martin@gnome.org>
22058 MCS now compiles corlib on GNU/Linux :-)
22060 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
22061 ie. check for MethodImplOptions.InternalCall.
22063 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
22064 and TypeManager.attribute_type are null, so we must explicitly check
22065 whether parent is not null to find out whether it's an attribute type.
22066 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
22067 and SetBuilder, not only if the property is neither abstract nor external.
22068 This is necessary to set the MethodImplOptions on the accessor methods.
22069 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
22070 SetBuilder, see Property.Emit().
22072 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
22073 populate "System.Object", "System.ValueType" and "System.Attribute" since
22074 they've already been populated from BootCorlib_PopulateCoreTypes().
22076 2002-06-29 Martin Baulig <martin@gnome.org>
22078 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
22079 is the NullLiteral, we also need to make sure that target_type is not
22082 2002-06-29 Martin Baulig <martin@gnome.org>
22084 * rootcontext.cs (RootContext.ResolveCore): We must initialize
22085 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
22086 before calling BootstrapCorlib_ResolveDelegate ().
22088 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22090 * statement.cs: fixed build-breaker. All tests passed ok.
22092 2002-06-27 Martin Baulig <martin@gnome.org>
22094 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
22095 for System.Decimal when compiling corlib.
22097 2002-06-27 Martin Baulig <martin@gnome.org>
22099 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
22100 switch blocks which contain nothing but a default clause.
22102 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
22104 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
22106 2002-06-27 Martin Baulig <martin@gnome.org>
22108 * ecore.cs (PropertyExpr.PropertyExpr): Call
22109 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
22111 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
22112 is already a TypeBuilder.
22114 2002-06-27 Martin Baulig <martin@gnome.org>
22116 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
22117 `target_type == TypeManager.array_type', not IsAssignableFrom() in
22118 the "from an array-type to System.Array" case. This makes it work
22119 when compiling corlib.
22121 2002-06-27 Martin Baulig <martin@gnome.org>
22123 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
22124 non-static PropertyExpr, set its InstanceExpression. This makes
22125 the `ICollection.Count' property work in System/Array.cs.
22127 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
22129 * driver.cs: Made error handling more consistent. Errors now
22130 tracked by Report class, so many methods which used to return int
22131 now return void. Main() now prints success/failure and
22132 errors/warnings message.
22134 Renamed '--probe' compiler argument to '--expect-error'. Removed
22135 the magic number return values (123 and 124). Now, if the
22136 expected error occurs, the compiler exits with success (exit value
22137 0). If the compilation completes without seeing that particular
22138 error, the compiler exits with failure (exit value 1). The
22139 makefile in mcs/errors has been changed to handle the new behaviour.
22141 * report.cs: Made 'expected error' number a property and renamed
22142 it from 'Probe' to 'ExpectedError'.
22144 * genericparser.cs: Removed error handling support, since it is
22145 now all done by Report class.
22147 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
22148 class, so parse() no longer returns an int.
22150 * namespace.cs: Use Report.Error instead of GenericParser.error
22152 2002-06-22 Miguel de Icaza <miguel@ximian.com>
22154 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
22155 TypeContainer.AddOperator): At the front of the list put the
22156 explicit implementations, so they get resolved/defined first.
22158 2002-06-21 Miguel de Icaza <miguel@ximian.com>
22160 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
22161 interface type is implemented by this TypeContainer. Used during
22162 explicit interface implementation.
22164 (Property.Define, Indexer.Define, Method.Define): Validate that
22165 the given interface in the explicit implementation is one of the
22166 base classes for the containing type.
22168 Also if we are explicitly implementing an interface, but there is
22169 no match in the pending implementation table, report an error.
22171 (Property.Define): Only define the property if we are
22172 not explicitly implementing a property from an interface. Use the
22173 correct name also for those properties (the same CSC uses,
22174 although that is really not needed).
22176 (Property.Emit): Do not emit attributes for explicitly implemented
22177 properties, as there is no TypeBuilder.
22179 (Indexer.Emit): ditto.
22181 Hiding then means that we do not really *implement* a pending
22182 implementation, which makes code fail.
22184 2002-06-22 Martin Baulig <martin@gnome.org>
22186 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
22187 the return value of Object.GetType(). [FIXME: we need to do this whenever
22188 we get a type back from the reflection library].
22190 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
22192 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
22194 2002-06-20 Miguel de Icaza <miguel@ximian.com>
22196 * attribute.cs: Return null if we can not look up the type.
22198 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
22199 the interface types found.
22201 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
22202 interface types found.
22204 * typemanager.cs (GetInterfaces): Make this routine returns alll
22205 the interfaces and work around the lame differences between
22206 System.Type and System.Reflection.Emit.TypeBuilder in the results
22207 result for GetInterfaces.
22209 (ExpandInterfaces): Given an array of interface types, expand and
22210 eliminate repeated ocurrences of an interface. This expands in
22211 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
22214 2002-06-21 Martin Baulig <martin@gnome.org>
22216 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
22219 2002-06-21 Martin Baulig <martin@gnome.org>
22221 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
22222 and called with one of the core types, return the corresponding typebuilder for
22225 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
22228 2002-06-21 Martin Baulig <martin@gnome.org>
22230 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
22231 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
22232 (Expression.ConvertReferenceExplicit): Likewise.
22234 * expression.cs (ElementAccess.DoResolve): Likewise.
22235 (ElementAccess.DoResolveLValue): Likewise.
22237 2002-06-10 Martin Baulig <martin@gnome.org>
22239 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
22240 add the "value" parameter to the parameter list.
22242 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
22245 2002-06-19 Miguel de Icaza <miguel@ximian.com>
22247 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
22248 the argument to an int, uint, long or ulong, per the spec. Also
22249 catch negative constants in array creation.
22251 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
22253 * class.cs: do not allow the same interface to appear twice in
22254 the definition list.
22256 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
22258 * ecore.cs: don't use ldlen with System.Array.
22260 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
22262 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
22264 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
22266 * modifiers.cs: produce correct field attributes for protected
22267 internal. Easy fix so miguel can work on ther harder stuff:-)
22269 2002-06-18 Miguel de Icaza <miguel@ximian.com>
22271 * pending.cs: New file. Move the code from class.cs here.
22272 Support clearning the pending flag for all methods (when not doing
22273 explicit interface implementation).
22275 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
22277 * rootcontext.cs: added a couple more types needed to bootstrap.
22279 2002-06-17 Miguel de Icaza <miguel@ximian.com>
22281 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
22282 constructor in the type, instead of any constructor in the type
22283 hierarchy. Thanks to Paolo for finding this bug (it showed up as
22284 a bug in the Mono runtime when applying the params attribute).
22286 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
22287 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
22289 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
22291 * expression.cs (Unary.ResolveOperator): Use TypeManager
22292 to resolve the type.
22294 2002-06-13 Ravi Pratap <ravi@ximian.com>
22296 * cs-parser.jay (enum_member_declaration): Pass in the attributes
22299 * enum.cs (AddEnumMember): Add support to store the attributes associated
22300 with each member too.
22302 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
22303 field builders too - this takes care of the enum member case.
22305 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
22307 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
22308 address-of operator on both value types and pointers.
22310 2002-06-10 Martin Baulig <martin@gnome.org>
22312 * interface.cs (Interface.PopulateIndexer): Add the indexer's
22313 PropertyBuilder to the `property_builders' list.
22315 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
22316 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
22317 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
22318 find any indexers which are inherited from an interface.
22320 2002-06-09 Martin Baulig <martin@gnome.org>
22322 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
22323 the same type as the constant if necessary. There's also a test-130.cs
22326 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
22328 * typemanager.cs (TypeManager.ChangeType): Previously known as
22329 Enum.ChangeEnumType().
22331 2002-06-09 Martin Baulig <martin@gnome.org>
22333 * expression.cs (Cast.TryReduce): Added support for consts.
22335 2002-06-08 Ravi Pratap <ravi@ximian.com>
22337 * class.cs (Accessor): Hold attributes information so we can pass
22340 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
22341 Modify to pass in attributes attached to the methods.
22343 (add_accessor_declaration, remove_accessor_declaration): Ditto.
22345 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
22346 to handle the Accessor kind :-)
22348 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
22350 2002-06-08 Martin Baulig <martin@gnome.org>
22352 * expression.cs (Unary.TryReduceNegative): Added support for
22355 2002-06-08 Martin Baulig <martin@gnome.org>
22357 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
22358 name can't be found in the `defined_names' - the caller will do a
22359 MemberLookup in this case and thus find methods in System.Enum
22360 such as Enum.IsDefined().
22362 2002-06-08 Martin Baulig <martin@gnome.org>
22364 * enum.cs (Enum.ChangeEnumType): This is a custom version of
22365 Convert.ChangeType() which works with TypeBuilder created types.
22366 (Enum.LookupEnumValue, Enum.Define): Use it here.
22368 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
22369 `TypeBuilder.BaseType != null' check.
22370 (TypeContainer.FindMembers): Only lookup parent members if we
22371 actually have a parent.
22372 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
22373 (ConstructorInitializer.Resolve): Likewise.
22375 * interface.cs (Interface.FindMembers): Added
22376 `TypeBuilder.BaseType != null' check.
22378 * rootcontext.cs (RootContext.ResolveCore): Added
22379 "System.Runtime.CompilerServices.IndexerNameAttribute" to
22380 classes_second_stage.
22382 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
22383 debug_type and trace_type when compiling with --nostdlib.
22385 2002-06-07 Martin Baulig <martin@gnome.org>
22387 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
22388 (AddField): Set it to true when adding a non-static field.
22389 (DefineType): Use `have_nonstatic_fields' to find out whether we
22390 have non-static fields, not `Fields != null'.
22392 2002-06-02 Miguel de Icaza <miguel@ximian.com>
22394 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
22395 dereferencing a null on the static-field code path)
22397 2002-05-30 Martin Baulig <martin@gnome.org>
22399 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
22400 to take command line arguments. Use reflection to call the new
22401 custom `Initialize' function on the symbol writer and pass it the
22402 command line arguments.
22404 * driver.cs (--debug-args): New command line argument to pass command
22405 line arguments to the symbol writer.
22407 2002-05-28 Miguel de Icaza <miguel@ximian.com>
22409 * assign.cs (DoResolve): Forgot to do the implicit conversion to
22410 the target type for indexers and properties. Thanks to Joe for
22413 2002-05-27 Miguel de Icaza <miguel@ximian.com>
22415 * typemanager.cs (MethodFlags): returns the method flags
22416 (Obsolete/ShouldIgnore) that control warning emission and whether
22417 the invocation should be made, or ignored.
22419 * expression.cs (Invocation.Emit): Remove previous hack, we should
22420 not do this on matching a base type, we should do this based on an attribute
22422 Only emit calls to System.Diagnostics.Debug and
22423 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
22424 on the command line.
22426 * rootcontext.cs: Global settings for tracing and debugging.
22428 * cs-tokenizer.cs (define): New utility function to track
22429 defines. Set the global settings for TRACE and DEBUG if found.
22431 2002-05-25 Ravi Pratap <ravi@ximian.com>
22433 * interface.cs (Populate*): Pass in the TypeContainer as well as
22434 the DeclSpace as parameters so that we can create EmitContexts and
22435 then use that to apply attributes etc.
22437 (PopulateMethod, PopulateEvent, PopulateProperty)
22438 (PopulateIndexer): Apply attributes everywhere.
22440 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
22443 (ApplyAttributes): Update accordingly.
22445 We now apply interface attributes for all members too.
22447 2002-05-26 Miguel de Icaza <miguel@ximian.com>
22449 * class.cs (Indexer.Define); Correctly check if we are explicit
22450 implementation (instead of checking the Name for a ".", we
22451 directly look up if the InterfaceType was specified).
22453 Delay the creation of the PropertyBuilder.
22455 Only create the PropertyBuilder if we are not an explicit
22456 interface implementation. This means that explicit interface
22457 implementation members do not participate in regular function
22458 lookups, and hence fixes another major ambiguity problem in
22459 overload resolution (that was the visible effect).
22461 (DefineMethod): Return whether we are doing an interface
22464 * typemanager.cs: Temporary hack until we get attributes in
22465 interfaces (Ravi is working on that) and we get IndexerName
22466 support in interfaces.
22468 * interface.cs: Register the indexers as properties.
22470 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
22471 warning, I have verified that this is a bug in the .NET runtime
22472 (JavaScript suffers of the same problem).
22474 * typemanager.cs (MemberLookup): When looking up members for
22475 interfaces, the parent of an interface is the implicit
22476 System.Object (so we succeed in searches of Object methods in an
22477 interface method invocation. Example: IEnumerable x; x.ToString
22480 2002-05-25 Miguel de Icaza <miguel@ximian.com>
22482 * class.cs (Event): Events should also register if they do
22483 implement the methods that an interface requires.
22485 * typemanager.cs (MemberLookup); use the new GetInterfaces
22488 (GetInterfaces): The code used to lookup interfaces for a type is
22489 used in more than one place, factor it here.
22491 * driver.cs: Track the errors at the bottom of the file, we kept
22494 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
22495 instance if the method we are calling is static!
22497 2002-05-24 Miguel de Icaza <miguel@ximian.com>
22499 * attribute.cs (ApplyAttributes): Make this function filter out
22500 the IndexerName attribute (as that attribute in reality is never
22501 applied) and return the string constant for the IndexerName
22504 * class.cs (TypeContainer.Emit): Validate that all the indexers
22505 have the same IndexerName attribute, and if so, set the
22506 DefaultName attribute on the class.
22508 * typemanager.cs: The return value might contain other stuff (not
22509 only methods). For instance, consider a method with an "Item"
22510 property and an Item method.
22512 * class.cs: If there is a problem with the parameter types,
22515 2002-05-24 Ravi Pratap <ravi@ximian.com>
22517 * ecore.cs (ImplicitConversionExists): Wrapper function which also
22518 looks at user defined conversion after making a call to
22519 StandardConversionExists - we need this for overload resolution.
22521 * expression.cs : Update accordingly the various method calls.
22523 This fixes 2 bugs filed against implicit user defined conversions
22525 2002-05-22 Miguel de Icaza <miguel@ximian.com>
22527 * statement.cs: Track the result of the assignment.
22529 2002-05-21 Miguel de Icaza <miguel@ximian.com>
22531 * expression.cs (MemberAccess): Improved error reporting for
22532 inaccessible members.
22534 2002-05-22 Martin Baulig <martin@gnome.org>
22536 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
22537 itself with debugging support.
22539 2002-05-22 Martin Baulig <martin@gnome.org>
22541 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
22542 Removed, this isn't needed anymore.
22544 2002-05-20 Martin Baulig <martin@gnome.org>
22546 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
22547 be underlying type for an enum.
22549 2002-05-20 Miguel de Icaza <miguel@ximian.com>
22551 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
22552 that splits out the loading of just the core types.
22554 * rootcontext.cs (ResolveCore): Split the struct resolution in
22555 two, so we can load the enumeration underlying types before any
22558 * expression.cs (Is): Bandaid until we fix properly Switch (see
22559 bug #24985 for details).
22561 * typemanager.cs (ImplementsInterface): The hashtable will contain
22562 a null if there are no interfaces implemented.
22564 2002-05-18 Miguel de Icaza <miguel@ximian.com>
22566 * cs-parser.jay (indexer_declarator): It is fine to have array
22569 2002-05-17 Miguel de Icaza <miguel@ximian.com>
22571 * typemanager.cs: (RegisterBuilder): New function used to register
22572 TypeBuilders that implement interfaces. Since
22573 TypeBuilder.GetInterfaces (as usual) does not work with lame
22575 (AddUserType): register interfaces.
22577 (ImplementsInterface): Use the builder_to_ifaces hash if we are
22578 dealing with TypeBuilder. Also, arrays are showing up as
22579 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
22580 methods can not be invoked on them!
22582 * ecore.cs (ExplicitReferenceConversionExists): Made public.
22583 (ImplicitReferenceConversionExists): Split out from
22584 StandardConversionExists.
22586 * expression.cs (As): We were only implementing one of the three
22587 cases for the as operator. We now implement them all.
22588 (Is): Implement the various other cases for Is as well.
22590 * typemanager.cs (CACHE): New define used to control if we want or
22591 not the FindMembers cache. Seems to have a negative impact on
22592 performance currently
22594 (MemberLookup): Nested types have full acess to
22595 enclosing type members
22597 Remove code that coped with instance/static returns for events, we
22598 now catch this in RealFindMembers.
22600 (RealFindMembers): only perform static lookup if the instance
22601 lookup did not return a type or an event.
22603 2002-05-17 Miguel de Icaza <miguel@ximian.com>
22605 * assign.cs (CompoundAssign): We pass more semantic information
22606 now to Compound Assignments than we did before: now we have all
22607 the information at hand, and now we resolve the target *before* we
22608 do the expression expansion, which allows the "CacheValue" method
22609 to have the effect we intended (before, a [x] += 1 would generate
22610 two differen ArrayAccess expressions from the ElementAccess,
22611 during the resolution process).
22613 (CompoundAssign.DoResolve): Resolve target and original_source here.
22615 2002-05-16 Miguel de Icaza <miguel@ximian.com>
22617 * expression.cs (ArrayAccess): dropped debugging information.
22619 * typemanager.cs: Small bug fix: I was always returning i_members,
22620 instead of one of i_members or s_members (depending on which had
22623 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
22624 method is invoked before any code generation takes place, and it
22625 is a mechanism to inform that the expression will be invoked more
22626 than once, and that the method should use temporary values to
22627 avoid having side effects
22629 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
22631 * ecore.cs (Expression.CacheTemporaries): Provide empty default
22634 * expression.cs (Indirection, ArrayAccess): Add support for
22635 CacheTemporaries in these two bad boys.
22637 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
22638 ldobj or ldind_ref.
22639 (StoreFromPtr): Handle stobj as well.
22641 * expression.cs (UnaryMutator): Share more code.
22643 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
22644 down: I was not tracking the Filter function as well, which
22645 was affecting the results of the cache.
22647 2002-05-15 Miguel de Icaza <miguel@ximian.com>
22649 * attribute.cs: Remove the hack to handle the CharSet property on
22652 2002-05-14 Miguel de Icaza <miguel@ximian.com>
22654 * attribute.cs (DoResolve): More uglyness, we now only try to
22655 resolve the attribute partially, to extract the CharSet
22656 information (only if we are a StructLayout attribute). Otherwise
22658 (GetExtraTypeInfo): Add some code to conditionally kill in the
22659 future this. I am more and more convinced that the .NET
22660 framework has special code to handle the attribute setting on
22663 * expression.cs (IsParamsMethodApplicable): Revert my previous
22664 foreach change here, it was wrong.
22666 2002-05-13 Miguel de Icaza <miguel@ximian.com>
22668 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
22669 (pp_expr): do not abort on unknown input, just return.
22670 (eval): abort if there are pending chars.
22672 * attribute.cs (Attribute.Resolve): Positional parameters are
22673 optional. Deal with that case.
22675 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
22676 the Ansi/Unicode/Auto information for the type.
22678 (TypeContainer.DefineType): instantiate the EmitContext here, as
22679 we will be using it during the type definition (to resolve
22680 attributes) and during the emit phase.
22682 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
22683 to pull type information out of the attributes
22685 (Attribute.Resolve): track the constructor builder, and allow for
22686 multiple invocations (structs and classes will use this).
22688 * ecore.cs (MemberLookupFinal): new version with all the
22689 parameters customizable.
22691 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
22692 constructors. Return if the result value is null (as the error
22693 would have been flagged already by MemberLookupFinal)
22695 Do not allow instances of abstract classes or interfaces to be
22698 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
22699 We have to compare the assembly property here when dealing with
22700 FamANDAssem and Assembly access modifiers, because we might be
22701 creating an assembly from *modules* (that means that we are not
22702 getting TypeBuilders for types defined in other modules that are
22703 part of this assembly).
22705 (Method.Emit): If the method is marked abstract and has a body,
22708 (TypeContainer.DefineMembers): If both the defined member and the
22709 parent name match are methods, then do not emit any warnings: let
22710 the Method.Define routine take care of flagging warnings. But if
22711 there is a mismatch (method overrides something else, or method is
22712 overriwritten by something, then emit warning).
22714 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
22715 set to null, this means `do not check for the return type on the
22718 (Method.Define): set the return type for the method signature to
22719 null, so that we get methods with the same name and parameters and
22720 different return types. This is used to flag warning 114 (you are
22721 hiding a method, and you probably want to use the new/override
22724 * typemanager.cs (MemberLookup): Implemented proper access
22725 control, closing a long standing set of bug reports. The problem
22726 was that the Framework only has two bits: Public and NonPublic,
22727 and NonPublic includes private and protected methods, but we need
22728 to enforce the FamANDAssem, FamOrAssem and Family.
22730 2002-05-11 Miguel de Icaza <miguel@ximian.com>
22732 * statement.cs (GotoCase): Return true: Ammounts to giving up
22733 knowledge on whether we return or not, and letting the other case
22734 be responsible for it.
22736 2002-05-10 Miguel de Icaza <miguel@ximian.com>
22738 * driver.cs: Do not load directories for each file processed, only
22739 do it if there is a pattern.
22741 * ecore.cs: Report readonly assigns here as well, as we might have
22742 been resolved only by MemberAccess.
22744 (SimpleName.SimpleNameResolve): Also be useful for LValue
22745 resolution. We need this to propagate assign to local readonly variables
22747 * typemanager.cs: Use a ptrhashtable for the criteria, because we
22748 do not want to reuse potential criteria memory.
22750 * class.cs (MyEventBuilder): Set reflected_type;
22752 * ecore.cs (Constantify): Added support for constifying bools.
22754 (RootContext.LookupType): Added a cache for values looked up in
22755 the declaration space.
22757 * typemanager.cs (FindMembers): Now is a front-end to
22758 RealFindMembers, and provides a two-level hashtable-based cache to
22761 15% performance improvement: from 22.5 to 19.2 seconds.
22763 * expression.cs (IsParamsMethodApplicable): use foreach.
22764 (Invocation.DoResolve): ditto.
22765 (New.DoResolve): ditto.
22766 (ArrayCreation.DoResolve): ditto.
22768 * ecore.cs (FindMostEncompassingType): use foreach.
22770 * delegate.cs (NewDelegate.DoResolve): Use foreach
22772 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
22773 (RemoveMethods): use foreach.
22775 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
22776 nested foreach statements instead of for, and also break out of
22777 the inner loop once a match is found.
22779 (Invocation.OverloadResolve): Use foreach, simplify the code.
22781 2002-05-08 Miguel de Icaza <miguel@ximian.com>
22783 * cfold.cs (BinaryFold): During an enumeration evaluation context,
22784 we actually unwrap the expression to allow for extra information
22787 * expression.cs: Use Shr_Un on unsigned operations.
22789 2002-05-08 Ravi Pratap <ravi@ximian.com>
22791 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
22792 applicable operators was not being considered correctly. This closes
22793 the bug Miguel reported.
22795 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
22797 * attribute.cs: check that the type derives from System.Attribute
22798 and report the correct error in that case (moved the duplicate code to
22799 its own method, too).
22801 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
22803 * attribute.cs: lookup attribute type name as the spec says: first the
22804 bare attribute name and then name + "Attribute" (nant compiles with
22805 mcs after this fix).
22807 2002-05-07 Miguel de Icaza <miguel@ximian.com>
22809 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
22810 Because of the way we parse things, we should try to see if a
22811 UIntConstant can fit in an integer.
22813 2002-05-07 Ravi Pratap <ravi@ximian.com>
22815 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
22816 when we are in an explicit context.
22818 (ConvertReferenceExplicit): When converting from Iface type S to Class
22819 T make sure the rules are implemented as an OR.
22821 * parameter.cs (ParameterType): Make it a property for now although the
22822 purpose really isn't anything immediate.
22824 * expression.cs (Is*Applicable): Do better checking on the parameter type
22825 of a ref/out parameter. The ones from the system assemblies are already
22826 marked with the correct type so we don't need to do any correction.
22828 * ecore.cs (StandardConversionExists): Conversion from Interface types to
22829 the object type is standard too so include that.
22831 2002-05-06 Miguel de Icaza <miguel@ximian.com>
22833 * ecore.cs (StandardConversionExists): Augment with missing code:
22834 deal with IntConstant, LongConstants and Enumerations.
22836 * assign.cs: Report the error, instead of failing silently
22838 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
22839 typecontainer that they are declared, because the
22840 typecontainer/namespace will have the list of using clauses that
22841 need to be applied.
22843 Assembly Attributes were escaping the normal registration
22846 (EmitCode): Apply attributes within an EmitContext that represents
22847 the container they were declared on.
22849 * cs-parser.jay: Track bases for structs. How did I get this wrong?
22851 2002-05-06 Ravi Pratap <ravi@ximian.com>
22853 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
22854 Revamp completely - make much cleaner as we now operate only
22857 (FindMostSpecificSource, FindMostSpecificTarget): New methods
22858 to implement the logic detailed in the spec more correctly.
22860 (UserDefinedConversion): Update accordingly.
22862 2002-05-06 Miguel de Icaza <miguel@ximian.com>
22864 * statement.cs: Return flow analysis information up.
22866 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
22869 (token): Do not consume an extra character before calling
22872 2002-05-06 Piers Haken <piersh@friskit.com>
22874 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
22876 2002-05-06 Miguel de Icaza <miguel@ximian.com>
22878 * class.cs (Constructor.Emit): Set the IsStatic flag in the
22879 EmitContext during the instance constructor initializer
22880 resolution, to stop access to instance variables.
22882 This is mandated by the spec, last paragraph of the `constructor
22883 initializers' section.
22885 2002-05-05 Miguel de Icaza <miguel@ximian.com>
22887 * cs-parser.jay, class.cs (Accessor): new class used to represent
22888 an accessor (get or set). In the past we used `null' to represent
22889 a missing accessor. But this is ambiguous because there was no
22890 way to tell in abstract indexers/properties if one of them was
22893 Now there is a way of addressing that.
22895 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
22896 instead of FindMembers.
22898 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
22899 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
22901 * attribute.cs: Treat indexers and properties as the same in terms
22902 of applying attributes
22904 * ecore.cs (FindMostEncompassedType): Use statically initialized
22905 EmptyExpressions()s like we do elsewhere to avoid creating useless
22906 objects (and we take this out of the tight loop).
22908 (GetConversionOperators): Move the code to extract the actual
22909 operators to a separate routine to clean things up.
22911 2002-05-04 Miguel de Icaza <miguel@ximian.com>
22913 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
22914 events are always registered FieldBuilders.
22916 * class.cs (FieldBase): New class shared by Fields
22918 * delegate.cs: If we are a toplevel delegate, use our full name.
22919 If we are a nested delegate, then only use our tail name.
22921 2002-05-02 Ravi Pratap <ravi@ximian.com>
22923 * expression.cs (IsApplicable): Ensure that we add the "&" to
22924 ref/out types before comparing it with the type of the argument.
22926 (IsParamsMethodApplicable): Ditto.
22928 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
22931 * delegate.cs : Handle the case when we have more than one applicable
22932 method. Flag an error only when we finish checking all.
22934 2002-05-02 Miguel de Icaza <miguel@ximian.com>
22936 * expression.cs: Add support for boolean static initializers.
22938 2002-05-01 Miguel de Icaza <miguel@ximian.com>
22940 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
22942 * parameter.cs (ComputeParameterTypes,
22943 ComputeAndDefineParameterTypes): Better error handling: now we
22944 clear the `types' cache if we fail during any of the type lookups.
22945 We also return the status code correctly to our caller
22947 * delegate.cs: If we fail to define a delegate, abort the extra
22950 * expression.cs (Binary.ResolveOperator): for
22951 operator==(object,object) and operator !=(object, object) we also
22952 have to verify that there is an implicit conversion from one to
22955 (ArrayAccess.DoResolve): Array Access can operate on
22958 2002-04-30 Miguel de Icaza <miguel@ximian.com>
22960 * assign.cs (CompoundAssign): A new class used as a "flag" that
22961 the assignment actually is happening as part of a compound
22962 assignment operator.
22964 During compound assignment, a few new rules exist to enable things
22971 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
22972 to the type of x) if y is implicitly convertible to the type of x,
22973 and the operator is a builtin operator and the return type of the
22974 operator is explicitly convertible to the type of x.
22976 * rootcontext.cs: Reset warning level to 2. 4 catches various
22977 "interesting" features in mcs, we must clean this up at some
22978 point, but currently am trying to kill other bugs ;-)
22980 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
22981 in container classes as well.
22983 * expression.cs (Binary.ResolveOperator): Handle string case
22984 before anything else (as operator overloading does emit an error
22985 before doing anything else).
22987 This code could go away when we move to a table driven model, but
22988 i could not come up with a good plan last night.
22990 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
22992 * typemanager.cs (CSharpName): reimplementation using regex.
22993 * class.cs: added null check for fields in Emit
22994 * rootcontext.cs: set warninglevel to 4
22996 2002-04-29 Miguel de Icaza <miguel@ximian.com>
22998 * typemanager.cs (CSharpName): reimplemented with Lupus
23001 2002-04-28 Miguel de Icaza <miguel@ximian.com>
23003 * statement.cs (If): correclty implement Resolve, because we were
23004 not catching sem errors in there. The same process is needed
23006 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
23009 (Statement.Warning_DeadCodeFound): Factorize code.
23010 (While): Report dead code here too.
23012 (Statement): Added Resolve virtual method to allow
23013 for resolution split from the emit code.
23015 2002-04-26 Miguel de Icaza <miguel@ximian.com>
23017 * statement.cs (EmitBoolExpression): No longer try to resolve the
23019 (MakeBoolean): New utility function that resolve, implicitly
23020 converts to boolean and tags the expression.
23023 (If, Do): Implement dead code elimination.
23024 (While): Implement loop inversion
23026 (Do, While, For, If): Resolve the expression prior to calling our
23029 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
23032 - added method Report28 (warning: program has more than one entry point)
23033 - added method IsEntryPoint, implements paragraph 10.1 of the spec
23034 - modified method Method.Define, the part at the end of the method
23036 * rootcontext.cs: added static public Location EntryPointLocation;
23038 * ../errors/cs0028.cs : Add test case for the above warning.
23041 - modified method CSharpName to allow arrays of primitive type to
23042 be printed nicely (e.g. instead of System.Int32[][] it now prints
23044 - added method CSharpSignature: returns the signature of a method
23045 in string format to be used in reporting errors, warnings, etc.
23047 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
23050 2002-04-26 Ravi Pratap <ravi@ximian.com>
23052 * delegate.cs (Define): Fix extremely silly bug where I was
23053 setting the type of the 'object' parameter of the BeginInvoke
23054 method to System.IAsyncResult instead of System.Object ;-)
23056 2002-04-26 Miguel de Icaza <miguel@ximian.com>
23058 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
23061 (Constructor.Emit): return if we fail to initialize the
23062 constructor. Another door closed!
23064 * expression.cs (New.DoResolve): Improve error message (from -6 to
23065 1501). Use DeclaredOnly lookup to find the exact constructor.
23067 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
23068 loop. This is useful.
23070 * cs-parser.jay: Adjust the default parameters so that destructors
23071 have the proper signature.
23073 2002-04-26 Martin Baulig <martin@gnome.org>
23075 * driver.cs (LoadAssembly): If `assembly' contains any characters
23076 which are only valid in path names and not in assembly names
23077 (currently slash, backslash and point), use Assembly.LoadFrom ()
23078 instead of Assembly.Load () on the `assembly' (before iteration
23079 over the link_paths).
23081 2002-04-26 Martin Baulig <martin@gnome.org>
23083 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
23085 2002-04-25 Miguel de Icaza <miguel@ximian.com>
23087 * class.cs (Property): use the new typemanager.MemberLookup
23089 (TypeContainer.MemberLookup): Implement using the
23090 TypeManager.MemberLookup now.
23092 * typemanager.cs: Make MemberLookup a function of the TypeManager,
23093 and return MemberInfos, so that these can be used without an
23094 EmitContext (what we had before).
23096 2002-04-24 Miguel de Icaza <miguel@ximian.com>
23098 * expression.cs: Fix the case where the argument to params if the
23099 type of the params. I omitted handling this before. Fixed
23101 2002-04-22 Miguel de Icaza <miguel@ximian.com>
23103 * driver.cs: Call BootCorlib_PopulateCoreType
23105 * class.cs (Property.CheckBase): Check for properties only, not
23108 * interface.cs: Temporary hack: try/catch around the
23109 CustomAttributeBuilder, because I am getting an exception that I
23112 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
23113 types whose definitions are required to be there (attributes are
23114 defined before standard types).
23116 Compute definitions as we boot the various types, as they are used
23117 immediately (value_type class will need object_type, but if we do
23118 not initialize object_type, we will pass a null, which will let
23119 the runtime pick the System.Object from the existing corlib, which
23120 is not what we want).
23122 2002-04-22 Patrik Torstensson <totte@labs2.com>
23124 * cs-tokenizer.cs: fixed a number of trim() issues.
23126 2002-04-22 Ravi Pratap <ravi@ximian.com>
23128 * expression.cs (Argument.Type): Ensure that we return the correct
23129 type when we have out or ref parameters [in which case we
23132 2002-04-22 Miguel de Icaza <miguel@ximian.com>
23134 * class.cs (Property, Indexer): Allow extern modifier in there.
23136 * typemanager.cs (InitBaseTypes): Initializes object_type and
23137 value_type, since those will be used early on during the bootstrap
23138 process to compile corlib.
23140 (InitCoreTypes): Move code from here to InitBaseTypes.
23142 2002-04-21 Miguel de Icaza <miguel@ximian.com>
23144 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
23145 single-dimension arrays as using the ldlen opcode.
23147 Daniel Lewis discovered this optimization.
23149 * typemanager.cs: Add signature for System.Array::get_Length
23151 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23153 * statement.cs: report the error when the foreach does not apply to an
23154 array nor a collection.
23156 2002-04-19 Miguel de Icaza <miguel@ximian.com>
23158 * expression.cs: Add implicit conversions to the operator ~.
23160 * constant.cs (DecimalConstant.Emit): Emit decimal value.
23162 * typemanager.cs: Locate the decimal constructor.
23164 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23166 * attribute.cs: use the new property of TypeOf.
23167 * expression.cs: added 'get' property around typearg.
23169 These changes fix a build breaker reported by NickD. Is this the
23170 correct way to fix? If not, please, revert my changes and make it
23173 2002-04-17 Miguel de Icaza <miguel@ximian.com>
23175 * attribute.cs: Add support for typeof in attribute invocations.
23176 I am not sure that this is right though.
23178 2002-04-14 Duncan Mak <duncan@ximian.com>
23180 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
23181 Binary.Operator.Division case.
23183 2002-04-13 Ravi Pratap <ravi@ximian.com>
23185 * class.cs (DefineType): Ensure that we do a proper check on
23186 attribute types and also register it with the TypeManager.
23188 (TypeContainer.Targets): The default for attribute types is
23189 AttributeTargets.All.
23191 * attribute.cs (ApplyAttributes): Registering the attribute type
23192 is done elsewhere, not when we discover we have a Usage attribute.
23194 2002-04-12 Ravi Pratap <ravi@ximian.com>
23196 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
23197 and get rid of is_delegate parameter.
23199 * everywhere : update.
23201 2002-04-12 Ravi Pratap <ravi@ximian.com>
23203 * cs-parser.jay (compilation_unit): Revamp completely to use
23204 some new ideas that I got from Rhys' grammar to solve the problems
23205 with assembly level attributes.
23207 (outer_declaration): New grammar production.
23209 (attribute_sections): Add.
23211 (opt_attributes): Base on attribute_sections
23213 (namespace_declaration): Allow opt_attributes to tackle the case
23214 when we have assembly level attributes - we are clever in this
23217 * attribute.cs (ApplyAttributes): Do not worry about assembly
23218 attributes in the non-global context.
23220 * rootcontext.cs (AddGlobalAttributes): Go back to using this
23221 instead of SetGlobalAttributes.
23223 * class.cs, rootcontext.cs : Ensure we define and generate
23224 attribute types before anything else.
23226 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
23227 and flag the new error -20 for the case when the attribute type
23228 does not have valid targets specified. csc does not catch this.
23230 * ../errors/errors.txt : update for error # -20
23232 2002-04-11 Ravi Pratap <ravi@ximian.com>
23234 * support.cs (InternalParameters.ParameterModifier): Do some null
23235 checking and return sane values.
23237 * class.cs (Method.Define): If we are a PInvoke method, ensure
23238 that we are static and extern. Report error # 601
23240 * ../errors/cs0601.cs : Add test case for the above error.
23242 2002-04-07 Ravi Pratap <ravi@ximian.com>
23244 * rootcontext.cs (attribute_types): We need to keep type of
23245 all attribute types separately and emit code for them first.
23247 (RegisterAttribute) : Implement.
23249 * class.cs (DefineType): Check if the current Type is a custom
23250 attribute type and register it accordingly.
23252 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
23253 adding the first attribute twice and rename to
23255 (SetGlobalAttributes): this.
23257 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
23260 * attribute.cs (ApplyAttributes): Take an additional argument telling us
23261 if we are processing global arguments. Hmm, I am unsure of this.
23263 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23265 * expression.cs: added static array of strings to avoid calling
23266 Enum.ToString () for Operator in Binary. Significant recover of
23269 2002-04-10 Miguel de Icaza <miguel@ximian.com>
23271 * class.cs (FindMembers): Allow the Builders of the various
23272 members to be null. If they are skip them. This only happens
23273 during the PInvoke declaration.
23275 2002-04-09 Miguel de Icaza <miguel@ximian.com>
23277 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
23278 failure, so we do not keep going afterwards.
23280 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
23281 wanted to pass `false' as the `is_delegate' argument. If this is
23282 the case, why not use delegate_type == null to mean `is_delegate =
23283 false' and anything else as is_delegate = true.
23285 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
23287 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
23288 code for the section, not the beginning of the tests.
23290 2002-04-08 Miguel de Icaza <miguel@ximian.com>
23292 * cfold.cs: Handle operator + (Enum x, Underlying x)
23294 * expression.cs (Binary): same. Warn about errors where we have
23295 Enum/Enum in operator + as well.
23297 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
23300 - added support for switch(bool)
23301 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
23302 - add TableSwitchEmit() to handle table-based switch statements
23304 2002-04-05 Ravi Pratap <ravi@ximian.com>
23306 * expression.cs (Invocation.OverloadResolve): Factor out code which
23307 does parameter compatibility checking with arguments so that we can
23308 re-use the code even from Delegate.VerifyApplicability
23310 (VerifyArgumentsCompat): Move above code here.
23312 * delegate.cs (VerifyApplicability): Get rid of duplicate code
23313 and instead make a call to the above method.
23315 2002-03-31 Ravi Pratap <ravi@ximian.com>
23317 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
23318 We use it to keep track of classes which are attribute types.
23320 2002-04-02 Miguel de Icaza <miguel@ximian.com>
23322 * delegate.cs (Delegate.Define): Correctly define the types in the
23323 presence of fixed and array parameters.
23325 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
23328 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
23329 include NonPublic after the first iteration.
23331 * class.cs (Indexer.CheckBase): Only check if both parents are
23334 * cs-parser.jay (accessor_body): If empty, set to null.
23336 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
23337 same code path here to resolve constants names that we did have in
23338 MemberAccess.DoResolve. There is too much code duplicated here.
23340 2002-04-01 Miguel de Icaza <miguel@ximian.com>
23342 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
23344 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
23347 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
23348 tokens, numbers and strings.
23350 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
23353 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
23354 asyncronous parameters and the regular parameters.
23356 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
23357 specify the target directory.
23359 * expression.cs: (This.DoResolve): Simplify
23360 (As.Emit): Optimize, do not generate IsInst if the expression is
23361 always of the given type.
23363 (Is.DoResolve): Bug fix, we were reporting both always/never for
23366 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
23367 creating too many unnecessary arrays.
23369 2002-03-31 Miguel de Icaza <miguel@ximian.com>
23371 * class.cs (EmitFieldInitializer): Use Assign expression to assign
23372 fields instead of rolling our own initializer. Takes care of all
23373 implicit conversions, and drops unnecessary static checks/argument.
23375 2002-03-31 Dick Porter <dick@ximian.com>
23377 * driver.cs: use the GetDirectories() return values properly, and
23378 use "/" as path separator.
23380 2002-03-30 Miguel de Icaza <miguel@ximian.com>
23382 * expression.cs (Unary): Optimize - - expr into expr.
23383 (Binary): Optimize a + (-b) into a -b.
23385 * codegen.cs (CodeGen): Made all methods static.
23387 2002-03-29 Miguel de Icaza <miguel@ximian.com>
23391 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
23392 TypeBuilder property.
23394 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
23397 * tree.cs: Removed the various RecordXXXX, and replaced with a
23398 single RecordDecl. Removed all the accessor methods, and just
23399 left a single access point Type
23401 * enum.cs: Rename DefineEnum to DefineType.
23403 * decl.cs: New abstract method `DefineType' used to unify the
23404 Defines for Enumerations, Interfaces, TypeContainers and
23407 (FindType): Moved LookupInterfaceOrClass here. Moved the
23408 LookupBaseClasses method that used to live in class.cs and
23409 interface.cs here, and renamed to FindType.
23411 * delegate.cs: Implement DefineType. Take advantage of the
23412 refactored pattern for locating the parent builder without taking
23413 the parent_builder argument (which we know does not work if we are
23414 nested, and triggering a toplevel definition).
23416 2002-03-28 Miguel de Icaza <miguel@ximian.com>
23418 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
23419 accessibility of a member has changed during override and report
23422 * class.cs (Method.Define, Property.Define): Only complain on
23423 overrides if the method is private, any other accessibility is
23424 fine (and since we just checked the permission is the same, we are
23427 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
23428 and elif are processed always. The other pre-processing
23429 directives are only processed if we are "taking" the path
23431 2002-03-29 Martin Baulig <martin@gnome.org>
23433 * class.cs (Method.Emit): Only emit symbolic debugging info if the
23434 current location is not Null.
23436 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
23437 a separate method so we can profile it.
23439 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
23440 `span.Seconds' are just seconds, but no minutes or hours.
23441 (MainDriver): Profile the CodeGen.SaveSymbols calls.
23443 2002-03-28 Miguel de Icaza <miguel@ximian.com>
23445 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
23446 Remove the gratuitous set of Final:
23448 // If an interface implementation, then we can set Final.
23449 if (((flags & MethodAttributes.Abstract) == 0) &&
23450 implementing.DeclaringType.IsInterface)
23451 flags |= MethodAttributes.Final;
23453 I do not know what I was smoking when I used that.
23456 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
23457 step into fixing the name resolution issues for delegates and
23458 unifying the toplevel name resolution.
23460 2002-03-28 Martin Baulig <martin@gnome.org>
23462 * class.cs (Method.Emit): If we have a symbol writer, call its
23463 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
23464 tell it about the current method.
23466 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
23467 writer that we're going to emit the first byte of IL code for a new
23468 statement (a new source line).
23469 (EmitContext.EmitTopBlock): If we have a symbol writer, call
23470 EmitContext.Mark() before emitting any code.
23472 * location.cs (SymbolDocument): Return null when we're Null.
23474 * statement.cs (Statement): Moved the `Location loc' variable here.
23475 (Statement.EmitBoolExpression): If we have a symbol writer, call
23476 ec.Mark() before emitting any code to tell it that we're at the
23477 beginning of a new statement.
23478 (StatementExpression): Added `Location' argument to the constructor.
23479 (Block): Added public readonly variable `StartLocation' and public
23480 variable `EndLocation'. The latter is to be set using SetEndLocation().
23481 (Block): Added constructor which takes a start and end location.
23482 (Block.SetEndLocation): New method. This sets the end location.
23483 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
23484 local variables we create.
23485 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
23486 each statement and do also mark the begin and end of the block.
23488 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
23489 tell it the current lexer.Location, use Location.Null for the end of the
23491 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
23492 current block, set its end location using SetEndLocation().
23493 (statement_expression): StatementExpression constructor now takes the
23494 lexer.Location as additional argument.
23495 (for_statement, declare_local_variables): Likewise.
23496 (declare_local_variables): When creating a new implicit block, use the
23497 new Block constructor and pass it the lexer.Location.
23499 2002-03-28 Miguel de Icaza <miguel@ximian.com>
23501 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
23502 members also on the parent interfaces recursively.
23504 2002-03-27 Miguel de Icaza <miguel@ximian.com>
23506 * report.cs: Use new formats, since Gonzalo finished the missing
23509 * expression.cs (Binary.ResolveOperator): added missing operator|
23510 operator& and operator^ for bool/bool.
23512 * cs-parser.jay: CheckDef now takes a Location argument that is
23513 used to report errors more precisly (instead of reporting the end
23514 of a definition, we try to track something which is a lot closer
23515 to the source of the problem).
23517 * cs-tokenizer.cs: Track global token use, so we can properly flag
23518 the use of #define/#undef after the first token has been seen.
23520 Also, rename the reportXXXX to Error_DescriptiveName
23522 * decl.cs (DeclSpace.IsTopLevel): Move property here from
23523 TypeContainer, so that Enum and Interface can use this too.
23525 * class.cs (TypeContainer.LookupInterfaceOrClass,
23526 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
23527 `builder' argument. Typically this was used to pass the parent
23528 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
23531 The problem is that a nested class could trigger the definition of
23532 a toplevel class, and the builder would be obviously wrong in that
23535 So we drop this argument, and we compute dynamically the
23536 TypeBuilder/ModuleBuilder (the correct information was available
23537 to us anyways from DeclSpace.Parent)
23539 * interface.cs (Interface.DefineInterface): Drop builder
23540 parameter cleanup like class.cs
23542 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
23545 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
23548 (Try.Emit): Propagate the returns value from the statement.
23550 (Return.Emit): Even if we are leavning
23552 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
23554 * modifiers.cs: Fix the computation of MethodAttributes flags.
23556 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
23558 * driver.cs: allow compilation of files that start with '/'.
23559 Add a default case when checking the argument of --target.
23561 2002-03-25 Miguel de Icaza <miguel@ximian.com>
23563 * interface.cs: Implement the same search algorithm for types in
23564 the interface code.
23566 * delegate.cs: Do not allow multiple definition.
23568 * Recovered ChangeLog that got accidentally amputated
23570 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
23572 * rootcontext.cs: Load manually enum to allow core classes to
23573 contain enumerations.
23575 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
23576 Update to new static methods in TypeManager.
23578 * typemanager.cs (GetMethod, GetConstructor): Use our
23579 implementation of FindMembers to find the members, since during
23580 corlib compilation, the types are TypeBuilders and GetMethod and
23581 GetConstructor do not work.
23583 Make all methods in TypeManager static.
23585 (InitCodeHelpers): Split the functionality from
23586 the InitCodeTypes function.
23588 * driver.cs: Call InitCodeHelpers after we have populated the
23591 * cs-parser.jay (delegate_declaration): we did not used to compute
23592 the delegate name correctly for void delegates.
23594 2002-03-24 Miguel de Icaza <miguel@ximian.com>
23596 * rootcontext.cs (RootContext): Init the interface_resolve_order
23597 and type_container_resolve_order always.
23599 (ResolveCore, BootstrapCorlib_ResolveClass,
23600 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
23601 compiler when compiling with --nostdlib
23603 * class.cs (TypeContainer.DefineType): Check that our parent is
23604 not null. This test is most important when we are bootstraping
23607 * codegen.cs: Split out the symbol writing code.
23609 2002-03-25 Martin Baulig <martin@gnome.org>
23611 * driver.cs (-g): Made -g an alias for --debug.
23613 2002-03-24 Martin Baulig <martin@gnome.org>
23615 * codegen.cs (SymbolWriter): New public variable. Returns the
23616 current symbol writer.
23617 (CodeGen): Added `bool want_debugging_support' argument to the
23618 constructor. If true, tell the ModuleBuild that we want debugging
23619 support and ask it for the ISymbolWriter.
23620 (Save): If we have a symbol writer, call it's Close() method after
23621 saving the assembly.
23623 * driver.c (--debug): New command line argument to create a
23624 debugger information file.
23626 * location.cs (SymbolDocument): New public property. Returns an
23627 ISymbolDocumentWriter object for the current source file or null
23628 if we don't have a symbol writer.
23630 2002-03-21 Miguel de Icaza <miguel@ximian.com>
23632 * driver.cs (LoadAssembly): Correctly return when all the paths
23633 have been tried and not before.
23635 * statement.cs (Switch.Emit): return the actual coverage for this
23636 statement (returns/not-returns)
23638 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
23639 switch of the statement if we are the last switch section. That
23640 kills two problems: try/catch problems (we used to emit an empty
23641 nop at the end) and switch statements where all branches would
23644 2002-03-19 Miguel de Icaza <miguel@ximian.com>
23646 * driver.cs: Add default assemblies (the equivalent to the
23647 Microsoft CSC.RSP file)
23649 * cs-tokenizer.cs: When updating `cols and setting it to zero,
23650 also update tokens_seen and set it to false.
23652 * driver.cs: Implement --recurse for Mike.
23654 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
23655 correctly splitting out the paths.
23657 2002-03-18 Miguel de Icaza <miguel@ximian.com>
23659 * interface.cs (Interface.PopulateProperty): Instead of using
23660 `parent' as the declaration space for the set parameters, use
23663 * support.cs (InternalParameters): InternalParameters constructor
23664 takes a DeclSpace instead of a TypeContainer.
23666 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
23667 types are being initialized, load the address of it before calling
23670 (New): Provide a mechanism to disable the generation of local
23671 value type temporaries when the caller will be providing us with
23672 an address to store it.
23674 (ArrayCreation.EmitDynamicInitializers): Use it.
23676 2002-03-17 Miguel de Icaza <miguel@ximian.com>
23678 * expression.cs (Invocation.EmitArguments): Only probe for array
23679 property if there is more than one argument. Sorry about that.
23681 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
23682 empty param arrays.
23684 * class.cs (Method.LabelParameters): Fix incorrect code path that
23685 prevented the `ParamArrayAttribute' from being applied to the
23688 2002-03-16 Miguel de Icaza <miguel@ximian.com>
23690 * support.cs (ReflectionParameters): Correctly compute whether the
23691 last argument is a params array. Fixes the problem with
23694 * typemanager.cs: Make the assemblies array always be non-null
23695 (empty, but non-null)
23697 * tree.cs (RecordDecl): New function that abstracts the recording
23698 of names. This reports error 101, and provides a pointer to the
23699 previous declaration. Fixes a crash in the compiler.
23701 * cs-parser.jay (constructor_declaration): Update to new grammar,
23702 and provide a constructor_body that can be empty.
23704 2002-03-15 Miguel de Icaza <miguel@ximian.com>
23706 * driver.cs: Add support for --resources.
23708 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
23709 Make all types for the various array helper methods be integer.
23711 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
23712 CheckState to ConvCast.
23714 (ConvCast): Now it takes a `checked' state argument, to avoid
23715 depending on the emit context for the conversion, and just using
23716 the resolve time setting.
23718 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
23719 instead of Invocation.EmitArguments. We do not emit the original
23720 arguments, instead we emit those which have been converted to
23721 unsigned int expressions.
23723 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
23725 * codegen.cs: ditto.
23727 * expression.cs (LocalVariableReference): Drop the use of the
23728 Store function that depended on the variable index.
23730 * statement.cs (VariableInfo): Drop the `Idx' property from this
23731 class, as this is not taking into account the indexes for
23732 temporaries tat we generate during the execution, getting the
23735 * class.cs: First emit class initializers, then call the parent
23738 * expression.cs (Binary): Fix opcode emision.
23739 (UnaryMutator.EmitCode): Support checked code generation
23741 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
23742 matches for events for both the Static and Instance scans,
23743 pointing to the same element. Fix that.
23745 2002-03-14 Miguel de Icaza <miguel@ximian.com>
23747 * rootcontext.cs (ResolveTree): Always set the
23748 interface_resolve_order, because nested interfaces will be calling
23751 * class.cs (GetInterfaceOrClass): Track the same resolution
23752 process used by TypeManager.LookupType. This fixes the nested
23753 type lookups in class declarations (separate path from
23756 (TypeContainer.DefineType): Also define nested interfaces.
23757 (TypeContainer.RegisterOrder): New public function used to
23758 register the order in which child interfaces need to be closed.
23760 Nested interfaces need to be closed after their parents have been
23763 * interface.cs (InterfaceAttr): Put all the logic for computing
23764 the interface attribute here.
23766 (DefineInterface): Register our interface order with the
23767 RootContext or with the TypeContainer depending on the case.
23769 2002-03-12 Miguel de Icaza <miguel@ximian.com>
23771 * cs-parser.jay: rework foreach statement to work with the new
23772 changes to the policy on SimpleNames.
23774 * report.cs: support Stacktrace on warnings as well.
23776 * makefile: drop --unsafe and /unsafe from the compile.
23778 2002-03-13 Ravi Pratap <ravi@ximian.com>
23780 * ecore.cs (StandardConversionExists): Modify to take an Expression
23781 as the first parameter. Ensure we do null -> reference type conversion
23784 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
23785 temporary Expression objects.
23787 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
23789 * interface.cs: workaround bug in method overloading resolution
23790 (there is already a bugzilla bug for it).
23792 2002-03-12 Miguel de Icaza <miguel@ximian.com>
23794 We could also solve this problem by having a separate path for
23795 performing type lookups, instead of DoResolve, we could have a
23796 ResolveType entry point, and only participating pieces of the
23797 production (simplename, deref, array) would implement this.
23799 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
23800 signal SimpleName to only resolve type names and not attempt to
23801 resolve anything else.
23803 * expression.cs (Cast): Set the flag.
23805 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
23807 * class.cs: Only report 108 if there is no `new' modifier.
23809 * cs-parser.jay: rework foreach statement to work with the new
23810 changes to the policy on SimpleNames.
23812 * report.cs: support Stacktrace on warnings as well.
23814 * makefile: drop --unsafe and /unsafe from the compile.
23816 2002-03-11 Miguel de Icaza <miguel@ximian.com>
23818 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
23819 lookups here, instead of doing that at parse time. This means
23820 that our grammar will not introduce `LocalVariableReferences' as
23821 expressions at this point. That solves the problem of code like
23825 static void Main ()
23829 This is only half the fix. The full fix requires parameters to
23830 also be handled in this way.
23832 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
23833 makes the use more obvious of the DeclSpace. The
23834 ec.TypeContainer.TypeBuilder is now only used to pull the
23835 TypeBuilder for it.
23837 My theory is that I can get rid of the TypeBuilder completely from
23838 the EmitContext, and have typecasts where it is used (from
23839 DeclSpace to where it matters).
23841 The only pending problem is that the code that implements Aliases
23842 is on TypeContainer, and probably should go in DeclSpace.
23844 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
23845 lookups here, instead of doing that at parse time. This means
23846 that our grammar will not introduce `LocalVariableReferences' as
23847 expressions at this point. That solves the problem of code like
23851 static void Main ()
23855 This is only half the fix. The full fix requires parameters to
23856 also be handled in this way.
23858 * class.cs (Property.DefineMethod): When implementing an interface
23859 method, set newslot, when implementing an abstract method, do not
23860 set the flag (before we tried never setting it, or always setting
23861 it, which is the difference).
23862 (Indexer.DefineMethod): same.
23863 (Method.DefineMethod): same.
23865 * ecore.cs: Only set the status used flag if we get back a Field.
23867 * attribute.cs: Temporary hack, so Paolo can keep working.
23869 2002-03-08 Ravi Pratap <ravi@ximian.com>
23871 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
23872 the unmanaged type in the case we have a MarshalAs attribute.
23874 (Resolve): Handle the case when we are parsing the special MarshalAs
23875 attribute [we need to store the unmanaged type to use later]
23877 * typemanager.cs (marshal_as_attr_type): Built in type for the
23878 MarshalAs Attribute.
23880 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
23881 on parameters and accordingly set the marshalling info.
23883 2002-03-09 Miguel de Icaza <miguel@ximian.com>
23885 * class.cs: Optimizing slightly by removing redundant code after
23886 we switched to the `NoTypes' return value.
23887 (Property.DefineMethod): use NoTypes here too.
23889 This fixes the bug I introduced in my last batch of changes.
23891 2002-03-05 Ravi Pratap <ravi@ximian.com>
23893 * tree.cs (RecordEnum): Add. We now keep track of enums too.
23895 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
23896 Enums since those are types too.
23898 * cs-parser.jay (enum_declaration): Record enums as we parse them.
23900 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
23901 thanks to a call during the lookup process.
23903 2002-03-07 Miguel de Icaza <miguel@ximian.com>
23905 * statement.cs (Foreach): Lots of work to accomodate a particular
23906 kind of foreach statement that I had not kept in mind. It is
23907 possible to have foreachs on classes that provide a GetEnumerator
23908 method that return objects that implement the "pattern" for using
23909 a foreach, there is no need to support GetEnumerator
23912 This is needed to compile nant.
23914 * decl.cs: Only report 114 if the member is not `Finalize' and if
23915 the warning level is at least 2.
23917 * class.cs: Moved the compare function from Method to
23920 (MethodSignature.InheritableMemberSignatureCompare): Add new
23921 filter function that is used to extract inheritable methods from a
23924 (Method.Define): Use the new `inheritable_method_signature_filter'
23927 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
23930 2002-03-06 Miguel de Icaza <miguel@ximian.com>
23932 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
23934 * cs-parser.jay: Add opt_semicolon to the interface declaration.
23936 * expression.cs: Pass location information to
23937 ConvertImplicitStandard.
23939 * class.cs: Added debugging code to track return values from
23942 2002-03-05 Miguel de Icaza <miguel@ximian.com>
23944 * expression.cs (Is.DoResolve): If either side of the `is' is an
23945 interface, do not flag the warning.
23947 * ecore.cs (ImplicitReferenceConversion): We need a separate test
23950 * report.cs: Allow for --fatal to be used with --probe.
23952 * typemanager.cs (NoTypes): Move the definition for the empty Type
23955 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
23957 (TypeContainer.DefineProxy): New function used to proxy to parent
23958 implementations when implementing interfaces.
23959 (TypeContainer.ParentImplements): used to lookup if our parent
23960 implements a public function that is required by an interface.
23961 (TypeContainer.VerifyPendingMethods): Hook this up.
23963 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
23964 `modules' and `assemblies' arraylists into arrays. We only grow
23965 these are the very early start up of the program, so this improves
23966 the speedof LookupType (nicely measured).
23968 * expression.cs (MakeByteBlob): Replaced unsafe code with
23969 BitConverter, as suggested by Paolo.
23971 * cfold.cs (ConstantFold.Binary): Special case: perform constant
23972 folding of string concatenation, but if either side is a string,
23973 and the other is not, then return null, and let the runtime use
23974 the concatenation on the string plus the object (using
23975 `Object.ToString').
23977 2002-03-04 Miguel de Icaza <miguel@ximian.com>
23979 Constant Folding has been implemented now.
23981 * expression.cs (Unary.Reduce): Do not throw an exception, catch
23982 the error instead on types that are not supported in one's
23985 * constant.cs (Constant and all children): New set of functions to
23986 perform implict and explicit conversions.
23988 * ecore.cs (EnumConstant): Implement the new functions to perform
23989 conversion by proxying to the child expression.
23991 * codegen.cs: (ConstantCheckState): Constant evaluation has its
23992 own separate setting that can not be turned off from the command
23993 line using --unchecked or --checked and is only controlled using
23994 the checked/unchecked statements and expressions. This setting is
23995 used by the constant folder to flag errors.
23997 * expression.cs (CheckedExpr, UncheckedExpr): Set the
23998 ConstantCheckState as well.
24000 During Resolve, they also have to flag the state, because the
24001 constant folder runs completely in the Resolve phase.
24003 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
24006 2002-03-01 Miguel de Icaza <miguel@ximian.com>
24008 * cfold.cs: New file, this file contains the constant folder.
24010 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
24011 argument to track whether we are using the resulting address to
24012 load or store a value and provide better error messages.
24014 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
24015 new AddressOf arguments.
24017 * statement.cs (Foreach.EmitCollectionForeach): Update
24019 * expression.cs (Argument.Emit): Call AddressOf with proper
24020 arguments to track usage.
24022 (New.DoEmit): Call AddressOf with new arguments.
24024 (Unary.Emit): Adjust AddressOf call.
24026 2002-03-01 Ravi Pratap <ravi@ximian.com>
24028 * cs-parser.jay (member_access): Change the case for pre-defined types
24029 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
24032 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
24035 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
24036 essentially like methods and apply attributes like MethodImplOptions to them too.
24038 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
24041 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
24042 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
24045 * Update code everywhere accordingly.
24047 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
24049 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
24051 2002-02-28 Ravi Pratap <ravi@ximian.com>
24053 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
24054 try performing lookups against those instead of jumping straight into using
24055 the 'using' clauses.
24057 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
24059 (LookupType): Perform lookups in implicit parents too.
24061 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
24062 sequence as RootContext.LookupType.
24064 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
24065 the various cases of namespace lookups into this method.
24067 2002-03-01 Miguel de Icaza <miguel@ximian.com>
24069 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
24070 in positional arguments)
24072 * class.cs (Operator): Update the AllowedModifiers to contain
24075 * cs-parser.jay: Update operator declaration to allow for the
24076 operator body to be empty.
24078 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
24081 2002-02-27 Miguel de Icaza <miguel@ximian.com>
24083 * class.cs (Method.Emit): Label parameters.
24085 * driver.cs: Return 1 or 0 as the program exit code.
24087 2002-02-26 Miguel de Icaza <miguel@ximian.com>
24089 * expression.cs: Special case the `null' object when trying to
24090 auto-compute the type, as anything can be explicitly converted to
24093 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
24094 spotting this Paolo.
24096 (Expression.ImplicitNumericConversion): Perform comparissions of
24097 the type using the underlying type in the case of an enumeration
24098 rather than using the enumeration type for the compare.
24100 Cope with the underlying == type case, which is not possible to
24103 (Expression.ConvertNumericExplicit): Perform comparissions of
24104 the type using the underlying type in the case of an enumeration
24105 rather than using the enumeration type for the compare.
24107 * driver.cs: If the user does not supply an extension, assume .exe
24109 * cs-parser.jay (if_statement): Rewrote so that we can track the
24110 location for the if statement.
24112 * expression.cs (Binary.ConstantFold): Only concat strings when
24113 the operation is "+", not everything ;-)
24115 * statement.cs (Statement.EmitBoolExpression): Take a location
24117 (If, While, Do): Track location.
24119 * expression.cs (Binary.ResolveOperator): In the object + string
24120 case, I was missing a call to ConvertImplicit
24122 2002-02-25 Ravi Pratap <ravi@ximian.com>
24124 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
24125 Location arguments. Ensure we use RootContext.LookupType to do our work
24126 and not try to do a direct Type.GetType and ModuleBuilder.GetType
24128 * interface.cs (PopulateMethod): Handle the type of the parameter being
24131 * expression.cs (Invocation.BetterFunction): Handle the case when we
24132 have a params method with no fixed arguments and a call is made with no
24135 2002-02-25 Miguel de Icaza <miguel@ximian.com>
24137 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
24138 the verbatim-string-literal
24140 * support.cs (InternalParameters.ParameterModifier): handle null
24142 (InternalParameters.ParameterType): ditto.
24144 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
24145 duplicating the name of the variable parameter.
24146 (GetParameterByName): Fix bug where we were not looking up array
24147 paramters if they were the only present (thanks Paolo!).
24148 (GetParameterInfo): We only have an empty set of types if both
24149 fixed and array are set to null.
24150 (GetParameterInfo-idx): Handle FixedParameter == null
24152 * cs-parser.jay: Handle the case where there is no catch
24153 statements (missing null test).
24155 2002-02-22 Miguel de Icaza <miguel@ximian.com>
24157 * driver.cs (MainDriver): Be conservative on our command line
24160 Catch DirectoryNotFoundException when calling GetFiles.
24162 (SplitPathAndPattern): Used to split the input specification into
24163 a path and a pattern that we can feed to Directory.GetFiles.
24165 2002-02-21 Miguel de Icaza <miguel@ximian.com>
24167 * statement.cs (Fixed): Implement the last case of the Fixed
24168 statement (string handling).
24170 * expression.cs (StringPtr): New class used to return a char * to
24171 a string; Used by the Fixed statement.
24173 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
24175 * expression.cs (Binary.ResolveOperator): Remove redundant
24176 MemberLookup pn parent type.
24177 Optimize union call, we do not need a union if the types are the same.
24178 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
24181 Specialize the use of MemberLookup everywhere, instead of using
24182 the default settings.
24184 (StackAlloc): Implement stackalloc keyword.
24186 * cs-parser.jay: Add rule to parse stackalloc.
24188 * driver.cs: Handle /h, /help, /?
24190 * expression.cs (MakeByteBlob): Removed the hacks we had in place
24191 before we supported unsafe code.
24193 * makefile: add --unsafe to the self compilation of mcs.
24195 2002-02-20 Miguel de Icaza <miguel@ximian.com>
24197 * expression.cs (PointerArithmetic): New class that is used to
24198 perform pointer arithmetic.
24199 (Binary.Resolve): Handle pointer arithmetic
24200 Handle pointer comparission.
24201 (ArrayPtr): Utility expression class that is used to take the
24202 address of an array.
24204 (ElementAccess): Implement array access for pointers
24206 * statement.cs (Fixed): Implement fixed statement for arrays, we
24207 are missing one more case before we are done.
24209 * expression.cs (Indirection): Implement EmitAssign and set the
24210 ExprClass to Variable. This allows pointer dereferences to be
24211 treated as variables, and to have values assigned to them.
24213 * ecore.cs (Expression.StoreFromPtr): New utility function to
24214 store values dereferencing.
24216 2002-02-20 Ravi Pratap <ravi@ximian.com>
24218 * expression.cs (Binary.ResolveOperator): Ensure that we are
24219 not trying to operate on a void type - this fixes the reported
24222 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
24223 the parent implementation is sealed.
24225 * ../errors/cs0239.cs : Add.
24227 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
24229 * typemanager.cs (unverifiable_code_type): Corresponds to
24230 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
24231 which have unsafe code in them.
24233 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
24236 2002-02-19 Miguel de Icaza <miguel@ximian.com>
24238 * cs-tokenizer.cs: Add support for @"litreal strings"
24240 Make tokenizer accept pre-processor directives
24241 on any column (remove the old C-like limitation).
24243 * rootcontext.cs (EmitCode): Emit any global attributes.
24244 (AddGlobalAttributes): Used to keep track of assembly attributes.
24246 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
24248 * cs-parser.jay: Add support for global attributes.
24250 2002-02-17 Miguel de Icaza <miguel@ximian.com>
24252 * expression.cs (Indirection): New helper class. Unary will
24253 create Indirection classes to be able to implement the
24254 IMemoryLocation interface on it.
24256 2002-02-16 Miguel de Icaza <miguel@ximian.com>
24258 * cs-parser.jay (fixed_statement): reference the right statement.
24260 * statement.cs (Fixed.Emit): Finish implementing the fixed
24261 statement for the &x case.
24263 2002-02-14 Miguel de Icaza <miguel@ximian.com>
24265 * class.cs (Property.Define, Method.Define): Remove newslot when
24268 * modifiers.cs: My use of NewSlot when `Abstract' was set was
24269 wrong. NewSlot should only be used if the `new' keyword is present.
24271 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
24272 locating our system dir. Sorry about this.
24274 2002-02-13 Miguel de Icaza <miguel@ximian.com>
24276 * driver.cs (GetSystemDir): Compute correctly the location of our
24277 system assemblies. I was using the compiler directory instead of
24278 the library directory.
24280 2002-02-13 Ravi Pratap <ravi@ximian.com>
24282 * expression.cs (BetterFunction): Put back in what Miguel commented out
24283 since it is the correct fix. The problem is elsewhere ;-)
24285 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
24286 parameters of the parms method are themselves compatible or not !
24288 (StandardConversionExists): Fix very dangerous bug where we were forgetting
24289 to check that a class implements an interface before saying that an implicit
24290 conversion was allowed. Use ImplementsInterface to do the checking.
24292 2002-02-13 Miguel de Icaza <miguel@ximian.com>
24294 * class.cs (Method.Define): Track whether we are an explicit
24295 implementation or not. And only call DefineMethodOverride if we
24296 are an explicit implementation.
24298 (Property.DefineMethod): Ditto.
24300 2002-02-11 Ravi Pratap <ravi@ximian.com>
24302 * expression.cs (BetterFunction): Catch hideous bug which was
24303 preventing us from detecting ambiguous calls due to implicit casts i.e
24306 2002-01-29 Miguel de Icaza <miguel@ximian.com>
24308 * support.cs (Pair): Remove un-needed method. I figured why I was
24309 getting the error in cs-parser.jay, the variable in a foreach loop
24310 is readonly, and the compiler does not really treat this as a variable.
24312 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
24313 instead of EQUALS in grammar.
24315 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
24317 * expression.cs (Unary.DoResolve): Check whether the argument is
24320 2002-01-28 Miguel de Icaza <miguel@ximian.com>
24322 * support.cs: Api for Pair to set a value. Despite the fact that
24323 the variables are public the MS C# compiler refuses to compile
24324 code that accesses the field if the variable is part of a foreach
24327 * statement.cs (Fixed): Begin implementation of the fixed
24330 (Block.AddVariable): Return the VariableInfo on success and null
24331 on failure instead of true/false.
24333 * cs-parser.jay (foreach): Catch errors on variables already
24334 defined (we were ignoring this value before) and properly unwind
24335 the block hierarchy
24337 (fixed_statement): grammar for the fixed statement.
24339 2002-01-25 Miguel de Icaza <miguel@ximian.com>
24341 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
24342 pointer types to be incretemented.
24344 (SizeOf): Implement.
24346 * cs-parser.jay (pointer_member_access): Implement
24347 expr->IDENTIFIER production.
24349 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
24350 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
24353 (Unary): Implement indirection.
24355 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
24356 use in non-unsafe context).
24358 (SimpleName.DoResolve): Check for pointers in field access on safe
24361 (Expression.LoadFromPtr): Factor the load-indirect code in this
24362 function. This was duplicated in UnboxCast and ParameterReference
24364 2002-01-24 Miguel de Icaza <miguel@ximian.com>
24366 * expression.cs (ComposedCast): report an error if a pointer cast
24367 is used in a safe region.
24369 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
24370 pointer type casts in unsafe context.
24372 * codegen.cs (EmitContext): Set up IsUnsafe.
24374 * cs-parser.jay (non_expression_type): Add productions for pointer
24377 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
24378 code. We should not use force into static mode if the method is
24379 not virtual. Fixes bug in MIS
24381 * statement.cs (Do.Emit, While.Emit, For.Emit,
24382 Statement.EmitBoolExpression): Add support to Do and While to
24383 propagate infinite loop as `I do return' semantics.
24385 Improve the For case to also test for boolean constants.
24387 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
24388 to the list of attributes we can add.
24390 Remove `EmitContext' argument.
24392 * class.cs (Method.Define): Apply parameter attributes.
24393 (Constructor.Define): Apply parameter attributes.
24394 (MethodCore.LabelParameters): Move here the core of labeling
24397 * support.cs (ReflectionParameters.ParameterModifier,
24398 InternalParameters.ParameterModifier): Use IsByRef on the type and
24399 only return the OUT bit for these parameters instead of in/out/ref
24402 This is because I miss-understood things. The ParameterInfo.IsIn
24403 and IsOut represent whether the parameter has the [In] and [Out]
24406 2002-01-22 Miguel de Icaza <miguel@ximian.com>
24408 * ecore.cs (FieldExpr.Emit): Release temporaries.
24410 * assign.cs (LocalTemporary.Release): new function.
24412 * codegen.cs (EmitContext.GetTemporaryStorage,
24413 EmitContext.FreeTemporaryStorage): Rework the way we deal with
24414 temporary storage. Now we can "put back" localbuilders when we
24417 2002-01-21 Miguel de Icaza <miguel@ximian.com>
24419 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
24420 need to make a copy of the variable to generate verifiable code.
24422 2002-01-19 Miguel de Icaza <miguel@ximian.com>
24424 * driver.cs: Compute dynamically the system directory.
24426 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
24427 Slower, but more generally useful. Used by the abstract
24428 registering implementation.
24430 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
24431 the rules for the special rule on Type/instances. First check if
24432 we have the same name, and if so, try that special static path
24433 rather than the instance path.
24435 2002-01-18 Miguel de Icaza <miguel@ximian.com>
24437 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
24440 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
24441 Enum, ValueType, Delegate or Array for non-corlib compiles.
24443 * cs-tokenizer.cs: Catch long identifiers (645)
24445 * typemanager.cs (IndexerPropetyName): Ravi never tested this
24448 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
24449 fix, we were returning too early, so we were not registering
24450 pending methods from abstract classes.
24452 Do not register pending methods if the class is abstract.
24454 * expression.cs (Conditional.DoResolve): Report circular implicit
24455 conversions when we neecd to compute it for conditional
24458 (Is.DoResolve): If the expression is always of the provided type,
24459 flag warning 183. If the expression can not ever be of the
24460 provided type flag warning 184.
24462 * class.cs: Catch 169 as well.
24464 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
24467 2002-01-18 Nick Drochak <ndrochak@gol.com>
24469 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
24471 2002-01-17 Miguel de Icaza <miguel@ximian.com>
24473 * interface.cs: (PopulateMethod): Check for pointers being defined
24474 only if the unsafe context is active.
24475 (PopulateProperty): ditto.
24476 (PopulateIndexer): ditto.
24478 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
24479 specified. If pointers are present, make sure that they are
24480 present in an unsafe context.
24481 (Constructor, Constructor.Define): ditto.
24482 (Field, Field.Define): ditto.
24483 (Property, Property.Define): ditto.
24484 (Event, Event.Define): ditto.
24486 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
24487 hashtable if there are classes or structs defined.
24489 * expression.cs (LocalVariableReference.DoResolve): Simplify this
24490 code, as the constant resolution moved.
24492 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
24493 the metadata, so we can flag error 133.
24495 * decl.cs (MemberCore.UnsafeOK): New function to test that a
24496 pointer is being declared in an unsafe context.
24498 2002-01-16 Miguel de Icaza <miguel@ximian.com>
24500 * modifiers.cs (Modifiers.Check): Require a Location argument.
24501 Report error 227 for Unsafe use.
24503 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
24505 * statement.cs (For.Emit): If the test is null, then report that
24506 we do `return', as we wont reach anything afterwards.
24508 (Switch.SwitchGoverningType): Track the expression that matched
24511 * driver.cs: Allow negative numbers as an error code to flag.
24513 * cs-parser.jay: Handle 1551.
24515 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
24517 2002-01-15 Miguel de Icaza <miguel@ximian.com>
24519 * cs-parser.jay: Report 1518 (type declaration can only contain
24520 class, struct, interface, enum or delegate)
24522 (switch_label): Report 1523 (keywords `case' or `default' must
24525 (opt_switch_sections): Report 1522 (empty switch)
24527 * driver.cs: Report 1515 (response file specified multiple times)
24528 Report 1516 (Source file specified multiple times).
24530 * expression.cs (Argument.Resolve): Signal 1510
24532 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
24533 access not allowed in static code)
24535 2002-01-11 Ravi Pratap <ravi@ximian.com>
24537 * typemanager.cs (IsPointerType): Utility method which we are going
24540 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
24541 the object type, so we take care of that.
24543 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
24545 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
24546 added to non-params parameters :-)
24548 * typemanager.cs (CSharpName): Include 'void' type too.
24550 (void_ptr_type): Include in the set of core types.
24552 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
24555 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
24558 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
24559 completely forgotten about it.
24561 2002-01-10 Ravi Pratap <ravi@ximian.com>
24563 * cs-parser.jay (pointer_type): Add. This begins our implementation
24564 of parsing rules for unsafe code.
24566 (unsafe_statement): Implement.
24568 (embedded_statement): Modify to include the above.
24570 * statement.cs (Unsafe): Implement new class for unsafe blocks.
24572 * codegen.cs (EmitContext.InUnsafe): Add. This determines
24573 if the current context is an unsafe one.
24575 * cs-parser.jay (local_variable_pointer_type): Since local variable types
24576 are handled differently, we need separate rules for them.
24578 (local_variable_declaration): Update to use local_variable_pointer_type
24579 to allow variable declarations of unmanaged pointer types.
24581 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
24582 in unsafe contexts.
24584 * ../errors/cs0214.cs : Add.
24586 2002-01-16 Nick Drochak <ndrochak@gol.com>
24588 * makefile: remove 'response' file when cleaning.
24590 2002-01-15 Miguel de Icaza <miguel@ximian.com>
24592 * cs-parser.jay: Report 1524.
24594 2002-01-14 Miguel de Icaza <miguel@ximian.com>
24596 * typemanager.cs (RegisterMethod): drop checking if we have
24597 registered this from here
24599 2002-01-12 Miguel de Icaza <miguel@ximian.com>
24601 * class.cs (Method.EmitDestructor): Implement calling our base
24604 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
24605 value of InFinally.
24607 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
24608 this routine and will wrap the call in a try/catch block. Deal
24611 2002-01-11 Miguel de Icaza <miguel@ximian.com>
24613 * ecore.cs (Expression.MemberLookup): instead of taking a
24614 parameter `same_type' that was used to tell whether we could
24615 access private members we compute our containing type from the
24618 (FieldExpr): Added partial support for volatile fields. This does
24619 not work for volatile fields exposed from assemblies, as I can not
24620 figure out how to extract the modreq from it.
24622 Updated all the source files to use this.
24624 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
24625 because it is referenced by MemberLookup very often.
24627 2002-01-09 Ravi Pratap <ravi@ximian.com>
24629 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
24630 TypeBuilder.GetCustomAttributes to retrieve what we need.
24632 Get rid of redundant default_member_attr_type as this is the same as
24633 default_member_type which already exists.
24635 * interface.cs, attribute.cs : Update accordingly.
24637 2002-01-08 Miguel de Icaza <miguel@ximian.com>
24639 * typemanager.cs: Enable IndexerPropertyName again. It does not
24640 work for TYpeBuilders though. Ravi, can you please fix this?
24642 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
24644 * expression.cs (Argument.Emit): Handle the case of ref objects
24645 being passed to ref functions;
24647 (ParameterReference.EmitLoad): Loads the content of the pointer
24648 without dereferencing.
24650 2002-01-07 Miguel de Icaza <miguel@ximian.com>
24652 * cs-tokenizer.cs: Implemented the pre-processing expressions.
24654 2002-01-08 Ravi Pratap <ravi@ximian.com>
24656 * class.cs (Indexer.DefineMethod): Incorporate the interface
24657 type in the name of the method if we are doing explicit interface
24660 * expression.cs (ConversionExists): Remove as it is completely obsolete.
24662 (BetterConversion): Fix extremely trivial bug where we were referring to
24663 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
24666 * ../errors/bug16.cs : Add although we have fixed it.
24668 2002-01-07 Miguel de Icaza <miguel@ximian.com>
24670 * expression.cs (BaseIndexer): Begin implementation.
24672 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
24674 * cs-parser.jay (indexer_declarator): Use qualified_identifier
24675 production directly to remove a shift/reduce, and implement
24676 explicit interface implementation.
24678 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
24679 after a floating point suffix.
24681 * expression.cs (DoNumericPromotions): Improved the conversion for
24682 uint/uint. If we have a constant, we avoid doing a typecast to a
24685 * class.cs (Indexer): Implement explicit interface implementation
24688 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
24690 * class.cs: make the default instance constructor public and hidebysig.
24692 2001-01-03 Ravi Pratap <ravi@ximian.com>
24694 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
24695 so we can call it from elsewhere.
24697 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
24698 we emit it internally if the class has a defined indexer; otherwise the user
24699 emits it by decorating the class definition with the DefaultMemberAttribute.
24701 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
24702 attribute is not used on a type which defines an indexer.
24704 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
24705 character when we skip whitespace.
24707 * ../errors/cs0646.cs : Add.
24709 2002-01-03 Miguel de Icaza <miguel@ximian.com>
24711 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
24714 * makefile: Add practical target `mcs3.exe' which builds the third
24715 generation compiler.
24717 * expression.cs (New): Fix structures constructor calling.
24719 * class.cs (Property, Method, Indexer): Emit Final flag on the
24720 method if we are an interface implementation and we are not
24723 * ecore.cs (PropertyExpr): New public field `IsBase', tells
24724 whether this property is referencing a `base' method.
24726 * expression.cs (Invocation.EmitCall): take an extra argument:
24727 is_base, this is used to determine whether the `call' or
24728 `callvirt' opcode should be used.
24731 * delegate.cs: update EmitCall.
24733 * class.cs (Method.Define): Set NewSlot for the cases where we are
24734 not implementing an interface method.
24736 (Property.Define): ditto.
24738 2002-01-02 Miguel de Icaza <miguel@ximian.com>
24740 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
24741 'r'. Allows mcs to parse itself fully.
24743 2002-01-02 Ravi Pratap <ravi@ximian.com>
24745 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
24746 of the number of initializers that require the InitializeArray method.
24748 (CheckIndices): Store the Expression in all cases - not the plain value. Also
24749 update the above field where necessary.
24751 (MakeByteBlob): Update accordingly.
24753 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
24756 (EmitDynamicInitializers): Update in accordance with the new optimization.
24758 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
24759 same OpCode applies.
24761 * cs-parser.jay : Fix some glaring errors I introduced.
24763 2002-01-01 Ravi Pratap <ravi@ximian.com>
24765 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
24766 so that we can check for name clashes there too.
24768 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
24769 for interface indexers.
24771 * interfaces.cs (Define): Emit the default member attribute.
24773 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
24774 variable was being referred to while setting the value ;-)
24776 2002-01-01 Miguel de Icaza <miguel@ximian.com>
24778 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
24779 byte-by-byte information when we know the data is zero.
24781 Make the block always a multiple of 4, because
24782 DefineInitializedData has a bug.
24784 * assign.cs: Fix, we should assign from the temporary, not from
24787 * expression.cs (MakeByteBlob): Fix my incorrect code.
24789 2001-12-31 Miguel de Icaza <miguel@ximian.com>
24791 * typemanager.cs (EnumToUnderlying): This function is used to get
24792 the underlying type from an enumeration, because it does not
24795 * constant.cs: Use the I4_S form for values between -128 and 127.
24797 * statement.cs (Block.LookupLabel): Looks up a label.
24798 (Block): Drop support for labeled blocks.
24800 (LabeledStatement): New kind of statement that represents a label
24803 (Goto): Finally implement this bad boy.
24805 * cs-parser.jay: Update to reflect new mechanism to implement
24808 2001-12-30 Miguel de Icaza <miguel@ximian.com>
24810 * codegen.cs (EmitContext.This): a codegen property that keeps the
24811 a single instance of this instead of creating many different this
24814 * delegate.cs (Delegate.DoResolve): Update to use the property;
24816 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
24818 * expression.cs (BaseAccess.DoResolve): Ditto.
24820 2001-12-29 Ravi Pratap <ravi@ximian.com>
24822 * typemanager.cs (methodimpl_attr_type): Add to hold the type
24823 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
24825 (InitCoreTypes): Update accordingly.
24827 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
24828 so we can quickly store the state.
24830 (ApplyAttributes): Set the correct implementation flags
24831 for InternalCall methods.
24833 2001-12-29 Miguel de Icaza <miguel@ximian.com>
24835 * expression.cs (EmitCall): if a method is not virtual, then do
24836 not use callvirt on it.
24838 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
24839 user defined stuff) requires the use of stobj, which takes an
24840 address on the stack instead of an array and an index. So emit
24841 the Ldelema operation for it.
24843 (EmitStoreOpcode): Use stobj for valuetypes.
24845 (UnaryMutator.EmitCode): Use the right 1 value depending on
24846 whether we are dealing with int64/uint64, float or doubles.
24848 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
24849 constructors that I implemented last night.
24851 (Constructor.IsDefault): Fix to work properly for static
24854 * cs-parser.jay (CheckDef): report method signature errors.
24855 Update error number 103 to be 132.
24857 * decl.cs: New AdditionResult enumeration value: MethodExists.
24858 Although we do this check for methods later on in the semantic
24859 analysis, catching repeated default constructors is so easy that
24860 we catch these here.
24862 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
24865 (ParameterReference.EmitAssign, Emit): handle
24868 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
24869 (ArrayAccess.EmitStoreOpcode): ditto.
24871 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
24873 * expression.cs (MakeByteBlob): Complete all the missing types
24874 (uint, short, ushort, byte, sbyte)
24876 * class.cs: Only init instance field initializers on instance
24879 Rename `constructors' to instance_constructors.
24881 (TypeContainer.AddConstructor): Only add constructors to the list
24882 if it is not static.
24884 Make sure that we handle default_static_constructor independently
24885 everywhere where we handle instance_constructors
24887 2001-12-28 Miguel de Icaza <miguel@ximian.com>
24889 * class.cs: Do not lookup or create a base initializer for a
24890 static constructor.
24892 (ConstructorInitializer.Resolve): use the proper type to lookup
24895 * cs-parser.jay: Report error 1585 (modifiers between type and name).
24897 * enum.cs, interface.cs: Remove CloseType, this is taken care by
24900 * decl.cs: CloseType is now an virtual method, the default
24901 implementation just closes this type.
24903 2001-12-28 Ravi Pratap <ravi@ximian.com>
24905 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
24906 to PreserveSig by default. Also emit HideBySig on such methods.
24908 Basically, set the defaults to standard values.
24910 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
24911 argument, if candidate is better, it can't be worse than the best !
24913 (Invocation): Re-write bits to differentiate between methods being
24914 applicable in their expanded form and their normal form - for params
24917 Get rid of use_standard everywhere as only standard conversions are allowed
24918 in overload resolution.
24920 More spec conformance.
24922 2001-12-27 Miguel de Icaza <miguel@ximian.com>
24924 * driver.cs: Add --timestamp, to see where the compiler spends
24927 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
24928 `this' in static code.
24930 (SimpleName.DoResolve): Implement in terms of a helper function
24931 that allows static-references to be passed upstream to
24934 (Expression.ResolveWithSimpleName): Resolve specially simple
24935 names when called by MemberAccess to implement the special
24938 (Expression.ImplicitReferenceConversion): Handle conversions from
24939 Null to reference types before others, as Null's type is
24942 * expression.cs (Invocation.EmitCall): Handle the special case of
24943 calling methods declared on a reference type from a ValueType
24944 (Base classes System.Object and System.Enum)
24946 (MemberAccess.Resolve): Only perform lookups on Enumerations if
24947 the left hand side is a TypeExpr, not on every enumeration.
24949 (Binary.Resolve): If types are reference types, then do a cast to
24950 object on operators != and == of both arguments.
24952 * typemanager.cs (FindMembers): Extract instance and static
24953 members if requested.
24955 * interface.cs (PopulateProperty): Use void_type instead of null
24956 as the return type for the setter method.
24958 (PopulateIndexer): ditto.
24960 2001-12-27 Ravi Pratap <ravi@ximian.com>
24962 * support.cs (ReflectionParameters): Fix minor bug where we
24963 were examining the wrong parameter for the ParamArray attribute.
24965 Cope with requests for the type of the parameter at position
24966 greater than the params parameter's. We now return the element
24967 type of the params array as that makes more sense.
24969 * expression.cs (Invocation.IsParamsMethodApplicable): Update
24970 accordingly as we no longer have to extract the element type
24973 (Invocation.OverloadResolve): Update.
24975 2001-12-27 Miguel de Icaza <miguel@ximian.com>
24977 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
24978 against IEnumerator, test whether the return value is a descendant
24979 of the IEnumerator interface.
24981 * class.cs (Indexer.Define): Use an auxiliary method to implement
24982 the other bits of the method definition. Begin support for
24983 explicit interface implementation.
24985 (Property.DefineMethod): Use TypeManager.void_type instead of null
24986 for an empty return value.
24988 2001-12-26 Miguel de Icaza <miguel@ximian.com>
24990 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
24991 dealing with a FieldExpr which is composed of a FieldBuilder, in
24992 the code path we did extract the constant, but we should have
24993 obtained the underlying value to be able to cast it (otherwise we
24994 end up in an infinite loop, this is what Ravi was running into).
24996 (ArrayCreation.UpdateIndices): Arrays might be empty.
24998 (MemberAccess.ResolveMemberAccess): Add support for section
24999 14.5.4.1 that deals with the special case of E.I when E is a type
25000 and something else, that I can be a reference to a static member.
25002 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
25003 handle a particular array type to create byte blobs, it is just
25004 something we dont generate byteblobs for.
25006 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
25009 * location.cs (Push): remove the key from the hashtable that we
25010 are about to add. This happens for empty files.
25012 * driver.cs: Dispose files after we have parsed them.
25014 (tokenize): new function that only runs the tokenizer on its
25015 input, for speed testing.
25017 2001-12-26 Ravi Pratap <ravi@ximian.com>
25019 * class.cs (Event.Define): Define the private field only if there
25020 are no accessors defined.
25022 * expression.cs (ResolveMemberAccess): If there is no associated
25023 field with the event, that means we have an event defined with its
25024 own accessors and we should flag error cs0070 since transforming
25025 ourselves into a field is not valid in that case.
25027 * ecore.cs (SimpleName.DoResolve): Same as above.
25029 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
25030 and charset to sane values.
25032 2001-12-25 Ravi Pratap <ravi@ximian.com>
25034 * assign.cs (DoResolve): Perform check on events only if they
25035 are being accessed outside the declaring type.
25037 * cs-parser.jay (event_declarations): Update rules to correctly
25038 set the type of the implicit parameter etc.
25040 (add_accessor, remove_accessor): Set current local parameters.
25042 * expression.cs (Binary): For delegate addition and subtraction,
25043 cast the return value from the method into the appropriate delegate
25046 2001-12-24 Ravi Pratap <ravi@ximian.com>
25048 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
25049 of these as the workaround is unnecessary.
25051 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
25052 delegate data - none of that is needed at all.
25054 Re-write bits to extract the instance expression and the delegate method
25057 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
25060 * attribute.cs (ApplyAttributes): New method to take care of common tasks
25061 of attaching attributes instead of duplicating code everywhere.
25063 * everywhere : Update code to do attribute emission using the above method.
25065 2001-12-23 Miguel de Icaza <miguel@ximian.com>
25067 * expression.cs (IsParamsMethodApplicable): if there are not
25068 parameters, return immediately.
25070 * ecore.cs: The 0 literal can be implicity converted to an enum
25073 (SimpleName.DoResolve): First lookup the type, then lookup the
25076 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
25077 want to get its address. If the InstanceExpression is not
25078 addressable, store the result in a temporary variable, then get
25081 * codegen.cs: Only display 219 errors on warning level or above.
25083 * expression.cs (ArrayAccess): Make it implement the
25084 IMemoryLocation interface.
25086 (Binary.DoResolve): handle the operator == (object a, object b)
25087 and operator != (object a, object b) without incurring into a
25088 BoxedCast (because 5 != o should never be performed).
25090 Handle binary enumerator operators.
25092 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
25093 value type, otherwise use Ldelem_ref.
25095 Use precomputed names;
25097 (AddressOf): Implement address of
25099 * cs-parser.jay (labeled_statement): Fix recursive block
25100 addition by reworking the production.
25102 * expression.cs (New.DoEmit): New has a special case:
25104 If we are dealing with a ValueType, we have a few
25105 situations to deal with:
25107 * The target of New is a ValueType variable, that is
25108 easy, we just pass this as the variable reference
25110 * The target of New is being passed as an argument,
25111 to a boxing operation or a function that takes a
25114 In this case, we need to create a temporary variable
25115 that is the argument of New.
25118 2001-12-23 Ravi Pratap <ravi@ximian.com>
25120 * rootcontext.cs (LookupType): Check that current_type is not null before
25121 going about looking at nested types.
25123 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
25124 not implement the IAssignMethod interface any more.
25126 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
25127 where we tranform them into FieldExprs if they are being resolved from within
25128 the declaring type.
25130 * ecore.cs (SimpleName.DoResolve): Do the same here.
25132 * assign.cs (DoResolve, Emit): Clean up code considerably.
25134 * ../errors/bug10.cs : Add.
25136 * ../errors/cs0070.cs : Add.
25138 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
25140 * assign.cs : Get rid of EventIsLocal everywhere.
25142 2001-12-23 Miguel de Icaza <miguel@ximian.com>
25144 * ecore.cs (ConvertIntLiteral): finished the implementation.
25146 * statement.cs (SwitchLabel): Convert the value we are using as a
25147 key before looking up the table.
25149 2001-12-22 Miguel de Icaza <miguel@ximian.com>
25151 * codegen.cs (EmitTopBlock): Require a Location argument now.
25153 * cs-parser.jay (constructor_declarator): We need to setup
25154 current_local_parameters before we parse the
25155 opt_constructor_initializer, to allow the variables to be bound
25156 to the constructor arguments.
25158 * rootcontext.cs (LookupType): First lookup nested classes in our
25159 class and our parents before we go looking outside our class.
25161 * expression.cs (ConstantFold): Extract/debox the values at the
25164 * rootcontext.cs (EmitCode): Resolve the constants first before we
25165 resolve the types. This is not really needed, but it helps debugging.
25167 * statement.cs: report location.
25169 * cs-parser.jay: pass location to throw statement.
25171 * driver.cs: Small bug fix.
25173 * report.cs: Updated format to be 4-zero filled digits.
25175 2001-12-22 Ravi Pratap <ravi@ximian.com>
25177 * expression.cs (CheckIndices): Fix minor bug where the wrong
25178 variable was being referred to ;-)
25180 (DoEmit): Do not call EmitStaticInitializers when the
25181 underlying type is System.Object.
25183 2001-12-21 Ravi Pratap <ravi@ximian.com>
25185 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
25186 and do the usual workaround for SRE.
25188 * class.cs (MyEventBuilder.EventType): New member to get at the type
25189 of the event, quickly.
25191 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
25193 * assign.cs (Assign.DoResolve): Handle the case when the target
25194 is an EventExpr and perform the necessary checks.
25196 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
25199 (SimpleName.MemberStaticCheck): Include check for EventExpr.
25201 (EventExpr): Set the type in the constructor itself since we
25202 are meant to be born fully resolved.
25204 (EventExpr.Define): Revert code I wrote earlier.
25206 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
25207 instance expression is null. The instance expression is a This in that case
25208 or a null, depending on whether it is a static method or not.
25210 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
25211 refers to more than one method.
25213 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
25214 and accordingly flag errors.
25216 2001-12-21 Miguel de Icaza <miguel@ximian.com>
25218 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
25220 2001-12-22 Miguel de Icaza <miguel@ximian.com>
25222 * location.cs (ToString): Provide useful rutine.
25224 2001-12-21 Miguel de Icaza <miguel@ximian.com>
25226 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
25227 objects, return the actual integral boxed.
25229 * statement.cs (SwitchLabel): define an ILLabel for each
25232 (Switch.CheckSwitch): If the value is a Literal, extract
25233 the underlying literal.
25235 Also in the unused hashtable we had, add the SwitchLabel so we can
25236 quickly look this value up.
25238 * constant.cs: Implement a bunch of new constants. Rewrite
25239 Literal based on this. Made changes everywhere to adapt to this.
25241 * expression.cs (Expression.MakeByteBlob): Optimize routine by
25242 dereferencing array only once, and also copes with enumrations.
25244 bytes are two bytes wide, not one.
25246 (Cast): Perform constant conversions.
25248 * ecore.cs (TryImplicitIntConversion): Return literals instead of
25249 wrappers to the literals here.
25251 * expression.cs (DoNumericPromotions): long literals can converted
25252 to ulong implicity (this is taken care of elsewhere, but I was
25253 missing this spot).
25255 * ecore.cs (Expression.Literalize): Make the return type Literal,
25256 to improve type checking.
25258 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
25260 2001-12-20 Miguel de Icaza <miguel@ximian.com>
25262 * literal.cs: Revert code from ravi that checked the bounds. The
25263 bounds are sane by the definition of the type itself.
25265 * typemanager.cs: Fix implementation of ImplementsInterface. We
25266 need to actually look up in our parent hierarchy for interfaces
25269 * const.cs: Use the underlying type for enumerations
25271 * delegate.cs: Compute the basename for the delegate creation,
25272 that should fix the delegate test case, and restore the correct
25273 Type Lookup semantics in rootcontext
25275 * rootcontext.cs: Revert Ravi's last patch. The correct way of
25276 referencing a nested type with the Reflection API is using the "+"
25279 * cs-parser.jay: Do not require EOF token at the end.
25281 2001-12-20 Ravi Pratap <ravi@ximian.com>
25283 * rootcontext.cs (LookupType): Concatenate type names with
25284 a '.' instead of a '+' The test suite passes again.
25286 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
25287 field of the enumeration.
25289 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
25290 the case when the member is an EventExpr.
25292 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
25293 static has an associated instance expression.
25295 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
25297 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
25299 * class.cs (Event.Define): Register event and perform appropriate checks
25302 We define the Add and Remove methods even if the use provides none because
25303 in that case, we provide default implementations ourselves.
25305 Define a private field of the type of the event. This is done by the CSC compiler
25306 and we should be doing it too ;-)
25308 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
25309 More methods we use in code we generate.
25311 (multicast_delegate_type, delegate_type): Two separate types since the distinction
25314 (InitCoreTypes): Update accordingly for the above.
25316 * class.cs (Event.Emit): Generate code for default accessors that we provide
25318 (EmitDefaultMethod): Do the job in the above.
25320 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
25323 2001-12-20 Miguel de Icaza <miguel@ximian.com>
25325 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
25326 builders even if we were missing one.
25328 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
25329 pass the Basename as our class name instead of the Name. The
25330 basename will be correctly composed for us.
25332 * parameter.cs (Paramters): Now takes a Location argument.
25334 * decl.cs (DeclSpace.LookupType): Removed convenience function and
25335 make all the code call directly LookupType in RootContext and take
25336 this chance to pass the Location information everywhere.
25338 * Everywhere: pass Location information.
25340 2001-12-19 Miguel de Icaza <miguel@ximian.com>
25342 * class.cs (Constructor.Define): Updated way of detecting the
25343 length of the parameters.
25345 (TypeContainer.DefineType): Use basename as the type name for
25348 (TypeContainer.Define): Do not recursively define types here, as
25349 definition is taken care in order by the RootContext.
25351 * tree.cs: Keep track of namespaces in a per-file basis.
25353 * parameter.cs (Parameter.ComputeSignature): Update to use
25356 (Parameters.GetSignature): ditto.
25358 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
25359 instead of a TypeContainer.
25361 (Interface.SemanticAnalysis): Use `this' instead of our parent to
25362 resolve names. Because we need to be resolve in our context, not
25365 * driver.cs: Implement response files.
25367 * class.cs (TypeContainer.DefineType): If we are defined, do not
25368 redefine ourselves.
25370 (Event.Emit): Emit the code for add/remove handlers.
25371 (Event.Define): Save the MethodBuilders for add/remove.
25373 * typemanager.cs: Use pair here too.
25375 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
25376 DictionaryEntry requires the first argument to be non-null.
25378 (enum_declaration): Compute full name for registering the
25381 (delegate_declaration): Instead of using
25382 formal_parameter_list, use opt_formal_parameter_list as the list
25385 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
25386 (EventParsing): New property that controls whether `add' and
25387 `remove' are returned as tokens or identifiers (for events);
25389 2001-12-19 Ravi Pratap <ravi@ximian.com>
25391 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
25392 use MyEventBuilder only and let it wrap the real builder for us.
25394 (MyEventBuilder): Revamp constructor etc.
25396 Implement all operations that we perform on EventBuilder in precisely the same
25399 (FindMembers): Update to use the EventBuilder member.
25401 (Event.Emit): Update accordingly.
25403 2001-12-18 Ravi Pratap <ravi@ximian.com>
25405 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
25406 by calling the appropriate methods.
25408 (GetCustomAttributes): Make stubs as they cannot possibly do anything
25411 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
25413 2001-12-17 Ravi Pratap <ravi@ximian.com>
25415 * delegate.cs (Delegate.Populate): Check that the return type
25416 and various parameters types are indeed accessible.
25418 * class.cs (Constructor.Define): Same here.
25420 (Field.Define): Ditto.
25422 (Event.Define): Ditto.
25424 (Operator.Define): Check that the underlying Method defined itself
25425 correctly - so it's MethodBuilder should not be null.
25427 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
25428 expression happens to be null.
25430 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
25431 members but as of now we don't seem to be able to do anything really useful with it.
25433 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
25434 not the EventBuilder.
25436 2001-12-18 Miguel de Icaza <miguel@ximian.com>
25438 * cs-tokenizer.cs: Add support for defines.
25439 Add support for #if, #elif, #else, #endif
25441 (eval_var): evaluates a variable.
25442 (eval): stubbed for evaluating functions.
25444 * cs-parser.jay: Pass the defines information
25446 * driver.cs: Add --define command line option.
25448 * decl.cs: Move MemberCore here.
25450 Make it the base class for DeclSpace. This allows us to catch and
25451 report 108 and 109 for everything now.
25453 * class.cs (TypeContainer.Define): Extract all the members
25454 before populating and emit the warning 108 (new keyword required
25455 to override) instead of having each member implement this.
25457 (MemberCore.Define): New abstract method, we will be using this in
25458 the warning reporting engine in Populate.
25460 (Operator.Define): Adjust to new MemberCore protocol.
25462 * const.cs (Const): This does not derive from Expression, it is a
25463 temporary object we use to create fields, it is a MemberCore.
25465 * class.cs (Method.Define): Allow the entry point to be in a
25468 * driver.cs: Rewrite the argument handler to clean it up a bit.
25470 * rootcontext.cs: Made it just an auxiliary namespace feature by
25471 making everything static.
25473 * driver.cs: Adapt code to use RootContext type name instead of
25476 * delegate.cs: Remove RootContext argument.
25478 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
25481 * class.cs (Event.Define): The lookup can fail.
25483 * cs-tokenizer.cs: Begin implementation of pre-procesor.
25485 * expression.cs: Resolve the this instance before invoking the code.
25487 2001-12-17 Miguel de Icaza <miguel@ximian.com>
25489 * cs-parser.jay: Add a production in element_access that allows
25490 the thing to become a "type" reference. This way we can parse
25491 things like "(string [])" as a type.
25493 Note that this still does not handle the more complex rules of
25497 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
25499 * ecore.cs: (CopyNewMethods): new utility function used to
25500 assemble the list of methods from running FindMembers.
25502 (MemberLookup): Rework FindMembers so that
25504 2001-12-16 Miguel de Icaza <miguel@ximian.com>
25506 * class.cs (TypeContainer): Remove Delegates who fail to be
25509 * delegate.cs (Populate): Verify that we dont get null return
25510 values. TODO: Check for AsAccessible.
25512 * cs-parser.jay: Use basename to emit error 574 (destructor should
25513 have the same name as container class), not the full name.
25515 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
25516 possible representation.
25518 Also implements integer type suffixes U and L.
25520 2001-12-15 Miguel de Icaza <miguel@ximian.com>
25522 * expression.cs (ArrayCreation.DoResolve): We need to do the
25523 argument resolution *always*.
25525 * decl.cs: Make this hold the namespace. Hold the root context as
25527 (LookupType): Move here.
25529 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
25531 * location.cs (Row, Name): Fixed the code, it was always returning
25532 references to the first file.
25534 * interface.cs: Register properties defined through interfaces.
25536 * driver.cs: Add support for globbing on the command line
25538 * class.cs (Field): Make it derive from MemberCore as well.
25541 2001-12-15 Ravi Pratap <ravi@ximian.com>
25543 * class.cs (Event::Define): Check that the type of the event is a delegate
25544 type else flag error #66.
25546 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
25549 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
25550 values of EntryPoint, CharSet etc etc.
25552 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
25554 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
25555 be null and we should ignore this. I am not sure if this is really clean. Apparently,
25556 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
25557 which needs this to do its work.
25559 * ../errors/cs0066.cs : Add.
25561 2001-12-14 Miguel de Icaza <miguel@ximian.com>
25563 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
25566 * class.cs: (MethodSignature.MethodSignature): Removed hack that
25567 clears out the parameters field.
25568 (MemberSignatureCompare): Cleanup
25570 (MemberCore): New base class used to share code between MethodCore
25573 (RegisterRequiredImplementations) BindingFlags.Public requires
25574 either BindingFlags.Instace or Static. Use instance here.
25576 (Property): Refactored code to cope better with the full spec.
25578 * parameter.cs (GetParameterInfo): Return an empty array instead
25581 * class.cs (Property): Abstract or extern properties have no bodies.
25583 * parameter.cs (GetParameterInfo): return a zero-sized array.
25585 * class.cs (TypeContainer.MethodModifiersValid): Move all the
25586 method modifier validation to the typecontainer so we can reuse
25587 this on properties.
25589 (MethodCore.ParameterTypes): return an empty sized array of types.
25591 (Property.Define): Test property modifier validity.
25593 Add tests for sealed/override too.
25595 (Method.Emit): abstract or extern methods have no bodies.
25597 2001-12-14 Ravi Pratap <ravi@ximian.com>
25599 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
25602 (Method::Define, ::Emit): Modify accordingly.
25604 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
25606 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
25608 * makefile: Pass in /unsafe.
25610 2001-12-13 Miguel de Icaza <miguel@ximian.com>
25612 * class.cs (MakeKey): Kill routine.
25614 * class.cs (TypeContainer.Define): Correctly define explicit
25615 method implementations (they require the full interface name plus
25618 * typemanager.cs: Deply the PtrHashtable here and stop using the
25619 lame keys. Things work so much better.
25621 This of course broke everyone who depended on `RegisterMethod' to
25622 do the `test for existance' test. This has to be done elsewhere.
25624 * support.cs (PtrHashtable): A hashtable that avoid comparing with
25625 the object stupid Equals method (because, that like fails all over
25626 the place). We still do not use it.
25628 * class.cs (TypeContainer.SetRequiredInterface,
25629 TypeContainer.RequireMethods): Killed these two routines and moved
25630 all the functionality to RegisterRequiredImplementations.
25632 (TypeContainer.RegisterRequiredImplementations): This routine now
25633 registers all the implementations required in an array for the
25634 interfaces and abstract methods. We use an array of structures
25635 which can be computed ahead of time to reduce memory usage and we
25636 also assume that lookups are cheap as most classes will not
25637 implement too many interfaces.
25639 We also avoid creating too many MethodSignatures.
25641 (TypeContainer.IsInterfaceMethod): Update and optionally does not
25642 clear the "pending" bit if we find that there are problems with
25645 (TypeContainer.VerifyPendingMethods): Update to report errors of
25646 methods that look like implementations but are not.
25648 (TypeContainer.Define): Add support for explicit interface method
25651 2001-12-12 Miguel de Icaza <miguel@ximian.com>
25653 * typemanager.cs: Keep track of the parameters here instead of
25654 being a feature of the TypeContainer.
25656 * class.cs: Drop the registration of parameters here, as
25657 InterfaceMethods are also interface declarations.
25659 * delegate.cs: Register methods with the TypeManager not only with
25660 the TypeContainer. This code was buggy.
25662 * interface.cs: Full registation here.
25664 2001-12-11 Miguel de Icaza <miguel@ximian.com>
25666 * expression.cs: Remove reducer for binary expressions, it can not
25669 * const.cs: Put here the code that used to go into constant.cs
25671 * constant.cs: Put here the code for constants, this is a new base
25672 class for Literals.
25674 * literal.cs: Make Literal derive from Constant.
25676 2001-12-09 Miguel de Icaza <miguel@ximian.com>
25678 * statement.cs (Return.Emit): Report error 157 if the user
25679 attempts to return from a finally block.
25681 (Return.Emit): Instead of emitting a return, jump to the end of
25684 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
25685 LocalBuilder to store the result of the function. ReturnLabel is
25686 the target where we jump.
25689 2001-12-09 Radek Doulik <rodo@ximian.com>
25691 * cs-parser.jay: remember alias in current namespace
25693 * ecore.cs (SimpleName::DoResolve): use aliases for types or
25696 * class.cs (LookupAlias): lookup alias in my_namespace
25698 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
25700 (LookupAlias): lookup alias in this and if needed in parent
25703 2001-12-08 Miguel de Icaza <miguel@ximian.com>
25707 * rootcontext.cs: (ModuleBuilder) Made static, first step into
25708 making things static. I need this to avoid passing the
25709 TypeContainer when calling ParameterType.
25711 * support.cs (InternalParameters.ParameterType): Remove ugly hack
25712 that did string manipulation to compute the type and then call
25713 GetType. Use Parameter.ParameterType instead.
25715 * cs-tokenizer.cs: Consume the suffix for floating values.
25717 * expression.cs (ParameterReference): figure out whether this is a
25718 reference parameter or not. Kill an extra variable by computing
25719 the arg_idx during emission.
25721 * parameter.cs (Parameters.GetParameterInfo): New overloaded
25722 function that returns whether a parameter is an out/ref value or not.
25724 (Parameter.ParameterType): The type of the parameter (base,
25725 without ref/out applied).
25727 (Parameter.Resolve): Perform resolution here.
25728 (Parameter.ExternalType): The full type (with ref/out applied).
25730 * statement.cs (Using.Emit, Using.EmitExpression): Implement
25731 support for expressions on the using statement.
25733 2001-12-07 Miguel de Icaza <miguel@ximian.com>
25735 * statement.cs (Using.EmitLocalVariableDecls): Split the
25736 localvariable handling of the using statement.
25738 (Block.EmitMeta): Keep track of variable count across blocks. We
25739 were reusing slots on separate branches of blocks.
25741 (Try.Emit): Emit the general code block, we were not emitting it.
25743 Check the type of the declaration to be an IDisposable or
25744 something that can be implicity converted to it.
25746 Emit conversions if required.
25748 * ecore.cs (EmptyExpression): New utility class.
25749 (Expression.ImplicitConversionExists): New utility function.
25751 2001-12-06 Miguel de Icaza <miguel@ximian.com>
25753 * statement.cs (Using): Implement.
25755 * expression.cs (LocalVariableReference): Support read only variables.
25757 * statement.cs: Remove the explicit emit for the Leave opcode.
25758 (VariableInfo): Add a readonly field.
25760 2001-12-05 Miguel de Icaza <miguel@ximian.com>
25762 * ecore.cs (ConvCast): new class used to encapsulate the various
25763 explicit integer conversions that works in both checked and
25764 unchecked contexts.
25766 (Expression.ConvertNumericExplicit): Use new ConvCast class to
25767 properly generate the overflow opcodes.
25769 2001-12-04 Miguel de Icaza <miguel@ximian.com>
25771 * statement.cs: The correct type for the EmptyExpression is the
25772 element_type, not the variable type. Ravi pointed this out.
25774 2001-12-04 Ravi Pratap <ravi@ximian.com>
25776 * class.cs (Method::Define): Handle PInvoke methods specially
25777 by using DefinePInvokeMethod instead of the usual one.
25779 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
25780 above to do the task of extracting information and defining the method.
25782 2001-12-04 Ravi Pratap <ravi@ximian.com>
25784 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
25785 of the condition for string type.
25787 (Emit): Move that here.
25789 (ArrayCreation::CheckIndices): Keep string literals in their expression
25792 (EmitDynamicInitializers): Handle strings appropriately.
25794 2001-12-04 Miguel de Icaza <miguel@ximian.com>
25796 * codegen.cs (EmitContext): Replace multiple variables with a
25797 single pointer to the current Switch statement.
25799 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
25802 2001-12-03 Miguel de Icaza <miguel@ximian.com>
25806 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
25809 (Foreach.Emit): Foreach on arrays was not setting
25810 up the loop variables (for break/continue).
25812 (GotoCase): Semi-implented.
25814 2001-12-03 Ravi Pratap <ravi@ximian.com>
25816 * attribute.cs (CheckAttribute): Handle system attributes by using
25817 Attribute.GetAttributes to examine information we need.
25819 (GetValidPlaces): Same here.
25821 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
25823 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
25825 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
25827 (Method::Define): Set appropriate flags if we have a DllImport attribute.
25829 (Method::Emit): Handle the case when we are a PInvoke method.
25831 2001-12-03 Miguel de Icaza <miguel@ximian.com>
25833 * expression.cs: Use ResolveWithSimpleName on compound names.
25835 2001-12-02 Ravi Pratap <ravi@ximian.com>
25837 * constant.cs (EmitConstant): Make sure we resolve the associated expression
25838 before trying to reduce it.
25840 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
25842 * constant.cs (LookupConstantValue): Implement.
25844 (EmitConstant): Use the above in emitting the constant.
25846 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
25847 that are user-defined by doing a LookupConstantValue on them.
25849 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
25852 2001-11-29 Miguel de Icaza <miguel@ximian.com>
25854 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
25856 (BaseAccess.DoResolve): Implement.
25858 (MemberAccess.DoResolve): Split this routine into a
25859 ResolveMemberAccess routine that can be used independently
25861 2001-11-28 Miguel de Icaza <miguel@ximian.com>
25863 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
25864 As that share bits of the implementation. Is returns a boolean,
25865 while As returns the Type that is being probed.
25867 2001-12-01 Ravi Pratap <ravi@ximian.com>
25869 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
25870 instead of a Literal - much easier.
25872 (EnumInTransit): Remove - utterly useless :-)
25874 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
25876 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
25878 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
25879 chain when we have no associated expression.
25881 2001-11-30 Ravi Pratap <ravi@ximian.com>
25883 * constant.cs (Define): Use Location while reporting the errror.
25885 Also emit a warning when 'new' is used and there is no inherited
25888 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
25891 (LookupEnumValue): Implement to lookup an enum member's value and define it
25894 (Populate): Re-write accordingly to use the above routine.
25896 2001-11-27 Miguel de Icaza <miguel@ximian.com>
25898 * expression.cs (This): Fix prototype for DoResolveLValue to
25899 override the base class DoResolveLValue.
25901 * cs-parser.cs: Report errors cs574 and cs575 (destructor
25904 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
25905 (we need to load the address of the field here). This fixes
25908 (FieldExpr.DoResolveLValue): Call the DoResolve
25909 function to initialize the Instance expression.
25911 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
25912 correctly the GetEnumerator operation on a value type.
25914 * cs-parser.jay: Add more simple parsing error catches.
25916 * statement.cs (Switch): Add support for string switches.
25917 Handle null specially.
25919 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
25921 2001-11-28 Ravi Pratap <ravi@ximian.com>
25923 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
25925 (declare_local_constant): New helper function.
25927 * statement.cs (AddConstant): Keep a separate record of constants
25929 (IsConstant): Implement to determine if a variable is a constant.
25931 (GetConstantExpression): Implement.
25933 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
25935 * statement.cs (IsVariableDefined): Re-write.
25937 2001-11-27 Ravi Pratap <ravi@ximian.com>
25939 * class.cs (TypeContainer::FindMembers): Look for constants
25940 in the case when we are looking for MemberTypes.Field
25942 * expression.cs (MemberAccess::DoResolve): Check that in the
25943 case we are a FieldExpr and a Literal, we are not being accessed
25944 by an instance reference.
25946 * cs-parser.jay (local_constant_declaration): Implement.
25948 (declaration_statement): Implement for constant declarations.
25950 2001-11-26 Miguel de Icaza <miguel@ximian.com>
25952 * statement.cs (Switch): Catch double defaults.
25954 (Switch): More work on the switch() statement
25955 implementation. It works for integral values now, need to finish
25959 2001-11-24 Miguel de Icaza <miguel@ximian.com>
25961 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
25962 integer literals into other integer literals. To be used by
25965 2001-11-24 Ravi Pratap <ravi@ximian.com>
25967 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
25970 (EmitDynamicInitializers): Cope with the above since we extract data
25971 directly from ArrayData now.
25973 (ExpectInitializers): Keep track of whether initializers are mandatory
25976 (Bounds): Make it a hashtable to prevent the same dimension being
25977 recorded for every element in that dimension.
25979 (EmitDynamicInitializers): Fix bug which prevented the Set array method
25982 Also fix bug which was causing the indices to be emitted in the reverse
25985 2001-11-24 Miguel de Icaza <miguel@ximian.com>
25987 * expression.cs (ArrayCreation): Implement the bits that Ravi left
25988 unfinished. They do not work, because the underlying code is
25991 2001-11-22 Miguel de Icaza <miguel@ximian.com>
25993 * cs-parser.jay: Remove bogus fixme.
25995 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
25996 on Switch statement.
25998 2001-11-23 Ravi Pratap <ravi@ximian.com>
26000 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
26003 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
26004 parameter. Apparently, any expression is allowed.
26006 (ValidateInitializers): Update accordingly.
26008 (CheckIndices): Fix some tricky bugs thanks to recursion.
26010 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
26011 I was being completely brain-dead.
26013 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
26014 and re-write acordingly.
26016 (DelegateInvocation): Re-write accordingly.
26018 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
26020 (MakeByteBlob): Handle types more correctly.
26022 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
26023 initialization from expressions but it is incomplete because I am a complete
26026 2001-11-22 Miguel de Icaza <miguel@ximian.com>
26028 * statement.cs (If.Emit): Fix a bug that generated incorrect code
26029 on If. Basically, we have to return `true' (ie, we do return to
26030 our caller) only if both branches of the if return.
26032 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
26033 short-circuit operators, handle them as short circuit operators.
26035 (Cast.DoResolve): Resolve type.
26036 (Cast.Cast): Take an expression as the target type.
26038 * cs-parser.jay (cast_expression): Remove old hack that only
26039 allowed a limited set of types to be handled. Now we take a
26040 unary_expression and we resolve to a type during semantic
26043 Use the grammar productions from Rhys to handle casts (this is
26044 not complete like Rhys syntax yet, we fail to handle that corner
26045 case that C# has regarding (-x), but we will get there.
26047 2001-11-22 Ravi Pratap <ravi@ximian.com>
26049 * class.cs (EmitFieldInitializer): Take care of the case when we have a
26050 field which is an array type.
26052 * cs-parser.jay (declare_local_variables): Support array initialization too.
26054 * typemanager.cs (MakeKey): Implement.
26056 (everywhere): Use the above appropriately.
26058 * cs-parser.jay (for_statement): Update for array initialization while
26059 declaring variables.
26061 * ecore.cs : The error message was correct, it's the variable's names that
26062 were misleading ;-) Make the code more readable.
26064 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
26065 the correct type etc.
26067 (ConvertExplicit): Handle Enum types by examining the underlying type.
26069 2001-11-21 Ravi Pratap <ravi@ximian.com>
26071 * parameter.cs (GetCallingConvention): Always return
26072 CallingConventions.Standard for now.
26074 2001-11-22 Miguel de Icaza <miguel@ximian.com>
26076 * expression.cs (Binary.ResolveOperator): Update the values of `l'
26077 and `r' after calling DoNumericPromotions.
26079 * ecore.cs: Fix error message (the types were in the wrong order).
26081 * statement.cs (Foreach.ProbeCollectionType): Need to pass
26082 BindingFlags.Instance as well
26084 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
26085 implicit int literal conversion in an empty cast so that we
26086 propagate the right type upstream.
26088 (UnboxCast): new class used to unbox value types.
26089 (Expression.ConvertExplicit): Add explicit type conversions done
26092 (Expression.ImplicitNumericConversion): Oops, forgot to test for
26093 the target type before applying the implicit LongLiterals to ULong
26096 2001-11-21 Miguel de Icaza <miguel@ximian.com>
26098 * cs-parser.jay (for_statement): Reworked the way For works: now
26099 we declare manually any variables that are introduced in
26100 for_initializer to solve the problem of having out-of-band code
26101 emition (that is what got for broken).
26103 (declaration_statement): Perform the actual variable declaration
26104 that used to be done in local_variable_declaration here.
26106 (local_variable_declaration): Do not declare anything, just pass
26107 the information on a DictionaryEntry
26109 2001-11-20 Ravi Pratap <ravi@ximian.com>
26111 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
26112 re-write of the logic to now make it recursive.
26114 (UpdateIndices): Re-write accordingly.
26116 Store element data in a separate ArrayData list in the above methods.
26118 (MakeByteBlob): Implement to dump the array data into a byte array.
26120 2001-11-19 Ravi Pratap <ravi@ximian.com>
26122 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
26125 * constant.cs (Define): Implement.
26127 (EmitConstant): Re-write fully.
26129 Pass in location info.
26131 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
26134 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
26135 DictionaryEntry since we need location info too.
26137 (constant_declaration): Update accordingly.
26139 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
26140 code into another method : UpdateIndices.
26142 2001-11-18 Ravi Pratap <ravi@ximian.com>
26144 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
26145 some type checking etc.
26147 2001-11-17 Ravi Pratap <ravi@ximian.com>
26149 * expression.cs (ArrayCreation::ValidateInitializers): Implement
26150 bits to provide dimension info if the user skips doing that.
26152 Update second constructor to store the rank correctly.
26154 2001-11-16 Ravi Pratap <ravi@ximian.com>
26156 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
26157 and try to implement.
26159 * ../errors/cs0150.cs : Add.
26161 * ../errors/cs0178.cs : Add.
26163 2001-11-16 Miguel de Icaza <miguel@ximian.com>
26165 * statement.cs: Implement foreach on multi-dimensional arrays.
26167 * parameter.cs (Parameters.GetParameterByName): Also lookup the
26168 name of the params argument.
26170 * expression.cs: Use EmitStoreOpcode to get the right opcode while
26171 initializing the array.
26173 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
26174 we can use this elsewhere.
26176 * statement.cs: Finish implementation of foreach for single
26179 * cs-parser.jay: Use an out-of-band stack to pass information
26180 around, I wonder why I need this.
26182 foreach_block: Make the new foreach_block the current_block.
26184 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
26185 function used to return a static Parameters structure. Used for
26186 empty parameters, as those are created very frequently.
26188 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
26190 2001-11-15 Ravi Pratap <ravi@ximian.com>
26192 * interface.cs : Default modifier is private, not public. The
26193 make verify test passes again.
26195 2001-11-15 Ravi Pratap <ravi@ximian.com>
26197 * support.cs (ReflectionParameters): Fix logic to determine
26198 whether the last parameter is a params one. Test 9 passes again.
26200 * delegate.cs (Populate): Register the builders we define with
26201 RegisterParameterForBuilder. Test 19 passes again.
26203 * cs-parser.jay (property_declaration): Reference $6 instead
26204 of $$ to get at the location.
26206 (indexer_declaration): Similar stuff.
26208 (attribute): Ditto.
26210 * class.cs (Property): Register parameters for the Get and Set methods
26211 if they exist. Test 23 passes again.
26213 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
26214 call to EmitArguments as we are sure there aren't any params arguments.
26215 Test 32 passes again.
26217 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
26218 IndexOutOfRangeException.
26220 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
26221 Test 33 now passes again.
26223 2001-11-15 Miguel de Icaza <miguel@ximian.com>
26225 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
26226 broke a bunch of things. Will have to come up with a better way
26227 of tracking locations.
26229 * statement.cs: Implemented foreach for single dimension arrays.
26231 2001-11-09 Miguel de Icaza <miguel@ximian.com>
26233 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
26234 an error. This removes the lookup from the critical path.
26236 * cs-parser.jay: Removed use of temporary_loc, which is completely
26239 2001-11-14 Miguel de Icaza <miguel@ximian.com>
26241 * support.cs (ReflectionParameters.ParameterModifier): Report
26242 whether the argument is a PARAMS argument or not.
26244 * class.cs: Set the attribute `ParamArrayAttribute' on the
26245 parameter argument.
26247 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
26248 and cons_param_array_attribute (ConstructorInfo for
26249 ParamArrayAttribute).,
26251 * codegen.cs: Emit the return using the `Return' statement, that
26252 way we can report the error correctly for missing return values.
26254 * class.cs (Method.Emit): Clean up.
26256 * expression.cs (Argument.Resolve): Take another argument: the
26257 location where this argument is used. Notice that this is not
26258 part of the "Argument" class as to reduce the size of the
26259 structure (we know the approximate location anyways).
26261 Test if the argument is a variable-reference, if not, then
26262 complain with a 206.
26264 (Argument.Emit): Emit addresses of variables.
26266 (Argument.FullDesc): Simplify.
26268 (Invocation.DoResolve): Update for Argument.Resolve.
26270 (ElementAccess.DoResolve): ditto.
26272 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
26273 method should be virtual, as this method is always virtual.
26275 (NewDelegate.DoResolve): Update for Argument.Resolve.
26277 * class.cs (ConstructorInitializer.DoResolve): ditto.
26279 * attribute.cs (Attribute.Resolve): ditto.
26281 2001-11-13 Miguel de Icaza <miguel@ximian.com>
26283 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
26285 * expression.cs (ParameterReference): Drop IStackStorage and implement
26286 IAssignMethod instead.
26288 (LocalVariableReference): ditto.
26290 * ecore.cs (FieldExpr): Drop IStackStorage and implement
26291 IAssignMethod instead.
26293 2001-11-13 Miguel de Icaza <miguel@ximian.com>
26295 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
26296 enumerations that are used in heavily used structures derive from
26297 byte in a laughable and pathetic attempt to reduce memory usage.
26298 This is the kind of pre-optimzations that you should not do at
26299 home without adult supervision.
26301 * expression.cs (UnaryMutator): New class, used to handle ++ and
26302 -- separatedly from the other unary operators. Cleans up the
26303 code, and kills the ExpressionStatement dependency in Unary.
26305 (Unary): Removed `method' and `Arguments' from this class, making
26306 it smaller, and moving it all to SimpleCall, so I can reuse this
26307 code in other locations and avoid creating a lot of transient data
26308 strucutres when not required.
26310 * cs-parser.jay: Adjust for new changes.
26312 2001-11-11 Miguel de Icaza <miguel@ximian.com>
26314 * enum.cs (Enum.Populate): If there is a failure during
26317 * cs-parser.jay (opt_enum_base): we used to catch type errors
26318 here, but this is really incorrect. The type error should be
26319 catched during semantic analysis.
26321 2001-12-11 Ravi Pratap <ravi@ximian.com>
26323 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
26324 current_local_parameters as expected since I, in my stupidity, had forgotten
26327 * attribute.cs (GetValidPlaces): Fix stupid bug.
26329 * class.cs (Method::Emit): Perform check on applicability of attributes.
26331 (Constructor::Emit): Ditto.
26333 (Field::Emit): Ditto.
26335 (Field.Location): Store location information.
26337 (Property, Event, Indexer, Operator): Ditto.
26339 * cs-parser.jay (field_declaration): Pass in location for each field.
26341 * ../errors/cs0592.cs : Add.
26343 2001-11-12 Ravi Pratap <ravi@ximian.com>
26345 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
26347 (InitCoreTypes): Update accordingly.
26349 (RegisterAttrType, LookupAttr): Implement.
26351 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
26352 info about the same.
26354 (Resolve): Update to populate the above as necessary.
26356 (Error592): Helper.
26358 (GetValidPlaces): Helper to the above.
26360 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
26362 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
26364 2001-11-12 Ravi Pratap <ravi@ximian.com>
26366 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
26368 * ../errors/cs0617.cs : Add.
26370 2001-11-11 Ravi Pratap <ravi@ximian.com>
26372 * enum.cs (Emit): Rename to Populate to be more consistent with what
26373 we expect it to do and when exactly it is called.
26375 * class.cs, rootcontext.cs : Update accordingly.
26377 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
26378 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
26380 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
26382 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
26383 of a fieldinfo using the above, when dealing with a FieldBuilder.
26385 2001-11-10 Ravi Pratap <ravi@ximian.com>
26387 * ../errors/cs0031.cs : Add.
26389 * ../errors/cs1008.cs : Add.
26391 * ../errrors/cs0543.cs : Add.
26393 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
26396 (FindMembers): Implement.
26398 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
26399 enums and delegates too.
26401 (enum_types): Rename to builder_to_enum.
26403 (delegate_types): Rename to builder_to_delegate.
26405 * delegate.cs (FindMembers): Implement.
26407 2001-11-09 Ravi Pratap <ravi@ximian.com>
26409 * typemanager.cs (IsEnumType): Implement.
26411 * enum.cs (Emit): Re-write parts to account for the underlying type
26412 better and perform checking etc.
26414 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
26415 of the underlying type.
26417 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
26420 * enum.cs (error31): Helper to report error #31.
26422 * cs-parser.jay (enum_declaration): Store location of each member too.
26424 * enum.cs (member_to_location): New hashtable.
26426 (AddEnumMember): Update location hashtable.
26428 (Emit): Use the location of each member while reporting errors.
26430 2001-11-09 Miguel de Icaza <miguel@ximian.com>
26432 * cs-parser.jay: A for_initializer if is a
26433 local_variable_declaration really ammount to have an implicit
26434 block with the variable declaration and no initializer for for.
26436 * statement.cs (For.Emit): Cope with null initializers.
26438 This fixes the infinite loop on for initializers.
26440 2001-11-08 Miguel de Icaza <miguel@ximian.com>
26442 * enum.cs: More cleanup.
26444 * ecore.cs: Remove dead code.
26446 * class.cs (Property.Emit): More simplification.
26447 (Event.Emit): ditto.
26449 Reworked to have less levels of indentation.
26451 2001-11-08 Ravi Pratap <ravi@ximian.com>
26453 * class.cs (Property): Emit attributes.
26463 * enum.cs (Emit): Ditto.
26465 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
26468 * class.cs (Field, Event, etc.): Move attribute generation into the
26469 Emit method everywhere.
26471 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
26472 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
26473 as we had no way of defining nested enums !
26475 * rootcontext.cs : Adjust code accordingly.
26477 * typemanager.cs (AddEnumType): To keep track of enum types separately.
26479 2001-11-07 Ravi Pratap <ravi@ximian.com>
26481 * expression.cs (EvalConstantExpression): Move into ecore.cs
26483 * enum.cs (Enum): Rename some members and make them public and readonly
26484 according to our convention.
26486 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
26489 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
26491 (Enum::Emit): Write a simple version for now which doesn't try to compute
26492 expressions. I shall modify this to be more robust in just a while.
26494 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
26496 (TypeContainer::CloseType): Create the Enum types too.
26498 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
26500 * expression.cs (EvalConstantExpression): Get rid of completely.
26502 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
26503 user-defined values and other cases.
26505 (IsValidEnumLiteral): Helper function.
26507 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
26508 out there in the case we had a literal FieldExpr.
26510 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
26512 (Literalize): Revamp a bit to take two arguments.
26514 (EnumLiteral): New class which derives from Literal to wrap enum literals.
26516 2001-11-06 Ravi Pratap <ravi@ximian.com>
26518 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
26520 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
26522 (Resolve): Use the above to ensure we have proper initializers.
26524 2001-11-05 Ravi Pratap <ravi@ximian.com>
26526 * expression.cs (Expression::EvalConstantExpression): New method to
26527 evaluate constant expressions.
26529 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
26531 2001-11-07 Miguel de Icaza <miguel@ximian.com>
26533 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
26536 (Binary.ResolveOperator): Handle operator != (object a, object b)
26537 and operator == (object a, object b);
26539 (Binary.DoNumericPromotions): Indicate whether the numeric
26540 promotion was possible.
26542 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
26545 Made the ArrayAccess implement interface IAssignMethod instead of
26546 IStackStore as the order in which arguments are passed reflects
26549 * assign.cs: Instead of using expr.ExprClass to select the way of
26550 assinging, probe for the IStackStore/IAssignMethod interfaces.
26552 * typemanager.cs: Load InitializeArray definition.
26554 * rootcontext.cs (RootContext.MakeStaticData): Used to define
26555 static data that can be used to initialize arrays.
26557 2001-11-05 Miguel de Icaza <miguel@ximian.com>
26559 * expression.cs: Handle operator== and operator!= for booleans.
26561 (Conditioal.Reduce): Implement reducer for the ?: operator.
26563 (Conditional.Resolve): Implement dead code elimination.
26565 (Binary.Resolve): Catch string literals and return a new
26566 concatenated string.
26568 (Unary.Reduce): Implement reduction of unary expressions.
26570 * ecore.cs: Split out the expression core handling here.
26572 (Expression.Reduce): New method used to perform constant folding
26573 and CSE. This is needed to support constant-expressions.
26575 * statement.cs (Statement.EmitBoolExpression): Pass true and false
26576 targets, and optimize for !x.
26578 2001-11-04 Ravi Pratap <ravi@ximian.com>
26580 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
26581 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
26582 set custom atttributes.
26584 * literal.cs (Literal::GetValue): New abstract method to return the actual
26585 value of the literal, cast as an object.
26587 (*Literal): Implement GetValue method.
26589 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
26590 expressions to the arraylist but objects of type Argument.
26592 * class.cs (TypeContainer::Emit): Emit our attributes too.
26594 (Method::Emit, Constructor::Emit): Ditto.
26596 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
26597 to be ignoring earlier.
26599 2001-11-03 Ravi Pratap <ravi@ximian.com>
26601 * attribute.cs (AttributeSection::Define): Implement to do the business
26602 of constructing a CustomAttributeBuilder.
26604 (Attribute): New trivial class. Increases readability of code.
26606 * cs-parser.jay : Update accordingly.
26608 (positional_argument_list, named_argument_list, named_argument): New rules
26610 (attribute_arguments): Use the above so that we are more correct.
26612 2001-11-02 Ravi Pratap <ravi@ximian.com>
26614 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
26615 to perform all checks for a method with a params parameter.
26617 (Invocation::OverloadResolve): Update to use the above method and therefore
26618 cope correctly with params method invocations.
26620 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
26623 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
26624 constructors in our parent too because we can't afford to miss out on
26627 * attribute.cs (AttributeSection): New name for the class Attribute
26629 Other trivial changes to improve readability.
26631 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
26632 use the new class names.
26634 2001-11-01 Ravi Pratap <ravi@ximian.com>
26636 * class.cs (Method::Define): Complete definition for params types too
26638 (Indexer::Define): Ditto.
26640 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
26641 Cope everywhere with a request for info about the array parameter.
26643 2001-11-01 Ravi Pratap <ravi@ximian.com>
26645 * tree.cs (RecordNamespace): Fix up to check for the correct key.
26647 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
26648 local_variable_type to extract the string corresponding to the type.
26650 (local_variable_type): Fixup the action to use the new helper method.
26652 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
26655 * expression.cs : Clean out code which uses the above.
26657 2001-10-31 Ravi Pratap <ravi@ximian.com>
26659 * typemanager.cs (RegisterMethod): Check if we already have an existing key
26660 and bale out if necessary by returning a false.
26662 (RegisterProperty): Ditto.
26664 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
26665 and print out appropriate error messages.
26667 * interface.cs (everywhere): Ditto.
26669 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
26670 location to constructor.
26672 * class.cs (Property, Event, Indexer): Update accordingly.
26674 * ../errors/cs111.cs : Added.
26676 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
26677 of a method, as laid down by the spec.
26679 (Invocation::OverloadResolve): Use the above method.
26681 2001-10-31 Ravi Pratap <ravi@ximian.com>
26683 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
26684 now take a TypeContainer and a Parameters object.
26686 (ParameterData): Modify return type of ParameterModifier method to be
26687 Parameter.Modifier and not a string.
26689 (ReflectionParameters, InternalParameters): Update accordingly.
26691 * expression.cs (Argument::GetParameterModifier): Same here.
26693 * support.cs (InternalParameters::ParameterType): Find a better way of determining
26694 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
26695 symbol in it at all so maybe this is only for now.
26697 2001-10-30 Ravi Pratap <ravi@ximian.com>
26699 * support.cs (InternalParameters): Constructor now takes an extra argument
26700 which is the actual Parameters class.
26702 (ParameterDesc): Update to provide info on ref/out modifiers.
26704 * class.cs (everywhere): Update call to InternalParameters to pass in
26705 the second argument too.
26707 * support.cs (ParameterData): Add ParameterModifier, which is a method
26708 to return the modifier info [ref/out etc]
26710 (InternalParameters, ReflectionParameters): Implement the above.
26712 * expression.cs (Argument::ParameterModifier): Similar function to return
26713 info about the argument's modifiers.
26715 (Invocation::OverloadResolve): Update to take into account matching modifiers
26718 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
26719 a new SetFormalParameters object which we pass to InternalParameters.
26721 2001-10-30 Ravi Pratap <ravi@ximian.com>
26723 * expression.cs (NewArray): Merge into the ArrayCreation class.
26725 2001-10-29 Ravi Pratap <ravi@ximian.com>
26727 * expression.cs (NewArray): Merge classes NewBuiltinArray and
26728 NewUserdefinedArray into one as there wasn't much of a use in having
26731 * expression.cs (Argument): Change field's name to ArgType from Type.
26733 (Type): New readonly property which returns the proper type, taking into
26734 account ref/out modifiers.
26736 (everywhere): Adjust code accordingly for the above.
26738 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
26739 whether we are emitting for a ref or out parameter.
26741 * expression.cs (Argument::Emit): Use the above field to set the state.
26743 (LocalVariableReference::Emit): Update to honour the flag and emit the
26746 * parameter.cs (Attributes): Set the correct flags for ref parameters.
26748 * expression.cs (Argument::FullDesc): New function to provide a full desc.
26750 * support.cs (ParameterData): Add method ParameterDesc to the interface.
26752 (ReflectionParameters, InternalParameters): Implement the above method.
26754 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
26757 (Invocation::FullMethodDesc): Ditto.
26759 2001-10-29 Miguel de Icaza <miguel@ximian.com>
26761 * cs-parser.jay: Add extra production for the second form of array
26764 * expression.cs (ArrayCreation): Update to reflect the above
26767 * Small changes to prepare for Array initialization.
26769 2001-10-28 Miguel de Icaza <miguel@ximian.com>
26771 * typemanager.cs (ImplementsInterface): interface might be null;
26772 Deal with this problem;
26774 Also, we do store negative hits on the cache (null values), so use
26775 this instead of calling t.GetInterfaces on the type everytime.
26777 2001-10-28 Ravi Pratap <ravi@ximian.com>
26779 * typemanager.cs (IsBuiltinType): New method to help determine the same.
26781 * expression.cs (New::DoResolve): Get rid of array creation code and instead
26782 split functionality out into different classes.
26784 (New::FormArrayType): Move into NewBuiltinArray.
26786 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
26789 (NewBuiltinArray): New class to handle creation of built-in arrays.
26791 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
26792 account creation of one-dimensional arrays.
26794 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
26796 (NewUserdefinedArray::DoResolve): Implement.
26798 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
26800 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
26801 we maintain inside the TypeManager. This is necessary to perform lookups on the
26804 (LookupType): Update to perform GetType on the module builders too.
26806 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
26808 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
26810 2001-10-23 Ravi Pratap <ravi@ximian.com>
26812 * expression.cs (New::DoResolve): Implement guts of array creation.
26814 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
26816 2001-10-27 Miguel de Icaza <miguel@ximian.com>
26818 * expression.cs: Fix bug I introduced lsat night that broke
26821 (Expression.Resolve): Report a 246 error (can not resolve name)
26822 if we find a SimpleName in the stream.
26824 (Expression.ResolveLValue): Ditto.
26826 (Expression.ResolveWithSimpleName): This function is a variant of
26827 ResolveName, this one allows SimpleNames to be returned without a
26828 warning. The only consumer of SimpleNames is MemberAccess
26830 2001-10-26 Miguel de Icaza <miguel@ximian.com>
26832 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
26833 might arrive here. I have my doubts that this is correct.
26835 * statement.cs (Lock): Implement lock statement.
26837 * cs-parser.jay: Small fixes to support `lock' and `using'
26839 * cs-tokenizer.cs: Remove extra space
26841 * driver.cs: New flag --checked, allows to turn on integer math
26844 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
26845 Threading.Monitor.Exit
26847 2001-10-23 Miguel de Icaza <miguel@ximian.com>
26849 * expression.cs (IndexerAccess::DoResolveLValue): Set the
26850 Expression Class to be IndexerAccess.
26852 Notice that Indexer::DoResolve sets the eclass to Value.
26854 2001-10-22 Miguel de Icaza <miguel@ximian.com>
26856 * class.cs (TypeContainer::Emit): Emit code for indexers.
26858 * assign.cs (IAssignMethod): New interface implemented by Indexers
26859 and Properties for handling assignment.
26861 (Assign::Emit): Simplify and reuse code.
26863 * expression.cs (IndexerAccess, PropertyExpr): Implement
26864 IAssignMethod, clean up old code.
26866 2001-10-22 Ravi Pratap <ravi@ximian.com>
26868 * typemanager.cs (ImplementsInterface): New method to determine if a type
26869 implements a given interface. Provides a nice cache too.
26871 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
26874 (ConvertReferenceExplicit): Ditto.
26876 * delegate.cs (Delegate::Populate): Update to define the parameters on the
26877 various methods, with correct names etc.
26879 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
26880 Operator.UnaryNegation.
26882 * cs-parser.jay (operator_declarator): Be a little clever in the case where
26883 we have a unary plus or minus operator.
26885 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
26888 * everywhere : update accordingly.
26890 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
26893 * class.cs (Method::Define): For the case where we are implementing a method
26894 inherited from an interface, we need to set the MethodAttributes.Final flag too.
26895 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
26897 2001-10-21 Ravi Pratap <ravi@ximian.com>
26899 * interface.cs (FindMembers): Implement to work around S.R.E
26902 * typemanager.cs (IsInterfaceType): Implement.
26904 (FindMembers): Update to handle interface types too.
26906 * expression.cs (ImplicitReferenceConversion): Re-write bits which
26907 use IsAssignableFrom as that is not correct - it doesn't work.
26909 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
26910 and accordingly override EmitStatement.
26912 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
26913 using the correct logic :-)
26915 2001-10-19 Ravi Pratap <ravi@ximian.com>
26917 * ../errors/cs-11.cs : Add to demonstrate error -11
26919 2001-10-17 Miguel de Icaza <miguel@ximian.com>
26921 * assign.cs (Assign::Resolve): Resolve right hand side first, and
26922 then pass this as a hint to ResolveLValue.
26924 * expression.cs (FieldExpr): Add Location information
26926 (FieldExpr::LValueResolve): Report assignment to readonly
26929 (Expression::ExprClassFromMemberInfo): Pass location information.
26931 (Expression::ResolveLValue): Add new method that resolves an
26934 (Expression::DoResolveLValue): Default invocation calls
26937 (Indexers): New class used to keep track of indexers in a given
26940 (IStackStore): Renamed from LValue, as it did not really describe
26941 what this did. Also ResolveLValue is gone from this interface and
26942 now is part of Expression.
26944 (ElementAccess): Depending on the element access type
26946 * typemanager.cs: Add `indexer_name_type' as a Core type
26947 (System.Runtime.CompilerServices.IndexerNameAttribute)
26949 * statement.cs (Goto): Take a location.
26951 2001-10-18 Ravi Pratap <ravi@ximian.com>
26953 * delegate.cs (Delegate::VerifyDelegate): New method to verify
26954 if two delegates are compatible.
26956 (NewDelegate::DoResolve): Update to take care of the case when
26957 we instantiate a delegate from another delegate.
26959 * typemanager.cs (FindMembers): Don't even try to look up members
26960 of Delegate types for now.
26962 2001-10-18 Ravi Pratap <ravi@ximian.com>
26964 * delegate.cs (NewDelegate): New class to take care of delegate
26967 * expression.cs (New): Split the delegate related code out into
26968 the NewDelegate class.
26970 * delegate.cs (DelegateInvocation): New class to handle delegate
26973 * expression.cs (Invocation): Split out delegate related code into
26974 the DelegateInvocation class.
26976 2001-10-17 Ravi Pratap <ravi@ximian.com>
26978 * expression.cs (New::DoResolve): Implement delegate creation fully
26979 and according to the spec.
26981 (New::DoEmit): Update to handle delegates differently.
26983 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
26984 because of which we were printing out arguments in reverse order !
26986 * delegate.cs (VerifyMethod): Implement to check if the given method
26987 matches the delegate.
26989 (FullDelegateDesc): Implement.
26991 (VerifyApplicability): Implement.
26993 * expression.cs (Invocation::DoResolve): Update to accordingly handle
26994 delegate invocations too.
26996 (Invocation::Emit): Ditto.
26998 * ../errors/cs1593.cs : Added.
27000 * ../errors/cs1594.cs : Added.
27002 * delegate.cs (InstanceExpression, TargetMethod): New properties.
27004 2001-10-16 Ravi Pratap <ravi@ximian.com>
27006 * typemanager.cs (intptr_type): Core type for System.IntPtr
27008 (InitCoreTypes): Update for the same.
27010 (iasyncresult_type, asynccallback_type): Ditto.
27012 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
27015 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
27018 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
27019 the builders for the 4 members of a delegate type :-)
27021 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
27024 * expression.cs (New::DoResolve): Implement guts for delegate creation.
27026 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
27028 2001-10-15 Miguel de Icaza <miguel@ximian.com>
27030 * statement.cs (Break::Emit): Implement.
27031 (Continue::Emit): Implement.
27033 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
27034 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
27035 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
27036 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
27039 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
27040 properties that track the label for the current loop (begin of the
27041 loop and end of the loop).
27043 2001-10-15 Ravi Pratap <ravi@ximian.com>
27045 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
27046 use of emitting anything at all.
27048 * class.cs, rootcontext.cs : Get rid of calls to the same.
27050 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
27052 (Populate): Define the constructor correctly and set the implementation
27055 * typemanager.cs (delegate_types): New hashtable to hold delegates that
27058 (AddDelegateType): Implement.
27060 (IsDelegateType): Implement helper method.
27062 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
27064 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
27065 and accordingly handle it.
27067 * delegate.cs (Populate): Take TypeContainer argument.
27068 Implement bits to define the Invoke method. However, I still haven't figured out
27069 how to take care of the native int bit :-(
27071 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
27072 Qualify the name of the delegate, not its return type !
27074 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
27077 (StandardConversionExists): Checking for array types turns out to be recursive.
27079 (ConvertReferenceExplicit): Implement array conversion.
27081 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
27083 2001-10-12 Ravi Pratap <ravi@ximian.com>
27085 * cs-parser.jay (delegate_declaration): Store the fully qualified
27086 name as it is a type declaration.
27088 * delegate.cs (ReturnType, Name): Rename members to these. Make them
27091 (DefineDelegate): Renamed from Define. Does the same thing essentially,
27092 as TypeContainer::DefineType.
27094 (Populate): Method in which all the definition of the various methods (Invoke)
27097 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
27100 (CloseDelegate): Finally creates the delegate.
27102 * class.cs (TypeContainer::DefineType): Update to define delegates.
27103 (Populate, Emit and CloseType): Do the same thing here too.
27105 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
27106 delegates in all these operations.
27108 2001-10-14 Miguel de Icaza <miguel@ximian.com>
27110 * expression.cs: LocalTemporary: a new expression used to
27111 reference a temporary that has been created.
27113 * assign.cs: Handle PropertyAccess back here, so that we can
27114 provide the proper semantic access to properties.
27116 * expression.cs (Expression::ConvertReferenceExplicit): Implement
27117 a few more explicit conversions.
27119 * modifiers.cs: `NEW' modifier maps to HideBySig.
27121 * expression.cs (PropertyExpr): Make this into an
27122 ExpressionStatement, and support the EmitStatement code path.
27124 Perform get/set error checking, clean up the interface.
27126 * assign.cs: recognize PropertyExprs as targets, and if so, turn
27127 them into toplevel access objects.
27129 2001-10-12 Miguel de Icaza <miguel@ximian.com>
27131 * expression.cs: PropertyExpr::PropertyExpr: use work around the
27134 * typemanager.cs: Keep track here of our PropertyBuilders again to
27135 work around lameness in SRE.
27137 2001-10-11 Miguel de Icaza <miguel@ximian.com>
27139 * expression.cs (LValue::LValueResolve): New method in the
27140 interface, used to perform a second resolution pass for LValues.
27142 (This::DoResolve): Catch the use of this in static methods.
27144 (This::LValueResolve): Implement.
27146 (This::Store): Remove warning, assigning to `this' in structures
27149 (Invocation::Emit): Deal with invocation of
27150 methods on value types. We need to pass the address to structure
27151 methods rather than the object itself. (The equivalent code to
27152 emit "this" for structures leaves the entire structure on the
27153 stack instead of a pointer to it).
27155 (ParameterReference::DoResolve): Compute the real index for the
27156 argument based on whether the method takes or not a `this' pointer
27157 (ie, the method is static).
27159 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
27160 value types returned from functions when we need to invoke a
27161 method on the sturcture.
27164 2001-10-11 Ravi Pratap <ravi@ximian.com>
27166 * class.cs (TypeContainer::DefineType): Method to actually do the business of
27167 defining the type in the Modulebuilder or Typebuilder. This is to take
27168 care of nested types which need to be defined on the TypeBuilder using
27169 DefineNestedMethod.
27171 (TypeContainer::GetClassBases): Implement. Essentially the code from the
27172 methods in RootContext, only ported to be part of TypeContainer.
27174 (TypeContainer::GetInterfaceOrClass): Ditto.
27176 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
27178 * interface.cs (Interface::DefineInterface): New method. Does exactly
27179 what RootContext.CreateInterface did earlier, only it takes care of nested types
27182 (Interface::GetInterfaces): Move from RootContext here and port.
27184 (Interface::GetInterfaceByName): Same here.
27186 * rootcontext.cs (ResolveTree): Re-write.
27188 (PopulateTypes): Re-write.
27190 * class.cs (TypeContainer::Populate): Populate nested types too.
27191 (TypeContainer::Emit): Emit nested members too.
27193 * typemanager.cs (AddUserType): Do not make use of the FullName property,
27194 instead just use the name argument passed in as it is already fully
27197 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
27198 to TypeContainer mapping to see if a type is user-defined.
27200 * class.cs (TypeContainer::CloseType): Implement.
27202 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
27203 the default constructor.
27205 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
27208 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
27210 * interface.cs (CloseType): Create the type here.
27212 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
27215 Remove all the methods which are now in TypeContainer.
27217 2001-10-10 Ravi Pratap <ravi@ximian.com>
27219 * delegate.cs (Define): Re-write bits to define the delegate
27222 2001-10-10 Miguel de Icaza <miguel@ximian.com>
27224 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
27226 * expression.cs (ImplicitReferenceConversion): handle null as well
27227 as a source to convert to any reference type.
27229 * statement.cs (Return): Perform any implicit conversions to
27230 expected return type.
27232 Validate use of return statement.
27234 * codegen.cs (EmitContext): Pass the expected return type here.
27236 * class.cs (Method, Constructor, Property): Pass expected return
27237 type to EmitContext.
27239 2001-10-09 Miguel de Icaza <miguel@ximian.com>
27241 * expression.cs: Make DoResolve take an EmitContext instead of a
27244 Replaced `l' and `location' for `loc', for consistency.
27246 (Error, Warning): Remove unneeded Tc argument.
27248 * assign.cs, literal.cs, constant.cs: Update to new calling
27251 * codegen.cs: EmitContext now contains a flag indicating whether
27252 code is being generated in a static method or not.
27254 * cs-parser.jay: DecomposeQI, new function that replaces the old
27255 QualifiedIdentifier. Now we always decompose the assembled
27256 strings from qualified_identifier productions into a group of
27259 2001-10-08 Miguel de Icaza <miguel@ximian.com>
27261 * rootcontext.cs: Deal with field-less struct types correctly now
27262 by passing the size option to Define Type.
27264 * class.cs: Removed hack that created one static field.
27266 2001-10-07 Miguel de Icaza <miguel@ximian.com>
27268 * statement.cs: Moved most of the code generation here.
27270 2001-10-09 Ravi Pratap <ravi@ximian.com>
27272 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
27275 (ElementAccess): Remove useless bits for now - keep checks as the spec
27278 2001-10-08 Ravi Pratap <ravi@ximian.com>
27280 * expression.cs (ElementAccess::DoResolve): Remove my crap code
27281 and start performing checks according to the spec.
27283 2001-10-07 Ravi Pratap <ravi@ximian.com>
27285 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
27286 rank_specifiers instead.
27288 (rank_specifiers): Change the order in which the rank specifiers are stored
27290 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
27292 * expression.cs (ElementAccess): Implement the LValue interface too.
27294 2001-10-06 Ravi Pratap <ravi@ximian.com>
27296 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
27297 except that user defined conversions are not included.
27299 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
27300 perform the conversion of the return type, if necessary.
27302 (New::DoResolve): Check whether we are creating an array or an object
27303 and accordingly do the needful.
27305 (New::Emit): Same here.
27307 (New::DoResolve): Implement guts of array creation.
27309 (New::FormLookupType): Helper function.
27311 2001-10-07 Miguel de Icaza <miguel@ximian.com>
27313 * codegen.cs: Removed most of the code generation here, and move the
27314 corresponding code generation bits to the statement classes.
27316 Added support for try/catch/finalize and throw.
27318 * cs-parser.jay: Added support for try/catch/finalize.
27320 * class.cs: Catch static methods having the flags override,
27321 virtual or abstract.
27323 * expression.cs (UserCast): This user cast was not really doing
27324 what it was supposed to do. Which is to be born in fully resolved
27325 state. Parts of the resolution were being performed at Emit time!
27329 2001-10-05 Miguel de Icaza <miguel@ximian.com>
27331 * expression.cs: Implicity convert the result from UserCast.
27333 2001-10-05 Ravi Pratap <ravi@ximian.com>
27335 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
27336 prevented it from working correctly.
27338 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
27339 merely ConvertImplicit.
27341 2001-10-05 Miguel de Icaza <miguel@ximian.com>
27343 * typemanager.cs: Make the LookupTypeContainer function static,
27344 and not per-instance.
27346 * class.cs: Make static FindMembers (the one that takes a Type
27349 * codegen.cs: Add EmitForeach here.
27351 * cs-parser.jay: Make foreach a toplevel object instead of the
27352 inline expansion, as we need to perform semantic analysis on it.
27354 2001-10-05 Ravi Pratap <ravi@ximian.com>
27356 * expression.cs (Expression::ImplicitUserConversion): Rename to
27357 UserDefinedConversion.
27359 (Expression::UserDefinedConversion): Take an extra argument specifying
27360 whether we look for explicit user conversions too.
27362 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
27364 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
27366 (ExplicitUserConversion): Make it a call to UserDefinedConversion
27367 with the appropriate arguments.
27369 * cs-parser.jay (cast_expression): Record location too.
27371 * expression.cs (Cast): Record location info.
27373 (Expression::ConvertExplicit): Take location argument.
27375 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
27376 to determine if we are doing explicit conversions.
27378 (UserCast::Emit): Update accordingly.
27380 (Expression::ConvertExplicit): Report an error if everything fails.
27382 * ../errors/cs0030.cs : Add.
27384 2001-10-04 Miguel de Icaza <miguel@ximian.com>
27386 * modifiers.cs: If the ABSTRACT keyword is present, also set the
27387 virtual and newslot bits.
27389 * class.cs (TypeContainer::RegisterRequiredImplementations):
27390 Record methods we need.
27392 (TypeContainer::MakeKey): Helper function to make keys for
27393 MethodBases, since the Methodbase key is useless.
27395 (TypeContainer::Populate): Call RegisterRequiredImplementations
27396 before defining the methods.
27398 Create a mapping for method_builders_to_methods ahead of time
27399 instead of inside a tight loop.
27401 (::RequireMethods): Accept an object as the data to set into the
27402 hashtable so we can report interface vs abstract method mismatch.
27404 2001-10-03 Miguel de Icaza <miguel@ximian.com>
27406 * report.cs: Make all of it static.
27408 * rootcontext.cs: Drop object_type and value_type computations, as
27409 we have those in the TypeManager anyways.
27411 Drop report instance variable too, now it is a global.
27413 * driver.cs: Use try/catch on command line handling.
27415 Add --probe option to debug the error reporting system with a test
27418 * report.cs: Add support for exiting program when a probe
27419 condition is reached.
27421 2001-10-03 Ravi Pratap <ravi@ximian.com>
27423 * expression.cs (Binary::DoNumericPromotions): Fix the case when
27424 we do a forcible conversion regardless of type, to check if
27425 ForceConversion returns a null.
27427 (Binary::error19): Use location to report error.
27429 (Unary::error23): Use location here too.
27431 * ../errors/cs0019.cs : Check in.
27433 * ../errors/cs0023.cs : Check in.
27435 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
27436 case of a non-null MethodInfo object with a length of 0 !
27438 (Binary::ResolveOperator): Flag error if overload resolution fails to find
27439 an applicable member - according to the spec :-)
27440 Also fix logic to find members in base types.
27442 (Unary::ResolveOperator): Same here.
27444 (Unary::report23): Change name to error23 and make first argument a TypeContainer
27445 as I was getting thoroughly confused between this and error19 :-)
27447 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
27448 (::FindMostEncompassedType): Implement.
27449 (::FindMostEncompassingType): Implement.
27450 (::StandardConversionExists): Implement.
27452 (UserImplicitCast): Re-vamp. We now need info about most specific
27453 source and target types so that we can do the necessary conversions.
27455 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
27456 mathematical union with no duplicates.
27458 2001-10-03 Miguel de Icaza <miguel@ximian.com>
27460 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
27461 in order from base classes to child classes, so that we can in
27462 child classes look up in our parent for method names and
27463 attributes (required for handling abstract, virtual, new, override
27464 constructs: we need to instrospect our base class, and if we dont
27465 populate the classes in order, the introspection might be
27466 incorrect. For example, a method could query its parent before
27467 the parent has any methods and would determine that the parent has
27468 no abstract methods (while it could have had them)).
27470 (RootContext::CreateType): Record the order in which we define the
27473 2001-10-02 Miguel de Icaza <miguel@ximian.com>
27475 * class.cs (TypeContainer::Populate): Also method definitions can
27476 fail now, keep track of this.
27478 (TypeContainer::FindMembers): Implement support for
27479 DeclaredOnly/noDeclaredOnly flag.
27481 (Constructor::Emit) Return the ConstructorBuilder.
27483 (Method::Emit) Return the MethodBuilder.
27484 Check for abstract or virtual methods to be public.
27486 * rootcontext.cs (RootContext::CreateType): Register all the
27487 abstract methods required for the class to be complete and the
27488 interface methods that must be implemented.
27490 * cs-parser.jay: Report error 501 (method requires body if it is
27491 not marked abstract or extern).
27493 * expression.cs (TypeOf::Emit): Implement.
27495 * typemanager.cs: runtime_handle_type, new global type.
27497 * class.cs (Property::Emit): Generate code for properties.
27499 2001-10-02 Ravi Pratap <ravi@ximian.com>
27501 * expression.cs (Unary::ResolveOperator): Find operators on base type
27502 too - we now conform exactly to the spec.
27504 (Binary::ResolveOperator): Same here.
27506 * class.cs (Operator::Define): Fix minor quirk in the tests.
27508 * ../errors/cs0215.cs : Added.
27510 * ../errors/cs0556.cs : Added.
27512 * ../errors/cs0555.cs : Added.
27514 2001-10-01 Miguel de Icaza <miguel@ximian.com>
27516 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
27517 single integer which is really efficient
27519 2001-10-01 Ravi Pratap <ravi@ximian.com>
27521 * expression.cs (Expression::ImplicitUserConversion): Use location
27522 even in the case when we are examining True operators.
27524 * class.cs (Operator::Define): Perform extensive checks to conform
27525 with the rules for operator overloading in the spec.
27527 * expression.cs (Expression::ImplicitReferenceConversion): Implement
27528 some of the other conversions mentioned in the spec.
27530 * typemanager.cs (array_type): New static member for the System.Array built-in
27533 (cloneable_interface): For System.ICloneable interface.
27535 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
27536 we start resolving the tree and populating types.
27538 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
27540 2001-10-01 Miguel de Icaza <miguel@ximian.com>
27542 * expression.cs (Expression::ExprClassFromMemberInfo,
27543 Expression::Literalize): Create literal expressions from
27544 FieldInfos which are literals.
27546 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
27547 type casts, because they were wrong. The test suite in tests
27550 (ImplicitNumericConversion): ushort to ulong requires a widening
27553 Int32 constant to long requires widening cast as well.
27555 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
27556 for integers because the type on the stack is not i4.
27558 2001-09-30 Miguel de Icaza <miguel@ximian.com>
27560 * expression.cs (report118): require location argument.
27562 * parameter.cs: Do not dereference potential null value.
27564 * class.cs: Catch methods that lack the `new' keyword when
27565 overriding a name. Report warnings when `new' is used without
27566 anything being there to override.
27568 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
27570 * class.cs: Only add constructor to hashtable if it is non-null
27571 (as now constructors can fail on define).
27573 (TypeManager, Class, Struct): Take location arguments.
27575 Catch field instance initialization in structs as errors.
27577 accepting_filter: a new filter for FindMembers that is static so
27578 that we dont create an instance per invocation.
27580 (Constructor::Define): Catch errors where a struct constructor is
27583 * cs-parser.jay: Pass location information for various new
27586 * delegate.cs (Delegate): take a location argument.
27588 * driver.cs: Do not call EmitCode if there were problesm in the
27589 Definition of the types, as many Builders wont be there.
27591 * decl.cs (Decl::Decl): Require a location argument.
27593 * cs-tokenizer.cs: Handle properly hex constants that can not fit
27594 into integers, and find the most appropiate integer for it.
27596 * literal.cs: Implement ULongLiteral.
27598 * rootcontext.cs: Provide better information about the location of
27599 failure when CreateType fails.
27601 2001-09-29 Miguel de Icaza <miguel@ximian.com>
27603 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
27606 * expression.cs (Binary::CheckShiftArguments): Add missing type
27608 (Binary::ResolveOperator): Add type to the logical and and logical
27609 or, Bitwise And/Or and Exclusive Or code paths, it was missing
27612 (Binary::DoNumericPromotions): In the case where either argument
27613 is ulong (and most signed types combined with ulong cause an
27614 error) perform implicit integer constant conversions as well.
27616 2001-09-28 Miguel de Icaza <miguel@ximian.com>
27618 * expression.cs (UserImplicitCast): Method should always be
27620 (Invocation::BetterConversion): Simplified test for IntLiteral.
27622 (Expression::ImplicitNumericConversion): Split this routine out.
27623 Put the code that performs implicit constant integer conversions
27626 (Expression::Resolve): Become a wrapper around DoResolve so we can
27627 check eclass and type being set after resolve.
27629 (Invocation::Badness): Remove this dead function
27631 (Binary::ResolveOperator): Do not compute the expensive argumnets
27632 unless we have a union for it.
27634 (Probe::Emit): Is needs to do an isinst and then
27635 compare against null.
27637 (::CanConvert): Added Location argument. If the Location argument
27638 is null (Location.Null), then we do not report errors. This is
27639 used by the `probe' mechanism of the Explicit conversion. We do
27640 not want to generate an error for something that the user
27641 explicitly requested to be casted. But the pipeline for an
27642 explicit cast first tests for potential implicit casts.
27644 So for now, if the Location is null, it means `Probe only' to
27645 avoid adding another argument. Might have to revise this
27648 (ClassCast): New class used to type cast objects into arbitrary
27649 classes (used in Explicit Reference Conversions).
27651 Implement `as' as well.
27653 Reverted all the patches from Ravi below: they were broken:
27655 * The use of `level' as a mechanism to stop recursive
27656 invocations is wrong. That was there just to catch the
27657 bug with a strack trace but not as a way of addressing
27660 To fix the problem we have to *understand* what is going
27661 on and the interactions and come up with a plan, not
27662 just get things going.
27664 * The use of the type conversion cache that I proposed
27665 last night had an open topic: How does this work across
27666 protection domains. A user defined conversion might not
27667 be public in the location where we are applying the
27668 conversion, a different conversion might be selected
27669 (ie, private A->B (better) but public B->A (worse),
27670 inside A, A->B applies, but outside it, B->A will
27673 * On top of that (ie, even if the above is solved),
27674 conversions in a cache need to be abstract. Ie, `To
27675 convert from an Int to a Short use an OpcodeCast', not
27676 `To convert from an Int to a Short use the OpcodeCast on
27677 the variable 5' (which is what this patch was doing).
27679 2001-09-28 Ravi Pratap <ravi@ximian.com>
27681 * expression.cs (Invocation::ConversionExists): Re-write to use
27682 the conversion cache
27684 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
27685 cache all conversions done, not just user-defined ones.
27687 (Invocation::BetterConversion): The real culprit. Use ConversionExists
27688 to determine if a conversion exists instead of acutually trying to
27689 perform the conversion. It's faster too.
27691 (Expression::ConvertExplicit): Modify to use ConversionExists to check
27692 and only then attempt the implicit conversion.
27694 2001-09-28 Ravi Pratap <ravi@ximian.com>
27696 * expression.cs (ConvertImplicit): Use a cache for conversions
27697 already found. Check level of recursion and bail out if necessary.
27699 2001-09-28 Miguel de Icaza <miguel@ximian.com>
27701 * typemanager.cs (string_concat_string_string, string_concat_object_object):
27702 Export standard methods that we expect for string operations.
27704 * statement.cs (Block::UsageWarning): Track usage of variables and
27705 report the errors for not used variables.
27707 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
27710 2001-09-27 Miguel de Icaza <miguel@ximian.com>
27712 * codegen.cs: remove unnneded code
27714 * expression.cs: Removed BuiltinTypeAccess class
27716 Fix the order in which implicit conversions are
27719 The previous fixed dropped support for boxed conversions (adding a
27720 test to the test suite now)
27722 (UserImplicitCast::CanConvert): Remove test for source being null,
27723 that code is broken. We should not feed a null to begin with, if
27724 we do, then we should track the bug where the problem originates
27725 and not try to cover it up here.
27727 Return a resolved expression of type UserImplicitCast on success
27728 rather than true/false. Ravi: this is what I was talking about,
27729 the pattern is to use a static method as a "constructor" for
27732 Also, do not create arguments until the very last minute,
27733 otherwise we always create the arguments even for lookups that
27734 will never be performed.
27736 (UserImplicitCast::Resolve): Eliminate, objects of type
27737 UserImplicitCast are born in a fully resolved state.
27739 * typemanager.cs (InitCoreTypes): Init also value_type
27740 (System.ValueType).
27742 * expression.cs (Cast::Resolve): First resolve the child expression.
27744 (LValue): Add new method AddressOf to be used by
27747 Change the argument of Store to take an EmitContext instead of an
27748 ILGenerator, because things like FieldExpr need to be able to call
27749 their children expression to generate the instance code.
27751 (Expression::Error, Expression::Warning): Sugar functions for
27754 (Expression::MemberLookup): Accept a TypeContainer instead of a
27755 Report as the first argument.
27757 (Expression::ResolvePrimary): Killed. I still want to improve
27758 this as currently the code is just not right.
27760 (Expression::ResolveMemberAccess): Simplify, but it is still
27763 (Unary::Resolve): Catch errors in AddressOf operators.
27765 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
27766 index to a byte for the short-version, or the compiler will choose
27767 the wrong Emit call, which generates the wrong data.
27769 (ParameterReference::Emit, ::Store): same.
27771 (FieldExpr::AddressOf): Implement.
27773 * typemanager.cs: TypeManager: made public variable instead of
27776 * driver.cs: document --fatal.
27778 * report.cs (ErrorMessage, WarningMessage): new names for the old
27779 Error and Warning classes.
27781 * cs-parser.jay (member_access): Turn built-in access to types
27782 into a normal simplename
27784 2001-09-27 Ravi Pratap <ravi@ximian.com>
27786 * expression.cs (Invocation::BetterConversion): Fix to cope
27787 with q being null, since this was introducing a bug.
27789 * expression.cs (ConvertImplicit): Do built-in conversions first.
27791 2001-09-27 Ravi Pratap <ravi@ximian.com>
27793 * expression.cs (UserImplicitCast::Resolve): Fix bug.
27795 2001-09-27 Ravi Pratap <ravi@ximian.com>
27797 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
27798 I had introduced long ago (what's new ?).
27800 * expression.cs (UserImplicitCast::CanConvert): Static method to do
27801 the work of all the checking.
27802 (ConvertImplicit): Call CanConvert and only then create object if necessary.
27803 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
27805 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
27806 that is the right way.
27808 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
27809 overloading resolution. Use everywhere instead of cutting and pasting code.
27811 (Binary::ResolveOperator): Use MakeUnionSet.
27813 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
27814 we have to convert to bool types. Not complete yet.
27816 2001-09-27 Miguel de Icaza <miguel@ximian.com>
27818 * typemanager.cs (TypeManager::CSharpName): support ushort.
27820 * expression.cs (Expression::TryImplicitIntConversion): Attempts
27821 to provide an expression that performsn an implicit constant int
27822 conversion (section 6.1.6).
27823 (Expression::ConvertImplicitRequired): Reworked to include
27824 implicit constant expression conversions.
27826 (Expression::ConvertNumericExplicit): Finished.
27828 (Invocation::Emit): If InstanceExpression is null, then it means
27829 that we perform a call on this.
27831 2001-09-26 Miguel de Icaza <miguel@ximian.com>
27833 * expression.cs (Unary::Emit): Remove some dead code.
27834 (Probe): Implement Resolve and Emit for `is'.
27835 (Expression::ConvertImplicitRequired): Attempt to do constant
27836 expression conversions here. Maybe should be moved to
27837 ConvertImplicit, but I am not sure.
27838 (Expression::ImplicitLongConstantConversionPossible,
27839 Expression::ImplicitIntConstantConversionPossible): New functions
27840 that tell whether is it possible to apply an implicit constant
27841 expression conversion.
27843 (ConvertNumericExplicit): Started work on explicit numeric
27846 * cs-parser.jay: Update operator constants.
27848 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
27849 (Parameters::GetSignature): Hook up VerifyArgs here.
27850 (Parameters::VerifyArgs): Verifies that no two arguments have the
27853 * class.cs (Operator): Update the operator names to reflect the
27854 ones that the spec expects (as we are just stringizing the
27857 * expression.cs (Unary::ResolveOperator): Fix bug: Use
27858 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
27859 previous usage did only work for our methods.
27860 (Expression::ConvertImplicit): Handle decimal implicit numeric
27861 conversions as well.
27862 (Expression::InternalTypeConstructor): Used to invoke constructors
27863 on internal types for default promotions.
27865 (Unary::Emit): Implement special handling for the pre/post
27866 increment/decrement for overloaded operators, as they need to have
27867 the same semantics as the other operators.
27869 (Binary::ResolveOperator): ditto.
27870 (Invocation::ConversionExists): ditto.
27871 (UserImplicitCast::Resolve): ditto.
27873 2001-09-26 Ravi Pratap <ravi@ximian.com>
27875 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
27876 operator, return after emitting body. Regression tests pass again !
27878 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
27879 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
27880 (Invocation::OverloadResolve): Ditto.
27881 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
27883 * everywhere : update calls to the above methods accordingly.
27885 2001-09-26 Miguel de Icaza <miguel@ximian.com>
27887 * assign.cs (Assign): Make it inherit from ExpressionStatement.
27889 * expression.cs (ExpressionStatement): New base class used for
27890 expressions that can appear in statements, so that we can provide
27891 an alternate path to generate expression that do not leave a value
27894 (Expression::Emit, and all the derivatives): We no longer return
27895 whether a value is left on the stack or not. Every expression
27896 after being emitted leaves a single value on the stack.
27898 * codegen.cs (EmitContext::EmitStatementExpression): Use the
27899 facilties of ExpressionStatement if possible.
27901 * cs-parser.jay: Update statement_expression.
27903 2001-09-25 Miguel de Icaza <miguel@ximian.com>
27905 * driver.cs: Change the wording of message
27907 2001-09-25 Ravi Pratap <ravi@ximian.com>
27909 * expression.cs (Binary::ResolveOperator): Had forgottten to set
27910 the type of the expression to the return type of the method if
27911 we have an overloaded operator match ! The regression tests pass again !
27912 (Unary::ResolveOperator): Ditto.
27914 * expression.cs (Invocation::ConversionExists): Correct the member lookup
27915 to find "op_Implicit", not "implicit" ;-)
27916 (UserImplicitCast): New class to take care of user-defined implicit conversions.
27917 (ConvertImplicit, ForceConversion): Take TypeContainer argument
27919 * everywhere : Correct calls to the above accordingly.
27921 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
27922 (ConvertImplicit): Do user-defined conversion if it exists.
27924 2001-09-24 Miguel de Icaza <miguel@ximian.com>
27926 * assign.cs: track location.
27927 (Resolve): Use implicit conversions on assignment.
27929 * literal.cs: Oops. Not good, Emit of short access values should
27930 pass (Bytes) or the wrong argument will be selected.
27932 * expression.cs (Unary::Emit): Emit code for -expr.
27934 (Unary::ResolveOperator): Handle `Substract' for non-constants
27935 (substract from zero from the non-constants).
27936 Deal with Doubles as well.
27938 (Expression::ConvertImplicitRequired): New routine that reports an
27939 error if no implicit conversion exists.
27941 (Invocation::OverloadResolve): Store the converted implicit
27942 expressions if we make them
27944 2001-09-24 Ravi Pratap <ravi@ximian.com>
27946 * class.cs (ConstructorInitializer): Take a Location argument.
27947 (ConstructorBaseInitializer): Same here.
27948 (ConstructorThisInitializer): Same here.
27950 * cs-parser.jay : Update all calls accordingly.
27952 * expression.cs (Unary, Binary, New): Take location argument.
27953 Update accordingly everywhere.
27955 * cs-parser.jay : Update all calls to the above to take a location
27958 * class.cs : Ditto.
27960 2001-09-24 Ravi Pratap <ravi@ximian.com>
27962 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
27963 (Invocation::BetterConversion): Same here
27964 (Invocation::ConversionExists): Ditto.
27966 (Invocation::ConversionExists): Implement.
27968 2001-09-22 Ravi Pratap <ravi@ximian.com>
27970 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
27971 Also take an additional TypeContainer argument.
27973 * All over : Pass in TypeContainer as argument to OverloadResolve.
27975 * typemanager.cs (CSharpName): Update to check for the string type and return
27978 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
27981 2001-09-21 Ravi Pratap <ravi@ximian.com>
27983 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
27984 (Invocation::BetterFunction): Implement.
27985 (Invocation::BetterConversion): Implement.
27986 (Invocation::ConversionExists): Skeleton, no implementation yet.
27988 Okay, things work fine !
27990 2001-09-21 Miguel de Icaza <miguel@ximian.com>
27992 * typemanager.cs: declare and load enum_type, delegate_type and
27995 * expression.cs (Expression::Emit): Now emit returns a value that
27996 tells whether a value is left on the stack or not. This strategy
27997 might be reveted tomorrow with a mechanism that would address
27998 multiple assignments.
27999 (Expression::report118): Utility routine to report mismatches on
28002 (Unary::Report23): Report impossible type/operator combination
28005 (Unary::IsIncrementableNumber): Whether the type can be
28006 incremented or decremented with add.
28007 (Unary::ResolveOperator): Also allow enumerations to be bitwise
28009 (Unary::ResolveOperator): Implement ++, !, ~,
28011 (Invocation::Emit): Deal with new Emit convetion.
28013 * All Expression derivatives: Updated their Emit method to return
28014 whether they leave values on the stack or not.
28016 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
28017 stack for expressions that are statements.
28019 2001-09-20 Miguel de Icaza <miguel@ximian.com>
28021 * expression.cs (LValue): New interface. Must be implemented by
28023 (LocalVariableReference, ParameterReference, FieldExpr): Implement
28026 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
28027 interface for generating code, simplifies the code.
28029 2001-09-20 Ravi Pratap <ravi@ximian.com>
28031 * expression.cs (everywhere): Comment out return statements in ::Resolve
28032 methods to avoid the warnings.
28034 2001-09-20 Miguel de Icaza <miguel@ximian.com>
28036 * driver.cs (parse): Report error 2001 if we can not open the
28039 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
28042 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
28045 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
28046 otherwise nested blocks end up with the same index.
28048 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
28050 * expression.cs: Instead of having FIXMEs in the Resolve
28051 functions, throw exceptions so it is obvious that we are facing a
28054 * cs-parser.jay (invocation_expression): Pass Location information.
28056 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
28057 Use a basename for those routines because .NET does not like paths
28060 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
28063 2001-09-19 Miguel de Icaza <miguel@ximian.com>
28065 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
28066 are loading the correct data types (throws an exception if not).
28067 (TypeManager::InitCoreTypes): Use CoreLookupType
28069 * expression.cs (Unary::ResolveOperator): return the child
28070 expression for expressions which are just +expr.
28071 (Unary::ResolveOperator): Return negative literals for -LITERAL
28072 expressions (otherwise they are Unary {Literal}).
28073 (Invocation::Badness): Take into account `Implicit constant
28074 expression conversions'.
28076 * literal.cs (LongLiteral): Implement long literal class.
28077 (IntLiteral): export the `Value' of the intliteral.
28079 2001-09-19 Ravi Pratap <ravi@ximian.com>
28081 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
28083 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
28084 instead of 'Operator'
28086 * expression.cs (Binary::ResolveOperator): Update accordingly.
28087 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
28090 * cs-parser.jay (unary_expression): Update to use the new names.
28092 * gen-treedump.cs (GetUnary): Same here.
28094 * expression.cs (Unary::Resolve): Implement.
28095 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
28096 operators are found instead of making noise ;-)
28097 (Unary::ResolveOperator): New method to do precisely the same thing which
28098 Binary::ResolveOperator does for Binary expressions.
28099 (Unary.method, .Arguments): Add.
28100 (Unary::OperName): Implement.
28101 (Unary::ForceConversion): Copy and Paste !
28103 * class.cs (Operator::Define): Fix a small bug for the case when we have
28106 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
28107 for the inbuilt operators. Only overloading works for now ;-)
28109 2001-09-18 Miguel de Icaza <miguel@ximian.com>
28111 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
28112 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
28114 * expression.cs (This::Emit): Implement.
28115 (This::Resolve): Implement.
28116 (TypeOf:Resolve): Implement.
28117 (Expression::ResolveSimpleName): Add an implicit this to instance
28119 (MemberAccess::Resolve): Deal with Parameters and Fields.
28120 Bind instance variable to Field expressions.
28121 (FieldExpr::Instance): New field used to track the expression that
28122 represents the object instance.
28123 (FieldExpr::Resolve): Track potential errors from MemberLookup not
28125 (FieldExpr::Emit): Implement.
28127 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
28128 the last instruction contains a return opcode to avoid generating
28129 the last `ret' instruction (this generates correct code, and it is
28130 nice to pass the peverify output).
28132 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
28133 initializer for static and instance variables.
28134 (Constructor::Emit): Allow initializer to be null in the case of
28135 static constructors. Only emit initializer for instance
28138 (TypeContainer::FindMembers): Return a null array if there are no
28141 Also fix the code for the MemberTypes.Method branch, as it was not
28142 scanning that for operators (or tried to access null variables before).
28144 * assign.cs (Assign::Emit): Handle instance and static fields.
28148 * driver.cs: Stop compilation if there are parse errors.
28150 * cs-parser.jay (constructor_declaration): Provide default base
28151 initializer for non-static constructors.
28152 (constructor_declarator): Do not provide a default base
28153 initializers if none was specified.
28154 Catch the fact that constructors should not have parameters.
28156 * class.cs: Do not emit parent class initializers for static
28157 constructors, that should be flagged as an error.
28159 2001-09-18 Ravi Pratap <ravi@ximian.com>
28161 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
28162 Move back code into TypeContainer::Populate.
28164 2001-09-18 Ravi Pratap <ravi@ximian.com>
28166 * class.cs (TypeContainer::AddConstructor): Fix the check to
28167 compare against Name, not Basename.
28168 (Operator::OpType): Change Plus and Minus to Add and Subtract.
28170 * cs-parser.jay : Update accordingly.
28172 * class.cs (TypeContainer::FindMembers): For the case where we are searching
28173 for methods, don't forget to look into the operators too.
28174 (RegisterMethodBuilder): Helper method to take care of this for
28175 methods, constructors and operators.
28176 (Operator::Define): Completely revamp.
28177 (Operator.OperatorMethod, MethodName): New fields.
28178 (TypeContainer::Populate): Move the registering of builders into
28179 RegisterMethodBuilder.
28180 (Operator::Emit): Re-write.
28182 * expression.cs (Binary::Emit): Comment out code path to emit method
28183 invocation stuff for the case when we have a user defined operator. I am
28184 just not able to get it right !
28186 2001-09-17 Miguel de Icaza <miguel@ximian.com>
28188 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
28191 (Expression::MemberLookup): Provide a version that allows to
28192 specify the MemberTypes and BindingFlags.
28194 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
28195 so it was not fetching variable information from outer blocks.
28197 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
28198 Beforefieldinit as it was buggy.
28200 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
28201 that Ravi put here.
28203 * class.cs (Constructor::Emit): Only emit if block is not null.
28204 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
28205 deal with this by semantically definining it as if the user had
28208 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
28209 constructors as we now "emit" them at a higher level.
28211 (TypeContainer::DefineDefaultConstructor): Used to define the
28212 default constructors if none was provided.
28214 (ConstructorInitializer): Add methods Resolve and Emit.
28216 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
28218 2001-09-17 Ravi Pratap <ravi@ximian.com>
28220 * class.cs (TypeContainer::EmitDefaultConstructor): Register
28221 the default constructor builder with our hashtable for methodbuilders
28224 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
28225 and argument_count is 0 in which case we have a match.
28226 (Binary::ResolveOperator): More null checking and miscellaneous coding
28229 2001-09-17 Ravi Pratap <ravi@ximian.com>
28231 * rootcontext.cs (IsNameSpace): Compare against null.
28233 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
28235 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
28236 and Unary::Operator.
28238 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
28241 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
28242 we have overloaded operators.
28243 (Binary::ResolveOperator): Implement the part which does the operator overload
28246 * class.cs (Operator::Emit): Implement.
28247 (TypeContainer::Emit): Emit the operators we have too.
28249 * expression.cs (Binary::Emit): Update to emit the appropriate code for
28250 the case when we have a user-defined operator.
28252 2001-09-17 Miguel de Icaza <miguel@ximian.com>
28254 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
28256 2001-09-16 Ravi Pratap <ravi@ximian.com>
28258 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
28259 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
28260 (Constructor::Emit): Implement.
28261 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
28262 if we have no work to do.
28263 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
28266 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
28267 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
28269 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
28272 2001-09-15 Ravi Pratap <ravi@ximian.com>
28274 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
28276 (Tree::RecordNamespace): Method to do what the name says ;-)
28277 (Tree::Namespaces): Property to get at the namespaces hashtable.
28279 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
28282 * rootcontext.cs (IsNamespace): Fixed it :-)
28284 2001-09-14 Miguel de Icaza <miguel@ximian.com>
28286 * class.cs (TypeContainer::FindMembers): Add support for
28288 (MethodCore): New class that encapsulates both the shared aspects
28289 of a Constructor and a Method.
28290 (Method, Constructor): Factored pieces into MethodCore.
28292 * driver.cs: Added --fatal which makes errors throw exceptions.
28293 Load System assembly as well as part of the standard library.
28295 * report.cs: Allow throwing exceptions on errors for debugging.
28297 * modifiers.cs: Do not use `parent', instead use the real type
28298 container to evaluate permission settings.
28300 * class.cs: Put Ravi's patch back in. He is right, and we will
28301 have to cope with the
28303 2001-09-14 Ravi Pratap <ravi@ximian.com>
28305 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
28306 FamORAssem, not FamANDAssem.
28308 2001-09-14 Miguel de Icaza <miguel@ximian.com>
28310 * driver.cs: Added --parse option that only parses its input files
28313 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
28314 incorrect. IsTopLevel is not used to tell whether an object is
28315 root_types or not (that can be achieved by testing this ==
28316 root_types). But to see if this is a top-level *class* (not
28317 necessarly our "toplevel" container).
28319 2001-09-14 Ravi Pratap <ravi@ximian.com>
28321 * enum.cs (Enum::Define): Modify to call the Lookup method on the
28322 parent instead of a direct call to GetType.
28324 2001-09-14 Ravi Pratap <ravi@ximian.com>
28326 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
28327 Modifiers.TypeAttr. This should just be a call to that method.
28329 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
28330 object so that we can determine if we are top-level or not.
28332 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
28335 * enum.cs (Enum::Define): Ditto.
28337 * modifiers.cs (FieldAttr): Re-write.
28339 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
28340 (TypeContainer::HaveStaticConstructor): New property to provide access
28341 to precisely that info.
28343 * modifiers.cs (MethodAttr): Re-write.
28344 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
28346 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
28347 of top-level types as claimed.
28349 2001-09-13 Miguel de Icaza <miguel@ximian.com>
28351 * expression.cs (MemberLookup): Fruitless attempt to lookup
28352 constructors. Maybe I need to emit default constructors? That
28353 might be it (currently .NET emits this for me automatically).
28354 (Invocation::OverloadResolve): Cope with Arguments == null.
28355 (Invocation::EmitArguments): new function, shared by the new
28356 constructor and us.
28357 (Invocation::Emit): Handle static and instance methods. Emit
28358 proper call instruction for virtual or non-virtual invocations.
28359 (New::Emit): Implement.
28360 (New::Resolve): Implement.
28361 (MemberAccess:Resolve): Implement.
28362 (MethodGroupExpr::InstanceExpression): used conforming to the spec
28363 to track instances.
28364 (FieldExpr::Resolve): Set type.
28366 * support.cs: Handle empty arguments.
28368 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
28369 SimpleLookup): Auxiliary routines to help parse a qualifier
28372 Update qualifier_identifier rule.
28374 * codegen.cs: Removed debugging messages.
28376 * class.cs: Make this a global thing, this acts just as a "key" to
28377 objects that we might have around.
28379 (Populate): Only initialize method_builders_to_methods once.
28381 * expression.cs (PropertyExpr): Initialize type from the
28384 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
28385 Resolve pattern. Attempt to implicitly convert value to boolean.
28388 * expression.cs: Set the type for the int32/int32 argument case.
28389 (Binary::ResolveOperator): Set the return type to boolean for
28390 comparission operators
28392 * typemanager.cs: Remove debugging print code.
28394 (Invocation::Resolve): resolve type.
28396 * class.cs: Allocate a MemberInfo of the correct size, as the code
28397 elsewhere depends on the test to reflect the correct contents.
28399 (Method::) Keep track of parameters, due to System.Reflection holes
28401 (TypeContainer::Populate): Keep track of MethodBuilders to Method
28404 (TypeContainer::FindMembers): Use ArrayList and then copy an array
28405 of the exact size and return that.
28407 (Class::LookupMethodByBuilder): New function that maps
28408 MethodBuilders to its methods. Required to locate the information
28409 on methods because System.Reflection bit us again.
28411 * support.cs: New file, contains an interface ParameterData and
28412 two implementations: ReflectionParameters and InternalParameters
28413 used to access Parameter information. We will need to grow this
28416 * expression.cs (Invocation::GetParameterData): implement a cache
28417 and a wrapper around the ParameterData creation for methods.
28418 (Invocation::OverloadResolve): Use new code.
28420 2001-09-13 Ravi Pratap <ravi@ximian.com>
28422 * class.cs (TypeContainer::EmitField): Remove and move into
28423 (Field::Define): here and modify accordingly.
28424 (Field.FieldBuilder): New member.
28425 (TypeContainer::Populate): Update accordingly.
28426 (TypeContainer::FindMembers): Implement.
28428 2001-09-13 Miguel de Icaza <miguel@ximian.com>
28430 * statement.cs: (VariableInfo::VariableType): New field to be
28431 initialized with the full type once it is resolved.
28433 2001-09-12 Miguel de Icaza <miguel@ximian.com>
28435 * parameter.cs (GetParameterInfo): Use a type cache to compute
28436 things only once, and to reuse this information
28438 * expression.cs (LocalVariableReference::Emit): Implement.
28439 (OpcodeCast::Emit): fix.
28441 (ParameterReference::Resolve): Implement.
28442 (ParameterReference::Emit): Implement.
28444 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
28445 that are expressions need to stay as Expressions.
28447 * typemanager.cs (CSharpName): Returns the C# name of a type if
28450 * expression.cs (Expression::ConvertImplicit): New function that
28451 implements implicit type conversions.
28453 (Expression::ImplicitReferenceConversion): Implements implicit
28454 reference conversions.
28456 (EmptyCast): New type for transparent casts.
28458 (OpcodeCast): New type for casts of types that are performed with
28459 a sequence of bytecodes.
28461 (BoxedCast): New type used for casting value types into reference
28462 types. Emits a box opcode.
28464 (Binary::DoNumericPromotions): Implements numeric promotions of
28465 and computation of the Binary::Type.
28467 (Binary::EmitBranchable): Optimization.
28469 (Binary::Emit): Implement code emission for expressions.
28471 * typemanager.cs (TypeManager): Added two new core types: sbyte
28474 2001-09-12 Ravi Pratap <ravi@ximian.com>
28476 * class.cs (TypeContainer::FindMembers): Method which does exactly
28477 what Type.FindMembers does, only we don't have to use reflection. No
28478 implementation yet.
28480 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
28481 typecontainer objects as we need to get at them.
28482 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
28484 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
28485 typecontainer object.
28487 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
28488 of just a Report object.
28490 2001-09-11 Ravi Pratap <ravi@ximian.com>
28492 * class.cs (Event::Define): Go back to using the prefixes "add_" and
28494 (TypeContainer::Populate): Now define the delegates of the type too.
28495 (TypeContainer.Delegates): Property to access the list of delegates defined
28498 * delegates.cs (Delegate::Define): Implement partially.
28500 * modifiers.cs (TypeAttr): Handle more flags.
28502 2001-09-11 Ravi Pratap <ravi@ximian.com>
28504 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
28506 (Operator::Define): Re-write logic to get types by using the LookupType method
28507 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
28508 (Indexer::Define): Ditto.
28509 (Event::Define): Ditto.
28510 (Property::Define): Ditto.
28512 2001-09-10 Ravi Pratap <ravi@ximian.com>
28514 * class.cs (TypeContainer::Populate): Now define operators too.
28515 (TypeContainer.Operators): New property to access the list of operators
28517 (Operator.OperatorMethodBuilder): New member to hold the method builder
28518 for the operator we are defining.
28519 (Operator::Define): Implement.
28521 2001-09-10 Ravi Pratap <ravi@ximian.com>
28523 * class.cs (Event::Define): Make the prefixes of the accessor methods
28524 addOn_ and removeOn_
28526 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
28527 of the location being passed in too. Ideally, this should go later since all
28528 error reporting should be done through the Report object.
28530 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
28531 (Populate): Iterate thru the indexers we have and define them too.
28532 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
28533 for the get and set accessors.
28534 (Indexer::Define): Implement.
28536 2001-09-09 Miguel de Icaza <miguel@ximian.com>
28538 * expression.cs (Binary::Resolve): Beginning of it. I scratched
28539 my previous implementation, did not work.
28541 * typemanager.cs: Add a couple of missing types (the longs).
28543 * literal.cs: Use TypeManager.bool_type instead of getting it.
28545 * expression.cs (EventExpr): New kind of expressions.
28546 (Expressio::ExprClassFromMemberInfo): finish
28548 2001-09-08 Miguel de Icaza <miguel@ximian.com>
28550 * assign.cs: Emit stores to static fields differently.
28552 2001-09-08 Ravi Pratap <ravi@ximian.com>
28554 * Merge in changes and adjust code to tackle conflicts. Backed out my
28555 code in Assign::Resolve ;-)
28557 2001-09-08 Ravi Pratap <ravi@ximian.com>
28559 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
28560 instead Report.Error and also pass in the location.
28561 (CSharpParser::Lexer): New readonly property to return the reference
28562 to the Tokenizer object.
28563 (declare_local_variables): Use Report.Error with location instead of plain
28567 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
28568 (Operator.CheckBinaryOperator): Ditto.
28570 * cs-parser.jay (operator_declarator): Update accordingly.
28572 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
28573 (CheckBinaryOperator): Same here.
28575 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
28576 on the name without any prefixes of namespace names etc. This is because we
28577 already might have something already fully qualified like
28578 'System.Console.WriteLine'
28580 * assign.cs (Resolve): Begin implementation. Stuck ;-)
28582 2001-09-07 Ravi Pratap <ravi@ximian.com>
28584 * cs-tokenizer.cs (location): Return a string which also contains
28587 * expression.cs (ElementAccess): New class for expressions of the
28588 type 'element access.'
28589 (BaseAccess): New class for expressions of the type 'base access.'
28590 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
28593 * cs-parser.jay (element_access): Implement action.
28594 (base_access): Implement actions.
28595 (checked_expression, unchecked_expression): Implement.
28597 * cs-parser.jay (local_variable_type): Correct and implement.
28598 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
28600 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
28602 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
28603 name and the specifiers.
28605 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
28607 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
28608 making them all public ;-)
28610 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
28613 2001-09-07 Miguel de Icaza <miguel@ximian.com>
28615 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
28617 (FieldExpr, PropertyExprs): New resolved expressions.
28618 (SimpleName::MemberStaticCheck): Perform static checks for access
28619 to non-static fields on static methods. Maybe this should be
28620 generalized for MemberAccesses.
28621 (SimpleName::ResolveSimpleName): More work on simple name
28624 * cs-parser.jay (primary_expression/qualified_identifier): track
28625 the parameter index.
28627 * codegen.cs (CodeGen::Save): Catch save exception, report error.
28628 (EmitContext::EmitBoolExpression): Chain to expression generation
28629 instead of temporary hack.
28630 (::EmitStatementExpression): Put generic expression code generation.
28632 * assign.cs (Assign::Emit): Implement variable assignments to
28633 local variables, parameters and fields.
28635 2001-09-06 Miguel de Icaza <miguel@ximian.com>
28637 * statement.cs (Block::GetVariableInfo): New method, returns the
28638 VariableInfo for a variable name in a block.
28639 (Block::GetVariableType): Implement in terms of GetVariableInfo
28641 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
28642 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
28644 2001-09-06 Ravi Pratap <ravi@ximian.com>
28646 * cs-parser.jay (operator_declaration): Continue on my quest : update
28647 to take attributes argument.
28648 (event_declaration): Ditto.
28649 (enum_declaration): Ditto.
28650 (indexer_declaration): Ditto.
28652 * class.cs (Operator::Operator): Update constructor accordingly.
28653 (Event::Event): Ditto.
28655 * delegate.cs (Delegate::Delegate): Same here.
28657 * enum.cs (Enum::Enum): Same here.
28659 2001-09-05 Ravi Pratap <ravi@ximian.com>
28661 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
28663 * ../tests/cs0658.cs : New file to demonstrate error 0658.
28665 * attribute.cs (Attributes): New class to encapsulate all attributes which were
28666 being passed around as an arraylist.
28667 (Attributes::AddAttribute): Method to add attribute sections.
28669 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
28670 (struct_declaration): Update accordingly.
28671 (constant_declaration): Update.
28672 (field_declaration): Update.
28673 (method_header): Update.
28674 (fixed_parameter): Update.
28675 (parameter_array): Ditto.
28676 (property_declaration): Ditto.
28677 (destructor_declaration): Ditto.
28679 * class.cs (Struct::Struct): Update constructors accordingly.
28680 (Class::Class): Ditto.
28681 (Field::Field): Ditto.
28682 (Method::Method): Ditto.
28683 (Property::Property): Ditto.
28684 (TypeContainer::OptAttribute): update property's return type.
28686 * interface.cs (Interface.opt_attributes): New member.
28687 (Interface::Interface): Update to take the extra Attributes argument.
28689 * parameter.cs (Parameter::Parameter): Ditto.
28691 * constant.cs (Constant::Constant): Ditto.
28693 * interface.cs (InterfaceMemberBase): New OptAttributes field.
28694 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
28695 the attributes as a parameter.
28696 (InterfaceProperty): Update constructor call.
28697 (InterfaceEvent): Ditto.
28698 (InterfaceMethod): Ditto.
28699 (InterfaceIndexer): Ditto.
28701 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
28702 pass the attributes too.
28703 (interface_event_declaration): Ditto.
28704 (interface_property_declaration): Ditto.
28705 (interface_method_declaration): Ditto.
28706 (interface_declaration): Ditto.
28708 2001-09-05 Miguel de Icaza <miguel@ximian.com>
28710 * class.cs (Method::Define): Track the "static Main" definition to
28711 create an entry point.
28713 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
28714 EntryPoint if we find it.
28716 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
28717 (EmitContext::ig): Make this variable public.
28719 * driver.cs: Make the default output file be the first file name
28720 with the .exe extension.
28722 Detect empty compilations
28724 Handle various kinds of output targets. Handle --target and
28725 rename -t to --dumper.
28727 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
28728 methods inherited from Expression return now an Expression. This
28729 will is used during the tree rewriting as we resolve them during
28732 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
28733 the spec. Missing entirely is the information about
28734 accessability of elements of it.
28736 (Expression::ExprClassFromMemberInfo): New constructor for
28737 Expressions that creates a fully initialized Expression based on
28738 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
28741 (Invocation::Resolve): Begin implementing resolution of invocations.
28743 * literal.cs (StringLiteral): Implement Emit.
28745 2001-09-05 Ravi Pratap <ravi@ximian.com>
28747 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
28750 2001-09-04 Ravi Pratap <ravi@ximian.com>
28752 * cs-parser.jay (attribute_arguments): Implement actions.
28753 (attribute): Fix bug in production. Implement action.
28754 (attribute_list): Implement.
28755 (attribute_target): Implement.
28756 (attribute_target_specifier, opt_target_specifier): Implement
28757 (CheckAttributeTarget): New method to check if the attribute target
28759 (attribute_section): Implement.
28760 (opt_attributes): Implement.
28762 * attribute.cs : New file to handle attributes.
28763 (Attribute): Class to hold attribute info.
28765 * cs-parser.jay (opt_attribute_target_specifier): Remove production
28766 (attribute_section): Modify production to use 2 different rules to
28767 achieve the same thing. 1 s/r conflict down !
28768 Clean out commented, useless, non-reducing dimension_separator rules.
28770 * class.cs (TypeContainer.attributes): New member to hold list
28771 of attributes for a type.
28772 (Struct::Struct): Modify to take one more argument, the attribute list.
28773 (Class::Class): Ditto.
28774 (Field::Field): Ditto.
28775 (Method::Method): Ditto.
28776 (Property::Property): Ditto.
28778 * cs-parser.jay (struct_declaration): Update constructor call to
28779 pass in the attributes too.
28780 (class_declaration): Ditto.
28781 (constant_declaration): Ditto.
28782 (field_declaration): Ditto.
28783 (method_header): Ditto.
28784 (fixed_parameter): Ditto.
28785 (parameter_array): Ditto.
28786 (property_declaration): Ditto.
28788 * constant.cs (Constant::Constant): Update constructor similarly.
28789 Use System.Collections.
28791 * parameter.cs (Parameter::Parameter): Update as above.
28793 2001-09-02 Ravi Pratap <ravi@ximian.com>
28795 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
28796 (TypeContainer.delegates): New member to hold list of delegates.
28798 * cs-parser.jay (delegate_declaration): Implement the action correctly
28799 this time as I seem to be on crack ;-)
28801 2001-09-02 Miguel de Icaza <miguel@ximian.com>
28803 * rootcontext.cs (RootContext::IsNamespace): new function, used to
28804 tell whether an identifier represents a namespace.
28806 * expression.cs (NamespaceExpr): A namespace expression, used only
28807 temporarly during expression resolution.
28808 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
28809 utility functions to resolve names on expressions.
28811 2001-09-01 Miguel de Icaza <miguel@ximian.com>
28813 * codegen.cs: Add hook for StatementExpressions.
28815 * class.cs: Fix inverted test for static flag in methods.
28817 2001-09-02 Ravi Pratap <ravi@ximian.com>
28819 * class.cs (Operator::CheckUnaryOperator): Correct error number used
28820 to make it coincide with MS' number.
28821 (Operator::CheckBinaryOperator): Ditto.
28823 * ../errors/errors.txt : Remove error numbers added earlier.
28825 * ../errors/cs1019.cs : Test case for error # 1019
28827 * ../errros/cs1020.cs : Test case for error # 1020
28829 * cs-parser.jay : Clean out commented cruft.
28830 (dimension_separators, dimension_separator): Comment out. Ostensibly not
28831 used anywhere - non-reducing rule.
28832 (namespace_declarations): Non-reducing rule - comment out.
28834 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
28835 with TypeContainer::AddEnum.
28837 * delegate.cs : New file for delegate handling classes.
28838 (Delegate): Class for declaring delegates.
28840 * makefile : Update.
28842 * cs-parser.jay (delegate_declaration): Implement.
28844 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
28846 * class.cs (Event::Define): Implement.
28847 (Event.EventBuilder): New member.
28849 * class.cs (TypeContainer::Populate): Update to define all enums and events
28851 (Events): New property for the events arraylist we hold. Shouldn't we move to using
28852 readonly fields for all these cases ?
28854 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
28856 * class.cs (Property): Revamp to use the convention of making fields readonly.
28857 Accordingly modify code elsewhere.
28859 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
28860 the Define method of the Property class.
28862 * class.cs : Clean up applied patch and update references to variables etc. Fix
28864 (TypeContainer::Populate): Update to define all the properties we have. Also
28865 define all enumerations.
28867 * enum.cs (Define): Implement.
28869 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
28871 * cs-parser.jay (overloadable_operator): The semantic value is an
28872 enum of the Operator class.
28873 (operator_declarator): Implement actions.
28874 (operator_declaration): Implement.
28876 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
28877 validity of definitions.
28878 (Operator::CheckBinaryOperator): Static method to check for binary operators
28879 (TypeContainer::AddOperator): New method to add an operator to a type.
28881 * cs-parser.jay (indexer_declaration): Added line to actually call the
28882 AddIndexer method so it gets added ;-)
28884 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
28885 already taken care of by the MS compiler ?
28887 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
28889 * class.cs (Operator): New class for operator declarations.
28890 (Operator::OpType): Enum for the various operators.
28892 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
28894 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
28895 ostensibly handle this in semantic analysis.
28897 * cs-parser.jay (general_catch_clause): Comment out
28898 (specific_catch_clauses, specific_catch_clause): Ditto.
28899 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
28900 (catch_args, opt_catch_args): New productions.
28901 (catch_clause): Rewrite to use the new productions above
28902 (catch_clauses): Modify accordingly.
28903 (opt_catch_clauses): New production to use in try_statement
28904 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
28905 and re-write the code in the actions to extract the specific and
28906 general catch clauses by being a little smart ;-)
28908 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
28909 Hooray, try and catch statements parse fine !
28911 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
28913 * statement.cs (Block::GetVariableType): Fix logic to extract the type
28914 string from the hashtable of variables.
28916 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
28917 I end up making that mistake ;-)
28918 (catch_clauses): Fixed gross error which made Key and Value of the
28919 DictionaryEntry the same : $1 !!
28921 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
28923 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
28925 * cs-parser.jay (event_declaration): Correct to remove the semicolon
28926 when the add and remove accessors are specified.
28928 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
28930 * cs-parser.jay (IndexerDeclaration): New helper class to hold
28931 information about indexer_declarator.
28932 (indexer_declarator): Implement actions.
28933 (parsing_indexer): New local boolean used to keep track of whether
28934 we are parsing indexers or properties. This is necessary because
28935 implicit_parameters come into picture even for the get accessor in the
28936 case of an indexer.
28937 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
28939 * class.cs (Indexer): New class for indexer declarations.
28940 (TypeContainer::AddIndexer): New method to add an indexer to a type.
28941 (TypeContainer::indexers): New member to hold list of indexers for the
28944 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
28946 * cs-parser.jay (add_accessor_declaration): Implement action.
28947 (remove_accessor_declaration): Implement action.
28948 (event_accessors_declaration): Implement
28949 (variable_declarators): swap statements for first rule - trivial.
28951 * class.cs (Event): New class to hold information about event
28953 (TypeContainer::AddEvent): New method to add an event to a type
28954 (TypeContainer::events): New member to hold list of events.
28956 * cs-parser.jay (event_declaration): Implement actions.
28958 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
28960 * cs-parser.jay (dim_separators): Implement. Make it a string
28961 concatenating all the commas together, just as they appear.
28962 (opt_dim_separators): Modify accordingly
28963 (rank_specifiers): Update accordingly. Basically do the same
28964 thing - instead, collect the brackets here.
28965 (opt_rank_sepcifiers): Modify accordingly.
28966 (array_type): Modify to actually return the complete type string
28967 instead of ignoring the rank_specifiers.
28968 (expression_list): Implement to collect the expressions
28969 (variable_initializer): Implement. We make it a list of expressions
28970 essentially so that we can handle the array_initializer case neatly too.
28971 (variable_initializer_list): Implement.
28972 (array_initializer): Make it a list of variable_initializers
28973 (opt_array_initializer): Modify accordingly.
28975 * expression.cs (New::NType): Add enumeration to help us
28976 keep track of whether we have an object/delegate creation
28977 or an array creation.
28978 (New:NewType, New::Rank, New::Indices, New::Initializers): New
28979 members to hold data about array creation.
28980 (New:New): Modify to update NewType
28981 (New:New): New Overloaded contructor for the array creation
28984 * cs-parser.jay (array_creation_expression): Implement to call
28985 the overloaded New constructor.
28987 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
28989 * class.cs (TypeContainer::Constructors): Return member
28990 constructors instead of returning null.
28992 2001-08-26 Miguel de Icaza <miguel@ximian.com>
28994 * typemanager.cs (InitCoreTypes): Initialize the various core
28995 types after we have populated the type manager with the user
28996 defined types (this distinction will be important later while
28997 compiling corlib.dll)
28999 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
29000 on Expression Classification. Now all expressions have a method
29001 `Resolve' and a method `Emit'.
29003 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
29004 generation from working. Also add some temporary debugging
29007 2001-08-24 Miguel de Icaza <miguel@ximian.com>
29009 * codegen.cs: Lots of code generation pieces. This is only the
29010 beginning, will continue tomorrow with more touches of polish. We
29011 handle the fundamentals of if, while, do, for, return. Others are
29012 trickier and I need to start working on invocations soon.
29014 * gen-treedump.cs: Bug fix, use s.Increment here instead of
29017 * codegen.cs (EmitContext): New struct, used during code
29018 emission to keep a context. Most of the code generation will be
29021 * cs-parser.jay: Add embedded blocks to the list of statements of
29022 this block. So code generation proceeds in a top down fashion.
29024 2001-08-23 Miguel de Icaza <miguel@ximian.com>
29026 * statement.cs: Add support for multiple child blocks.
29028 2001-08-22 Miguel de Icaza <miguel@ximian.com>
29030 * codegen.cs (EmitCode): New function, will emit the code for a
29031 Block of code given a TypeContainer and its ILGenerator.
29033 * statement.cs (Block): Standard public readonly optimization.
29034 (Block::Block constructors): Link children.
29035 (Block::Child): Child Linker.
29036 (Block::EmitVariables): Emits IL variable declarations.
29038 * class.cs: Drop support for MethodGroups here, delay until
29040 (Method::): Applied the same simplification that I did before, and
29041 move from Properties to public readonly fields.
29042 (Method::ParameterTypes): Returns the parameter types for the
29043 function, and implements a cache that will be useful later when I
29044 do error checking and the semantic analysis on the methods is
29046 (Constructor::GetCallingConvention): Renamed from CallingConvetion
29047 and made a method, optional argument tells whether this is a class
29048 or a structure to apply the `has-this' bit.
29049 (Method::GetCallingConvention): Implement, returns the calling
29051 (Method::Define): Defines the type, a second pass is performed
29052 later to populate the methods.
29054 (Constructor::ParameterTypes): implement a cache similar to the
29055 one on Method::ParameterTypes, useful later when we do semantic
29058 (TypeContainer::EmitMethod): New method. Emits methods.
29060 * expression.cs: Removed MethodGroup class from here.
29062 * parameter.cs (Parameters::GetCallingConvention): new method.
29064 2001-08-21 Miguel de Icaza <miguel@ximian.com>
29066 * class.cs (TypeContainer::Populate): Drop RootContext from the
29069 (Constructor::CallingConvention): Returns the calling convention.
29070 (Constructor::ParameterTypes): Returns the constructor parameter
29073 (TypeContainer::AddConstructor): Keep track of default constructor
29074 and the default static constructor.
29076 (Constructor::) Another class that starts using `public readonly'
29077 instead of properties.
29079 (Constructor::IsDefault): Whether this is a default constructor.
29081 (Field::) use readonly public fields instead of properties also.
29083 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
29084 track of static constructors; If none is used, turn on
29085 BeforeFieldInit in the TypeAttributes.
29087 * cs-parser.jay (opt_argument_list): now the return can be null
29088 for the cases where there are no arguments.
29090 (constructor_declarator): If there is no implicit `base' or
29091 `this', then invoke the default parent constructor.
29093 * modifiers.cs (MethodAttr): New static function maps a set of
29094 modifiers flags into a MethodAttributes enum
29095 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
29096 MethodAttr, TypeAttr to represent the various mappings where the
29097 modifiers are used.
29098 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
29100 2001-08-19 Miguel de Icaza <miguel@ximian.com>
29102 * parameter.cs (GetParameterInfo): Fix bug where there would be no
29105 * interface.cs (PopulateIndexer): Implemented the code generator
29106 for interface indexers.
29108 2001-08-17 Miguel de Icaza <miguel@ximian.com>
29110 * interface.cs (InterfaceMemberBase): Now we track the new status
29113 (PopulateProperty): Implement property population. Woohoo! Got
29114 Methods and Properties going today.
29116 Removed all the properties for interfaces, and replaced them with
29117 `public readonly' fields.
29119 2001-08-16 Miguel de Icaza <miguel@ximian.com>
29121 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
29122 initialize their hashtables/arraylists only when they are needed
29123 instead of doing this always.
29125 * parameter.cs: Handle refs and out parameters.
29127 * cs-parser.jay: Use an ArrayList to construct the arguments
29128 instead of the ParameterCollection, and then cast that to a
29131 * parameter.cs: Drop the use of ParameterCollection and use
29132 instead arrays of Parameters.
29134 (GetParameterInfo): Use the Type, not the Name when resolving
29137 2001-08-13 Miguel de Icaza <miguel@ximian.com>
29139 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
29140 and instead use public readonly fields.
29142 * class.cs: Put back walking code for type containers.
29144 2001-08-11 Miguel de Icaza <miguel@ximian.com>
29146 * class.cs (MakeConstant): Code to define constants.
29148 * rootcontext.cs (LookupType): New function. Used to locate types
29151 2001-08-08 Miguel de Icaza <miguel@ximian.com>
29153 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
29154 this System.Reflection code is. Kudos to Microsoft
29156 * typemanager.cs: Implement a type cache and avoid loading all
29157 types at boot time. Wrap in LookupType the internals. This made
29158 the compiler so much faster. Wow. I rule!
29160 * driver.cs: Make sure we always load mscorlib first (for
29161 debugging purposes, nothing really important).
29163 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
29164 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
29166 * rootcontext.cs: Lookup types on their namespace; Lookup types
29167 on namespaces that have been imported using the `using' keyword.
29169 * class.cs (TypeContainer::TypeAttr): Virtualize.
29170 (Class::TypeAttr): Return attributes suitable for this bad boy.
29171 (Struct::TypeAttr): ditto.
29172 Handle nested classes.
29173 (TypeContainer::) Remove all the type visiting code, it is now
29174 replaced with the rootcontext.cs code
29176 * rootcontext.cs (GetClassBases): Added support for structs.
29178 2001-08-06 Miguel de Icaza <miguel@ximian.com>
29180 * interface.cs, statement.cs, class.cs, parameter.cs,
29181 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
29182 Drop use of TypeRefs, and use strings instead.
29184 2001-08-04 Miguel de Icaza <miguel@ximian.com>
29188 * class.cs (Struct::Struct): set the SEALED flags after
29189 checking the modifiers.
29190 (TypeContainer::TypeAttr): new property, returns the
29191 TypeAttributes for a class.
29193 * cs-parser.jay (type_list): Oops, list production was creating a
29194 new list of base types.
29196 * rootcontext.cs (StdLib): New property.
29197 (GetInterfaceTypeByName): returns an interface by type name, and
29198 encapsulates error handling here.
29199 (GetInterfaces): simplified.
29200 (ResolveTree): Encapsulated all the tree resolution here.
29201 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
29204 * driver.cs: Add support for --nostdlib, to avoid loading the
29205 default assemblies.
29206 (Main): Do not put tree resolution here.
29208 * rootcontext.cs: Beginning of the class resolution.
29210 2001-08-03 Miguel de Icaza <miguel@ximian.com>
29212 * rootcontext.cs: Provide better error reporting.
29214 * cs-parser.jay (interface_base): set our $$ to be interfaces.
29216 * rootcontext.cs (CreateInterface): Handle the case where there
29217 are no parent interfaces.
29219 (CloseTypes): Routine to flush types at the end.
29220 (CreateInterface): Track types.
29221 (GetInterfaces): Returns an array of Types from the list of
29222 defined interfaces.
29224 * typemanager.c (AddUserType): Mechanism to track user types (puts
29225 the type on the global type hash, and allows us to close it at the
29228 2001-08-02 Miguel de Icaza <miguel@ximian.com>
29230 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
29231 RecordInterface instead.
29233 * cs-parser.jay: Updated to reflect changes above.
29235 * decl.cs (Definition): Keep track of the TypeBuilder type that
29236 represents this type here. Not sure we will use it in the long
29237 run, but wont hurt for now.
29239 * driver.cs: Smaller changes to accomodate the new code.
29241 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
29244 * rootcontext.cs (CreateInterface): New method, used to create
29245 the System.TypeBuilder type for interfaces.
29246 (ResolveInterfaces): new entry point to resolve the interface
29248 (CodeGen): Property, used to keep track of the code generator.
29250 2001-07-26 Miguel de Icaza <miguel@ximian.com>
29252 * cs-parser.jay: Add a second production for delegate_declaration
29255 (enum_body): Put an opt_comma here instead of putting it on
29256 enum_body or enum_member_declarations so we can handle trailing
29257 commas on enumeration members. Gets rid of a shift/reduce.
29259 (type_list): Need a COMMA in the middle.
29261 (indexer_declaration): Tell tokenizer to recognize get/set
29263 * Remove old targets.
29265 * Re-add the parser target.
29267 2001-07-13 Simon Cozens <simon@simon-cozens.org>
29269 * cs-parser.jay: Add precendence rules for a number of operators
29270 ot reduce the number of shift/reduce conflicts in the grammar.
29272 2001-07-17 Miguel de Icaza <miguel@ximian.com>
29274 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
29277 Get rid of old crufty code.
29279 * rootcontext.cs: Use this to keep track of the parsed
29280 representation and the defined types available to the program.
29282 * gen-treedump.cs: adjust for new convention.
29284 * type.cs: Split out the type manager, and the assembly builder
29287 * typemanager.cs: the type manager will live here now.
29289 * cil-codegen.cs: And the code generator here.
29291 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
29293 * makefile: Fixed up for easy making.
29295 2001-07-13 Simon Cozens <simon@simon-cozens.org>
29297 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
29300 (unary_expression): Expand pre_increment_expression and
29301 post_decrement_expression to reduce a shift/reduce.
29303 2001-07-11 Simon Cozens
29305 * cs-tokenizer.cs: Hex numbers should begin with a 0.
29307 Improve allow_keyword_as_indent name.
29309 2001-06-19 Miguel de Icaza <miguel@ximian.com>
29311 * Adjustments for Beta2.
29313 2001-06-13 Miguel de Icaza <miguel@ximian.com>
29315 * decl.cs: Added `Define' abstract method.
29316 (InTransit): new property, used to catch recursive definitions.
29318 * interface.cs: Implement `Define'.
29320 * modifiers.cs: Map Modifiers.constants to
29321 System.Reflection.TypeAttribute flags.
29323 * class.cs: Keep track of types and user-defined types.
29324 (BuilderInit): New method for creating an assembly
29325 (ResolveType): New function to launch the resolution process, only
29326 used by interfaces for now.
29328 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
29329 that are inserted into the name space.
29331 2001-06-08 Miguel de Icaza <miguel@ximian.com>
29333 * ARGH. I have screwed up my tree so many times due to the use of
29334 rsync rather than using CVS. Going to fix this at once.
29336 * driver.cs: Objetify driver. Load assemblies, use assemblies to
29339 2001-06-07 Miguel de Icaza <miguel@ximian.com>
29341 * Experiment successful: Use System.Type rather that our own
29344 2001-05-25 Miguel de Icaza <miguel@ximian.com>
29346 * cs-parser.jay: Removed nsAliases from here.
29348 Use new namespaces, handle `using XXX;'
29350 * namespace.cs: Reimplemented namespace handling, use a recursive
29351 definition of the class. Now we can keep track of using clauses
29352 and catch invalid using clauses.
29354 2001-05-24 Miguel de Icaza <miguel@ximian.com>
29356 * gen-treedump.cs: Adapted for all the renaming.
29358 * expression.cs (Expression): this class now has a Type property
29359 which returns an expression Type.
29361 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
29362 `Type', as this has a different meaning now in the base
29364 2001-05-22 Miguel de Icaza <miguel@ximian.com>
29366 * interface.cs, class.cs: Removed from all the sources the
29367 references to signature computation, as we can not do method
29368 signature computation during the parsing time, as we are not
29369 trying to solve at that point distinguishing:
29373 void a (NS.Blah x) {}
29376 Which depending on the context might be valid or not, as we do not
29377 know if Blah is the same thing as NS.Blah at that point.
29379 * Redid everything so the code uses TypeRefs now instead of
29380 Types. TypeRefs are just temporary type placeholders, that need
29381 to be resolved. They initially have a pointer to a string and the
29382 current scope in which they are used. This is used later by the
29383 compiler to resolve the reference to an actual Type.
29385 * DeclSpace is no longer a CIR.Type, and neither are
29386 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
29387 are all DeclSpaces, but no Types.
29389 * type.cs (TypeRefManager): This implements the TypeRef manager,
29390 which keeps track of all the types that need to be resolved after
29391 the parsing has finished.
29393 2001-05-13 Miguel de Icaza <miguel@ximian.com>
29395 * ARGH. We are going to have to store `foreach' as a class rather
29396 than resolving it, as we need to verify error 1579 after name
29397 resolution. *OR* we could keep a flag that says `This request to
29398 IEnumerator comes from a foreach statement' which we can then use
29399 to generate the error.
29401 2001-05-10 Miguel de Icaza <miguel@ximian.com>
29403 * class.cs (TypeContainer.AddMethod): we now add methods to the
29404 MethodGroup instead of the method hashtable.
29406 * expression.cs: Add MethodGroup abstraction, which gets us one
29407 step closer to the specification in the way we handle method
29410 * cs-parser.jay (primary_expression): qualified_identifier now
29411 tried to match up an identifier to a local variable reference or
29412 to a parameter reference.
29414 current_local_parameters is now a parser global variable that
29415 points to the current parameters for the block, used during name
29418 (property_declaration): Now creates an implicit `value' argument to
29421 2001-05-09 Miguel de Icaza <miguel@ximian.com>
29423 * parameter.cs: Do not use `param' arguments as part of the
29424 signature, per the spec.
29426 2001-05-08 Miguel de Icaza <miguel@ximian.com>
29428 * decl.cs: Base class for classes, structs and interfaces. This
29429 is the "Declaration Space"
29431 * cs-parser.jay: Use CheckDef for checking declaration errors
29432 instead of having one on each function.
29434 * class.cs: Factor out some code for handling error handling in
29435 accordance to the "Declarations" section in the "Basic Concepts"
29436 chapter in the ECMA C# spec.
29438 * interface.cs: Make all interface member classes derive from
29439 InterfaceMemberBase.
29441 2001-05-07 Miguel de Icaza <miguel@ximian.com>
29443 * Many things: all interfaces are parsed and generated in
29444 gen-treedump. Support for member variables, constructors,
29445 destructors, properties, constants is there.
29447 Beginning of the IL backend, but very little done, just there for
29450 2001-04-29 Miguel de Icaza <miguel@ximian.com>
29452 * cs-parser.jay: Fix labeled statement.
29454 * cs-tokenizer.cs (escape): Escape " and ' always.
29455 ref_line, ref_name: keep track of the line/filename as instructed
29456 by #line by the compiler.
29459 2001-04-27 Miguel de Icaza <miguel@ximian.com>
29461 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
29462 to match the values in System.CodeDOM.
29464 Divid renamed to Divide.
29466 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
29468 (Statements.set): remove.
29470 * System.CodeDOM/CodeCatchClause.cs: always have a valid
29473 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
29474 falseStatements always have valid values.
29476 * cs-parser.jay: Use System.CodeDOM now.