1 2008-06-19 Marek Safar <marek.safar@gmail.com>
3 A fix for bug #359611, #359604
4 * anonymous.cs: Mutate all types of hoisted parameters.
6 2008-06-19 Marek Safar <marek.safar@gmail.com>
8 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, linq.cs, class.cs
9 delegate.cs, iterators.cs, cs-parser.jay, assign.cs, anonymous.cs, driver.cs
10 expression.cs, codegen.cs, statement.cs
12 Fixes bugs: #318652, #323223, #234779, #325069, #325476, #332532, #334465,
13 #345907, #349190, #353276, #355256, #359617, #378542, #384584, #396530
15 ** Anonymous methods, lambda expressions rewrite **
17 Anonymous expressions are now resolved when an explicit block is resolved
18 and they don't require any registration procedure anymore. Further,
19 anonymous methods are defined when explicit block is emitted which allows
20 better control of whole process and opens possibilities for more
21 optimizations as well as alternative to reverse whole process.
23 A concept of `MutateHoistedGenericType' was introduced to keep the resolve
24 process consistent and to correctly emit hoisted generic methods when they
25 have at least 1 hoisted variable.
27 2008-06-17 Martin Baulig <martin@ximian.com>
29 * class.cs: Also emit the `[DebuggerHidden]' attribute on the main
31 (AbstractPropertyEventMethod.IsDebuggerHidden): New protected
32 virtual property; check it in Emit().
33 (PropertyMethod.IsDebuggerHidden): Override, check whether we're
35 (MethodOrOperator.ResolveMethods): Set `DEBUGGER_HIDDEN' if we're
37 (Indexer.Define): Likewise.
39 2008-06-17 Marek Safar <marek.safar@gmail.com>
41 * convert.cs: Don't use IsInterface on type arguments.
43 * delegate.cs: DelegateInvocation uses MethodInfo.
45 * parameter.cs: Removed IsTypeParameter.
47 * generic-mcs.cs: More missing stuff.
49 2008-06-16 Martin Baulig <martin@ximian.com>
52 (Modifiers.DEBUGGER_HIDDEN): New public const.
55 (TypeManager.GetDebuggerHiddenAttribute): New public static method.
58 (MethodOrOperator.Emit): Check `Modifiers.DEBUGGER_HIDDEN'.
59 (AbstractPropertyEventMethod): Likewise.
60 (Constructor.Emit): Likewise.
61 (SourceMethod.SetCompilerGenerated): Removed.
63 * iterator.cs: Set `Modifiers.DEBUGGER_HIDDEN' everywhere except
67 (RootScopeInfo.DoDefineMembers): Set `Modifiers.DEBUGGER_HIDDEN'
68 if we're an `IteratorHost'.
69 (AnonymousMethodMethod..ctor): Don't set
70 `Modifiers.COMPILER_GENERATED'; csc only sets this on the class,
73 2008-06-16 Marek Safar <marek.safar@gmail.com>
75 * statement.cs: Clean-up foreach statements.
77 2008-06-12 Marek Safar <marek.safar@gmail.com>
79 * class.cs: Stop using public method which should not exist.
81 2008-06-11 Martin Baulig <martin@ximian.com>
84 (Location.LookupFile): Add `CompilationUnit' argument; when given
85 a relative file name, make it relative to the directory the .cs
86 file is located in instead of using the current directory.
88 2008-06-11 Martin Baulig <martin@ximian.com>
91 (IMethodData.EmitExtraSymbolInfo): Added `SourceMethod' argument.
92 (MethodOrOperator.EmitExtraSymbolInfo): Likewise.
93 (SourceMethod.SetRealMethodName): Moved here from the symbol writer.
94 (SourceMethod.SetCompilerGenerated): Likewise.
96 2008-06-11 Marek Safar <marek.safar@gmail.com>
98 * codegen.cs, driver: Only write symbol file when it's asked for.
100 2008-06-11 Marek Safar <marek.safar@gmail.com>
102 * codegen.cs: Don't use assembly writer error handling for symbol writer.
104 2008-06-10 Martin Baulig <martin@ximian.com>
106 * symbolwriter.cs: Reflect latest MarkSequencePoint() API changes.
108 2008-06-09 Marek Safar <marek.safar@gmail.com>
110 A fix for bug #316290
111 * expression.cs: Include decimal operators in predefined table.
113 * parameters.cs: More readonlyness.
115 2008-06-09 Marek Safar <marek.safar@gmail.com>
117 A fix for bug #397213
118 * cs-parser.jay: One more missing current_local_parameters reset.
120 2008-06-09 Marek Safar <marek.safar@gmail.com>
122 A fix for bug #396633
123 * class.cs: Host backing field in partial container.
125 2008-06-09 Marek Safar <marek.safar@gmail.com>
127 A fix for bug #397068
128 * expression.cs: Check both operand types when predefined operator is used.
130 2008-06-05 Martin Baulig <martin@ximian.com>
132 Merged the `debugger-kahalo' branch.
135 (MethodData.Emit): Call SymbolWriter.SetCompilerGenerated() if
136 we're an iterator method.
137 (SourceMethod): Reflect latest symbol writer changes;
138 SymbolWriter.OpenMethod() now takes a `ICompileUnit' argument and
139 now `start_row' and `end_row'.
140 (Constructor.Emit): Fix the logic whether to emit symbol information.
142 * iterator.cs: Call SymbolWriter.SetCompilerGenerated() on all the
146 (CompilationUnit): New public class; derives from `SourceFile'.
147 (SourceFileEntry.DefineSymbolInfo): New public method.
148 (SourceFileEntry.SetChecksum): New public method.
149 (Location): Encode hidden line numbers by using `column == 255';
150 the .ctor now accepts `column == -1' to mark a hidden line number.
151 (Location.Hidden): New public property.
152 (Location.CheckPoint): Add `CompilationUnit'.
153 (Location.SourceFiles): Change return type to `CompilationUnit[]'.
154 (Location.Push): Add `CompilationUnit compile_unit' argument.
155 (Location.CompilationUnit): New public property.
158 (ToplevelBlock.Emit): Add `ec.Mark (EndLocation)'.
160 * cs-parser.jay: `SourceFile' -> `CompilationUnit'.
162 * driver.cs: `SourceFile' -> `CompilationUnit'.
164 * cs-tokenizer.cs: `SourceFile' -> `CompilationUnit'.
166 * namespace.cs: `SourceFile' -> `CompilationUnit'.
168 * cs-tokenizer.cs: Add support for `#pragma checksum' and
172 (SymbolWriter.MarkSequencePoint): Take a `Location' and use the
173 new symbol writer API to also pass the file.
175 2008-06-05 Marek Safar <marek.safar@gmail.com>
177 * statement.cs: Emit catch variable assignment using variable expression.
179 2008-06-05 Marek Safar <marek.safar@gmail.com>
181 * ecore.cs, expression.cs, statement.cs: Make TemporaryVariable compatible
182 with other variable types.
184 2008-06-04 Marek Safar <marek.safar@gmail.com>
186 * ecore.cs, expression.cs, statement.cs, typemanager.cs: Removed custom
187 GetLength method emit, it breaks resolve rules.
189 2008-06-02 Atsushi Enomoto <atsushi@ximian.com>
190 Marek Safar <marek.safar@gmail.com>
192 A fix for bug #395542
193 * cs-parser.jay: The trailing comma is allowed in anonymous type member
196 2008-06-02 Marek Safar <marek.safar@gmail.com>
198 A fix for bug #395287
199 * class.cs, modifiers.cs: Automatic properties method base modifiers checks.
201 2008-05-31 Marek Safar <marek.safar@gmail.com>
203 A fix for bug #395845
204 * class.cs, nullable.cs: User unary operator is allowed to have nullable and
205 non-nullable parameter type.
207 2008-05-31 Marek Safar <marek.safar@gmail.com>
209 * class.cs: Handle contructor initializer as a statement in top-level block.
211 2008-05-30 Marek Safar <marek.safar@gmail.com>
213 * attribute.cs: Don't mix old and new corlib types when emitting corlib
216 2008-05-24 Marek Safar <marek.safar@gmail.com>
218 * ecore.cs, expression.cs: Small IVariable refactoring.
220 2008-05-22 Marek Safar <marek.safar@gmail.com>
222 * assign.cs (LocalTemporary): Implemented CreateExpressionTree.
224 2008-05-21 Marek Safar <marek.safar@gmail.com>
226 * cs-parser.jay: Removed redundant catch type check.
228 2008-05-21 Marek Safar <marek.safar@gmail.com>
230 A fix for bug #390372
231 * nullable.cs: Set correct return type.
233 2008-05-21 Marek Safar <marek.safar@gmail.com>
235 A fix for bug #391062
236 * typemanager.cs: Fixed crash when comparing null types.
238 2008-05-21 Marek Safar <marek.safar@gmail.com>
240 A fix for bug #391871
241 * cs-parser.jay: Better error handling for invalid catch type.
243 2008-05-20 Marek Safar <marek.safar@gmail.com>
245 A fix for bug #392155
246 * cs-tokenizer.cs: Fixed casting of byte and decimal expression.
248 2008-05-15 Marek Safar <marek.safar@gmail.com>
250 A fix for bug #390666
251 * ecore.cs (BetterExpressionConversion): Unwrap each Expression<T>
254 2008-05-15 Marek Safar <marek.safar@gmail.com>
256 * class.cs, expression.cs, statement.cs: Removed a hack, setting block flag
259 2008-05-13 Marek Safar <marek.safar@gmail.com>
261 A fix for bug #389625
262 * delegate.cs, generic.cs: Some progress on method group return type
265 2008-05-13 Marek Safar <marek.safar@gmail.com>
267 A fix for bug #378419
268 * namespace.cs: Inspect also parent namespaces not only namespace entries.
270 2008-05-12 Marek Safar <marek.safar@gmail.com>
272 * class.cs (Constructor): Added IsCompilerGenerated.
274 2008-05-12 Marek Safar <marek.safar@gmail.com>
276 * expression.cs: Enum binary operators can accept non-enum operand only when
277 is implicitly convertible to underlying type.
279 2008-05-12 Marek Safar <marek.safar@gmail.com>
281 A fix for bug #389272
282 * support.cs: Workaround System.InvalidOperationException for enums.
284 2008-05-12 Marek Safar <marek.safar@gmail.com>
286 A fix for bug #389073
287 * convert.cs: More undocumented explicit IntPtr/UIntPtr conversions.
289 2008-05-10 Marek Safar <marek.safar@gmail.com>
291 * driver.cs: Split Parse.
293 * location.cs (LookupFile): Uses string.Empty.
295 2008-05-07 Marek Safar <marek.safar@gmail.com>
297 * expression.cs, parameter.cs: Small ParameterReference clean up.
299 2008-05-07 Marek Safar <marek.safar@gmail.com>
301 * anonymous.cs, codegen.cs, convert.cs, ecore.cs: Removed uber ugly TempEc
304 2008-05-06 Martin Baulig <martin@ximian.com>
306 * class.cs (Constructor.Emit): Fix the logic whether to emit
309 2008-05-06 Raja R Harinath <harinath@hurrynot.org>
312 * iterators.cs (Iterator.CurrentBlock.DoEmit): Don't emit
313 InvalidOperationException when the iterator is before the start or
316 2008-05-06 Marek Safar <marek.safar@gmail.com>
318 * nullable.cs (NullCoalescingOperator): Result is underlying type of left,
319 when left is nullable type.
321 2008-05-06 Marek Safar <marek.safar@gmail.com>
323 A fix for bug #386628
324 * expression.cs (LocalVariableReference): Continue in resolving when
325 variable is not assigned.
327 2008-05-05 Marek Safar <marek.safar@gmail.com>
329 * nullable.cs, statement.cs (Unwrap): Store non-variable expression in all
332 2008-05-04 Marek Safar <marek.safar@gmail.com>
334 * nullable.cs, statement.cs (Unwrap): Don't duplicate variable expressions,
335 it saves many redundant temporary variables for nullable operations.
337 2008-05-03 Marek Safar <marek.safar@gmail.com>
339 * assign.cs: EventAddOrRemove is a statement and cannot have a type.
341 * cfold.cs, constant.cs, expression.cs: Share Error_OperatorCannotBeApplied
344 * nullable.cs: Constant coalescing operator optimizations.
346 2008-05-03 Marek Safar <marek.safar@gmail.com>
348 * constant.cs: Use unsigned conversion for values which are unsigned only.
350 2008-05-03 Marek Safar <marek.safar@gmail.com>
352 * convert.cs, literal.cs, nullabel.cs, typemanager.cs: Implemeted null
353 coalescing operator as it should be.
355 2008-05-02 Marek Safar <marek.safar@gmail.com>
357 A fix for bug #371016
358 * expression.cs: All predefined delegate operators require implicit method
361 2008-05-02 Marek Safar <marek.safar@gmail.com>
363 * constant.cs: Emit long constant as uint when fits the range.
365 * convert.cs, expression.cs: Fixed few unsafe conversions.
367 2008-05-02 Marek Safar <marek.safar@gmail.com>
369 * convert.cs, literal.cs: Don't wrap implicit reference conversion to object
371 2008-05-02 Raja R Harinath <harinath@hurrynot.org>
374 * convert.cs (ImplicitNumericConversion): Don't modify the type of
376 * ecore.cs (EmptyCast.Create): Flatten nested EmptyCasts.
378 2008-05-01 Marek Safar <marek.safar@gmail.com>
380 * constant.cs, literal.cs: IsLiteral property for error reporting.
382 * ecore.cs, expression.cs: Implemented Property expression.
384 2008-05-01 Marek Safar <marek.safar@gmail.com>
386 * class.cs, modifiers.cs, flowanalysis.cs: New BACKING_FIELD flag.
388 * nullable.cs: Implemented nullable coalescing null operator.
390 * ecore.cs, expression.cs: Expression trees work.
392 2008-05-01 Marek Safar <marek.safar@gmail.com>
394 * ecore.cs: CreateExpressionTree is finally abstract.
396 * expression.cs, linq.cs: Updated.
398 2008-05-01 Marek Safar <marek.safar@gmail.com>
400 * expression.cs, ecore.cs: Block base access expression inside expression
403 2008-05-01 Marek Safar <marek.safar@gmail.com>
405 A fix for bug #385058
406 * expression.cs: User-defined operator implementations always take
407 precedence over predefined operator implementations.
409 2008-04-30 Marek Safar <marek.safar@gmail.com>
411 * assign.cs, anonymous.cs, lambda.cs, nullable.cs, ecore.cs, linq.cs,
412 class.cs, iterators.cs, expression.cs, attribute.cs: Filled a few more
413 expression tree conversions.
415 2008-04-30 Marek Safar <marek.safar@gmail.com>
417 * typemanager.cs, ecore.cs, class.cs, expression.cs, doc.cs: Merged all
418 operators method details to Operator class.
420 2008-04-30 Marek Safar <marek.safar@gmail.com>
422 * anonymous.cs: Pass unsafe flags to anonymous container.
424 * ecore.cs, expression.cs, statement.cs: Block unsafe pointer operations
425 inside expression tree.
427 2008-04-29 Martin Baulig <martin@ximian.com>
429 * cs-tokenizer.cs (Tokenizer.Position): Added `line'.
430 (Tokenizer.PopPosition): Also restore the `line'.
432 2008-04-29 Marek Safar <marek.safar@gmail.com>
434 * delegate.cs: Implemented Invoke expression.
436 2008-04-29 Marek Safar <marek.safar@gmail.com>
438 * expression.cs: Fixed equality reference comparison regression.
440 2008-04-29 Marek Safar <marek.safar@gmail.com>
442 * ecore.cs: Clean up EmptyCast hack.
444 * expression.cs, nullable.cs: Implemented enum binary and unary operations
445 using correct conversion rules. Also fixes #383993.
447 2008-04-28 Martin Baulig <martin@ximian.com>
449 * class.cs (Constructor.Emit): Don't emit debugging information
450 for generated default .ctor's.
452 2008-04-28 Marek Safar <marek.safar@gmail.com>
454 * convert.cs: Empty-cast ushort to int conversion.
456 2008-04-28 Marek Safar <marek.safar@gmail.com>
458 A fix for bug #384191
459 * ecore.cs, expression.cs: Fixed expression cloning.
461 2008-04-28 Marek Safar <marek.safar@gmail.com>
463 * ecore.cs, delegate.cs, assign.cs: Few tweaks for recent changes.
465 2008-04-28 Raja R Harinath <harinath@hurrynot.org>
467 Fix #381559, test-638.cs, test-639.cs
468 * assign.cs (CompoundAssign.Helper): New wrapper.
469 (CompoundAssign.DoResolve): Use it to wrap the nested 'target'
471 * ecore.cs (MethodGroupExpr.VerifyArgumentsCompat) <params arguments>:
472 Pass unconverted expressions to the params array creation expression.
473 (FieldExpr.EmitAssign): Don't special-case StringConcat.
474 (PropertyExpr.EmitAssign): Likewise.
475 * expression.cs (ArrayCreation.ResolveArrayElement): Keep track of the
476 element if it is of kind CompoundAssign.Helper.
477 (ArrayCreation.Emit): If we saw a CompoundAssign.Helper, emit it
478 first before anything else.
479 (ArrayAccess.EmitAssign): Don't special-case StringConcat.
480 (ArrayAccess.LoadArrayAndArguments): Simplify.
482 2008-04-27 Marek Safar <marek.safar@gmail.com>
484 * expression.cs: Fixed cloning of typeof(void).
486 2008-04-27 Raja R Harinath <harinath@hurrynot.org>
488 * assign.cs (Assign.DoResolve): Remove support for EventExprs.
489 (Assign.Emit): Likewise. Move it to ...
490 (CompoundAssign.DoResolve): ... here and ...
491 (CompoundAssign.Emit): ... here.
492 (EventAddOrRemove): New helper to handle += and -= on events, and
493 avoid the use of BinaryDelegates.
494 * ecore.cs (EventExpr.DoResolveLValue): Emit CS0070 unconditionally.
495 (EventExpr.EmitAddOrRemove): Improve.
496 * delegate.cs (DelegateInvocation.DoResolve): Simplify slightly.
498 * cs-parser.jay (type) <namespace_or_type_name variant>: Don't
499 create VarExprs for 'foo.bar.var'.
500 * ecore.cs (VarExpr.InferType): Rename from DoResolveLValue, which
501 is a highly inappropriate name for its functionality.
503 2008-04-26 Raja R Harinath <harinath@hurrynot.org>
505 Simplify handling of multiple assignments
506 * assign.cs (Assign): Clear out all 'embedded assign' gunk. Make
508 (SimpleAssign): New. Class to be used for normal assignments.
509 * anonymous.cs, class.cs, cs-parser.jay: Update to changes.
510 * expression.cs, parameter.cs, statement.cs: Likewise.
512 2008-04-25 Marek Safar <marek.safar@gmail.com>
514 * ecore.cs, expression.cs, nullable.cs: Implemeted enum binary add operation
515 for incompatible underlying types, more to come, uff.
517 2008-04-26 Raja R Harinath <harinath@hurrynot.org>
520 * expression.cs (VariableReference.EmitAssign) <source is NewInstance>:
523 2008-04-25 Marek Safar <marek.safar@gmail.com>
525 * expression.cs, nullable.cs: Implemented UnaryPlus expression.
527 2008-04-24 Raja R Harinath <harinath@hurrynot.org>
529 Fix test-636.cs. Sprinkle a few more 'EmitSideEffect's around
530 * expression.cs (Unary.TryReduceConstant): Unwrap SideEffectConstant.
531 * statement.cs (While, Do, For): Allow test to have side effects.
532 (For.DoEmit): Always emit InitStatement.
535 * expression.cs (Binary.DoResolve) <BitwiseAnd with zero constant>:
536 Always create SideEffectConstant.
537 (Binary.EnumLiftUp): Don't assume that the enumeration constant is
538 of type EnumConstant.
540 * expression.cs (Binary.EmitBranchable) <Equality with constant>:
541 Handle 'right' being SideEffectConstant of type 'bool'.
543 * expression.cs (Binary.EmitBranchable) <Equality with constant>:
544 Use left.EmitBranchable instead of open coding it, so as to
545 improve optimization opportunities.
547 * constant.cs (SideEffectConstant.EmitSideEffect): Simplify slightly.
549 * ecore.cs (Expression.EmitBranchable): Document some non-obvious
551 (Expression.EmitSideEffect): Document.
553 2008-04-23 Marek Safar <marek.safar@gmail.com>
555 * expression.cs: Implemented NewArrayBounds, TypeIs, and TypeAs expressions.
557 2008-04-23 Marek Safar <marek.safar@gmail.com>
559 * constant.cs, statement.cs: Use EmitSideEffect for constant if statement.
561 2008-04-23 Marek Safar <marek.safar@gmail.com>
563 * ecore.cs, expression.cs, delegate.cs: Implemeted delegate instantiation
564 conversion to expression tree.
566 2008-04-23 Marek Safar <marek.safar@gmail.com>
568 * ecore.cs: Removed unused expression.
570 2008-04-22 Marek Safar <marek.safar@gmail.com>
572 * expression.cs: Implemented NegateChecked and New expressions.
574 2008-04-22 Marek Safar <marek.safar@gmail.com>
576 * convert.cs, nullable.cs, expression.cs: Implemented Negate expression.
578 2008-04-22 Raja R Harinath <harinath@hurrynot.org>
581 * anonymous.cs (AnonymousMethodExpression.DoResolve): Mark as
582 needing final 'ret' instruction.
584 2008-04-22 Marek Safar <marek.safar@gmail.com>
586 * expression.cs: Disabled lifted binary conversion on ISO-1 profiles.
588 2008-04-21 Marek Safar <marek.safar@gmail.com>
590 * expression.cs: Emit ldnull and not null expression as an instance argument
591 of static method expression calls.
593 2008-04-21 Marek Safar <marek.safar@gmail.com>
595 A fix for bug #378200
596 * expression.cs: Fixed crash when creating parameterless expression tree
599 2008-04-21 Marek Safar <marek.safar@gmail.com>
601 A fix for bug #375297
602 * anonymous.cs: Fixed crash when inferring from null argument anonymous
605 2008-04-21 Marek Safar <marek.safar@gmail.com>
607 A fix for bug #377596
608 * decl.cs, class.cs: Emit delegate type argument attributes.
610 2008-04-21 Marek Safar <marek.safar@gmail.com>
612 A fix for bug #365314
613 * generic.cs, ecore.cs: Type parameter declaration cannot be of generic type
615 2008-04-21 Marek Safar <marek.safar@gmail.com>
617 * cs-parser.jay, expression.cs: ComposedCast can work with type expressions
620 2008-04-21 Marek Safar <marek.safar@gmail.com>
622 * generic.cs (TypeParameter): Removed redundant location.
624 2008-04-19 Marek Safar <marek.safar@gmail.com>
626 * generic.cs, parameter.cs, namespace.cs, ecore.cs, class.cs, decl.cs,
627 delegate.cs, iterators.cs, cs-parser.jay, const.cs, enum.cs: Use
628 FullNamedExpression in all declaration type expression, statements will come
631 2008-04-18 Marek Safar <marek.safar@gmail.com>
633 * generic.cs, namespace.cs, ecore.cs, class.cs, decl.cs, generic-mcs.cs,
634 nullable.cs, expression.cs, enum.cs, doc.cs: Cleaning up type expressions.
636 2008-04-18 Marek Safar <marek.safar@gmail.com>
638 * parameter.cs, delegate.cs, cs-parser.jay, expression.cs: Removed unused
641 2008-04-17 Marek Safar <marek.safar@gmail.com>
643 * decl.cs, class.cs, generic.cs: Verify partial parts type parameters and
646 2008-04-17 Marek Safar <marek.safar@gmail.com>
648 * decl.cs, class.cs, cs-parser.jay, ecore.cs, expression.cs: Unify all type
652 2008-04-17 Raja R Harinath <harinath@hurrynot.org>
654 Hook up 'EmitSideEffect'
655 * constant.cs (Constant.EmitSideEffect): New.
656 (SideEffectConstant.Emit): Simplify. Use EmitSideEffect.
657 (SideEffectConstant.EmitSideEffect): New.
658 * ecore.cs (BoxedCast.EmitBranchable): Remove. We can't use an
659 unconditional branch in EmitBranchable.
660 (FieldExpr.EmitBranchable): New.
661 * expression.cs (Unary.EmitSideEffect): New.
662 (Binary.EmitSideEffect): New.
663 (VariableReference.EmitSideEffect): New. Do nothing.
665 2008-04-16 Raja R Harinath <harinath@hurrynot.org>
667 Introduce 'EmitSideEffect'
668 * ecore.cs (Expression.EmitSideEffect): New.
669 (TypeCast): Rename from EmptyCast.
671 (EmptyCast.EmitBranchable, EmptyCast.EmitSideEffect): Implement.
672 (BoxedCast.EmitBranchable, BoxedCast.EmitSideEffect): Implement.
673 * convert.cs, nullable.cs: Update to changes.
675 2008-04-16 Marek Safar <marek.safar@gmail.com>
677 * class.cs, cs-parser.jay: Early check for base types expression.
679 2008-04-16 Marek Safar <marek.safar@gmail.com>
681 * decl.cs (MemberName): Declare PrettyName as obsolete.
683 2008-04-16 Marek Safar <marek.safar@gmail.com>
685 * namespace.cs: Use MemberName comparison.
687 2008-04-16 Raja R Harinath <harinath@hurrynot.org>
690 * decl.cs (MemberName.PrettyName): New. Replaces the misnamed
692 (MemberName.MethodName, MemberName.GetSignatureForError): Improve.
693 (MemberName.FullyQualifiedName): New. Provides the functionality
694 that users assume FullName would have.
695 * ecore.cs, namespace.cs: Update to changes.
697 * statement.cs (Using.assign): Make into ExpressionStatement.
698 (Using.EmitPreTryBody): Simplify.
700 2008-04-16 Marek Safar <marek.safar@gmail.com>
702 * report.cs: ColorFormat is protected.
704 * rootcontext.cs: Unused fields clean-up.
706 * namespace.cs: Made UsingEntry name private.
708 2008-04-16 Marek Safar <marek.safar@gmail.com>
710 * cs-tokenizer.cs, location.cs: Removed unused field.
712 2008-04-16 Jan Oravec <jan.oravec@6com.sk>
713 Raja R Harinath <harinath@hurrynot.org>
716 * constant.cs (SideEffectConstant.value): Rename from 'left'.
717 (SideEffectConstant.side_effect): Rename from 'right'.
718 (SideEffectConstant..ctor): Normalize 'side_effect'.
719 (SideEffectConstant.Emit): Emit 'value', not 'side_effect' as the
720 value of this constant.
721 * cfold.cs: Update to changes.
723 2008-04-15 Marek Safar <marek.safar@gmail.com>
725 * cs-paser.jay: Removed unused variable.
727 * driver.cs: Made Compile instance method.
729 2008-04-15 Raja R Harinath <harinath@hurrynot.org>
731 * flowanalysis.cs (FlowBranching.MergeChild): Simplify.
733 2008-04-15 Marek Safar <marek.safar@gmail.com>
735 * cs-paser.jay, namespace.cs: Simplified handling of namespace imports.
737 2008-04-13 Jb Evain <jbevain@novell.com>
739 * namespace.cs: update the System.Core fullname for 2.1
740 * driver.cs: update the list of required assemblies for 2.1.
741 Merged from the Moonlight 2 branch.
743 2008-04-11 Marek Safar <marek.safar@gmail.com>
745 * assign.cs, ecore.cs, expression.cs, nullable.cs: More work on nullable
746 types and user defined operators. User operators arguments has to be checked
747 for null value before invocation, which also means no operator is called
748 when any argument is not convertible to unwrapped nullable type.
750 2008-04-09 Marek Safar <marek.safar@gmail.com>
752 * convert.cs, ecore.cs, expression.cs, nullable.cs: Initial refactoring
753 of Unary expressions to follow operator overloading rules precisely.
754 Also fixes #321794, #323794
756 2008-04-08 Marek Safar <marek.safar@gmail.com>
758 * cs-parser.jay, expression.cs: Don't wrap Indirection expression in Unary
761 2008-04-08 Marek Safar <marek.safar@gmail.com>
763 * expression.cs, ecore.cs: Implemented MemberInit expression.
765 2008-04-08 Raja R Harinath <harinath@hurrynot.org>
767 Fix mono/tests/exception4.cs
768 * statement.cs (ExceptionStatement, TryCatch): Revert to using
769 ec.NeedReturnLabel () rather emitting a 'nop'.
771 * statement.cs (ExceptionStatement.SomeCodeFollows): A hook for a
773 (TryCatch.SomeCodeFollows): Likewise.
774 * flowanalysis.cs (FlowBranchingException): Call 'SomeCodeFollows'
775 for 'break', 'continue' and 'return' statements inside a try.
776 We're fairly sure that the generated IL stream will have more
777 instructions textually following the try.
778 (FlowBranchingTryCatch): Likewise.
780 * statement.cs (Throw.Resolve): Move CS0156 and CS0724 testing ...
781 * flowanalysis.cs (FlowBranching.CheckRethrow): ... here and to its
784 * statement.cs (CollectionForeach.DisposableWrapper): Make a true
785 wrapper -- forward everything to CollectionForeach.
786 (CollectionForeach.NonDisposableWrapper): New.
787 (CollectionForeach.EmitFinallyBody): Use 'endfinally' instruction
788 instead of a pop + branch to end.
790 2008-04-07 Marek Safar <marek.safar@gmail.com>
792 A fix for bug #377485
793 * assign.cs, expression.cs, decl.cs, class.cs, ecore.cs, namespace.cs:
794 Propagate location for extension method groups. Report conversion failure at
797 2008-04-07 Marek Safar <marek.safar@gmail.com>
799 * anonymous.cs, expression.cs, ecore.cs, typemanager.cs: Implemented
800 ListInit and Field expressions.
802 2008-04-06 Raja R Harinath <harinath@hurrynot.org>
804 * iterators.cs (Iterator.EmitMoveNext): Remove try/fault wrapper.
805 Since $PC is always -1 inside the body of MoveNext, the fault
807 * flowanalysis.cs (FlowBranchingException.EmitFinally): Kill.
808 * statement.cs (ExceptionStatement.emit_finally): Likewise.
809 (ExceptionStatement.ResolveFinally): Drop 'branching' argument.
811 The denouement! Fix #324708
812 * iterators.cs (Iterator.EmitMoveNext): Reset $PC to -1 on entry.
813 (Iterator.EmitYieldBreak): We no longer need to reset $PC.
814 * statement.cs (ExceptionStatement.DoEmit): Actually emit the
815 'finally' inside the finally clause.
817 * statement.cs (ExceptionStatement.DoEmit): Emit try/finally block
818 inside an iterator. Don't emit the body of the 'finally' inside
819 the finally clause yet.
821 Use the ResumableStatement infrastructure for MoveNext ()
822 * iterators.cs (Iterator.EmitMoveNext_NoResumePoints): New.
823 (Iterator.EmitMoveNext): Use 'resume_points'. Get rid of
824 'old_resume_points'. Move dispatcher upfront.
825 (Iterator.MarkYield): Mark the 'resume_point' of a Yield.
826 * statement.cs (ExceptionStatement.DoEmit): Emit a dispatcher if
827 in an enumerator. This encodes the main fix in this patch series
828 -- we can only jump into the first instruction of a try from the
829 outside, but we want to emit try/finally regions in iterators and
830 resume in the middle of them.
832 2008-04-05 Raja R Harinath <harinath@hurrynot.org>
834 * statement.cs (ExceptionStatement.ResolveFinally): Move setting
835 of NeedReturnLabel here.
837 Introduce a common point for emitting try/finally to IL
838 * statement.cs (ExceptionStatement.DoEmit): New. Combines all the
839 features of the various subclasses, which are now driven by ...
840 (ExceptionStatement.EmitPreTryBody): ... this and ...
841 (ExceptionStatement.EmitTryBody): ... this and the original
843 (TryFinally, Lock, Using, UsingTemporary, DisposableWrapper):
844 Remove DoEmit and update to follow above protocol.
846 * statement.cs (ExceptionStatement.EmitForDispose): If all labels
847 of the dispatcher are the same, skip emitting the 'switch'.
848 * iterator.cs (Iterator.EmitDispose): Update to changes.
850 Clean up handling of 'using' statement
851 * statement.cs (UsingTemporary): New. Carved out of ...
852 (Using): ... this. Simplify drastically. Handle exactly
854 * cs-parser.jay (using_statement): Split. Create UsingTemporary
855 or Using as appropriate. If there are multiple variable declared,
856 create nested Using statements.
857 (resource_acquisition): Kill.
859 * statement.cs (ExceptionStatement.EmitForDispose): Use
860 EmitFinallyBody, not EmitFinally.
862 * flowanalysis.cs (FlowBranching.StealFinallyClauses): Remove.
863 * iterator.cs: Update to changes.
865 Start using the ResumableStatement infrastructure
866 * statement.cs (ResumeableStatement.PrepareForDispose): New.
867 (ResumableStatement.EmitForDispose): New.
868 (ExceptionStatement): Override them.
869 * iterators.cs (Iterator.EmitDispose): Use PrepareForDispose and
870 EmitForDispose to create the body of the Dispose method. Don't
873 * iterator.cs (Iterator.AddResumePoint): Move here from ...
874 * statement.cs (Toplevel.AddResumePoint): ... here.
875 (Toplevel.MoveNextStatement.Resolve): Create FlowBranchingIterator.
876 * flowanalysis.cs (FlowBranchingIterator): New.
877 * codegen.cs (EmitContext): Update to changes.
879 * iterators.cs (Iterator.OldResumePoint): Rename from ResumePoint.
880 (Iterator.old_resume_points): Rename from 'resume_points'.
881 (Iterator.MoveNextStatement): Remove unused class.
883 New infrastructure for try/finally in iterators (still unused)
884 * flowanalysis.cs (FlowBranching.AddResumePoint): New.
885 (FlowBranchingToplevel.AddResumePoint): Hook into
886 ToplevelBlock.AddResumePoint.
887 (FlowBranchingTryCatch): Move CS01626 and CS01631 checks here.
888 (FlowBranchingException): Hook into ExceptionBlock.AddResumePoint.
889 * statement.cs (ToplevelBlock.AddResumePoint): New. Collect
890 resume points and assign program-counter values.
891 (ExceptionBlock.AddResumePoint): Collect resume points for
892 de-muxer at the top of try block.
893 * iterators.cs (Yield.CheckContext): Simplify.
894 (Yield.Resolve): Use FlowBranching.AddResumePoint.
896 2008-04-04 Raja R Harinath <harinath@hurrynot.org>
898 * flowanalysis.cs (FlowBranching.AddReturnOrigin): Change Location
899 argument to an ExitStatement.
900 (FlowBranchingException): Refactor saved origins code.
901 * statement.cs (ExitStatement): Update to cahges.
902 * iterator.cs (YieldBreak): Likewise.
904 * statement.cs (ResumableStatement): New. Common base class for
905 YieldReturn and ExceptionStatement.
906 (ExitStatement): New. Common base class for Return and YieldBreak.
907 (Return): Update to changes.
908 * iterator.cs (YieldBreak): Likewise.
909 * lambda.cs (ContextualReturn): Likewise.
912 * ecore.cs (Expression.ResolveAsTypeStep): If '!silent' attempt to
913 emit a meaningful error message.
916 * flowanalysis.cs (VariableInfo.IsEverAssigned): New.
917 (VariableInfo.SetAssigned): Set it.
918 * statement.cs (Block.UsageWarning): Use 'IsEverAssigned' to
919 determine if CS0219 or CS0168 is appropriate. Don't use
920 flow-analysis information.
921 (Block.Resolve): Use ec.EndFlowBranching, not ec.DoEndFlowBranching.
922 * codegen.cs (EmitContext.DoEndFlowBranching): Kill. Inline into ...
923 (EmitContext.EndFlowBranching): ... this.
925 2008-04-03 Marek Safar <marek.safar@gmail.com>
927 * class.cs, typemanager.cs: Emit volatile field with IsVolatile modifier.
929 2008-04-03 Marek Safar <marek.safar@gmail.com>
931 A fix for bug #376508
932 * convert.cs, expression.cs: Fixed difference between ImplicitConversion and
933 ImplicitConversionExists.
935 2008-04-03 Marek Safar <marek.safar@gmail.com>
937 * expression.cs (Binary): Added remaining binary operators to expression
940 * nullable.cs: Optimize shift with null argument.
942 2008-04-03 Raja R Harinath <harinath@hurrynot.org>
944 Fix minor IL regression
945 * statement.cs (TryCatch..ctor): Add 'inside_try_finally' argument.
946 (TryCatch.DoEmit): Use it to avoid creating another ExceptionBlock.
947 * cs-parser.jay (try_statement): Update to changes.
949 * statement.cs (TryFinally.need_exc_block): Delete.
950 (TryFinally): Update to changes.
952 Now all ExceptionStatements are unconditional
953 * statement.cs (CollectionForeach.DisposableWrapper): New.
954 Extract out the try/finally code into a new wrapper.
955 (CollectionForeach.Resolve): Use it to simplify the code.
957 2008-04-02 Raja R Harinath <harinath@hurrynot.org>
959 Start at simplifying ExceptionStatement semantics a bit
960 * statement.cs (TryCatch, TryFinally): Split 'Try' into two pieces.
961 * cs-parser.jay (try_statement): Update to changes.
962 (opt_catch_clauses): Remove.
963 * flowanalysis.cs: Update to changes.
964 (FlowBranching.BranchingType.TryCatch): New.
965 (FlowBranchingTryCatch): New.
967 * flowanalysis.cs (FlowBranching.BranchingType.SwitchSection): Kill.
968 (FlowBranching.CreateBranching): Update to changes.
969 (FlowBranchingBlock.AddSibling): Add sanity check.
970 * codegen.cs (EmitContext.StartFlowBranching) <Block variant>:
973 * iterators.cs (Iterator.MarkFinally): Remove.
974 * statement.cs (ExceptionStatement): Update to changes.
976 Add support for skipping over finally blocks at runtime. First
977 in a series to fix #324708
978 * iterators.cs (Iterator.SkipFinally): New LocalBuilder.
979 (Iterator.EmitMoveNext): Initialize it.
980 * statement.cs (ExceptionStatement.EmitFinally): Use it to emit a
981 branch over the body of the 'finally' clause.
983 2008-03-31 Raja R Harinath <harinath@hurrynot.org>
985 Avoid lopsided use of Foo/DoFoo names
986 * statement.cs (ExpressionStatement.EmitFinallyBody):
987 Rename from EmitFinally.
988 (ExpressionStatement.EmitFinally): Rename from DoEmitFinally.
989 * iterator.cs: Update to changes.
991 2008-04-02 Marek Safar <marek.safar@gmail.com>
993 * ecore.cs, expression.cs, nullable.cs: ConditionalLogicalOperator is now
994 based on UserOperatorCall. More binary nullable operators clean up.
996 2008-04-02 Martin Baulig <martin@ximian.com>
998 * symbolwriter.cs: Remove the `#if !DISABLE_TERRANIA_CHANGES' conditionals.
1000 2008-04-02 Marek Safar <marek.safar@gmail.com>
1002 * nullable.cs: Merge user and empty conversions when lifting expression
1005 * expression.cs (StringConcat): Implemented expression tree representation.
1007 2008-04-01 Marek Safar <marek.safar@gmail.com>
1009 * nullable.cs: When lifting null literal and a user operator exists, no call
1012 2008-04-01 Marek Safar <marek.safar@gmail.com>
1014 * nullable.cs, ecore.cs, expression.cs: Convert null arithmetic to lifted
1017 2008-04-01 Marek Safar <marek.safar@gmail.com>
1019 * nullable.cs, expression.cs: Use namespace instead heavily nested
1020 monster abstract class.
1022 2008-04-01 Marek Safar <marek.safar@gmail.com>
1024 * ecore.cs, convert.cs, constant.cs, nullable.cs, expression.cs: Implemented
1025 lifting of null literal and user operators. Clean up of some temporary
1028 2008-03-30 Raja R Harinath <harinath@hurrynot.org>
1030 Fix #368224, test-629.cs
1031 * flowanalysis.cs (FlowBranching.StealFinallyClauses): Return true
1032 if it crossed an unwind-protect boundary.
1033 * iterators.cs (Yield.CheckContext): Relax check for 'yield break'.
1034 (Yield.Resolve, Yield.DoEmit): Track whether the yield occurs
1035 inside an unwind-protected region.
1036 (YieldBreak.Resolve, YieldBreak.DoEmit): Likewise.
1037 (Iterator.MarkYield): Add 'unwind_protect' parameter. Emit a
1038 'leave' instead of a 'br' if unwind-protected.
1039 (Iterator.EmitYieldBreak): Likewise.
1041 2008-03-29 Gert Driesen <drieseng@users.sourceforge.net>
1043 * driver.cs: Only define versioninfo resources if no win32 resource
1046 2008-03-28 Marek Safar <marek.safar@gmail.com>
1048 A fix for bug #372375
1049 * convert.cs: Fixed boxing of nullable types.
1051 2008-03-28 Marek Safar <marek.safar@gmail.com>
1053 * typemanager.cs: Initialize InternalsVisibleTo as the very first optional
1056 2008-03-28 Marek Safar <marek.safar@gmail.com>
1058 A fix for bug #374619
1059 * nullable.cs: Fixed guarding of EmitBitwiseBoolean.
1061 2008-03-27 Marek Safar <marek.safar@gmail.com>
1063 * lambda.cs: Check return type only for invocation.
1065 2008-03-27 Marek Safar <marek.safar@gmail.com>
1067 A fix for bug #374214
1068 * ecore.cs: Correctly report argument type mismatch.
1070 2008-03-27 Marek Safar <marek.safar@gmail.com>
1072 * convert.cs (ImplicitReferenceConversionCore): Correctly compare enum type
1073 and not rely on broken IsEnum.
1075 2008-03-27 Marek Safar <marek.safar@gmail.com>
1077 * nullable.cs: New file, extracted from generic.cs.
1079 * generic.cs, generic-mcs.cs, *.csproj, *.sources: Updated.
1081 2008-03-27 Marek Safar <marek.safar@gmail.com>
1083 * generic.cs, convert.cs, generic-mcs.cs, expression.cs: Added lifting of
1084 predefined comparison operators and null literals.
1086 * report.cs: New warning ID.
1088 2008-03-25 Marek Safar <marek.safar@gmail.com>
1090 A fix for bug #370577
1091 * lambda.cs: Check return type too.
1093 2008-03-25 Marek Safar <marek.safar@gmail.com>
1095 A fix for bug #372846
1096 * class.cs: Automatic properties can be declared as unsafe.
1098 2008-03-20 Marek Safar <marek.safar@gmail.com>
1100 * location.cs: Use string based concatenation.
1102 * expression.cs: LiftedBinaryOperator is gmcs only.
1104 2008-03-20 Marek Safar <marek.safar@gmail.com>
1106 * generic.cs, literal.cs, ecore.cs, expression.cs: Ongoing work on nullable
1107 conversions rules and expression trees.
1109 2008-03-19 Marek Safar <marek.safar@gmail.com>
1111 * delegate.cs: Use extension method source as delegate target.
1113 2008-03-19 Marek Safar <marek.safar@gmail.com>
1115 * generic.cs, generic-mcs.cs, expression.cs, ecore.cs: Rewrote nullable
1116 binary operations to be purely based on binary operations and optimized
1117 emitted code (30% less in some cases). Introduced ReducedExpression for ETs
1118 and other ET refactoring.
1120 * typemanager.cs: Fixed warning.
1122 2008-03-17 Marek Safar <marek.safar@gmail.com>
1124 * class.cs, decl.cs, delegate.cs: Do protected modifier check on each member
1126 * symbolwriter.cs: Fixed.
1128 2008-03-17 Marek Safar <marek.safar@gmail.com>
1130 * anonymous.cs, driver.cs: Reset anonymous types counters.
1132 2008-03-17 Marek Safar <marek.safar@gmail.com>
1134 * ecore.cs (MethodGroupExpr): Skip first candidate, it's already the best.
1136 * class.cs: Use fullname for all type member definitions.
1138 2008-02-19 Martin Baulig <martin@ximian.com>
1141 (IMethodData.EmitExtraSymbolInfo): New interface method.
1142 (MethodData.Emit): Call method.EmitExtraSymbolInfo().
1143 (MethodOrOperator.EmitExtraSymbolInfo): Implement this new
1144 interface method here as an empty public virtual method.
1147 (AnonymousMethodMethod.ctor): Added `string real_name' argument.
1148 (AnonymousMethodMethod.EmitExtraSymbolInfo): Override and call
1149 CodeGen.SymbolWriter.SetRealMethodName().
1151 2008-02-18 Martin Baulig <martin@ximian.com>
1154 (ScopeInfo.EmitType): Override this and emit debugging
1155 information for captured variables.
1156 (RootScopeInfo.EmitType): Override this and emit symbol
1157 information for a captured `this'.
1159 2008-02-15 Martin Baulig <martin@ximian.com>
1161 * iterators.cs: Emit debugging info.
1164 (EmitContext.Flags): Add `OmitDebuggingInfo'.
1165 (EmitContext.OmitDebuggingInfo): New public property.
1168 (While): Override Emit() and don't emit symbol info there; do it
1169 inside DoEmit() instead.
1170 (Block.Emit): Omit symbol information while emitting the scope
1171 initializers; don't ec.Mark() the `EndLocation'. Fix the lexical
1173 (ExplicitBlock.IsIterator): Moved here from `ToplevelBlock'.
1174 (ToplevelBlock.MakeIterator): Pass the `flags' to `ExplicitBlock's
1175 .ctor to make `IsIterator' work.
1177 2008-03-14 Martin Baulig <martin@ximian.com>
1179 * symbolwriter.cs: Added the new symbol writer function from the
1180 debugger's `terrania' branch; temporarily enclose them inside
1181 `#if !DISABLE_TERRANIA_CHANGES' conditionals until I'm back from
1184 2008-03-14 Martin Baulig <martin@ximian.com>
1187 (SymbolWriter): Make this a public static class.
1190 (CodeGen.SymbolWriter): Removed; use the new static `SymbolWriter'
1191 class instead of using `if (CodeGen.SymbolWriter != null)' everywhere.
1193 2008-03-14 Marek Safar <marek.safar@gmail.com>
1195 A fix for bug #370577
1196 * statement.cs, lambda.cs: Added extra limitations when dealing with void
1199 2008-03-14 Marek Safar <marek.safar@gmail.com>
1201 * typemanager.cs (CSharpName): Made 250 times faster.
1203 2008-03-13 Marek Safar <marek.safar@gmail.com>
1205 * ecore.cs, expression.cs: Emit conversion for ET shift argument.
1207 2008-03-12 Marek Safar <marek.safar@gmail.com>
1209 * generic.cs, typemanager.cs, enum.cs, codegen.cs, statement.cs: Try not to
1210 crash when predefined field does not exist.
1212 2008-03-12 Marek Safar <marek.safar@gmail.com>
1214 * ecore.cs (PropertyExpr): Fixed IsSingleDimensionalArrayLength regression.
1216 2008-03-12 Marek Safar <marek.safar@gmail.com>
1218 * class.cs (FixedField): Don't crash when contructors are missing.
1220 2008-03-11 Marek Safar <marek.safar@gmail.com>
1222 * typemanager.cs, namespace.cs, literal.cs, ecore.cs, class.cs, decl.cs,
1223 convert.cs, constant.cs, expression.cs, statement.cs: Use same method to
1224 check internal types accessibility for internal and external types.
1225 Replaced EnumToUnderlying by GetEnumUnderlyingType.
1227 2008-03-11 Marek Safar <marek.safar@gmail.com>
1229 * support.cs, typemanager.cs, pending.cs, ecore.cs, class.cs, delegate.cs
1230 convert.cs, const.cs, anonymous.cs, constant.cs, expression.cs,
1231 attribute.cs, statement: Use corect instance of predefined types (work
1232 related to #364674).
1234 2008-03-07 Marek Safar <marek.safar@gmail.com>
1236 * expression.cs (TypeOfVoid): Fixed predefined method initialization.
1238 2008-03-07 Marek Safar <marek.safar@gmail.com>
1240 * generic.cs, typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs,
1241 class.cs, delegate.cs, iterators.cs, const.cs, constant.cs, driver.cs,
1242 expression.cs, attribute.cs, codegen.cs, statement.cs: TypeManager optional
1243 predefined types clean up, delayed predefined types members initialization
1244 (work related to #364674).
1246 2008-03-05 Marek Safar <marek.safar@gmail.com>
1248 * typemanager.cs (IsFriendAssembly): InternalsVisibleTo is not mandatory.
1250 2008-03-05 Marek Safar <marek.safar@gmail.com>
1252 * typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, class.cs, decl.cs,
1253 delegate.cs, convert.cs, driver.cs, attribute.cs, codegen.cs: TypeManager
1254 predefined types clean up (work related to #364674).
1256 2008-03-04 Marek Safar <marek.safar@gmail.com>
1258 * ecore.cs: Print an error message instead of throwing exception.
1260 2008-03-04 Marek Safar <marek.safar@gmail.com>
1262 * generic.cs, typemanager.cs, literal.cs, convert.cs, cfold.cs, constant.cs,
1263 expression.cs, statement.cs: Unififed null literal representation.
1265 2008-03-03 Marek Safar <marek.safar@gmail.com>
1267 * anonymous.cs, cfold.cs, convert.cs, delegate.cs, doc.cs, ecore.cs,
1268 expression.cs: Refactored binary operators resolve phase and improved speed.
1269 The nullable code is still missing and won't work correctly, more fixes
1272 It also fixes #323726, #324312, #324248, and many other unreported issues.
1274 2008-02-29 Zoltan Varga <vargaz@gmail.com>
1276 * report.cs (FeatureIsNotAvailable): Use 'mcs1' instead of 'mcs', and 'mcs'
1279 2008-02-27 Marek Safar <marek.safar@gmail.com>
1281 * ecore.cs: Clean-up and split BetterConversion.
1283 2008-02-25 Raja R Harinath <harinath@hurrynot.org>
1286 * enum.cs (EnumMember.Value): Only access 'value' if
1287 ResolveValue says it's ok.
1288 (EnumMember.DoResolveValue): Don't set prev_member.value.
1289 (Enum.GetDefinition): Reverse arguments of Equals --
1290 EnumMember.Value can return 'null'.
1292 * statement.cs (Switch.Error_AlreadyOccurs): Fix typo in name.
1294 2008-02-22 Marek Safar <marek.safar@gmail.com>
1296 * generic.cs, expression.cs: More ongoing work on expression trees.
1298 2008-02-21 Marek Safar <marek.safar@gmail.com>
1300 * class.cs, typemanager.cs: Rewrote operator matching logic to correctly
1301 handle missing matches when mutiple operators exist.
1303 2008-02-20 Marek Safar <marek.safar@gmail.com>
1305 A fix for bug #363218
1306 * expression.cs (ArrayCreation.Clone): Deal with multi-dimensional
1309 2008-02-20 Marek Safar <marek.safar@gmail.com>
1311 * expression.cs, constant.cs, cfold.cs: Yet another side-effect constant
1312 update. This time to deal correctly with SideEffectConstant expression used
1313 as an argument for another constant folding.
1315 2008-02-20 Raja R Harinath <harinath@hurrynot.org>
1317 * typemanager.cs (DropGenericMethodArguments): Ensure we get an underlying
1320 2008-02-19 Marek Safar <marek.safar@gmail.com>
1322 * constant.cs, cfold.cs: SideEffectConstant results can apply for folding.
1324 2008-02-19 Marek Safar <marek.safar@gmail.com>
1326 A fix for bug #328136
1327 * expression.cs: Do not fold immediately LogicalAnd operators when the left
1328 side is a false constant, because we still need to evaluate the right-hand
1331 * statement.cs (If): Emit two types of boolean constants (simple constant,
1332 side-effect constant).
1334 2008-02-19 Marek Safar <marek.safar@gmail.com>
1336 * constant.cs (SideEffectConstant): Don't emit boolean constant.
1338 * expression.cs: Fold immediately LogicalAnd operators when both sides are
1341 2008-02-18 Marek Safar <marek.safar@gmail.com>
1343 A fix for bug #361457
1344 * ecore.cs (IsApplicable): Params methods have lower priority.
1346 * support.cs: Return correct parameter modifier for params types.
1348 2008-02-18 Marek Safar <marek.safar@gmail.com>
1350 * generic.cs (TypeParameter): Cache attribute target name.
1352 * support.cs: Removed unused variable.
1354 * typemanager.cs: Removed debugging leftover.
1356 * ecore.cs: Use local type instead of a property;
1358 * class.cs (VerifyMembers): Consider also parent to test whether type member
1361 * expression.cs (FullMethodDesc): Removed.
1363 * attribute.cs (IsValidArgumentType): Made static.
1365 2008-02-17 Raja R Harinath <harinath@hurrynot.org>
1367 Cleanup to be more readable.
1368 * Makefile (GMCS_PROFILE): Remove.
1369 (COMPILER_NAME): New helper.
1371 2008-02-15 Miguel de Icaza <miguel@novell.com>
1373 * cs-tokenizer.cs: if a conditional expression happens inside a
1374 (...) this also means that we do not need to de-ambiguate between
1375 an parenthesized expression and a cast.
1379 * constant.cs (SideEffectConstant): a constant value that happens
1380 to have a side effect.
1382 Fixes the build regressions introduced by the fix for #359789
1384 2008-02-14 Rodrigo Kumpera <rkumpera@novell.com>
1386 * expression.cs (Conditional.Emit): when emitting the ternary
1387 operator, use local variables to generate code verifiable code.
1389 The verifier cannot infer that the type on stack before the
1390 stloc.0 is executed is of type ParentB. This happens because the
1391 stack merge algorithm uses only parent types when deciding which
1392 is the common type. This is described in Part III 1.8.1.3 of ECMA
1395 This code compiled with mcs is not verifiable under MS. The MS
1396 verifier picks the first common interface of Foo and Bar, which is
1397 wrong, but doesn't use a full join type of the 2 interfaces.
1399 CSC uses a clever hack to compile such code in a verifiable
1400 way. It stores the intermediate values in a local variable with
1405 2008-02-14 Miguel de Icaza <miguel@novell.com>
1407 * expression.cs: Do not fold BitwiseAnd operators when the left
1408 side is a false constant, because we still need to evaluate the
1413 * support.cs: Instead of throwing an InternalErrorException when
1414 the position of the stream is outside the boundary of our buffer,
1415 reset the state of the reader, and restart the reading from the
1416 beginning of the file.
1418 2008-02-14 Marek Safar <marek.safar@gmail.com>
1420 * generic.cs (TypeParameter.GetMembers): Is not supported operation.
1422 2008-02-14 Marek Safar <marek.safar@gmail.com>
1424 A fix for bug #361686
1425 * decl.cs: A protected types used inside a private class which parents
1426 derives from the protected class are accessible.
1428 2008-02-13 Marek Safar <marek.safar@gmail.com>
1430 * generic.cs (ConstraintChecker): Use cached member lookup when looking for
1431 the parameterless constructor.
1433 2008-02-13 Marek Safar <marek.safar@gmail.com>
1435 * generic.cs, typemanager.cs, iterators.cs, codegen.cs: Refactored core
1436 lookup methods to use standard member cache when doing member lookup.
1438 2008-02-12 Marek Safar <marek.safar@gmail.com>
1440 * driver.cs: Don't report full path for referenced module as assembly error.
1442 2008-02-12 Marek Safar <marek.safar@gmail.com>
1444 * Makefile: Fixed `qh' target to work on all machines.
1446 * report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs, anonymous.cs,
1447 expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type IsSubclassOf
1448 and HasElementType with TypeManager implementation.
1450 2008-02-08 Marek Safar <marek.safar@gmail.com>
1452 A fix for bugs #325134, #359749
1453 * expression.cs, ecore.cs: Try to resolve an extension method even if the
1454 first binds point to non-method member expression.
1456 2008-02-08 Marek Safar <marek.safar@gmail.com>
1458 * cs-parser.jay: Null coalescing operator is not part of ISO-1.
1460 2008-02-08 Marek Safar <marek.safar@gmail.com>
1462 A fix for bugs #321394, #323028
1463 * generic.cs, parameter.cs, ecore.cs, class.cs, decl.cs, delegate.cs:
1464 Reworked naive IsAccessibleAs implementation to handle nested types.
1466 2008-02-05 Jb Evain <jbevain@novell.com>
1468 * class.cs: use generic type comparison for parameters
1471 2008-02-05 Marek Safar <marek.safar@gmail.com>
1473 A fix for bug #325372
1474 * class.cs: Use generic type comparison when testing method signatures.
1476 2008-02-05 Marek Safar <marek.safar@gmail.com>
1478 A fix for bug #357047
1479 * ecore.cs: Applied C# 3.0 changes to better conversion.
1481 2008-02-05 Marek Safar <marek.safar@gmail.com>
1483 A fix for bug #358374
1484 * cs-parser.jay: Correctly set modifiers for all constructor types.
1486 2008-02-04 Marek Safar <marek.safar@gmail.com>
1488 A fix for bug #355251
1489 * generic.cs: Added base class constraint based type inference.
1491 2008-02-01 Marek Safar <marek.safar@gmail.com>
1493 A fix for bug #357255
1494 * decl.cs: One more missing visibility check.
1496 2008-02-01 Marek Safar <marek.safar@gmail.com>
1498 * support.cs: Fixed broken return.
1500 2008-01-25 Marek Safar <marek.safar@gmail.com>
1502 * report.cs: Correctly reset warnings count after probing.
1504 2008-01-25 Martin Baulig <martin@ximian.com>
1507 (NamespaceEntry.SymbolFileID): Make this work again after
1508 MemberName.ToString() is gone.
1510 2008-01-25 Marek Safar <marek.safar@gmail.com>
1512 * expression.cs: Implemented Divide, Equal, ExclusiveOr, GreaterThanOrEqual
1515 2008-01-25 Marek Safar <marek.safar@gmail.com>
1517 * generic.cs: Use full implicit conversion for type inference fixing.
1519 2008-01-24 Marek Safar <marek.safar@gmail.com>
1521 * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
1522 Fixed user operator conversions.
1524 2008-01-24 Marek Safar <marek.safar@gmail.com>
1526 * generic.cs: Do nullable type to null comparison optimization during
1529 2008-01-24 Marek Safar <marek.safar@gmail.com>
1531 A fix for bug #355163
1532 * generic.cs: Enabled l-value resolve on nullable expressions.
1534 2008-01-24 Marek Safar <marek.safar@gmail.com>
1536 A fix for bug #353986
1537 * class.cs: Ingore static ctors with parameters for any further checks.
1539 2008-01-24 Marek Safar <marek.safar@gmail.com>
1541 A fix for bug #354310
1542 * namespace.cs: Removed redundant check.
1544 2008-01-24 Marek Safar <marek.safar@gmail.com>
1546 A fix for bug #354928
1547 * expression.cs: ElementInitializers can be resolved only once.
1549 2008-01-24 Marek Safar <marek.safar@gmail.com>
1551 * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
1552 Condition expressions.
1554 2008-01-23 Marek Safar <marek.safar@gmail.com>
1556 * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
1558 2008-01-22 Marek Safar <marek.safar@gmail.com>
1560 * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
1563 * generic.cs: Implemented coalesce expression.
1565 2008-01-22 Marek Safar <marek.safar@gmail.com>
1567 A fix for bug #355145
1568 * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
1569 expression tree type inference.
1571 2008-01-22 Raja R Harinath <harinath@hurrynot.org>
1574 * expression.cs (Binary.IsUnsignedType): Fix typo.
1576 2008-01-22 Marek Safar <marek.safar@gmail.com>
1578 * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
1580 2008-01-22 Marek Safar <marek.safar@gmail.com>
1582 A fix for bug #355161
1583 * ecore.cs, expression.cs: Wider range of extension method supported
1586 2008-01-22 Gert Driesen <drieseng@users.sourceforge.net>
1588 * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
1589 AssemblyBuilder to operate in compiler context. Fixes mcs part of
1592 2008-01-22 Marek Safar <marek.safar@gmail.com>
1594 A fix for bug #355148
1595 * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
1597 2008-01-22 Miguel de Icaza <miguel@novell.com>
1599 * expression.cs (CreateExpressionTree): Add support for or and
1600 logical or, and indent following the coding conventions.
1602 * typemanager.cs (LinqExpression): renamed from
1603 ExpressionTreeManager, for a shorter name.
1605 Use TypeManager.CoreLookupType to lookup types from our core
1606 assemblies and turn those into "Type" variables.
1608 Consumers that previously used "Namespace" and "Type" from this
1609 class should instead use the TypeExpression which is a type that
1610 is fully resolved (without involving the regular C# resolution
1613 This typically looks like this:
1615 TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
1616 new MemberAccess (texpr, name, type_arguments, loc)
1618 This avoids the problem in: #355178
1620 2008-01-21 Marek Safar <marek.safar@gmail.com>
1622 * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
1623 feature in parser only as we do in other cases.
1625 2008-01-21 Marek Safar <marek.safar@gmail.com>
1627 * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
1628 typemanager.cs: A refactoring of params arguments to reuse existing
1629 expressions (params -> array initializer) to emit params argument instead
1630 of specialized handling.
1631 It was required by expression tree implementation and it has other benefits
1632 as well, we now apply same optimization for params arguments as we do for
1635 2008-01-18 Marek Safar <marek.safar@gmail.com>
1637 A fix for bug #353526
1638 * generic.cs: A type inference of params arguments may not required any
1639 temporary array creation.
1641 2008-01-18 Marek Safar <marek.safar@gmail.com>
1643 A fix for bug #353534
1644 * generic.cs, ecore.cs, expression.cs: A method group type inference is
1645 supported for delegates only.
1647 2008-01-18 Marek Safar <marek.safar@gmail.com>
1649 * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
1650 type for more than 1 candidates.
1652 2008-01-18 Marek Safar <marek.safar@gmail.com>
1654 * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
1657 2008-01-16 Marek Safar <marek.safar@gmail.com>
1659 * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
1660 expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
1661 operator) expressions.
1663 2008-01-16 Zoltan Varga <vargaz@gmail.com>
1665 * statement.cs: Avoid declaring an IL variable for this_variable since it is
1666 not accessed from the generated IL.
1668 2008-01-14 Marek Safar <marek.safar@gmail.com>
1670 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
1671 iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
1672 statement.cs: The first expression tree implementation drop, mostly
1673 infrastructure work.
1675 2008-01-14 Marek Safar <marek.safar@gmail.com>
1677 * ecore.cs (IsNestedChild): Refactored.
1679 2008-01-11 Marek Safar <marek.safar@gmail.com>
1681 * lambda.cs: Don't use a cast on unknown expression statement.
1683 2008-01-10 Geoff Norton <gnorton@novell.com>
1685 * cs-tokenizer.cs: One more token to distinguish between method and lambda
1688 2008-01-09 Marek Safar <marek.safar@gmail.com>
1690 * doc.cs: Report better /doc crash details.
1692 2008-01-09 Marek Safar <marek.safar@gmail.com>
1694 A fix for bug #352536
1695 * ecore.cs, assign.cs, codegen.cs: Check event assignments.
1697 2008-01-08 Marek Safar <marek.safar@gmail.com>
1699 A fix for bug #352287
1700 * ecore.cs, expression.cs: Do `this' access checking in all member access
1703 2008-01-08 Marek Safar <marek.safar@gmail.com>
1705 * rootcontext.cs, driver.cs: Switch to linq mode by default.
1707 * report.cs: Reset message stacks.
1709 2008-01-08 Marek Safar <marek.safar@gmail.com>
1711 * generic.cs (InferInPhases): Correctly calculate params position.
1713 2008-01-08 Marek Safar <marek.safar@gmail.com>
1715 * cs-tokenizer.cs: No need to parse full string when parsing lambda
1718 2008-01-07 Marek Safar <marek.safar@gmail.com>
1720 * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
1722 * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
1724 * driver.cs: Updated --help option.
1726 2008-01-07 Marek Safar <marek.safar@gmail.com>
1728 * generic.cs (InferParamsTypeArguments): Removed.
1729 (InferInPhases): Add params type inference.
1730 (LowerBoundInference): Fixed scoring mechanism.
1732 * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
1734 2008-01-06 Gert Driesen <drieseng@users.sourceforge.net>
1736 * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
1737 byte array for unsigned "baked" assemblies.
1739 2008-01-05 Gert Driesen <drieseng@users.sourceforge.net>
1741 * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
1742 array for assemblies that are not strongnamed.
1744 2008-01-04 Marek Safar <marek.safar@gmail.com>
1746 A fix for bug #351481
1747 * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
1748 declaring type for nested generic types.
1750 2008-01-04 Marek Safar <marek.safar@gmail.com>
1752 * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
1753 instead of ToString.
1755 2008-01-03 Marek Safar <marek.safar@gmail.com>
1757 A fix for bug #351047
1758 * expression.cs (Binary.ResolveOperator): Allow equality operators between
1759 null and structs only when equality and inequality operators are defined
1760 either as an user-operators or predefined operators.
1762 2008-01-03 Marek Safar <marek.safar@gmail.com>
1764 A fix for bug #351047
1765 * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
1767 2008-01-03 Marek Safar <marek.safar@gmail.com>
1769 A fix for bug #351257
1770 * cs-tokenizer.cs: Advance line number for '\r' correctly.
1772 2008-01-03 Marek Safar <marek.safar@gmail.com>
1774 A fix for bug #351157
1775 * class.cs (Using): Fixed yet another broken cloning.
1777 (Block): Put back more sensible default value for statements.
1779 2008-01-01 Gert Driesen <drieseng@users.sourceforge.net>
1781 * codegen.cs: Allow AssemblyVersion with only major version component.
1784 2007-12-29 Marek Safar <marek.safar@gmail.com>
1786 A fix for bug #324654
1787 * class.cs: Use FullName property as member name.
1789 2007-12-28 Marek Safar <marek.safar@gmail.com>
1791 A fix for bug #342117
1792 * generic.cs (ConstraintChecker): Struct constraint also satisfies default
1793 constructor constraint.
1795 2007-12-28 Marek Safar <marek.safar@gmail.com>
1797 A fix for bug #338273
1798 * class.cs (ProbertyBase): Access modifier checks are required for overrides
1801 2007-12-28 Marek Safar <marek.safar@gmail.com>
1803 A fix for bug #350839
1804 * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
1806 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
1808 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
1811 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
1813 * statement.cs: Changed some Hashtables to use HybridDictionaries
1814 instead. It was observed that some HashTables only contained a few
1815 items in the vast majority of cases. Since HybridDictionary is
1816 more efficient on small sets (<10 elements), "known_variables"
1817 from class ExplicitBlock as well as "labels" and "constants " from
1818 class Block were changed to HybridDictionaries.
1820 Atsai results: (56216kb->54987kb)
1822 Miguel results (bootstrap of mcs): 59819kb -> 59290kb
1825 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
1827 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
1830 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
1832 * expression.cs: foreach loop to for loop, saved on allocation of
1833 enumerator (59333kb->59141kb)
1835 * statement.cs. Changed foreach loops to for loops, saved on
1836 allocation of enumerator (59141kb->59006kb)
1838 * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
1839 when constructed with no specified capacity. This was causing a
1840 few ArrayLists to allocate more memory than they would potentially
1841 need in the Block class and MemberCache class. Setting the
1842 ArrayLists to construct with a capacity of 1 saves some
1843 memory. (56216kb->55585kb)
1845 2007-12-27 Marek Safar <marek.safar@gmail.com>
1847 A fix for bug #347189 (2nd issue)
1848 * expression.cs (MemberAccess): Nested type can be found in base non-generic
1851 2007-12-27 Miguel de Icaza <miguel@novell.com>
1853 * report.cs: Do not use colors if stdout and stderr are not a
1856 2007-12-27 Marek Safar <marek.safar@gmail.com>
1858 A fix for bug #346998
1859 * ecore.cs (MethodGroupExpr): Implemented override filter for generic
1862 2007-12-27 Marek Safar <marek.safar@gmail.com>
1864 A fix for bug #343465
1865 * class.cs: Explicit method name for nested types uses dots only.
1867 2007-12-27 Marek Safar <marek.safar@gmail.com>
1869 A fix for bug #343707
1870 * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
1872 2007-12-27 Marek Safar <marek.safar@gmail.com>
1874 * ecore.cs: Report type inference errors only when arguments count matches
1877 * generic.cs (NullCoalescingOperator): Cannot be applied to null.
1879 * expression.cs, report.cs: New warning.
1881 * typemanager.cs: Catch anonymous method type too.
1883 2007-12-23 Marek Safar <marek.safar@gmail.com>
1885 A fix for bug #346379
1886 * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
1888 2007-12-23 Marek Safar <marek.safar@gmail.com>
1890 A fix for bug #347359
1891 * expression.cs (Invocation): Don't resolve already resolved expression.
1893 2007-12-23 Marek Safar <marek.safar@gmail.com>
1895 A fix for bug #347189
1896 * class.cs (FixedField): Use non-dependent code only in the define phase.
1898 2007-12-23 Marek Safar <marek.safar@gmail.com>
1900 A fix for bug #348076
1901 * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
1903 2007-12-22 Marek Safar <marek.safar@gmail.com>
1905 * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
1906 discovered extension methods.
1908 2007-12-22 Marek Safar <marek.safar@gmail.com>
1910 * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
1913 2007-12-21 Miguel de Icaza <miguel@novell.com>
1915 * report.cs (ErrorMessage): Add support for using colors on
1916 terminals that support it.
1918 2007-12-21 Marek Safar <marek.safar@gmail.com>
1920 * ecore.cs: Use information about expanded params for error reporting.
1922 2007-12-21 Marek Safar <marek.safar@gmail.com>
1924 * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
1925 and logic for params overloads.
1927 2007-12-15 Miguel de Icaza <miguel@novell.com>
1929 * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
1930 as this is also created from the parser. Fixes #349034
1932 2007-12-12 Miguel de Icaza <miguel@novell.com>
1934 * statement.cs (Throw.CloneTo): it is valid to have empty
1935 expressions for throw.
1937 2007-12-03 Marek Safar <marek.safar@gmail.com>
1939 * cs-parser.jay: Set delegate constraint parsing region correctly.
1941 2007-12-03 Marek Safar <marek.safar@gmail.com>
1943 A fix for bug #345467
1944 * typemanager.cs (IsEqual): Compare generic parameters position only.
1946 2007-11-28 Marek Safar <marek.safar@gmail.com>
1948 * expression.cs (BaseAccess): Type arguments can be null.
1950 2007-11-27 Raja R Harinath <harinath@gmail.com>
1952 * statement.cs (Block.Resolve): Ensure flow-branching tree is
1953 consistent even when an error has occured.
1954 (Switch.Resolve): Likewise.
1956 2007-11-22 Marek Safar <marek.safar@gmail.com>
1958 A fix for bug #334505
1959 * class.cs: Don't ignore InternalsVisibleTo attribute for internal
1962 2007-11-22 Marek Safar <marek.safar@gmail.com>
1964 * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of
1965 refactorings required to resolve extension methods correctly when mixing
1966 generics and non-generics members.
1968 2007-11-20 Marek Safar <marek.safar@gmail.com>
1970 A fix for bug #342584
1971 * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
1974 2007-11-19 Marek Safar <marek.safar@gmail.com>
1976 A fix for bug #342512
1977 * delegate.cs: Use delegate argument expression when is available. Don't
1978 emit virtual call when class is sealed.
1980 2007-11-16 Marek Safar <marek.safar@gmail.com>
1982 A fix for bug #325423
1983 * assign.cs (FieldInitializer): Use resolved expression for emit.
1985 * class.cs: Print less confusing error message.
1987 2007-11-16 Marek Safar <marek.safar@gmail.com>
1989 * cs-tokenizer.cs: Removed GMCS ifdefs.
1991 * rootcontext.cs, report.cs: Report unavailable gmcs features used by
1994 * cs-parser.jay: Disabled nullable check.
1996 * generic-mcs: Copied more generic stuff.
1998 2007-11-16 Marek Safar <marek.safar@gmail.com>
2000 * gcs-parser.jay: Merged to cs-parser.jay.
2002 * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
2003 * *.csproj, *.sources: Updated to use only jay parser file.
2005 2007-11-16 Marek Safar <marek.safar@gmail.com>
2007 * gcs-parser.jay: Added nullable and default expression feature checks.
2009 2007-11-16 Marek Safar <marek.safar@gmail.com>
2011 * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing,
2012 it fixes many TODOs and hidden bugs.
2014 * expression: Removed duplicate error check.
2016 2007-11-15 Marek Safar <marek.safar@gmail.com>
2018 * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
2019 implicitly type local variable only when it is used in a declaration.
2021 2007-11-15 Marek Safar <marek.safar@gmail.com>
2023 * attribute.cs: Use CS0612 for empty strings.
2025 2007-11-14 Marek Safar <marek.safar@gmail.com>
2027 * lambda.cs, statement.cs: Contextual return may act as a statement.
2029 2007-11-14 Marek Safar <marek.safar@gmail.com>
2031 A fix for a regression cause by #324222
2032 * class.cs: Don't report unused even when it implements an interface.
2034 2007-11-13 Marek Safar <marek.safar@gmail.com>
2036 A fix for bug #341205
2037 * ecore.cs, expression.cs: Method group expression cannot do static
2038 method access with an instance reference check before overloading takes
2041 2007-11-13 Marek Safar <marek.safar@gmail.com>
2043 A fix for bug #325359
2044 * class.cs: Use predictable name for automatically generated property.
2046 2007-11-12 Marek Safar <marek.safar@gmail.com>
2048 A fix for bug #324996
2049 * expression.cs (Is): Handle case where D is nullable and T is not
2052 * generics.cs (Nullable.HasValue): Nullable HasValue expression.
2054 2007-11-12 Marek Safar <marek.safar@gmail.com>
2056 * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
2057 anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
2058 Flush small error reporting changes.
2060 2007-11-09 Marek Safar <marek.safar@gmail.com>
2062 A fix for bug #324996
2063 * expression.cs: Rewrote Is expression implementation to work with
2064 generics, nullable types, anonymous method. A const result expression
2065 uses existing infrastructure instead of custom not fully-featured one.
2067 2007-11-08 Marek Safar <marek.safar@gmail.com>
2069 A fix for bug #340202
2070 * class.cs: Consider generics for volatile field.
2072 2007-11-08 Marek Safar <marek.safar@gmail.com>
2074 A fix for bug #335594
2075 * expression.cs: Use conversion rules when handling string addition.
2077 2007-11-07 Marek Safar <marek.safar@gmail.com>
2079 A fix for bug #336651
2080 * expression.cs: Fixed a crash when probing is on.
2082 2007-11-07 Marek Safar <marek.safar@gmail.com>
2084 A fix for bug #324242
2085 * covert.cs: Added a conversion from any nullable-type with an
2086 underlying enum-type to the type System.Enum.
2088 2007-11-07 Marek Safar <marek.safar@gmail.com>
2090 A fix for bug #324222
2091 * class.cs: Report all non-used event fields.
2093 2007-11-07 Marek Safar <marek.safar@gmail.com>
2095 A fix for bug #325161
2096 * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
2097 qualifier for generic types.
2099 2007-11-07 Marek Safar <marek.safar@gmail.com>
2101 A fix for bug #322971
2102 * expression.cs, ecore.cs: Added intermediate result value check for
2105 2007-11-07 Marek Safar <marek.safar@gmail.com>
2107 A fix for bug #324754
2108 * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
2109 when it was requested.
2111 2007-11-07 Marek Safar <marek.safar@gmail.com>
2113 A fix for bug #325101
2114 * expression.cs: Do type not value comparison for `is' expression.
2116 2007-11-07 Marek Safar <marek.safar@gmail.com>
2118 A fix for bug #320236
2119 * convert.cs: Don't apply user conversion on underlying target type.
2121 2007-11-06 Marek Safar <marek.safar@gmail.com>
2123 * expression.cs: Don't use unresolved expression for error reporting.
2125 2007-11-06 Marek Safar <marek.safar@gmail.com>
2127 A fix for bugs #337712, #324490
2128 * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
2129 overloading resolution too.
2131 * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
2132 the process consistent and more robust.
2134 * expression.cs, linq.cs, report.cs: Update.
2136 2007-11-02 Marek Safar <marek.safar@gmail.com>
2138 A fix for bug #332909
2139 * attribute.cs: Resolve attributes in correct context using error
2142 * rootcontext.cs: Define Obsolete attribute members as core members.
2144 2007-11-02 Marek Safar <marek.safar@gmail.com>
2146 * statement.cs: Removed unused methods.
2148 2007-10-31 Wade Berrier <wberrier@novell.com>
2150 * Makefile: reenable copy of gmcs.exe.config, but include it in EXTRA
2151 DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
2154 2007-10-31 Marek Safar <marek.safar@gmail.com>
2156 A fix for bug #338102
2157 * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
2158 methods registered as non-generics.
2160 2007-10-31 Marek Safar <marek.safar@gmail.com>
2162 A fix for bugs #337712, #324490
2163 * delegate.cs: Delegate covariance and contravariance is not allowed for
2166 2007-10-31 Marek Safar <marek.safar@gmail.com>
2168 A fix for bug #337719
2169 * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
2172 2007-10-30 Marek Safar <marek.safar@gmail.com>
2174 * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
2176 2007-10-29 Marek Safar <marek.safar@gmail.com>
2178 * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
2181 2007-10-29 Raja R Harinath <rharinath@novell.com>
2183 * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
2185 2007-10-29 Marek Safar <marek.safar@gmail.com>
2187 A fix for bug #334652
2188 * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
2189 extension methods when we have not found the best candidate in normal
2192 2007-10-27 Marek Safar <marek.safar@gmail.com>
2194 * AssemblyInfo.cs: Keep up-to-date.
2196 2007-10-27 Marek Safar <marek.safar@gmail.com>
2198 * Makefile: Fixed generics compiler name.
2200 2007-10-27 Marek Safar <marek.safar@gmail.com>
2202 * lambda.test: removed, lambda parsing is done differently.
2204 * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
2206 2007-10-27 Gert Driesen <drieseng@users.sourceforge.net>
2208 * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
2210 2007-10-27 Marek Safar <marek.safar@gmail.com>
2212 * Makefile, *.sources : All C# compilers are in mcs folder.
2214 * *.cs: Use existing 2_1 define for smcs.
2216 2007-10-26 Marek Safar <marek.safar@gmail.com>
2218 A fix for bug #335847
2219 * assign.cs, expression.cs: Couple of changes to avoid creating a
2220 temporary variable for each object initializer assignment statement. It
2221 simplifies struct initialization too, otherwise two temporary variables
2223 Implemented optimization of redundant default element initializers.
2225 2007-10-25 Marek Safar <marek.safar@gmail.com>
2227 A fix for bug #336766
2228 * expression.cs (Class.CheckBase): Use generic name when method is
2231 2007-10-25 Marek Safar <marek.safar@gmail.com>
2233 A fix for bug #334737
2234 * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
2235 variable and not variable argument for prepared copies.
2237 2007-10-24 Marek Safar <marek.safar@gmail.com>
2239 A fix for bug #325110
2240 * class.cs, expression.cs, attribute.cs: Use open generic method when
2241 checking conditional attribute.
2243 2007-10-24 Marek Safar <marek.safar@gmail.com>
2245 * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs,
2246 expression.cs, statement.cs: Renamed method FeatureIsNotISO to
2247 FeatureIsNotAvailable.
2249 2007-10-24 Marek Safar <marek.safar@gmail.com>
2251 ** C# 3.0 Partial methods
2253 * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
2254 methods support. Because of member cache issue with generics only
2255 non-generics partial methods are fully supported.
2257 2007-10-23 Marek Safar <marek.safar@gmail.com>
2259 * class.cs, decl.cs: Rewrote member overloads check to cope with
2260 generics and to use member cache for member checking. It also improves
2261 performance and fixes remaining overloads issues.
2263 2007-10-20 Marek Safar <marek.safar@gmail.com>
2265 * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
2266 roottypes.cs, typemanager.cs:
2268 A member cache creation logic changed to add members immediately and
2269 not rely on fallback. The member cache is now only prefered way
2270 how to access and find type declaration members. It saves 5 MB of memory
2271 during MWF compilation and makes code ready for more optimizations and
2272 clean-ups, it's also a pre-requirement for partial methods.
2274 2007-10-18 Raja R Harinath <harinath@gmail.com>
2276 * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
2277 handling for generic parameters.
2279 2007-10-15 Marek Safar <marek.safar@gmail.com>
2281 * class.cs (FixedField): Removed redundant volatile check.
2283 2007-10-15 Marek Safar <marek.safar@gmail.com>
2285 * class.cs, decl.cs: Fixed overload members verification to do only one
2286 check per possible collision.
2288 2007-10-13 Marek Safar <marek.safar@gmail.com>
2290 A fix for bug #325478
2291 * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
2292 and create only one disposable flags container.
2294 2007-10-12 Marek Safar <marek.safar@gmail.com>
2296 A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
2297 * statement.cs (Fixed): Fixed variables cloning.
2299 2007-10-12 Marek Safar <marek.safar@gmail.com>
2301 A fix for bug #333342
2302 * class.cs (EventField): Don't mark value type event as synchronized.
2304 2007-10-12 Marek Safar <marek.safar@gmail.com>
2306 * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
2307 inference to identify best candidate method correctly.
2308 (ProperyExpr): A range variable is read only and cannot be modified.
2310 2007-10-11 Marek Safar <marek.safar@gmail.com>
2312 * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
2313 logic to identify best candidate method correctly.
2315 2007-10-11 Marek Safar <marek.safar@gmail.com>
2317 * location.cs (Equals, GetHashCode): Removed.
2319 2007-10-11 Marek Safar <marek.safar@gmail.com>
2321 * report.cs: Implemented message recorder. It is used mainly for lambda
2322 expressions to capture otherwise swallowed error messages.
2324 * anonymous.cs, lambda.cs.cs: Do full parameters check.
2326 * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
2328 (MethodGroupExpr.DoResolve): Use message recorder for error handling.
2330 * expression.cs (MemberAccess): Always report lookup failure.
2332 * location.cs: Implemented Equals, GetHashCode.
2334 * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
2336 2007-10-10 Jb Evain <jbevain@novell.com>
2338 * codegen.cs: re-enable assembly version check.
2340 2007-10-09 Marek Safar <marek.safar@gmail.com>
2342 * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
2345 * namespace.cs (UsingAlias): Do correct version check.
2347 2007-10-08 Marek Safar <marek.safar@gmail.com>
2349 * expresison.cs, ecore.cs: Issue extension method error message when
2352 * rootcontext.cs: Added ISO_2 compiler mode option.
2354 2007-10-08 Marek Safar <marek.safar@gmail.com>
2356 * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
2359 2007-10-08 Marek Safar <marek.safar@gmail.com>
2361 * attribute.cs (GetString, GetBoolean): Work with both literal and
2364 * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
2365 Moved method overload specific methods to MethodGroupExpr.
2367 (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
2368 it should be less memory consuming.
2370 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
2372 * codegen.cs: remove the assembly version check until the buildbot is
2375 2007-10-07 Jb Evain <jbevain@novell.com>
2377 * attribute.cs (Attribute.GetString): if the value
2378 expression is a StringConstant, return its string value.
2380 2007-10-07 Jb Evain <jbevain@novell.com>
2382 * typemanager.cs: add `assembly_version_attribute_type`.
2383 * codegen.cs: on attribute emission, check that the
2384 AssemblyVersionAttribute doesn't overflow.
2386 2007-10-05 Marek Safar <marek.safar@gmail.com>
2388 A fix for bug #324677
2389 * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
2390 parent container of a scope container with currently resolved one.
2392 2007-10-05 Marek Safar <marek.safar@gmail.com>
2394 A fix for bug #325534
2395 * class.cs (Invocation.DoResolve): Check invocation of object finalizer
2398 2007-10-05 Marek Safar <marek.safar@gmail.com>
2400 A fix for bug #327504
2401 * class.cs (Operator.Define): Refactored implicit and explicit user
2402 operator conversion rules.
2404 2007-10-05 Marek Safar <marek.safar@gmail.com>
2406 A fix for bug #327520
2407 * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
2409 2007-10-04 Marek Safar <marek.safar@gmail.com>
2411 A fix for bug #328022
2412 * class.cs (MethodData.Define): Use correct method to check whether
2413 a method implementents an accessor.
2415 2007-10-04 Marek Safar <marek.safar@gmail.com>
2417 A fix for bug #330069
2418 * statement.cs (Fixed.Resolve): Read the first array element only when
2419 an array is instantiated.
2421 2007-10-04 Marek Safar <marek.safar@gmail.com>
2423 * expression.cs, assign.cs, generics.cs: Print correct operator when
2424 compound assignment is used.
2426 2007-10-04 Marek Safar <marek.safar@gmail.com>
2428 A fix for bug #325841
2429 * expression.cs (ArrayAccess): Use full argument cloning only for
2430 string compound concatenation.
2432 2007-10-03 Marek Safar <marek.safar@gmail.com>
2434 A fix for bug #328774
2435 * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
2437 (PropertyExpr.EmitAssign): Fixed string concatenation compound
2440 2007-10-03 Raja R Harinath <rharinath@novell.com>
2443 * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
2444 Event accessibility checks here. Remove some bogus code that
2445 accidently made GenericMethods work.
2446 (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
2448 2007-09-25 Marek Safar <marek.safar@gmail.com>
2450 * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
2452 * statement.cs (Block): Refactored AddVariable to allow error handling
2455 * generic.cs: New stub.
2457 2007-09-23 Marek Safar <marek.safar@gmail.com>
2459 * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
2462 2007-09-17 Marek Safar <marek.safar@gmail.com>
2464 * class.cs: Use partial container to record whether any partial part
2465 contains static field initializer and therefore default contructor has
2468 2007-09-14 Marek Safar <marek.safar@gmail.com>
2470 * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
2471 mono-list when only one of two partial parts has defined accessibility
2474 2007-09-14 Marek Safar <marek.safar@gmail.com>
2476 A fix for bug #82845
2478 * class.cs (TypeContainer): Set correct resolve context for all field
2481 2007-09-13 Marek Safar <marek.safar@gmail.com>
2483 * assign.cs: Fixed a crash when field is resolved twice with an error.
2485 * codegen.cs: Changed InFieldInitializer to be flag.
2487 * anonymous.cs, ecore.cs, expression.cs: Update after
2488 IsInFieldInitializer rename.
2490 * const.cs: Removed unused parameter.
2492 * class.cs: Changed the way how we resolve and emit field initializers.
2493 The field initilizers have to have access to contructor block to emit
2494 compiler generated code.
2496 2007-09-13 Marek Safar <marek.safar@gmail.com>
2498 * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
2499 generics use TypeContainer instead.
2501 2007-09-12 Marek Safar <marek.safar@gmail.com>
2503 * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
2505 * lambda.cs (ResolveParameters): Use more powerful
2506 InflateGenericArgument.
2508 * parameters.cs: Better exception message.
2510 2007-09-10 Marek Safar <marek.safar@gmail.com>
2512 * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
2513 correct expression block type.
2515 * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
2517 * expression.cs (Invocation): Extracted method group resolve to
2520 2007-09-07 Marek Safar <marek.safar@gmail.com>
2522 * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
2523 (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
2525 * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
2526 generic extension methods.
2528 2007-09-06 Marek Safar <marek.safar@gmail.com>
2530 A fix for bug #82676 (Do I get it right now?)
2531 * convert.cs (Binary.ResolveOperator): An interface is converted to the
2532 object before a standard conversion is applied.
2534 2007-09-06 Marek Safar <marek.safar@gmail.com>
2536 * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
2539 2007-09-05 Marek Safar <marek.safar@gmail.com>
2541 A fix for bug #82676
2542 * convert.cs (ImplicitReferenceConversionCore): Check both sides for
2543 non-generic interface types.
2545 2007-09-05 Marek Safar <marek.safar@gmail.com>
2547 A fix for bug #82690
2548 * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
2550 2007-09-05 Marek Safar <marek.safar@gmail.com>
2552 A fix for bug #82571
2553 * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal
2554 modifier for container based methods.
2556 2007-09-05 Marek Safar <marek.safar@gmail.com>
2558 A fix for bug #82676
2559 * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
2560 any interface-type T means to any of interface type T.
2562 2007-09-04 Marek Safar <marek.safar@gmail.com>
2564 * namespace.cs: We have 2 versions of System.Core assembly.
2566 2007-09-04 Marek Safar <marek.safar@gmail.com>
2568 A fix for bug #82652
2569 * class.cs (Class.GetClassBases): Compare types and not expressions.
2571 2007-09-04 Marek Safar <marek.safar@gmail.com>
2573 A fix for bug #82620
2574 * expression.cs (Invocation.EmitArguments): Duplicate params arguments
2575 actually never worked before.
2576 (IndexerAccess): Emit prepared arguments before they are modified.
2578 2007-09-04 Marek Safar <marek.safar@gmail.com>
2580 A fix for bug #82563
2581 * assign.cs: Revert wrong fix.
2583 * expression.cs (VariableReference.EmitAssign): Handle ref reference
2585 (ArrayAccess): Changed the way we emit compound (prepared) assignments.
2586 Instead of ldelema/stdind we have to use temporary variables to handle
2587 cases like String.Concat (params string[]).
2589 2007-08-31 Marek Safar <marek.safar@gmail.com>
2591 * class.cs: EmitAttributes to Emit rename.
2593 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
2595 (MemberCore.HasClsCompliantAttribute): Don't depend on
2596 GetClsCompliantAttributeValue execution.
2598 2007-08-31 Marek Safar <marek.safar@gmail.com>
2600 * anonymous.cs: Use shorter type prefix.
2602 * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
2605 * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
2606 variables when probing is on.
2608 * statement.cs (LocaLInfo.Clone): Clone correctly resolved and
2609 unresolved variables.
2610 (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
2611 handle transparent identifiers.
2613 2007-08-26 Marek Safar <marek.safar@gmail.com>
2615 * attribute.cs (IsClsCompliant): Add nullable types test.
2617 2007-08-24 Atsushi Enomoto <atsushi@ximian.com>
2619 * doc.cs : catch other types of exception than XmlException to
2620 report CS1570. Fixed bug #82565.
2622 2007-08-23 Marek Safar <marek.safar@gmail.com>
2624 * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference):
2625 The number of delegate parameters has to match.
2626 (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
2629 2007-08-21 Marek Safar <marek.safar@gmail.com>
2631 * anonymous.cs (AnonymousMethod): Generate private anonymous method
2632 to fix problem with private arguments.
2634 2007-08-20 Marek Safar <marek.safar@gmail.com>
2636 * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
2638 * decl.cs (MemberName): Ignore generic type with no generic arguments.
2640 * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
2641 empty. Add cloning suport.
2643 * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
2645 2007-08-20 Marek Safar <marek.safar@gmail.com>
2647 * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method
2648 to create EmptyCast. It handles EmptyConstantCast specialization for
2651 2007-08-18 Marek Safar <marek.safar@gmail.com>
2653 * expression.cs (Binary.is_unsigned): Handle unsafe types too.
2654 (EmitArrayArgument): One routine for array arguments.
2655 (ArrayCreation.MakeByteBlob): Fixed an array alignment.
2657 2007-08-17 Marek Safar <marek.safar@gmail.com>
2659 * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
2661 2007-08-17 Marek Safar <marek.safar@gmail.com>
2663 * anonymous.cs: MemberLookupFinal update.
2665 * class.cs (ConstructorInitializer): Is expression based.
2667 * delegate.cs: MethodGroupExpr update.
2669 * ecore.cs (Error_MemberLookupFailed): Improved to report better error
2671 (Error_MemberLookupFailed): Customizable error override.
2672 (MethodGroupExpr): Keep queried type for later usage.
2673 (MethodGroupExpr.OverloadResolve): Catch errors related to overload
2676 * expression.cs: Error_MemberLookupFailed refactoring.
2677 (New.DoResolve): Resolve as much as possible.
2678 (ElementInitializer.Error_MemberLookupFailed): Object initializer
2679 customization for invalid member types.
2681 * statement.cs: MethodGroupExpr update.
2683 2007-08-16 Marek Safar <marek.safar@gmail.com>
2685 * modifier.cs (Check): Check all modifiers and not only accessibility
2688 2007-08-16 Marek Safar <marek.safar@gmail.com>
2690 * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
2691 type and not an expression.
2693 2007-08-16 Marek Safar <marek.safar@gmail.com>
2695 * statement.cs (Catch.Clone): Type and variable can be null.
2697 2007-08-16 Marek Safar <marek.safar@gmail.com>
2699 A fix for bug #81979
2700 * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
2701 I am really not sure whether this is the best fix.
2703 * expression.cs (VariableReference.EmitAssign): Do prepare_load test
2706 2007-08-14 Marek Safar <marek.safar@gmail.com>
2708 ** C# 3.0 Object and collection initializers (major re-write)
2710 * assign.cs (DoResolve): Initializers are not assign related.
2712 * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
2713 used during collection or object initialization.
2715 * expression.cs (Error_InvalidArguments): Add initializers specific
2716 messages. More will come later because it requires some general
2718 (New.DoResolve): Better error handling for unsafe types.
2719 (EmptyExpressionStatement): New class.
2720 (ElementInitializer): An object initializer expression.
2721 (CollectionElementInitializer): A collection initializer expression.
2722 (CollectionOrObjectInitializers): A block of object or collection
2724 (NewInitialize): New expression with element/object initializers.
2726 * statement.cs: Reverted object/collection initializer hacks.
2728 * typemanager.cs (CSharpName): Filter __arglist type.
2730 2007-08-09 Marek Safar <marek.safar@gmail.com>
2732 ** C# 3.0 Anonymous Types (update to the latest standard)
2734 * expression.cs (Binary.ResolveOperator): Threat all null based types
2736 (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
2737 (AnonymousTypeParameter): Updated.
2739 * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
2740 (AnonymousTypeClass): New anonymous type container.
2742 * class.cs (AddField): Return operation result.
2744 * generic.cs: Another empty TypeArguments overload.
2746 * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
2747 are stored at top of normal hierarchy.
2749 * typemanager.cs (CSharpName): Filter anonymous types.
2751 2007-08-09 Marek Safar <marek.safar@gmail.com>
2753 * expression.cs (StringConcat.Append): Handle 3 and more concatenation
2754 as single Concat call. How could we miss that :-(
2756 2007-08-08 Marek Safar <marek.safar@gmail.com>
2758 * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
2760 2007-08-07 Miguel de Icaza <miguel@novell.com>
2762 * expression.cs: Fix the previous commit, the creation of the
2763 arguments array list needs also to be conditional on the arguments
2766 * class.cs: Add a little bit of help to help narrow down problems.
2768 * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
2769 not try to copy in that case.
2771 * driver.cs: When building SMCS, include a new different set of
2772 default assemblies here. Do this here so we can control whether
2773 to include the default assemblies with /noconfig.
2775 2007-08-03 Marek Safar <marek.safar@gmail.com>
2777 A fix for bug #81979
2778 * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
2781 2007-08-03 Marek Safar <marek.safar@gmail.com>
2783 A fix for bug #82300
2785 * anonymous.cs (AnonymousContainer.Define): Don't define anything when
2786 we are in probing scope.
2788 2007-08-03 Marek Safar <marek.safar@gmail.com>
2790 A fix for bug #82301
2792 * statement.cs (Catch.CloneTo): Clone blocks in the right order.
2793 (Statement.CloneTo): Clone and not map children blocks.
2795 2007-08-03 Marek Safar <marek.safar@gmail.com>
2797 A fix for bug #82299
2799 * expression.cs (LocalVariableReference.CloneTo): Remap local info
2802 * statement.cs (Statement.CloneTo): Clone variables before statements
2803 to allow remaping of local variables.
2805 2007-08-03 Marek Safar <marek.safar@gmail.com>
2807 A fix for bug #82296
2810 * report.cs: Log crash details for future clone problems.
2812 * statement.cs (Return.Clone): Don't clone non-existent expression.
2814 2007-08-03 Raja R Harinath <harinath@gmail.com>
2816 * class.cs (TypeContainer.AddBasesForPart): Make virtual.
2817 (Class.AddBasesForPart): Move CS0537 check here from ...
2818 * cs-parser.jay (class_declaration): ... here. Move calling of
2819 'AddBasesForPart' to ...
2820 (class_bases): ... here.
2821 (struct_declaration, interface_declaration): Update to changes.
2823 2007-08-02 Marek Safar <marek.safar@gmail.com>
2825 A fix for bug #81923
2827 * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
2828 conversion is allowed.
2830 2007-08-02 Marek Safar <marek.safar@gmail.com>
2832 A fix for bug #81564
2834 * ecore.cs (EventExpr): Add IsBase handling.
2836 * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
2839 2007-08-02 Raja R Harinath <harinath@gmail.com>
2841 Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
2842 * cs-parser.jay: Some whitespace cleanups.
2843 (current_delegate): New.
2845 (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
2846 a dummy code block, and use 'type_name' instead of 'member_name'.
2847 (interface_declaration, class_declaration): Likewise.
2848 (delegate_declaration): Likewise. Rearrange slightly and use
2850 * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
2851 (GetKeyword): Update to change. Use '!foo' instead of 'foo == false'.
2853 2007-08-02 Marek Safar <marek.safar@gmail.com>
2855 A fix for bug #82039
2857 * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
2860 * typemanager.cs (CSharpName): Split to string overload.
2862 2007-08-02 Marek Safar <marek.safar@gmail.com>
2865 * report.cs: Updated warning CS0472.
2867 2007-08-01 Marek Safar <marek.safar@gmail.com>
2869 A fix for bug #82181
2871 * cs-tokenizer.cs: Ignore partial keyword inside block expression.
2873 2007-08-01 Marek Safar <marek.safar@gmail.com>
2875 A fix for bug #82277
2876 * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
2878 2007-08-01 Marek Safar <marek.safar@gmail.com>
2880 ** C# 3.0 Type Inference (major bits are working)
2882 * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
2883 (.ImplicitStandardConversionExists): Uses compatible.
2884 (.ExplicitTypeInference): Infers type arguments based on explicit arguments
2885 (.InferReturnType): New method.
2886 (.Compatible): Refactored.
2887 (.ResolveParameters): Uses factory to create resolved parameters.
2888 (.CompatibleMethod): Add probing mode support.
2889 (AnonymousContainer): Removed unused fields. Split Define and Resolve to
2890 clearly distinguish between 2 different operations.
2891 (LambdaMethod): Moved to lambda.cs.
2892 (AnonymousMethod): Removed unused fields and methods.
2893 (AnonymousDelegate): Simplified.
2895 * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
2897 * convert. cs (ImplicitConversionStandard): Compatible works differently.
2899 * delegate.cs (Delegate): New mehods to reduce code duplication.
2900 (.GetConstructor): New method.
2901 (.GetInvokeMethod): New method.
2902 (DelegateCreation): Updated.
2904 * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
2906 (OverloadResolve): Made probing little bit faster.
2908 * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
2911 * generic.cs (TypeInferenceContext): Dummy implementation.
2913 * iterators.cs: Updated after Resolve/Define rename.
2915 * lambda.cs (LambdaExpression)
2916 (.ResolveParameters): Handles both type of arguments and type inference too.
2918 * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
2919 (InflateTypes): Updated.
2921 * support.cs (InflateTypes): Changed signature and updated.
2923 * typemanager.cs (LookupMemberCache): Better dynamic type check.
2924 (MemberLookup_FindMembers): More MS tricks.
2925 (GetParameterData): Ditto.
2926 (GetDelegateParameters): Uses quick path for dynamic types.
2928 2007-08-01 Marek Safar <marek.safar@gmail.com>
2930 * class.cs (MethodData.Define): EmitContext is required for generic stuff
2933 2007-07-31 Marek Safar <marek.safar@gmail.com>
2935 * statement.cs (ProcessParameters): Don't crash when parameters have wrong
2938 2007-07-26 Jb Evain <jbevain@novell.com>
2940 * typemanager.cs (TypeManager.GetConstructor): Add a method overload
2941 which takes a boolean 'report_errors', similar to the GetMethod.
2942 (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
2943 in .net 2.1, do not report errors here.
2945 * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
2946 System.Runtime.CompilerServices.RequiredAttributeAttribute and
2947 System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
2950 * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
2951 of the type InternalsVisibleToAttribute before the first call
2952 to CoreLookupType which is allowed to fail (third boolean parameter
2953 to true). Because, during the resolution for a type that is not
2954 immediately found, we try to check if the type is not defined in
2955 a friend assembly, and to do so, we need the
2956 InternalVisibleToAttribute.
2958 2007-07-23 Miguel de Icaza <miguel@novell.com>
2960 * expression.cs (Binary): Add support for the brain-dead CSC 2.x
2961 feature that allows structs to be compared against null and inline
2962 the result as true or false.
2964 Notice that the same code is not permitted inside a generic block
2965 of code that would do:
2967 class Foo<T> where T : struct {
2974 It is only allowed if the type of T is not bound (no where
2975 clause). In my opinion, this CSC 2 behavior is broken but people
2976 seem to be using it (IronRuby does, a few bug reports on bugzilla
2977 have it and some people have complained about it).
2979 All of the users that depend on this behavior have code that is
2982 * report.cs (Warning, Error): make these take object arguments,
2983 not strings, as that allows us to take advantage of Format.
2985 2007-07-20 William Holmes <billholmes54@gmail.com>
2987 * decl.cs: Changed MemberName.CountTypeArguments to also check the
2988 Left member variable for the Count.
2989 * doc.cs: Changed DocUtil.GetMethodDocCommentName to call
2990 MemberName.CountTypeArguments to avoid a NRE.
2992 This code is contributed under the MIT X11 license
2994 2007-07-18 Marek Safar <marek.safar@gmail.com>
2996 * cs-tokenizer.cs: Improved lambda parsing and removed old code.
2998 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
3000 * doc.cs : generic method arguments are written as ``x while generic
3001 type arguments are `x. Combined with the previous change, fixed bug
3004 2007-07-18 Raja R Harinath <rharinath@novell.com>
3007 * expression.cs (Binary.ResolveOperator): When converting
3008 'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
3010 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
3012 * doc.cs : when T: or whatever x: is specified, it does not really
3013 check the doc comment's syntax correctness. Fixed bug #82006.
3015 2007-07-18 Marek Safar <marek.safar@gmail.com>
3017 * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
3018 LambdaExpression better.
3020 * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
3022 * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
3024 * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
3025 as it can be generated.
3027 * expression.cs (Invocation.Error_InvalidArguments): Show correct
3030 * lambda.cs (LambdaExpression): Refactored to share same code with
3031 AnonymousMethodExpression.
3033 2007-07-17 Marek Safar <marek.safar@gmail.com>
3035 * anonymous.cs (MakeName): Include host name for easier debugging.
3036 (LambdaMethod): New class for lambda spcecific stuff.
3038 * attribute.cs: Set EmitContext return type.
3040 * class.cs: Set EmitContext return type.
3042 * codegen.cs (EmitContext): Return type cannot be null to stop messing
3043 with null/void meaning.
3045 * iterators.cs (ContainerType): Implemented.
3047 * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
3049 * statement.cs (Return): Updated to lambda expressions.
3050 (Block.CloneTo): Parent can be null.
3052 2007-07-13 Marek Safar <marek.safar@gmail.com>
3054 A fix for bug #81917
3055 * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
3057 * class.cs (FixedField): Check whether field is in unsafe scope.
3059 * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
3060 (FieldExpr.Emit): Fixed buffers cannot be volatile.
3062 * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
3065 * statement.cs (Fixed.Resolve): Simplified fixed buffers.
3067 2007-07-13 Marek Safar <marek.safar@gmail.com>
3069 * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
3070 rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
3073 2007-07-13 Marek Safar <marek.safar@gmail.com>
3075 * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
3077 2007-07-13 Marek Safar <marek.safar@gmail.com>
3079 * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
3080 (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
3082 * codegen.cs(EmitContext): Add ProbingMode flag.
3084 * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
3086 * driver.cs: For now set both warning values.
3088 * ecore.cs (SimpleName): Name is readonly.
3089 (MethodGroup.OverloadResolve): One quick path for probing.
3091 * expression.cs (Unary): Set Oper r/o.
3092 (Binary): Set Oper r/o.
3093 (ParameterReference): Set few instance variables as r/o.
3094 (ParameterReference.DoResolveBase): Don't capture aruments when
3096 (Invocation.CloneTo): Fixed typo, looks easy, yeah.
3097 (Arglist): arguments are private.
3098 (SizeOf): type is private and r/o.
3099 (MemberAccess): arguments are private.
3101 * report.cs: Enhanced reporting on/off capabilities.
3103 * lambda.cs: Uses ec.IsInProbingMode.
3104 (ContextualReturn): Derives from return.
3106 * rootcontext.cs: For now set both warning values.
3108 * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
3110 (Return.Resolve): Don't die immediately.
3111 (Block.Resolve): Speed-up probing.
3112 (Block.CloneTo): Clone only child blocks.
3114 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
3116 * iterators.cs: reverted Miguel's latest change (r81925) as it
3117 breaks the build in System.
3119 2007-07-13 Miguel de Icaza <miguel@novell.com>
3121 * iterators.cs (Yield.CheckContext): Check for the iterator type
3122 also here as we can call into Yield even in codepaths that are not
3124 (MethodOrOperator is the only path that was checked).
3126 In addition to the standard check, use a more specific check for
3127 constructors to report a more verbose error.
3129 2007-07-12 Miguel de Icaza <miguel@novell.com>
3131 * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
3132 report the warning and continue
3134 * statement.cs (Using.EmitLocalVariableDecls): We were leaving
3135 values on the stack on the call to Emit. Use EmitStatement if
3136 possible, or using Emit + Pop if not possible. Fixes #82064
3138 2007-07-12 Raja R Harinath <rharinath@novell.com>
3140 * expression.cs (Invocation.IsApplicable): Reorganize slightly to
3141 avoid try...finally in some cases.
3143 2007-07-10 Marek Safar <marek.safar@gmail.com>
3145 * attribute.cs (Attribute.ResolveConstructor): Uses method group.
3147 * class.cs (ConstructorInitializer.Resolve): Use and keep method group
3148 instead of method. Re-use standard error handling.
3149 (ConstructorInitializer.Emit): Simplified.
3151 * delegate.cs: Updated after Invocation.EmitCall change.
3153 * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
3154 (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
3155 (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
3156 method and don't permanently changing input arguments.
3157 (MethodGroupExpr): Introduced resolved best_candidate, when method group
3158 is resolved it has one of the candidates is the best one which is later
3159 used to emit. Removed a few unused method.
3160 (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
3162 * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
3163 (Binary.ResolveOperator): Ditto.
3164 (ConditionalLogicalOperator.DoResolve): Ditto.
3165 (Invocation): Uses method group.
3166 (Invocation.DoResolve): Simplified.
3167 (Invocation.EmitCall): Removed useless is_static.
3168 (Invocation.Emit): Delegate to method group.
3169 (Invocation.EmitStatement): Simplified.
3170 (New): Uses method group.
3171 (MemberAccess.DoResolve): Don't destroy original expression.
3173 * statement.cs (ForEach.Resolve): Use null for no method arguments.
3175 2007-07-04 Marek Safar <marek.safar@gmail.com>
3177 * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
3180 * lambda.cs: Add custom error message type.
3182 2007-07-03 Marek Safar <marek.safar@gmail.com>
3184 * lambda.cs: Simplified little bit.
3186 * parameter.cs: Introduced ImplicitLambdaParameter.
3187 (Parameters.CreateFullyResolved): New factory instead of ctor.
3191 * delegate.cs: Updated parameter creation.
3193 2007-07-03 Marek Safar <marek.safar@gmail.com>
3195 * ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
3198 * generic.cs: Synchronized with gmcs.
3200 2007-07-03 Marek Safar <marek.safar@gmail.com>
3202 * class.cs (Indexer): Check return type as soon as possible.
3204 * cs-parser.jay: Initialize implicit_value_parameter_type for interface
3207 * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
3209 * expression.cs (Invocation.Error_InvalidArguments): Show type only.
3211 * parameter.cs (Parameter): Use expression type when it is available.
3213 * support.cs (ReflectionParameters.ParameterDesc): Show an extension
3214 method modifier for the first parameter only.
3216 2007-06-24 Marek Safar <marek.safar@gmail.com>
3218 A fix for bug #81938
3219 * typemanager.cs (ChangeType): Fixed couple of char conversions.
3221 * constant.cs: Tide up an exception message.
3223 2007-06-22 Marek Safar <marek.safar@gmail.com>
3225 * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
3226 an uninitialized variable is used.
3228 * expression.cs (LocalVariableReference.DoResolve): Ditto.
3230 2007-06-22 Marek Safar <marek.safar@gmail.com>
3232 * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
3233 not found error handling.
3235 * expression.cs (ArrayCreation): Removed redundant fields and little bit
3237 (ArrayCreation.ResolveArrayElement): To be ready to customization.
3238 (ArrayCreation.DoResolve): Simplified.
3239 (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
3240 its own resolve process.
3241 (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
3243 2007-06-20 Marek Safar <marek.safar@gmail.com>
3245 * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
3248 2007-06-20 Marek Safar <marek.safar@gmail.com>
3250 * cs-tokenizer.cs: Removed var related stuff.
3252 * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
3253 (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
3254 a type and a keyword at same time.
3256 * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
3259 * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
3260 implicitly typed arrays, more changes will follow.
3262 * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
3264 2007-06-19 Marek Safar <marek.safar@gmail.com>
3266 * ecore.cs (VarExpr): Removed Handled field.
3268 * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
3269 build-in assign functionality.
3270 (ForEach.Resolve): Removed all implicitly typed local variable code and
3272 (ArrayForeach.Resolve): Infer implicitly typed local variable here.
3273 (CollectionForeach.Resolve): Infer implicitly typed local variable here.
3275 2007-06-18 Marek Safar <marek.safar@gmail.com>
3277 * assign.cs: Removed implicitly typed local variable check.
3279 * expression.cs (LocalVariableReference.DoResolve): Add check for self
3280 referencing implicitly typed local variable.
3281 (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
3284 * statement.cs (Fixed): Removed unsupported implicitly typed local
3287 2007-06-15 Marek Safar <marek.safar@gmail.com>
3289 * decl.cs (MemberName): Moved all Unbound stuff to parser.
3291 2007-06-14 Marek Safar <marek.safar@gmail.com>
3293 A fix for bugs #81855 and #76274
3294 * attribute.cs (AttachTo): Always set owner for global attributes to
3297 * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
3300 * cs-parser.jay: Assembly and module attributes must precede all other
3301 elements except using clauses and extern alias declarations.
3303 2007-06-13 Marek Safar <marek.safar@gmail.com>
3305 A fix for bug #81748
3307 * expression.cs: More checks for non ISO-1 features.
3309 2007-06-12 Marek Safar <marek.safar@gmail.com>
3311 A fix for bug #81807
3312 * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
3313 present inside switch statement and it is required by nullable check.
3315 2007-06-12 Marek Safar <marek.safar@gmail.com>
3317 A fix for bug #81840
3318 * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
3319 when type matching fails.
3321 * namespace.cs: Tiny error message change.
3323 2007-06-12 Marek Safar <marek.safar@gmail.com>
3325 * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
3326 reporting. Added automatic property check.
3328 * class.cs: Updated after CheckAbstractAndExtern relocation.
3329 (AEventPropertyAccessor.GetSignatureForError): Customized.
3331 2007-06-11 Marek Safar <marek.safar@gmail.com>
3333 * class.cs (DefineBaseTypes): Base type can be undefined.
3335 * ecore.cs (TypeLookup): Minor refactoring.
3336 (DoResolveAsTypeStep): Removed redundant check.
3338 * namespace.cs (Lookup): Removed redundant check.
3340 * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal
3341 ResolveAsTypeTerminal step.
3342 (BootstrapCorlib_*): Simplified.
3343 (PopulateCoreType): Core types can be now external.
3345 2007-06-07 Marek Safar <marek.safar@gmail.com>
3347 * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
3349 (InferTypeArguments): Infers anonymous expression type arguments.
3350 (Compatible): Split to Compatible and InferTypeArguments.
3352 * lambda.cs: Updated.
3354 2007-06-08 Marek Safar <marek.safar@gmail.com>
3356 * anonymous.cs (AnonymousContainer): Marked as compiler generated.
3358 2007-06-07 Raja R Harinath <harinath@gmail.com>
3360 Fix #80477, cs0135-2.cs, cs0135-3.cs
3361 * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
3362 names to the "known" variables list.
3363 (Block.CheckInvariantMeaningInBlock): Handle the fact the
3364 parameter names are also "known".
3365 (Block.CheckError136): Remove.
3366 (ExplicitBlock.CloneTo): New. Set 'known_variables' in target to
3369 2007-06-07 Marek Safar <marek.safar@gmail.com>
3371 * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
3373 2007-06-06 Marek Safar <marek.safar@gmail.com>
3375 * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
3376 internal error not an user error.
3378 * expression.cs (IsApplicable): Refactored to make debugging easier.
3380 * support.cs: More tricks for non-mono runtimes.
3382 * typemanager.cs (CoreLookupType): Made public.
3383 (InitSystemCore): All linq specific stuff moved to linq.cs
3385 2007-06-05 Marek Safar <marek.safar@gmail.com>
3387 * typemanager.cs (CSharpSignature): One more missing build-in types
3389 More tricks for non-mono runtime.
3391 2007-06-05 Raja R Harinath <harinath@gmail.com>
3393 * statement.cs (Block.CheckError136_InParents): Remove.
3394 (Block.AddVariable): Use GetParameterInfo instead.
3395 (ToplevelBlock.ProcessArguments): Likewise.
3397 2007-06-04 Raja R Harinath <rharinath@novell.com>
3399 * statement.cs (ToplevelBlock.CloneTo): New. Copy over parameter
3401 (ToplevelBlock.GetParameterInfo): Split out of ...
3402 (ToplevelBlock.GetParameterRefernce): ... this.
3403 (ToplevelBlock.ParameterMap): Remove.
3404 * expression.cs (ParameterReference): Update to use
3405 ToplevelParameterInfo.
3407 * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
3410 * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
3411 * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
3413 * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
3414 (ToplevelBlock.ProcessParameters) ... here.
3415 (ToplevelBlock..ctor): Invoke it.
3417 * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
3420 * statement.cs (IKnownVariable): New interface.
3421 (LocalInfo): Implement it.
3422 (ToplevelParameterInfo): New class.
3423 (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
3424 (ExplicitBlock.GetKnownVariable): Likewise. Rename from
3425 GetKnownVariableInfo.
3427 2007-06-03 Raja R Harinath <harinath@gmail.com>
3429 Partly speed up CS0136 error checks.
3430 * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
3431 'recurse' parameter.
3432 (Block.DoCheckError136): Only check errors in parameters. Move
3433 local variable checks ...
3434 (Block.AddVariable): ... here, and ...
3435 (ToplevelBlock.ResolveMeta): ... here.
3437 2007-06-02 Raja R Harinath <harinath@gmail.com>
3439 * statement.cs (Block.IsChildOf): Remove.
3441 * statement.cs (Statement.Clone): Move special case code ...
3442 (Block.CloneTo): ... here.
3444 2007-05-29 Raja R Harinath <rharinath@novell.com>
3446 * statement.cs (ToplevelBlock.container): Remove field. It's
3447 redundant with 'Parent'.
3448 (ToplevelBlock.ContainerBlock): Remove accessor.
3449 (ToplevelBlock..ctor): Update to changes. Register anonymous
3450 child with parent here, ...
3451 * cs-parser.jay (end_anonymous): ... not here. Don't modify
3453 (start_anonymous): Don't save current_block.
3454 (top_current_block): Remove.
3456 * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
3457 (Block.Resolve): Update to changes.
3458 (Block..ctor): Move setting of "correct" 'Toplevel'
3459 and 'Explicit' fields to ...
3460 (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
3462 2007-05-27 Raja R Harinath <harinath@gmail.com>
3465 * statement.cs (Block.Implicit): Remove.
3466 (Block): Update to changes.
3467 * flowanalysis.cs: Likewise.
3469 Mildly speed up CheckInvariantMeaningInBlock
3470 * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
3471 Recursively call AddKnownVariable to all enclosing blocks.
3472 (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
3473 Remove recursive calls.
3474 (Block): Update to changes.
3476 New ExplicitBlock invariants
3477 * statement.cs (Block.Explicit): New field. It points to the
3478 immediately enclosing non-implicit block.
3479 (Block..ctor): Maintain the invariant.
3480 * cs-parser.jay: Take advantage of invariant.
3482 Introduce ExplicitBlock
3483 * statement.cs (ExplicitBlock): New.
3484 (ToplevelBlock): Derive from it.
3485 (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
3487 (Block.Implicit): Update to changes.
3488 * cs-parser.jay: Update to changes.
3491 * codegen.cs (EmitContext.IsLastStatement): Remove.
3492 * statement.cs (Block.DoEmit): Update to changes.
3494 2007-05-25 Raja R Harinath <rharinath@novell.com>
3496 * cs-parser.jay: Use 'start_block' and 'end_block' rather than
3497 modifying current_block directly.
3499 2007-05-23 Scott Peterson <lunchtimemama@gmail.com>
3501 * class.cs: Implemented automatic properties (C# 3.0)
3502 Thanks to Marek for the help.
3504 2007-05-23 Raja R Harinath <rharinath@novell.com>
3506 * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
3507 variable as assigned, note also that all its components are
3509 (MyBitVector.SetRange): New. Function to set multiple bits to true.
3511 2007-05-19 Marek Safar <marek.safar@gmail.com>
3513 * anonymous.cs, class.cs: Emit Compiler generated attribute when
3514 member is marked as compiler generated.
3516 * decl.cs (MemberCore): Refactored ModFlags into property.
3518 * modifiers.cs: Add new modifier (COMPILER_GENERATED).
3519 (Check): Check only accessibility modifiers.
3521 2007-05-18 Raja R Harinath <rharinath@novell.com>
3523 Track all assignable slots in one bit array
3524 * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
3525 (ToplevelBlock.ResolveMeta): Don't create a VariableMap. Move
3526 logic from VariableMap constructor here. Use the same 'offset'
3527 variable that's later used for computing offsets of local
3529 * flowanalysis.cs (UsageVector.parameters): Remove.
3530 (UsageVector): Update to changes.
3531 (VariableMap): Remove.
3533 Avoid creating ParameterMap in every block
3534 * statement.cs (Block.ParameterMap): Move ...
3535 (ToplevelBlock.ParameterMap): ... here.
3536 (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
3538 * flowanalysis.cs (FlowBranching.param_map): Remove.
3539 (FlowBranching.UsageVector): Update to changes.
3540 (FlowBranchingToplevel.CheckOutParameters): Likewise.
3542 * statement.cs (Block.CloneTo): Clone Toplevel field too.
3544 * expression.cs (ParameterReference): Distinguish between block
3545 where parameter was referenced and declared.
3547 2007-05-18 Marek Safar <marek.safar@gmail.com>
3549 * flowanalysis.cs, statement.cs: Put back improved error handling.
3551 2007-05-15 Scott Peterson <lunchtimemama@gmail.com>
3555 Imporved object and collection initialization (C# 3.0).
3557 2007-05-15 Marek Safar <marek.safar@gmail.com>
3559 A fix for bug #81380
3560 * expression.cs (Is.DoResolve): Only value types have constant `is'
3563 2007-05-15 Raja R Harinath <rharinath@novell.com>
3565 * statement.cs (ToplevelBlock.child): Remove.
3567 2007-05-15 Raja R Harinath <harinath@gmail.com>
3569 Rationalize ResolveMeta: refactoring
3570 (Block.ResolveMeta): Remove wrong or superfluous comments. Carve
3571 out constant handling code into ...
3572 (Block.DoResolveConstants): ... this.
3574 Rationalize ResolveMeta: kill local_map
3575 * statement.cs (Block.local_map, Block.LocalMap): Remove.
3576 (Block.AssignableSlots): New.
3577 (Block.ResolveMeta): Make protected. Don't create a VariableMap
3578 for locals -- move code from VariableMap here. Avoid unnecessary
3580 * flowanalysis.cs (FlowBranching.local_map): Remove.
3581 (FlowBranching..ctor): Use Block.AssignableSlots.
3582 (VariableMap): Remove unused constructors.
3584 2007-05-11 Raja R Harinath <rharinath@novell.com>
3586 * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
3588 2007-05-11 Marek Safar <marek.safar@gmail.com>
3590 * typemanager.cs (IsFriendAssembly): Should not be called for building
3593 2007-05-09 Marek Safar <marek.safar@gmail.com>
3595 * literal.cs (NullConstant): Print null in all cases.
3597 * expression.cs (Binary.ResolveOperator): Implemented delegate
3598 comparison based on C# 2.0 changes.
3600 2007-04-28 Scott Peterson <lunchtimemama@gmail.com>
3602 This code is contributed under the MIT X11 license
3604 The following enables support for several C# 3.0 language features:
3606 * cs-tokenizer.cs: Added support for the "var" keyword.
3608 * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
3609 Added VarExpr class to facilitate type inferencing.
3611 * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
3612 to support anonymous types.
3614 * assign.cs: Added support for type inferencing and initialization.
3616 * anonymous.cs: Added AnonymousClass class to enable anonymous types.
3618 * expression.cs: Added implicit array support to ArrayCreation.
3619 Added 5 types and 1 interface:
3621 IInitializable Implementing classes can inject initializing
3622 statements after object instantiation.
3624 Initializer Stores data for object initialization.
3626 AnonymousType An expression for anonymous types.
3628 AnonymousTypeParameter Stores data about an anonymous type's field.
3630 NewInitialize An expression for object initialization.
3632 CollectionInitialize An expression for collection initialization.
3634 * statement.cs: Added "var" keyword support to the foreach, using, and fixed
3637 2007-05-06 Marek Safar <marek.safar@gmail.com>
3639 A fix for bug #81500
3640 * cs-tokenizer.cs: Add special handling for coalescing operator.
3642 2007-05-06 Marek Safar <marek.safar@gmail.com>
3644 A fix for bug #81529
3645 * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
3646 its value from base class until it is redefined.
3648 2007-05-02 Raja R Harinath <rharinath@novell.com>
3650 Fix regression in cs0631-3.cs
3651 * cs-parser.jay (operator_declarator): Add opt_attributes to error
3652 fallback. Make error fallback catch more cases.
3654 2007-05-01 Miguel de Icaza <miguel@novell.com>
3656 * cs-parser.jay: Allow parameters in operator declarations to have
3659 2007-04-27 Miguel de Icaza <miguel@novell.com>
3661 * statement.cs (If.CloneTo): Only clone the FalseStatement if it
3664 * lambda.cs (ContextualReturn.Resolve): An expression is valid
3665 inside the ContextualReturn, it does not have to be an
3666 ExpressionStatement.
3668 2007-04-24 Miguel de Icaza <miguel@novell.com>
3670 * lambda.cs (ContextualReturn.Resolve): if the return type is not
3673 2007-04-23 Miguel de Icaza <miguel@novell.com>
3675 * anonymous.cs (AnonymousContainer): split the virtual Resolve
3676 method in two methods: ResolveNoDefine and Resolve.
3678 ResolveNoDefine will stop just after ResolveTopBlock has been
3681 Resolve will then continue by creating a method and issuing the
3682 call to method.Define ().
3684 (AnonymousMethod): Split and implement the new Resolve and
3685 ResolveNoDefine as well.
3687 * lambda.cs (LambdaExpression): Split the anonymous method
3688 resolution code into a separate routine (CoreCompatibilityTest)
3689 from DoCompatibleTest.
3691 (LambdaExpression.TryBuild): New method, this method tries to
3692 build the LambdaExpression with the given set of types to be used
3693 as the types for the various parameters of the lambda expression.
3695 If the compilation succeed with the given types, the infered type
3696 of the Anonymous method is returned, otherwise null is returned.
3698 2007-04-23 Marek Safar <marek.safar@gmail.com>
3700 A fix for bug #81414
3701 * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
3703 2007-04-22 Miguel de Icaza <miguel@novell.com>
3705 * cs-tokenizer.cs: Change various identifiers here from the
3706 camelCasing to the recommended Linux-like style for instance
3707 variables from the Coding Guidelines.
3709 2007-04-19 Martin Baulig <martin@ximian.com>
3712 (Convert.ImplicitReferenceConversionCore): Allow conversions from
3713 System.Enum to System.ValueType.
3715 2007-04-13 Martin Baulig <martin@ximian.com>
3717 Rewrote implicit reference conversions. We need to distinguish
3718 between implicit reference conversions (13.1.4) and implicit
3719 boxing conversions (13.1.5).
3721 According to the spec, there's an an implicit conversion
3722 "From a one-dimensional array-type S[] to IList<T> and base
3723 interfaces of this interface, provided there is an implicit
3724 reference conversion from S to T." Note that this does not
3725 include boxing conversions.
3728 (Convert.ImplicitTypeParameterBoxingConversion): New method.
3729 (Convert.ImplicitReferenceConversion): Split into
3730 ImplicitReferenceConversionCore() and
3731 ImplicitBoxingConversionExist().
3732 (Convert.ImplicitReferenceConversionExists): Use the new
3733 ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
3735 2007-04-12 Martin Baulig <martin@ximian.com>
3737 * convert.cs (Convert.ImplicitReferenceConversion): Move the
3738 `TypeManager.null_type' checks up to the top of the method.
3740 2007-04-11 Marek Safar <marek.safar@gmail.com>
3742 A fix for bug #81350
3743 * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
3746 2007-04-11 Martin Baulig <martin@ximian.com>
3748 * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
3749 Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
3750 to make this work for generic classes; fixes #79561.
3752 2007-04-11 Martin Baulig <martin@ximian.com>
3754 * expression.cs (As): Add support for nullable types; fixes #79371.
3756 2007-04-11 Martin Baulig <martin@ximian.com>
3758 * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
3759 `type.FullName' is null; fixes #80243.
3761 2007-04-11 Martin Baulig <martin@ximian.com>
3763 * expression.cs (Invocation.IsApplicable): Don't modify the method
3764 if type inference succeeded, but the method was not applicable.
3767 2007-04-10 Marek Safar <marek.safar@gmail.com>
3769 A fix for bug #81324
3770 * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
3771 internal and external namespaces containers.
3773 2007-04-10 Martin Baulig <martin@ximian.com>
3775 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
3776 TypeManager.DropGenericMethodArguments() so we also call
3777 IMethodData.SetMemberIsUsed() for generic methods. Fixes #80357.
3779 2007-04-10 Martin Baulig <martin@ximian.com>
3781 * iterators.cs (Iterator.CreateIterator): Don't crash if
3782 `method.ReturnType' is null. This happens if something went wrong
3783 while resolving that typ (we already reported an error in this case).
3785 2007-04-10 Martin Baulig <martin@ximian.com>
3787 * expression.cs (New.DoResolve): Don't call CheckComImport() on
3788 generic interfaces; report the CS0144 directly.
3790 2007-04-10 Martin Baulig <martin@ximian.com>
3792 * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
3793 `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
3795 2007-04-10 Martin Baulig <martin@ximian.com>
3797 * expression.cs (New.DoEmitTypeParameter): Fix #81109.
3799 2007-04-09 Raja R Harinath <rharinath@novell.com>
3802 * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
3803 * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
3806 * statement.cs (For.Resolve): If resolution fails, use
3809 2007-04-08 Marek Safar <marek.safar@gmail.com>
3811 * anonymous.cs (MakeName): Make faster and zero-based.
3812 (VerifyExplicitParameterCompatibility): Back to mode where generic
3813 parameter is ignored.
3814 (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
3816 * class.cs (EmitType): Method can emit another new method.
3818 * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
3820 * driver.cs: Updated.
3822 * lambda.cs: Reuse predefined empty parameters.
3824 * parameter.cs: Updated
3826 * support.cs: Implemented InflateTypes.
3828 * typemanager.cs (GetFullName): Don't use FullName as it can be null.
3829 (InitSystemCore): Introduced to isolate 3.0 dependencies.
3831 2007-04-03 Martin Baulig <martin@ximian.com>
3835 * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
3836 version of TypeManager.IsOverride() which also works with generic
3839 2007-04-03 Martin Baulig <martin@ximian.com>
3844 (Convert.ExplicitReferenceConversion): We need to cast when
3845 converting from IList<T> to S[].
3847 2007-04-01 Marek Safar <marek.safar@gmail.com>
3849 * decl.cs (FindExtensionMethods): Consider all candidates with same name
3852 * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
3854 2007-03-31 Marek Safar <marek.safar@gmail.com>
3856 * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
3857 argument and return type inferring.
3859 * codegen.cs (InferReturnType): Flag whether return can be inferred.
3860 (ReturnType): Turned to property.
3862 * statement.cs (Return): Implemented return type inferring.
3864 * support.cs (ReflectionParameters): Use local types if possible.
3866 2007-03-30 Raja R Harinath <rharinath@novell.com>
3868 * flowanalysis.cs (FlowBranching.Reachability): Remove.
3869 (FlowBranching.UsageVector): Update to changes.
3871 Prepare to kill 'Reachability'
3872 * flowanalysis.cs (UsageVector): Remove 'Reachability' from
3873 argument of constructor.
3875 2007-03-29 Raja R Harinath <rharinath@novell.com>
3877 Prepare to kill 'Reachability'
3878 * flowanalysis.cs (UsageVector.is_unreachable): New.
3879 (UsageVector): Update to maintain 'is_unreachable' in parallel to
3880 'reachability', and verify they're consistent.
3883 * expression.cs (New.EmitStatement): Handle type parameters here too.
3885 2007-03-29 Martin Baulig <martin@ximian.com>
3890 (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
3891 CompilerGeneratedClass.
3892 (ScopeInfo.EmitScopeInstance): Make this protected.
3893 (CapturedVariable.EmitInstance): Use `Ldarg_0' if
3894 `ec.CurrentAnonymousMethod.Scope == Scope'.
3896 * statement.cs (Block.ScopeInfo): Make this a property.
3898 2007-03-27 Raja R Harinath <harinath@gmail.com>
3900 Prepare to kill 'Reachability'
3901 * flowanalysis.cs (FlowBranching.Reachability): Make class private.
3902 (FlowBranching.UsageVector.Reachability): Remove property.
3903 (FlowBranching.UsageVector.IsUnreachable): New property.
3904 (FlowBranching.UsageVector.ResetBarrier): New.
3905 (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
3906 * codegen.cs, statement.cs: Update to changes.
3908 2007-03-27 Martin Baulig <martin@ximian.com>
3913 (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
3916 2007-03-26 Raja R Harinath <rharinath@novell.com>
3918 * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
3919 instead of TriState. Remove all mention of TriState.
3921 * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
3922 replaced by a boolean. Add boolean 'is_unreachable' field, check
3923 and maintain invariants.
3925 2007-03-25 Marek Safar <marek.safar@gmail.com>
3927 * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
3929 2007-03-25 Marek Safar <marek.safar@gmail.com>
3931 * expression.cs: Stop using obsolete 2.0 opcodes.
3933 2007-03-25 Marek Safar <marek.safar@gmail.com>
3935 * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
3936 one of the latests Martin's fixes.
3938 2007-03-23 Miguel de Icaza <miguel@novell.com>
3940 * expression.cs: On BigEndian systems, swap the bytes, temporary
3941 solution until we get a new bitconverter class.
3943 2007-03-23 Martin Baulig <martin@ximian.com>
3947 * decl.cs (MemberCache.AddMembers): Add generic methods both as
3948 "Method" and "Method`1". Normally, a cache lookup is done on the
3949 "Method" form (ie. without the generic arity), but this one makes
3950 lookups on the full form work as well.
3952 2007-03-22 Raja R Harinath <rharinath@novell.com>
3954 * flowanalysis.cs (Reachability): Reorganize slightly, and remove
3957 2007-03-20 Bill Holmes <billholmes54@gmail.com>
3959 Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
3960 ordered_member_list, to TypeBuilder to store members to be defined
3961 in the order they were parsed in.
3962 - ordered_explicit_member_list contains all properties indexers
3963 and methods that are defined as explicit implementation of an
3964 interface or base class.
3965 - ordered_member_list contains all properties indexers and methods
3966 that are not defined as explicit implementation of an interface
3969 Removed MethodArrayList and IndexerArrayList from TypeBuilder. The
3970 functionality in these removed classes has been replaced with
3971 ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and
3972 CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
3974 Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
3975 to CheckForDuplications inside GetMethod and SetMethod Define Method
3976 to handle method property and indexer name conflicts.
3980 All code is contributed under the MIT/X11 license.
3982 2007-03-20 Martin Baulig <martin@ximian.com>
3984 * class.cs (TypeContainer.Interfaces): Removed; they're now
3985 included in `TypeContainer.Types'.
3987 2007-03-20 Martin Baulig <martin@ximian.com>
3989 Fix #77963, #80314 and #81019. Added gtest-317, ..., gtest-320.
3991 * class.cs (TypeContainer.CreateType): New public method. This is
3992 now called before DefineType() to create the TypeBuilders.
3993 (TypeContainer.DefineType): Don't create the TypeBuilder here; it
3994 has already been created by CreateType().
3995 (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
3996 don't resolve our base classes here; this has been moved into
3997 DefineBaseTypes(). We're now called from CreateType().
3998 (TypeContainer.DefineBaseTypes): New private method; resolve our
3999 base classes here. We're now called from DefineType().
4002 (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
4003 our types first to create all the TypeBuilders. After that, call
4004 TypeContainer.DefineType() on all the types which'll resolve their
4005 base classes and setup the resolve order.
4007 2007-03-20 Martin Baulig <martin@ximian.com>
4009 * class.cs (TypeContainer.Enums): Removed; they're now included in
4010 `TypeContainer.Types'.
4012 2007-03-20 Martin Baulig <martin@ximian.com>
4015 (TypeContainer.DefineType): Don't call ResolveMembers() here.
4016 (TypeContainer.DoResolveMembers): Call DefineType() on our
4017 `compiler_generated' classes; moved here from DefineNestedTypes().
4020 (RootContext.ResolveTree): Call ResolveMembers() on all
4021 TypeContainer's in the `type_container_resolve_order'.
4023 2007-03-19 Marek Safar <marek.safar@gmail.com>
4025 * class.cs: Use corlib to handle InternalMethodImplAttribute.
4027 2007-03-17 Marek Safar <marek.safar@gmail.com>
4029 * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
4030 implementation flags.
4032 2007-03-17 Marek Safar <marek.safar@gmail.com>
4034 * class.cs: More optimizations for type parameters.
4036 2007-03-15 Marek Safar <marek.safar@gmail.com>
4038 * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
4040 * ecore.cs, parameter.cs: More common code for both corlibs.
4042 * typemanager.cs (IsGenericMethod): Simplified.
4044 2007-03-15 Raja R Harinath <rharinath@novell.com>
4046 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
4048 * statement.cs, iterators.cs, lambda.cs: Update to changes.
4050 * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
4051 unconditionally. Simplify explanation.
4052 (Try.Resolve, Using.Resolve): Likewise.
4054 2007-03-15 Martin Baulig <martin@ximian.com>
4058 * decl.cs (DeclSpace): If we're a partial class, use our
4059 `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
4061 2007-03-15 Raja R Harinath <rharinath@novell.com>
4063 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
4065 (FlowBranching.UsageVector): Update to changes.
4066 (FlowBranching.MergeSiblings): Likewise.
4067 * statement.cs: Likewise.
4069 2007-03-15 Martin Baulig <martin@ximian.com>
4074 (MemberCache): Added a special .ctor for type parameters.
4077 (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
4080 2007-03-09 Martin Baulig <martin@ximian.com>
4082 * enum.cs (Enum): Make this a TypeContainer.
4083 (EnumMember): Derive from `Const'.
4086 (Const.DoResolveValue): New protected virtual method; move most of
4087 the functionality of ResolveValue() here so we can override it in
4089 (Const.CreateConstantReference): Make this virtual.
4091 * class.cs (Kind): Add `Kind.Enum'.
4092 (TypeContainer.Emit): Don't emit the enums here; they're already
4093 in the `RootContext.typecontainer_resolve_order'.
4095 * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
4096 here; they're already in the `typecontainer_resolve_order'.
4098 * ecore.cs (EnumConstant.ConvertImplicitly): Add
4099 TypeManager.DropGenericTypeArguments().
4102 (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
4103 (TypeManager.IsEnumType): Likewise.
4104 (TypeManager.EnumToUnderlying): Likewise.
4105 (TypeManager.IsEqual): Add support for enums.
4107 2007-03-12 Raja R Harinath <rharinath@novell.com>
4109 * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
4110 DefaultParameterValueAttribute to be undefined, say if System.dll
4113 2007-03-11 Marek Safar <marek.safar@gmail.com>
4115 * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
4118 2007-03-10 Marek Safar <marek.safar@gmail.com>
4120 * class.cs, parameter.cs: Unified parameters verification.
4122 2007-03-08 Martin Baulig <martin@ximian.com>
4124 * cs-parser.jay (constructor_header): Pass the location to the
4125 newly created TopLevelBlock.
4127 2007-03-07 Martin Baulig <martin@ximian.com>
4129 * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
4131 2007-03-06 Miguel de Icaza <miguel@novell.com>
4133 * convert.cs (ExplicitReferenceConversionExists): Sync this method
4134 with the changes from David, fixes the build.
4136 2007-03-05 David Mitchell <dmitchell@logos.com>
4138 * convert.cs: Implement From System.Collecitons.Generic.IList<T>
4139 and its base interfaces to a one-dimensional array type S[],
4140 provided there is an implicit or explicit reference conversion
4143 2007-03-03 Marek Safar <marek.safar@gmail.com>
4145 * cs-tokenizer.cs: Implemented basic linq grammar.
4147 * driver.cs: Set linq lang version on demand.
4149 2007-02-26 Marek Safar <marek.safar@gmail.com>
4151 * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
4153 2007-02-25 Marek Safar <marek.safar@gmail.com>
4155 * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
4158 * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
4160 Check property and event extern attributes.
4162 * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
4165 2007-02-24 Marek Safar <marek.safar@gmail.com>
4167 A fix for bug #80407
4168 * ecore.cs: Don't report ambiguity error when methods have same parent.
4170 2007-02-23 Marek Safar <marek.safar@gmail.com>
4172 A fix for bug #80878
4173 * class.cs, cs-parser.jay: Event property can host anonymous methods.
4175 2007-02-22 Marek Safar <marek.safar@gmail.com>
4177 * attribute.cs: Enable ExtensionAttribute presence test.
4179 2007-02-22 Marek Safar <marek.safar@gmail.com>
4181 * class.cs: Warn about missing GetHashCode only when Equals is override.
4183 * decl.cs: Check accessibility of type arguments.
4185 * typemanager.cs: Correctly report nullable array.
4187 2007-02-20 Marek Safar <marek.safar@gmail.com>
4189 * class.cs, report.cs: Capture more details when things go wrong.
4191 2007-02-20 Marek Safar <marek.safar@gmail.com>
4193 A fix for bug #80650
4194 * cs-parser.jay: Anonymous container starts at constructor declaration
4195 and not at block beginning because it has to be usable in constructor
4198 * statement.cs: Use context location and not block one for error reporting.
4200 2007-02-18 Marek Safar <marek.safar@gmail.com>
4202 A fix for bug #78712
4203 * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
4206 2007-02-18 Marek Safar <marek.safar@gmail.com>
4208 A fix for bug #80493 by Atsushi Enomoto
4209 * cs-parser.jay: Ignore invalid attribute target.
4211 2007-02-18 Marek Safar <marek.safar@gmail.com>
4213 * cs-tokenizer.cs: Ignore '\0' as white space character.
4215 2007-02-17 Miguel de Icaza <miguel@novell.com>
4217 * cs-parser.jay: Add support for lambda expressions to the mcs
4220 * lambda.cs: Only clone when we are probing, not on the final call
4221 (Compatible is the final call).
4223 * statement.cs (CloneContext): Introduce class to provide block
4224 remapping during clone.
4226 All statements Clone themselves now.
4228 (Clone): special handling for blocks, when we clone a block, we
4229 register the block inside this routine, as children of the block
4230 might trigger a lookup.
4232 * expression.cs: Add support for CloneContext in all expressions.
4234 2007-02-17 Marek Safar <marek.safar@gmail.com>
4236 A fix for bug #80493
4237 * statement.cs: Report ambiguous warning when interfaces are not related.
4239 2007-02-15 Marek Safar <marek.safar@gmail.com>
4241 C# 3.0 extension methods.
4243 * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
4244 cannot be used directly.
4246 * class.cs (Class.Emit): Emit extension attribute if any class method
4247 is extension method.
4248 (Method.Define): Add basic extension method validation conditions.
4249 (Method.Emit): Emit extension attribute for method.
4251 * codegen.cs (AssemblyClass): Emit extension attribute if at least one
4252 extension method exists. Currently we follow same approach as Microsoft
4253 does, emit even if a method or a class are private but this can change
4256 * cs-parser.jay: Add handling of `this' keyword in method parameters
4259 * decl.cs (DeclSpace.IsStaticClass): New property.
4260 (MemberCache.FindExtensionMethods): Looks for extension methods with
4261 defined name and extension type.
4263 * doc.cs: Updated after OverloadResolve changes.
4265 * driver.cs: Add new soft reference to System.Core.dll.
4267 * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
4268 (ExtensionMethodGroupExpr): Represents group of extension methods.
4270 * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
4271 BetterFunction, IsOverride, IsAncestralType, OverloadResolve
4272 to MethodGroupExpr and made non-static for easier customization.
4273 (Invocation.DoResolve): Add extension method lookup when no standard
4275 (MemberAccess.DoResolve): Try extension methods if no member exists.
4277 * modifiers.cs: Add METHOD_EXTENSION modifier.
4279 * namespace.cs (RegisterExtensionMethodClass): Register class namespace
4280 as well as candidate extension type.
4281 (ComputeNamespaces): When assembly constains extension methods registers
4283 (Namespace.RegisterExternalExtensionMethodClass): Register type for later
4284 extension method lookup.
4285 (Namespace.LookupExtensionMethod): Looks for extension method in this
4287 (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
4288 find a method which matches name and extensionType.
4290 * parameter.cs (Parameter): Add This modifer.
4291 (HasExtensionMethodModifier): New property.
4292 (Resolve): Add extension parameter check.
4293 (ModFlags): turned to property to exclude this modifier as it is not real
4295 (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
4297 * support.cs (ParameterData): Add ExtensionMethodType.
4298 (ReflectionParameters): Implemented ExtensionMethodType interface property.
4300 * typemanager.cs: Add type and ctor extension attribute type.
4302 2007-02-15 Miguel de Icaza <miguel@novell.com>
4304 * report.cs (DisableErrors, EnableErrors): used to prevent error
4305 output when we are "trying" to compile various methods with
4308 * ecore.cs (Expression): Add Clone method that calls the virtual
4309 CloneTo method. The current CloneTo method in Expression throws
4310 an exception so we can track down all the places where this must
4311 be implemented (not using abstract, because that would be a lot of
4312 up-front-work before we can start testing the implementation
4315 Important: we only need Clone capabilities for expressions created
4316 by the parser, as the expressions we will be cloning are
4317 expressions in the pre-resolved state. This vastly simplifies
4320 (SimpleName): Add CloneTo that does nothing.
4321 (EmptyCast): Add CloneTo.
4323 * expression.cs (Binary): Implement CloneTo.
4324 (Invocation.IsApplicable): Store the current ec in
4325 EmitContext.TempEc and restore it on return. This is used so we
4326 do not have to sprinkle hundres of methods with an extra
4327 EmitContext, we know that the only user is the lambda expression
4328 ImplicitConversionExists code.
4330 (Argument): Add Cloning capabilities.
4331 (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
4332 Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
4333 ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
4334 UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
4335 IndexerAccess): Add Clone capability.
4337 (LocalVariableReference, This): TODO: needs cloned Block mapping.
4339 (Argument): Add cloning capability.
4341 * assign.cs (Assign): Implement CloneTo.
4343 * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
4345 * lambda.cs (ImplicitStandardConversionExists): Implement lambda
4346 version by calling Convert with the EmitContext (that we are
4347 currently storing in ec, this is not great, but will do for now,
4348 to avoid passing EmitContext parameters to hundreds of functions
4349 that do not need them now).
4351 (SetExpression): Remove, it is not needed.
4353 (ContextualReturn): Implement CloneTo.
4355 * statement.cs (Statement): Implement cloning infrastructure,
4356 similar to expressions.
4358 (Block): Partial implementation of Clone for statements.
4360 (Return): Implement clone.
4362 * constant.cs (Constant.CloneTo): New method, does nothing.
4364 * codegen.cs (TempEc): Add a static EmitContext as a temporary
4365 solution, until we decide how to exactly do this.
4367 2007-02-14 Marek Safar <marek.safar@gmail.com>
4369 A fix for bug #80493
4370 * class.cs (FindOutBaseMethod): When the base accessor does not exist and
4371 a property is override we need to use second accessor.
4373 2007-02-13 Marek Safar <marek.safar@gmail.com>
4375 A fix for bug #80418
4376 * attribute.cs, class.cs: Use correct calling conventions for pinvoke
4379 2007-02-13 Marek Safar <marek.safar@gmail.com>
4381 Another fix for bug #80749
4382 * pending.cs: Abstract class has priority over interfaces.
4384 2007-02-13 Marek Safar <marek.safar@gmail.com>
4386 Another fix for bug #80749
4387 * pending.cs: Abstract class has priority over interfaces.
4389 2007-02-13 Marek Safar <marek.safar@gmail.com>
4391 Another fix for bug #80749
4392 * pending.cs: Abstract class has priority over interfaces.
4394 2007-02-13 Marek Safar <marek.safar@gmail.com>
4396 Another fix for bug #80749
4397 * pending.cs: Abstract class has priority over interfaces.
4399 2007-02-13 Marek Safar <marek.safar@gmail.com>
4401 * class.cs Better error message.
4403 * driver.cs: Add shorter versions of -optimize option.
4405 2007-02-13 Martin Baulig <martin@ximian.com>
4407 * class.cs (Constructor.Emit): Check the return value of
4408 ec.ResolveTopBlock() and return on error.
4410 2007-02-13 Raja R Harinath <rharinath@novell.com>
4412 * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
4413 message to fix error message regression.
4415 2007-02-12 Marek Safar <marek.safar@gmail.com>
4417 * delegate.cs: Delegate creation expression cannot be of Nullable type.
4419 2007-02-12 Marek Safar <marek.safar@gmail.com>
4421 A fix for bug #80749
4422 * assign.cs (FieldInitializer): FieldInitializer has to keep track of
4423 its parent container.
4425 * class.cs (DefineFieldInitializers): Each initializer can has different
4428 * const.cs: Updated.
4430 2007-02-11 Miguel de Icaza <miguel@novell.com>
4432 * lambda.cs (LambdaExpression.Compatible): Remove some early code,
4433 now all the heavy lifting to check that embedded statements or
4434 expressions have the right form is done in the ContextualReturn.
4436 (ContextualReturn): New class.
4438 * ecore.cs (Error_InvalidExpressionStatement): Make a helper
4439 method that can be invoked to report 201, so we do not replicate
4442 * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
4444 * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
4445 treating tabs as spaces.
4447 2007-02-09 Marek Safar <marek.safar@gmail.com>
4449 A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
4450 * assign.cs: Use full implicit conversion for right side check.
4452 2007-02-09 Marek Safar <marek.safar@gmail.com>
4454 * statement.cs (Switch): Switch over boolean type is not standardized.
4456 2007-02-08 Marek Safar <marek.safar@gmail.com>
4458 A fix for bug #80755
4459 * decl.cs (FindBaseEvent): Don't use method cache for events.
4461 2007-02-07 Marek Safar <marek.safar@gmail.com>
4463 * cs-parser.jay: Better syntax error handling.
4465 * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
4466 instead of underlying type value.
4468 2007-02-06 Marek Safar <marek.safar@gmail.com>
4470 * driver.cs: Check define identifier before is registered.
4472 * namespace.cs: Use existing error message.
4474 * report.cs: New warning.
4476 2007-02-06 Marek Safar <marek.safar@gmail.com>
4478 A fix for bug #80742
4479 * expression.cs: Delegate Invoke method can be called directly.
4481 2007-02-06 Marek Safar <marek.safar@gmail.com>
4483 A fix for bug #80676
4484 * class.cs (IsEntryPoint): The Main method can have params modifier.
4486 2007-02-04 Miguel de Icaza <miguel@novell.com>
4488 * parameter.cs (Parameter, Parameters): Add Clone method.
4490 * anonymous.cs (Compatible): Turn method into virtual method, so
4491 LambdaExpression can implement a different behavior.
4493 (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
4494 out the basic checking here, so it can be used by
4497 * lambda.cs: Introduce "Compatible" function that will do the
4500 2007-02-02 Marek Safar <marek.safar@gmail.com>
4502 * attribute.cs: Unified one error message.
4504 * class.cs (Class): Use type attributes and not properties to test static
4506 (IsEntryPoint): Don's pass local variable.
4508 * convert.cs: Removed duplicate check.
4510 * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
4512 * driver.cs: Don't crash when soft reference does not exist.
4514 * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
4515 (UsingEntry): Removed redundant allocation.
4517 * parameter.cs: Add fast path for type parameters.
4519 * support.cs: Don't allocate attribute when it's not used.
4521 2007-01-30 Miguel de Icaza <miguel@novell.com>
4524 (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
4525 this into a virtual method, so we can override it in LambdaExpression.
4527 * driver.cs: Improve diagnostics in case of failure.
4529 * cs-tokenizer.cs: Instead of trying to parse a type and a name,
4530 write a function that is slightly more complex and that parses:
4532 type identifier [, type identifier]* )
4534 The old function would return incorrectly a OPEN_PARENS_LAMBDA for
4537 (canEmpty ? i >= 0 : i > 0)
4539 2007-01-30 Raja R Harinath <rharinath@novell.com>
4541 * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
4542 exception on possibly valid code.
4544 2007-01-29 Raja R Harinath <rharinath@novell.com>
4546 * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
4548 (parse_opt_type_arguments): Remove. It's almost the same as
4550 (parse_namespace_or_typename): Use parse_less_than.
4552 2007-01-28 Miguel de Icaza <miguel@novell.com>
4554 * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
4555 this bug took a few hours to find, because the state saved and
4556 restored by PushPosition and PopPosition was ignoring the state of
4557 parse_generic_less_than.
4559 I can also now remove the handling of OP_LT and OP_GT, this solves
4562 * cs-tokenizer.cs: store the location for the ARROW token, we use
4565 (PushPosition, PopPosition): save/restore also `current_token',
4566 restore `parse_generic_less_than' (was missing).
4568 (parse_opt_type_arguments): use parse_type, not
4569 parse_namespace_or_typename to parse types.
4571 * lambda.cs: Empty new file, will eventually have the lambda
4572 expression implementation.
4574 * lambda.test: used to test the internal tokenizer.
4576 * report.cs (FeatureIsNotISO1): Rename from
4577 FeatureIsNotStandardized, because it was about the language level
4578 (1 vs 2) it was not about standarization.
4580 (FeatureRequiresLINQ): New.
4582 * support.cs (SeekableStreamReader): Only require that the reader
4583 is a TextReader, not a StreamReader, so we can plug StringReader.
4585 * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
4586 given position in the input stream the following tokens can be
4587 parsed as a type followed by an identifier.
4589 (is_punct): after a '(' if parse_type_and_parameter returns true,
4590 then return a special token OPEN_PARENS_LAMBDA which is used to
4591 avoid reduce/reduce errors in the grammar for the
4592 lambda_expression rules.
4594 (parse_type): implement a type parser inside the
4595 tokenizer, the parser only returns true or false depending on
4596 whether the input at a given position can be parsed as a type.
4598 (peek_token): new method used during type parsing.
4600 2007-01-28 Raja R Harinath <rharinath@novell.com>
4603 * anonymous.cs (ScopeInfo.InflateParameters): New.
4604 (AnonymousContainer.Resolve): Use it to redirect types of
4605 delegate parameters.
4607 2007-01-27 Raja R Harinath <rharinath@novell.com>
4610 * expression.cs (Error_InvalidArguments): Don't use two different
4611 messages for CS1503. Use ExtraInformation and
4612 SymbolRelatedToPreviousError instead.
4615 * decl.cs (DeclSpace.initialize_type_params): Don't access
4616 'type_params' of a partial class directly.
4618 2007-01-26 Miguel de Icaza <miguel@novell.com>
4620 * constant.cs: Removed a handful of out-of-range checks that were
4623 2007-01-25 Marek Safar <marek.safar@gmail.com>
4625 * expression.cs (CheckUselessComparison): Add additional check for char
4628 * namespace.cs: Fixed typo.
4630 2007-01-23 Miguel de Icaza <miguel@novell.com>
4632 * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
4633 gone, instead we inline the test, preventing the needless casts to
4634 longs, ulongs and doubles for the parameters, avoiding calls to
4635 methods that overchecked stuff, and instead inlined things
4638 2007-01-20 Marek Safar <marek.safar@gmail.com>
4640 * cs-parser.jay: Better parameter error handling.
4642 2007-01-17 Marek Safar <marek.safar@gmail.com>
4644 A fix for bug #80368, #80522
4645 * expression.cs (ArrayCreation.only_constant_initializers): Indicates
4646 whether array initializer contains constants only.
4647 (ArrayCreation.Emit): Use better formula to decide when
4648 are array initializers for static initialization.
4649 (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
4650 have to emit even constants otherwise they are pre-initialized.
4652 2007-01-17 Bill Holmes <bill.holmes@ansys.com>
4653 Raja R Harinath <rharinath@novell.com>
4655 Fix emit order of 'get' vs. 'set'.
4656 * support.cs (Accessors): New.
4657 * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
4658 Note the order in which accessors are declared in the source.
4659 * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
4660 Refactored from Property.Define and Indexer.Define.
4661 (PropertyBase.DefineAccessors): New helper that calls the above in
4662 appropriate order as noted by the parser.
4663 (Property.Define, Indexer.Define): Update to changes.
4664 (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
4666 2007-01-17 Raja R Harinath <rharinath@novell.com>
4668 Fix cs0029-6.cs and gcs0029-2.cs (regression)
4669 * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
4670 there's an implicit conversion from the current type to the target
4671 type before converting the underlying constant.
4673 2007-01-16 Marek Safar <marek.safar@gmail.com>
4675 * const.cs (ResolveValue): Updated after constant conversion was made more
4678 * constant.cs (GetAttributableValue): constant to object conversion is
4679 used for attributes only.
4680 (IntConstant.ConvertImplicitly): Moved from convert to be used in all
4681 constant conversions.
4682 (LongConstant.ConvertImplicitly): Ditto.
4684 * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
4685 (ImplicitConversionStandard): Handle constant conversion as extra step.
4686 It solves the issue when constant conversion was called indirectly like
4687 inside array initializer and constant folding was skipped.
4689 * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
4692 * statement.cs(ImplicitConversionStandard): Updated after constant
4693 conversion was made more generic.
4695 2007-01-16 Sergey P. Kondratyev <se@unicom.tomica.ru>
4697 * expression.cs (As.DoResolve): Use GenericConstraints instead of
4698 Constraints, solves the problem where the compiler incorrectly
4699 reported that a type parameter was not constrained to a class (Bug
4702 2007-01-14 Marek Habersack <grendello@gmail.com>
4704 * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
4706 2007-01-14 Marek Safar <marek.safar@gmail.com>
4708 A fix for bug #80368
4709 * assign.cs (FieldInitializer): New class implements field
4710 initializer statement.
4712 * attribute.cs: Update after FieldMember rename.
4714 * class.cs (PropertyBasedMember): New common class for property based
4716 (InterfaceMemberBase): New base class for all members which can be used as
4717 an interface members.
4718 (MethodCore): Moved really common code to InterfaceMemberBase.
4719 (Method.Define): Equal and GetHasCode detection is relevant for methods
4721 (MethodData.Define): Don't assume that public event implements an
4722 interface automatically.
4723 (MethodData.DefineMethodBuilder): Issue an error even if only extern
4725 (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
4726 (FieldMember): Merged with FieldBase.
4727 (EventProperty.AEventPropertyAccessor): New specialization to check whether
4728 event extern modifier can be used.
4729 (EventField.EventFieldAccessor): Moved event field specific code here.
4730 (Event.AllowedModifiers): Even event can be extern.
4731 (Event.FindOutBaseMethod): New override specific to events.
4732 (Indexer.parameters): Reintroduce parameters because base class holds
4733 only properties common data.
4734 (Indexer.CheckForDuplications): Indexers are threated as methods so we
4735 need do extra parameters check.
4737 * const.cs: Update after FieldMember rename.
4739 * decl.cs (MemberCache.FindBaseEvent): New method.
4741 * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
4742 to reflect that indexer is now derived from PropertyBased.
4744 * ecore.cs (GetMemberType): Made public.
4745 (EventExpr.ResolveMemberAccess): Use right event cache and checks for
4748 * flowanalysis.cs, statement.cs: Update after FieldMember rename.
4750 * typemanager.cs (CSharpSignature): Correctly print event accessors.
4751 (RegisterEvent): Removed.
4752 (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
4753 (GetPrivateFieldOfEvent): Renamed to GetEventField.
4755 2007-01-11 Raja R Harinath <rharinath@novell.com>
4758 * statement.cs (CollectionForeach.TryType): Prefer generic
4759 GetEnumerator over non-generic variant. Fix code to follow comments.
4761 2007-01-09 Raja R Harinath <rharinath@novell.com>
4764 * support.cs (ReflectionParameter): Don't use an invalid index on
4765 the generic parameter data.
4767 2007-01-08 Miguel de Icaza <miguel@novell.com>
4769 * driver.cs: Just add a tiny bit of infrastructure.
4771 2007-01-02 Marek Safar <marek.safar@gmail.com>
4773 * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
4774 where field type is struct from current assembly.
4776 * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
4779 2007-01-02 Marek Safar <marek.safar@gmail.com>
4781 A fix for bug #80381
4782 * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
4785 * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
4787 (Namespace.LookupType): Always use core types from corlib when speficied.
4789 * report.cs: A new warning.
4791 * rootcontext.cs (BootstrapCorlib_ResolveInterface,
4792 BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
4793 (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
4795 * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
4796 (InitCoreTypes): Set expression type of object_type and value_type
4797 immediately after lookup.
4799 2007-01-01 Miguel de Icaza <miguel@novell.com>
4801 * cs-tokenizer.cs: Accept Pc class characters (Connector
4802 Punctuation) as valid identifiers. Fixes #78259
4804 * expression.cs (Invocation.DoResolve): Moved the check for the
4805 use of `this' for doing method calls to the Invocation resolution
4806 step, after overload resolution has taken place instead of doing
4807 the check at the low-level `This.DoResolve' level.
4809 The `This.DoResolve'(appens before overload resolution, so it has
4810 no way of knowing if the method that will be called will be
4811 instace or static, triggering an erroneous report for cs0188 (Bug
4814 We now do the check for instance method invocations after we know
4815 what method will be called.
4817 (This.CheckThisUsage): Move the actual use of this structure
4818 checking into its own method and expose it.
4820 * Everywhere that called Error_ValueCannotBeConverted: pass a new
4823 Exceptions: Null.ConvertImplicitly,
4824 Constant.ImplicitConversionRequired as there are too many call
4825 sites for passing the ec.
4827 * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
4828 EmitContext, if the value is null, then we do not try to provide
4829 the extra information from the error (If a userdefined conversion
4830 exists, as UserDefinedConversion requires a non null-EmitContext).
4834 2006-12-30 Raja R Harinath <rharinath@novell.com>
4836 * flowanalysis.cs (MyBitVector): Document some invariants.
4837 (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
4838 introduced below, and add a couple of others,
4840 2006-12-30 Marek Safar <marek.safar@gmail.com>
4842 * attribute.cs (GetMethodObsoleteAttribute): Uses new
4843 GetPropertyFromAccessor and GetEventFromAccessor.
4845 * class.cs (MethodCore.CheckBase): A new warning when obsolete member
4846 overrides non-obsolete one.
4847 (Indexer.Define): Error message has been moved to the parser.
4849 * cs-parser.jay: Better syntax errors handling.
4851 * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
4852 when an invocation has no arguments.
4854 * ecore.cs: Removed not used caching.
4856 * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
4859 * report.cs: Add a new warning.
4861 * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
4863 * typemanager.cs (enumeration_type): Removed.
4864 (CSharpSignature): Reuses IsSpecialMethod.
4865 (IsEqual): Hack for MS BCL.
4866 (GetPropertyFromAccessor): New method.
4867 (GetEventFromAccessor): New method.
4868 (IsSpecialMethod): Fixed to handle more cases.
4870 2006-12-30 Marek Safar <marek.safar@gmail.com>
4872 * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
4873 Made white spaces array static.
4875 * ecore.cs (RemoveGenericArity): Optimized.
4877 * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
4879 (MyBitVector.initialize_vector): Simplified.
4881 2006-12-22 Miguel de Icaza <miguel@novell.com>
4883 * ecore.cs: Am not entirely happy with this hack, but it seems to
4884 address the issue in 80257 (a small test case for
4887 I set the MethodGroupExpr.Type to an internal compiler type
4888 (itself in this case) to force the resolution to take place. Why
4889 it does not take place with a null is beyond me.
4891 2006-12-20 Marek Safar <marek.safar@gmail.com>
4893 A fix for bug #80288
4894 * expression.cs (ResolveOperator): Consider user defined conversion for
4895 logical and operator too.
4896 (EmitBranchable): Optimization for logical and when full constant folding
4897 could not be applied but one operand is constant.
4899 2006-12-19 Marek Safar <marek.safar@gmail.com>
4901 * class.cs (GetClassBases): Write 5 times every day, will never use
4902 FullName for error reporting.
4904 * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
4906 2006-12-19 Martin Baulig <martin@ximian.com>
4908 * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
4909 the symbol file info here.
4911 2006-12-18 Marek Safar <marek.safar@gmail.com>
4913 * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
4914 of `elseif' is taking then following sections are not taking.
4915 Fixes an issue reported on mono mailing list.
4917 2006-12-18 Marek Safar <marek.safar@gmail.com>
4919 A fix for bug #80300
4920 * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
4921 a caller is not taking.
4923 2006-12-18 Raja R Harinath <rharinath@novell.com>
4925 * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
4926 (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
4927 (RootScopeInfo, AnonymousMethodMethod): Update to changes.
4928 * iterator.cs: Change several TypeContainer declarations to DeclSpace.
4929 * class.cs: Update to changes.
4931 2006-12-17 Marek Safar <marek.safar@gmail.com>
4933 A fix for bug #79934
4934 * anonymous.cs (CompilerGeneratedClass): Register class in a shared
4937 * class.cs (ResolveMembers): Register an iterator in current container and
4940 2006-12-16 Raja R Harinath <rharinath@novell.com>
4943 * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
4944 satisfy a params annotated parameter.
4946 2006-12-16 Marek Safar <marek.safar@gmail.com>
4948 A fix for bug #77014
4949 * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
4950 paramters correctly and not rely on hacks in Parameters class.
4951 (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
4953 (Invocation.VerifyArgumentsCompat): Ditto.
4954 (Invocation.EmitArguments): Changed to correctly emit params arguments at
4957 * parameter.cs (HasParams): Don't assume that params is the last one.
4959 * support.cs (ReflectionParameters.ctor): Look for params attribute
4961 (ReflectionParameters.ParameterType): Removed hack when we returned last
4962 parameter for out of range parameters.
4963 (ParameterName, ParameterModifier): Ditto.
4965 2006-12-14 Marek Safar <marek.safar@gmail.com>
4967 A fix for bug #79987
4968 * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
4969 when assembly is not CLS compliant but type is. I have no idea why is this
4972 * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
4974 2006-12-13 Miguel de Icaza <miguel@novell.com>
4976 * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
4977 in struct constructors, they are basically no-ops.
4979 2006-12-12 Marek Safar <marek.safar@gmail.com>
4981 * cs-tokenizer.cs (Position): Save preprocessor status too.
4983 2006-12-12 Marek Safar <marek.safar@gmail.com>
4985 A fix for bug #77794
4986 * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
4988 2006-12-12 Marek Safar <marek.safar@gmail.com>
4990 * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
4992 (pp_expr): Report error for an invalid expression.
4993 (handle_preprocessing_directive): Simplified; add more error checking.
4995 2006-12-11 Marek Safar <marek.safar@gmail.com>
4997 A fix for bug #74939
4998 * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
4999 directives handling.
5001 2006-12-10 Marek Safar <marek.safar@gmail.com>
5003 A fix for bugs #80093, and #75984
5004 * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
5005 logic, it seems to me as it worked before "by coincidence".
5006 (xtoken): Simplified to use reworked handle_preprocessing_directive.
5007 (cleanup): Enabled endif check.
5009 2006-12-09 Marek Safar <marek.safar@gmail.com>
5011 A fix for bug #80162
5012 * statement.cs (CollectionForeach.TryType): Generics and non-generics
5013 enumerators are never ambiguous.
5015 2006-12-08 Raja R Harinath <rharinath@novell.com>
5018 * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
5020 2006-12-06 Marek Safar <marek.safar@gmail.com>
5022 A fix for bug #80144
5023 * class.cs (EventProperty.Define): Explicit implementation means
5024 that an even is used.
5026 2006-12-06 Marek Safar <marek.safar@gmail.com>
5028 Fixes the operators implementation (part II)
5030 * cfold.cs (DoConstantNumericPromotions): Renamed to
5031 DoBinaryNumericPromotions and simplified.
5032 (BinaryFold): Couple of conversion fixes; simplified.
5034 * constant.cs, ecore.cs, literal.cs
5035 (ToType): Renamed to ConvertImplicitly.
5036 (Reduce): Renamed to ConvertExplicitly.
5038 * class.cs, convert.cs: Updated.
5040 * expression.cs: TryReduce doesn't throw an exception.
5042 2006-12-01 Marek Safar <marek.safar@gmail.com>
5044 A fix for bug #80108
5045 * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
5048 2006-11-30 Marek Safar <marek.safar@gmail.com>
5050 Fixes unary operators implementation (part I)
5053 * cfold.cs (Error_CompileTimeOverflow): Made internal
5055 * const.cs (IConstant): Changed to use reference to constant and
5056 not constant itself.
5057 Updated IConstant implementations.
5059 * constant.cs (CreateConstant): New factory method.
5060 Updated IConstant implementation.
5062 * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
5064 * ecore.cs: Updated to use CreateConstantReference.
5066 * enum.cs: Reflects IConstant changes.
5068 * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
5070 * literal.cs (NullConstant): Change to be independently usable.
5072 2006-11-29 Martin Baulig <martin@ximian.com>
5074 * class.cs (Constructor.Emit): Correctly handle anonymous methods;
5075 we need to emit the scope initializer before calling the base .ctor.
5077 * anonymous.cs: Merged back from the new anonymous methods branch.
5078 (AnonymousMethodHost): Renamed to `RootScopeInfo'.
5080 * expression.cs (ParameterReference.DoResolveBase): Create a
5081 "normal" ScopeInfo when capturing parameters rather than using the
5082 root scope; this makes things work with anonymous methods having
5086 (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
5088 2006-11-22 Marek Safar <marek.safar@gmail.com>
5090 A fix for bug #79987
5091 * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
5092 check to a base class.
5093 * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
5094 only when assembly has missing attribute.
5095 * report.cs: Update.
5097 2006-11-21 Marek Safar <marek.safar@gmail.com>
5099 * cs-tokenizer.cs: Merged with gmcs version.
5101 2006-11-20 Marek Safar <marek.safar@gmail.com>
5104 * cs-parser.jay: Better error message when partial keyword is misplaced.
5106 2006-11-19 Gert Driesen <drieseng@users.sourceforge.net>
5108 A fix for bug #79810
5109 report.cs: CS1058 only applies to 2.0 profile (gmcs).
5110 codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
5111 a RuntimeWrappedException by default.
5113 2006-11-18 Marek Safar <marek.safar@gmail.com>
5115 A fix for bug #79843
5116 * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
5118 (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
5120 2006-11-18 Marek Safar <marek.safar@gmail.com>
5122 * driver.cs, namespace.cs: Uses faster IndexOf version.
5124 2006-11-17 Marek Safar <marek.safar@gmail.com>
5126 A fix for bug #79941
5127 * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
5129 (Operator.Define): Implicit/Explicit operator of same type is duplicate
5130 even if internal name is different.
5131 * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
5132 (UserDefinedConversion): Simplified as the operators cannot be internal.
5133 * ecore.cs (Error_ValueCannotBeConverted): Take account of user
5135 (MethodLookup): Replaced EmitContext with parentType.
5136 * expression.cs: Updated.
5138 2006-11-09 Raja R Harinath <rharinath@novell.com>
5140 * driver.cs (BadAssembly): Handle all the ugliness of
5141 DefineDynamicAssembly.
5143 2006-11-08 Raja R Harinath <rharinath@novell.com>
5145 Address parts of #58244 -- most of what's left is in the runtime
5146 * driver.cs (LoadAssembly): Simplify slightly. Add CS0009 and
5147 CS1509 error checks, and handle them for all assembly loads, not
5148 just the first invocation.
5149 (LoadModule): Likewise. Move handling of 'adder_method' ...
5150 * codegen.cs (AssemblyClass.AddModule): ... here.
5152 2006-11-02 Marek Safar <marek.safar@gmail.com>
5154 * statement.cs.cs (CollectionForeach.TryType): Issue a error when
5155 IEnumerable<T> is ambiguous.
5157 2006-10-31 Marek Safar <marek.safar@gmail.com>
5159 A fix for bug #67689
5160 * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
5161 GetEnumerator is ambiguous.
5163 * report.cs: Add new warning.
5165 2006-10-29 Marek Safar <marek.safar@gmail.com>
5167 A fix for bug #78602
5168 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
5169 to protected member can be nested type.
5171 2006-10-28 Marek Safar <marek.safar@gmail.com>
5173 A fix for bug #78965
5174 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
5175 to protected member must derive from current type.
5177 2006-10-27 Marek Safar <marek.safar@gmail.com>
5179 assign.cs: Reuses error method.
5181 ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
5182 instead of type for constants.
5183 (Expression.Error_ValueAssignment): Common error method.
5185 * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
5188 2006-10-27 Marek Safar <marek.safar@gmail.com>
5190 A fix for bug #79081
5191 * expression.cs (MemberAccess.DoResolve): Check nested type
5194 2006-10-27 Atsushi Enomoto <atsushi@ximian.com>
5196 * doc.cs : nested delegates were not handled. Fixed bug #79754.
5198 2006-10-26 Marek Safar <marek.safar@gmail.com>
5200 A fix for bug #76591
5201 * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
5203 2006-10-26 Marek Safar <marek.safar@gmail.com>
5205 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
5206 type forwarder of the same type multiple times.
5208 2006-10-26 Raja R Harinath <rharinath@novell.com>
5211 * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
5212 instance as an rvalue, even when we later resolve as an lvalue.
5214 2006-10-25 Martin Baulig <martin@ximian.com>
5216 * anonymous.cs: Fix #79673.
5218 2006-10-24 Marek Safar <marek.safar@seznam.cz>
5220 A fix for bug #79666
5221 expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
5222 ignored when is optimized (= default value) as its value is already set.
5224 2006-10-23 Marek Safar <marek.safar@seznam.cz>
5226 A fix for bug #79724
5227 * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
5228 TypeContainer for type lookup.
5230 2006-10-23 Marek Safar <marek.safar@seznam.cz>
5232 A fix for bug #79231
5233 * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
5234 * expression.cs (OverloadResolve): Always convert type name for
5236 (ResolveNamespaceOrType): Don't confuse a nested type with any
5239 2006-10-18 Martin Baulig <martin@ximian.com>
5241 * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
5243 2006-10-17 Miguel de Icaza <miguel@novell.com>
5245 * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
5246 an int32, but requesting an int64 from the conversion
5248 2006-10-12 Martin Baulig <martin@ximian.com>
5251 (AnonymousContainer.Resolve): Inflate the `ReturnType'. Fixes #79592.
5253 2006-10-12 Martin Baulig <martin@ximian.com>
5256 (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
5258 2006-10-11 Miguel de Icaza <miguel@novell.com>
5260 * convert.cs: Remove broken code: I was doing the "Existance"
5261 tests for Implicit conversions.
5263 2006-10-10 Miguel de Icaza <miguel@novell.com>
5265 * convert.cs: Added one missing case in
5266 ImplicitStandardConversionExists uint64 to intptr.
5270 * typemanager.cs (uintptr_type): another core known type.
5272 * ecore.cs (OperatorCast): routine used to do cast operations that
5273 depend on op_Explicit. We could change some of the Decimal
5274 conversions to use this.
5276 This one has a probe mechanism that checks both types for an op_
5277 which it coudl be used to eliminate two classes: CastToDecimal
5278 and CastFromDecimal.
5280 * convert.cs: Implement the conversions documented in #59800
5282 2006-10-10 Martin Baulig <martin@ximian.com>
5284 * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
5285 before RootScope.ResolveMembers().
5287 * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
5288 `CurrentType' if appropriate.
5290 2006-10-09 Marek Safar <marek.safar@seznam.cz>
5292 A fix for bug #78568
5293 * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
5294 when contains binary operators.
5295 * cs-parser.jay: Updated.
5297 2006-10-09 Martin Baulig <martin@ximian.com>
5300 (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
5301 moved that into Define() and also do the other type parameter
5302 checks there. Fixes #79094. Added gtest-292.cs.
5305 (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
5306 since that doesn't include type parameters; don't use `Ldelema'
5307 for type parameters. Fixes #78980. Added gtest-293.cs.
5309 2006-10-08 Marek Safar <marek.safar@seznam.cz>
5312 * convert.cs (ExplicitReferenceConversion): Only enum to enum value
5313 conversion is allowed.
5315 2006-10-06 Marek Safar <marek.safar@seznam.cz>
5317 * ecore.cs (Expression.MemberLookup): Don't register any symbol for
5318 error reporting when no error occurs.
5320 2006-10-06 Marek Safar <marek.safar@seznam.cz>
5322 * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
5325 2006-10-06 Raja R Harinath <rharinath@novell.com>
5328 * class.cs (DefineTypeBuilder): Check circular dependencies before
5329 setting the parent of the TypeBuilder.
5330 (CheckRecursiveDefinition): Don't use 'BaseType', since
5331 it may not be valid until after DefineTypeBuilder. Use
5332 'base_type' instead.
5334 2006-10-04 Martin Baulig <martin@ximian.com>
5336 Merged the Anonymous Methods patch.
5338 * anonymous.cs, iterators.cs: The new anonymous methods code.
5340 * statement.cs (Variable): New public abstract class.
5341 (LocalInfo.Variable): New public property.
5342 (LocalInfo.ResolveVariable): New public method.
5343 (Block.Flags): Add `IsIterator'.
5344 (Block.AddVariable): Improved the CS0136 check.
5345 (Block.AnonymousChildren): New public property.
5346 (Block.AddAnonymousChild): New public method.
5347 (ToplevelBlock): Update to use the new anonymous method framework.
5348 (ToplevelBlock.ctor): `container' is now a `Block' and not a
5349 `ToplevelBlock'; this is required to correctly implement the
5351 (Fixed, Using): Use `TemporaryVariable' instead of directly
5352 creating the `LocalBuilder'.
5354 * parameter.cs (Parameter.ResolveVariable): New public method.
5355 (Parameters.ResolveVariable): Likewise.
5357 * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
5359 * class.cs (TypeContainer): Replaced the `iterators' list and
5360 corresponding methods with a list of `CompilerGeneratedClass'es.
5361 (TypeContainer.ResolveMembers): New public method.
5362 (Method): `IIteratorContainer' has been replaced by
5365 * expression.cs (VariableReference): New public abstract base
5366 class for `LocalVariableReference', `ParameterReference' and
5369 * codegen.cs (EmitContext): Removed `capture_context',
5370 `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
5371 (EmitContext.EmitThis): Removed.
5373 * cs-parser.jay: Replace `iterator_container' with
5376 2006-10-04 Martin Baulig <martin@ximian.com>
5378 * generic.cs (GenericMethod): Don't make this abstract.
5379 (Constraints.Clone): Added dummy implementation.
5381 2006-10-04 Raja R Harinath <harinath@gmail.com>
5384 * namespace.cs (LookForAnyGenericType): Avoid nullref on
5385 'declspaces'. Avoid allocating arrays willy-nilly.
5388 * cfold.cs (BinaryFold): Move boolean Equality and Inequality
5389 cases out of the switch.
5391 2006-09-28 Marek Safar <marek.safar@seznam.cz>
5393 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
5394 message when non-generic type is used with the type arguments.
5395 * expression.cs: Updated.
5397 2006-09-28 Raja R Harinath <rharinath@novell.com>
5400 * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
5401 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
5402 Change semantics slightly. Don't insist on having only one
5403 temporary EmptyExpression -- just throttle the creation of new ones.
5406 * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
5407 non-interfaces too. If no methods are found, don't try to create
5410 2006-09-28 Marek Safar <marek.safar@seznam.cz>
5412 * ecore.cs (ResolveAsTypeStep): Print better error when type can be
5415 * namespace.cs (Namespace.LookForAnyGenericType): New method to help
5416 us produce better error message.
5418 2006-09-27 Marek Safar <marek.safar@seznam.cz>
5420 * expression.cs (Binary.ResolveOperator): Warn about a side effect
5421 of the `|' operator.
5423 * report.cs: A new warning added.
5425 2006-09-27 Martin Baulig <martin@ximian.com>
5427 * generic.cs (GenericMethod): Don't make this abstract.
5429 2006-09-27 Martin Baulig <martin@ximian.com>
5432 (InternalErrorException): Added overloaded ctor taking a params array.
5434 2006-09-26 Marek Safar <marek.safar@seznam.cz>
5436 * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
5437 Fixed the cases when same error was reported twice.
5439 * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
5440 now report symbol information.
5442 2006-09-25 Martin Baulig <martin@ximian.com>
5444 * class.cs: Completely unified with the gmcs version.
5446 2006-09-25 Martin Baulig <martin@ximian.com>
5448 * typemanager.cs (TypeManager.IsNullableType): New public function.
5449 (TypeManager.IsNullableTypeOf): Likewise.
5450 (TypeManager.IsNullableValueType): Likewise.
5452 * class.cs (MethodCore): Added the `GenericMethod' argument from
5453 gmcs and also unified all classes derived from `MethodCore' with gmcs.
5455 2006-09-24 Raja R Harinath <harinath@gmail.com>
5457 * convert.cs: Unify with gmcs version.
5459 2006-09-24 Marek Safar <marek.safar@seznam.cz>
5461 * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
5462 verify them as well.
5464 * report.cs: New warning.
5466 2006-09-24 Marek Safar <marek.safar@seznam.cz>
5468 * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
5469 for anonymous block with out argument.
5471 2006-09-24 Marek Safar <marek.safar@seznam.cz>
5473 * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
5474 not used private events only.
5476 2006-09-23 Marek Safar <marek.safar@seznam.cz>
5478 * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
5480 * const.cs (Const.Define): Check for constant type.
5481 (Const.IsConstantTypeValid): Looks for valid constant types.
5483 * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
5485 * ecore.cs (EmptyConstantCast): New common class for all constant based
5488 * expression.cs (Is.DoResolve): Handle null constant especially.
5489 (New.DoResolve): Check for new void().
5490 (MemberAccess.DoResolve): Cope with all kind of nulls.
5492 * literal.cs (NullConstant): Uses EmptyConstantCast.
5493 (NullDefault): Based on EmptyConstantCast.
5494 (NullLiteral): Uses EmptyConstantCast.
5496 * statement.cs (Block.ResolveMeta): Check for constant type.
5498 2006-09-22 Martin Baulig <martin@ximian.com>
5500 * delegate.cs, attribute.cs: Merged with the gmcs versions.
5502 2006-09-22 Raja R Harinath <rharinath@novell.com>
5504 * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
5508 * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
5509 * decl.cs (DeclSpace.FindMemberToOverride): Likewise. Reorganize
5512 2006-09-22 Martin Baulig <martin@ximian.com>
5514 * ecore.cs: Merged with the gmcs version.
5516 * generic.cs (ConstructedType): New dummy class.
5517 (TypeArguments): Don't make this abstract.
5520 (TypeManager.IsGenericTypeDefinition): New method.
5521 (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
5523 2006-09-22 Raja R Harinath <rharinath@novell.com>
5525 * expression.cs (ComposedCast): Check for arrays of TypedReference
5526 before creating the type, not after.
5528 2006-09-21 Marek Safar <marek.safar@seznam.cz>
5530 * cfold.cs, const.cs, enum.cs, statement.cs: Updated
5531 after ToType change.
5533 * constant.cs (Constant.ImplicitConversionRequired): Designed to used
5534 when constant must be implicitly convertible.
5536 * convert.cs (ImplicitReferenceConversion): Reuse ToType.
5538 * ecore.cs (NullCast): Derives from NullConstant.
5540 * expression.cs (Is.DoResolve): Removed useless variables.
5541 (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
5542 (New.Constantify): Add enum support.
5543 (MemberAccess.DoResolve): Add warning when accessing null constant or
5546 * generic.cs (GenericConstraints.IsReferenceType): Another dummy
5549 * literal.cs (NullConstant): New abstract class with common
5550 functionality for all null specializations.
5551 (NullDefault): Represents default(X) when result can be
5553 (NullLiteral): Updated.
5555 * report.cs: Add new warning.
5557 2006-09-21 Martin Baulig <martin@ximian.com>
5559 * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
5561 2006-09-21 Martin Baulig <martin@ximian.com>
5563 * generic.cs (GenericConstraints): New dummy class.
5564 (Constraints): Likewise.
5565 (TypeParameter): Likewise.
5566 (TypeParameterName): Likewise.
5567 (GenericMethod): Likewise.
5569 * typemanager.cs (TypeManager.GetGenericArguments): New method.
5571 * decl.cs: Merged with the gmcs version.
5573 2006-09-21 Raja R Harinath <rharinath@novell.com>
5575 * generic.cs (TypeParameter): Implement IMemberContainer.
5576 (GenericTypeParameterBuilder): New. An abominable repugnant hack.
5578 * rootcontext.cs: Unify with gmcs version.
5580 * report.cs: Unify with gmcs version.
5581 * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
5582 from gmcs/generics.cs.
5583 * generics.cs (TypeParameter): New dummy class.
5585 * support.cs: Unify with gmcs version.
5587 2006-09-20 Raja R Harinath <rharinath@novell.com>
5589 * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
5590 * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
5592 * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
5593 * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
5594 * mcs.exe.sources: Add generic.cs.
5596 * codegen.cs: Unify with gmcs version.
5598 * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
5599 (EmitContext): Add GenericDeclContainer implementation.
5600 * decl.cs (MemberCore, DeclSpace): Likewise.
5601 * namespace.cs: Remove #ifdef GMCS_SOURCE.
5603 * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
5604 MCS TypeManager has a corresponding dummy method.
5606 2006-09-19 Martin Baulig <martin@ximian.com>
5608 * expression.cs: Completely merged with the gmcs version.
5610 2006-09-19 Martin Baulig <martin@ximian.com>
5612 * expression.cs (Invocation): Merged with the gmcs version.
5613 (ArrayAccess.GetStoreOpcode): Likewise.
5615 2006-09-19 Martin Baulig <martin@ximian.com>
5618 (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
5619 (TypeManager.IsGenericMethodDefinition): Likewise.
5621 2006-09-19 Martin Baulig <martin@ximian.com>
5624 (TypeManager.IsEqual): Moved the gmcs implementation here.
5625 (TypeManager.DropGenericTypeArguments): Likewise.
5626 (TypeManager.DropGenericMethodArguments): Likewise.
5627 (TypeManager.GetTypeArguments): Moved here from gmcs.
5628 (TypeManager.HasGenericArguments): Likewise.
5630 2006-09-19 Martin Baulig <martin@ximian.com>
5632 * expression.cs (Binary): Merged with the gmcs version.
5634 2006-09-19 Martin Baulig <martin@ximian.com>
5636 * expression.cs (Probe, As, Is): Merged with the gmcs version.
5638 2006-09-19 Martin Baulig <martin@ximian.com>
5640 * typemanager.cs: Merged with the gmcs version.
5642 2006-09-16 Raja R Harinath <rharinath@novell.com>
5644 * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
5645 * driver.cs: Likewise.
5647 2006-09-16 Marek Safar <marek.safar@seznam.cz>
5650 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
5651 only if parent type is class.
5652 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
5655 2006-09-15 Marek Safar <marek.safar@seznam.cz>
5658 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
5660 * typemanager.cs(CSharpName): Converts NullType to null.
5662 2006-09-15 Martin Baulig <martin@ximian.com>
5665 (TypeManager.GetMethodName): Added mcs implementation.
5666 (TypeManager.IsEqual): Likewise.
5669 (SimpleName.RemoveGenericArity): Added dummy implementation.
5671 * pending.cs: Merged with the gmcs version.
5673 2006-09-15 Martin Baulig <martin@ximian.com>
5675 * statement.cs: Merge with the gmcs version.
5677 2006-09-15 Martin Baulig <martin@ximian.com>
5679 * statement.cs (Switch): Merge with the gmcs implementation
5680 (without nullables), which is newer.
5682 2006-09-15 Martin Baulig <martin@ximian.com>
5684 * statement.cs (Block.Variables): Make this public.
5685 (ToplevelBlock.Parameters): Make this a property.
5686 (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
5688 2006-09-15 Martin Baulig <martin@ximian.com>
5690 * namespace.cs: Merge with the gmcs version.
5692 2006-09-15 Martin Baulig <martin@ximian.com>
5694 * decl.cs (MemberName): Minor code cleanups.
5696 2006-09-15 Martin Baulig <martin@ximian.com>
5698 * parameter.cs: Merge with the gmcs version.
5700 2006-09-15 Martin Baulig <martin@ximian.com>
5702 * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
5703 and an error in mcs.
5705 2006-09-15 Martin Baulig <martin@ximian.com>
5707 * flowanalysis.cs: Merged from GMCS; added the generics code into
5708 a `GMCS_SOURCE' conditional so we can share this file.
5710 2006-09-08 Martin Baulig <martin@ximian.com>
5712 * typemanager.cs (TypeManager.interlocked_type): New public field.
5713 (TypeManager.int_interlocked_compare-exchange): New public field.
5714 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
5715 enumerator types here and call InitGenericCoreTypes().
5716 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
5717 after calling InitEnumUnderlyingTypes().
5720 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
5721 `classes_second_stage'.
5723 2006-09-14 Marek Safar <marek.safar@seznam.cz>
5725 * assign.cs, ecore.cs, expression.cs: Share error message text.
5726 * class.cs (FieldMember.Define): Check for varible of static type.
5727 * driver.cs (LoadAssembly): Uses error output for errors.
5728 * statement.cs: Updated.
5730 2006-09-08 Marek Safar <marek.safar@seznam.cz>
5732 * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
5735 2006-09-07 Martin Baulig <martin@ximian.com>
5738 (MainDriver): Revert r62663 from Marek; see #70506 for details.
5740 2006-08-29 Miguel de Icaza <miguel@novell.com>
5742 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
5744 2006-08-17 Miguel de Icaza <miguel@novell.com>
5746 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
5747 #52019 and #79064, the use of the \uXXXX sequence in source code
5748 to represent unicode characters.
5750 2006-08-15 Marek Safar <marek.safar@seznam.cz>
5752 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
5754 * class.cs, ecore.cs, statement.cs: Merged to one error message.
5756 2006-08-13 Miguel de Icaza <miguel@novell.com>
5758 * assign.cs: Catch attempts to assign to a method groups in += and
5761 2006-08-13 Marek Safar <marek.safar@seznam.cz>
5764 * cs-parser.jay: Don't destroy current array type by typeof of array's.
5766 2006-08-12 Marek Safar <marek.safar@seznam.cz>
5768 * class.cs (Method.Define): Issue a warning when generic method looks like
5770 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
5773 2006-08-09 Marek Safar <marek.safar@seznam.cz>
5775 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
5777 * decl.cs (MemberCache.FindMembers): When container is interface we need to
5778 search all base interfaces as a member can be ambiguous.
5779 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
5780 Constructor member type filter.
5781 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
5782 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
5783 reporting for returned memberinfos.
5784 * report.cs: Updated.
5785 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
5786 version to work on all runtimes.
5787 (TypeManager.RealMemberLookup): Removed members filtering.
5789 2006-08-08 Raja R Harinath <rharinath@novell.com>
5791 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
5792 (PropertyExpr.EmitAssign): Likewise.
5793 * expression.cs (Indirection.EmitAssign): Likewise.
5794 (LocalVariableReference.EmitAssign): Likewise.
5795 (ParameterReference.EmitAssign): Likewise.
5796 (Invocation.EmitArguments): Likewise.
5797 (ArrayAccess.EmitAssign): Likewise.
5798 (IndexerAccess.EmitAssign): Likewise.
5799 (This.EmitAssign): Likewise.
5800 (ConditionalLogicalOperator.Emit): Likewise.
5803 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
5804 instead of ArrayList. If the hashtable has a LocalBuilder, don't
5805 leave it in after returning it.
5806 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
5808 2006-08-06 Marek Safar <marek.safar@seznam.cz>
5810 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
5813 2006-08-03 Raja R Harinath <rharinath@novell.com>
5815 Fix cs0146-3.cs and cs0146-4.cs.
5816 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
5817 enclosing types don't depend on the current type.
5819 2006-08-02 Raja R Harinath <rharinath@novell.com>
5822 * class.cs (TypeContainer.DoDefineMembers): Use
5823 FindBaseMemberWithSameName on Parent, since we're interested in
5824 whether we hide inherited members or not.
5825 (FindBaseMemberWithSameName): Make slightly more robust.
5827 Fix the non-generic testcase from #77396
5828 * decl.cs (DeclSpace.DeclContainer): Remove override.
5830 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
5831 declspaces for doppelgangers too.
5832 (UsingEntry): Implement IResolveContext.
5833 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
5834 'this' as the resolve context.
5835 (LocalAliasEntry): Likewise.
5837 Implement parts of #77403
5838 * roottypes.cs (RootDeclSpace): New. Used to represent the
5839 toplevel declaration space. Each namespace declaration introduces
5840 a "partial" root declaretion space.
5841 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
5842 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
5843 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
5844 from 'current_namespace.SlaveDeclSpace'.
5845 (namespace_declaration): Likewise.
5846 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
5847 check. It can't happen now.
5848 * decl.cs (DeclSpace.LookupType): Likewise.
5849 * driver.cs (MainDriver): Sanity check.
5851 2006-08-01 Raja R Harinath <rharinath@novell.com>
5853 * decl.cs (DeclSpace.FindNestedType): Remove.
5854 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
5855 LookupTypeContainer to get the container of the nested type.
5856 * class.cs (TypeContainer.FindNestedType): Make non-override.
5858 2006-07-31 Raja R Harinath <rharinath@novell.com>
5860 * decl.cs (DeclSpace.PartialContainer): Move field from ...
5861 * class.cs (TypeContainer.PartialContainer): ... here.
5862 (TypeContainer.AddBasesForPart): New helper.
5863 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
5865 * cs-parser.jay (current_class): Convert to DeclSpace.
5866 (struct_declaration, interface_declaration, class_declaration):
5867 Use AddBasesForPart instead of .Bases directly.
5868 * const.cs, iterators.cs: Update to changes.
5870 2006-07-28 Raja R Harinath <rharinath@novell.com>
5872 * class.cs (TypeContainer.AddMemberType): Rename from
5874 (TypeContainer.AddMember): Rename from AddToMemberContainer.
5875 (AddTypeContainer): New. Combine AddClassOrStruct and
5877 (AddPartial): Update. Add 'is_partial' argument.
5878 * roottypes.cs: Update to changes.
5879 * cs-parser.jay (push_current_class): New helper for handling
5880 current_container and current_class.
5881 (struct_declaration, interface_declaration, class_declaration):
5884 2006-07-26 Raja R Harinath <rharinath@novell.com>
5886 * roottypes.cs: Rename from tree.cs.
5888 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
5889 * tree.cs (Tree, ITreeDump): Remove types.
5890 * rootcontext.cs (tree, Tree): Remove fields.
5891 (root, ToplevelTypes): New.
5892 * *.cs: Update to rename.
5894 * tree.cs (Tree.RecordDecl): Remove.
5895 (RootTypes.AddToTypeContainer): Record the toplevel type in its
5897 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
5899 2006-07-23 Raja R Harinath <harinath@gmail.com>
5901 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
5902 DoFlowAnalysis and OmitStructFlowAnalysis here.
5903 (ec.With): Rename from WithUnsafe and generalize.
5904 (ec.WithCheckState): Remove. All users can be handled by 'With'.
5905 (ec.WithFlowAnalyis): New.
5906 * ecore.cs, expression.cs, statement.cs: Update.
5908 2006-07-22 Raja R Harinath <harinath@gmail.com>
5910 * statement.cs (Block.ResolveMeta): Simplify slightly.
5912 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
5913 multiple boolean fields. Convert InUnsafe, constant_check_state,
5914 check_state to flags.
5915 (CheckState, ConstantCheckState): Update.
5916 (InUnsafe): New read-only property.
5917 (FlagsHandle): Rename from CheckStateHandle and convert to handle
5919 (WithUnsafe): New helper similar to WithCheckState.
5920 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
5921 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
5923 2006-07-21 Raja R Harinath <rharinath@novell.com>
5925 Make comparisons use the same IL irrespective of whether they're
5926 in a 'checked' or 'unchecked' context: one of the issues in #78899
5927 * codegen.cs (EmitContext.CheckState): Make read-only property.
5928 (EmitContext.ConstantCheckState): Likewise.
5929 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
5930 helper that implement a save/restore stack for CheckState
5931 values. This is the only way to change check-state.
5932 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
5933 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
5934 (CheckedExpr.EmitBranchable): New forwarding method.
5935 (UnCheckedExpr): Likewise.
5936 * statement.cs (Block.ResolveMeta): Use WithCheckState.
5937 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
5938 (Checked.Resolve, checked.DoEmit): Likewise.
5940 2006-07-20 Miguel de Icaza <miguel@novell.com>
5942 * anonymous.cs: Cache the resolved anonymous delegate, and return
5943 this so that the ResolveTopBlock is only triggered once, not
5946 Currently we trigger ResolvetopBlock twice due to a first pass of
5947 argument check compatibility, and a second pass that does the
5950 2006-07-15 Marek Safar <marek.safar@seznam.cz>
5952 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
5954 * rootcontext.cs (Reset): Add helper_classes.
5956 2006-07-15 Marek Safar <marek.safar@seznam.cz>
5959 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
5962 2006-07-13 Miguel de Icaza <miguel@novell.com>
5964 * statement.cs (Lock): Handle expressions of type
5965 TypeManager.null_type specially. Fixes #78770
5967 2006-07-08 Marek Safar <marek.safar@seznam.cz>
5969 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
5972 2006-07-08 Marek Safar <marek.safar@seznam.cz>
5974 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
5975 for accessors as well.
5976 * ecore.cs (EventExpr): Add AccessorTable.
5978 2006-07-01 Marek Safar <marek.safar@seznam.cz>
5981 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
5982 for CS0122 where appropriate.
5983 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
5985 (Filter): Assembly can be null in the case of top level attributes.
5987 2006-06-25 Marek Safar <marek.safar@seznam.cz>
5991 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
5992 is done at global level.
5994 2006-06-24 Marek Safar <marek.safar@seznam.cz>
5996 A fix for #77002, Implemented TypeForwarder support.
5998 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
5999 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
6000 * typemanager.cs (): Add type_forwarder_attr_type.
6002 2006-06-24 Marek Safar <marek.safar@seznam.cz>
6004 * report.cs: Add CS0469 warning.
6006 2006-06-21 Martin Baulig <martin@ximian.com>
6008 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
6009 the `try'-block, so we also report CS0016 etc. there.
6011 2006-06-21 Martin Baulig <martin@ximian.com>
6014 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
6016 2006-06-21 Martin Baulig <martin@ximian.com>
6018 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
6019 also report CS1686 for parameters.
6021 2006-06-21 Martin Baulig <martin@ximian.com>
6023 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
6024 instead of an error if the value is not implicitly convertible to
6025 the switch types; fixes #77964.
6027 2006-06-21 Raja R Harinath <rharinath@novell.com>
6030 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
6031 FieldBuilder is null.
6034 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
6035 'left' and 'right' before error-checking.
6037 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
6039 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
6041 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
6042 (FieldExpr.DoResolve): likewise.
6043 (PropertyExpr.InstanceResolve): likewise.
6044 (EventExpr.InstanceResolve): likewise.
6046 2006-06-04 Marek Safar <marek.safar@seznam.cz>
6048 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
6049 attribute applicable tests for attribute argument.
6051 2006-06-02 Raja R Harinath <rharinath@novell.com>
6054 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
6055 (Binary.OverloadResolve_PredefinedIntegral): New.
6056 (Binary.OverloadResolve_PredefinedFloating): New.
6057 (Binary.OverloadResolve_PredefinedString): New.
6058 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
6059 Follow the standard more closely, and treat numeric promotions in
6060 terms of overload resolution.
6061 (Binary.CheckShiftArguments): Simplify.
6063 2006-06-01 Raja R Harinath <rharinath@novell.com>
6065 * flowanalysis.cs (MyBitVector): Simplify representation.
6066 (MyBitVector.Clone): Avoid allocating BitArray.
6067 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
6068 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
6069 (*): Update. Change all references to MyBitVector.And and
6070 MyBitVector.Or to &= and |=.
6072 2006-05-29 Raja R Harinath <rharinath@novell.com>
6075 * cs-parser.jay (formal_parameter_list): Extend the pattern below
6076 to param arguments too.
6078 2006-05-26 Miguel de Icaza <miguel@novell.com>
6080 * cs-parser.jay: Catch another parsing form for arglist being
6081 followed by other arguments. Fixes #78313.
6083 2006-05-24 Raja R Harinath <rharinath@novell.com>
6085 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
6086 checking of out parameters to ...
6087 (FlowBranchingToplevel.Merge): ... here.
6088 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
6089 set, propagate the origin upward, and only complain if there was
6091 (FlowBranchingException.AddContinueOrigin): Likewise.
6092 (FlowBranchingException.AddReturnOrigin): Likewise.
6093 (FlowBranchingException.AddGotoOrigin): Likewise.
6095 2006-05-23 Raja R Harinath <rharinath@novell.com>
6097 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
6098 unreachable, skip it.
6099 (FlowBranchingException.Merge): Always propagate jumps, even if
6100 the finally block renders subsequent code unreachable.
6102 2006-05-18 Raja R Harinath <rharinath@novell.com>
6105 * statement.cs (Goto.Resolve): Move responsibility for resolving
6106 'goto' to FlowBranching.AddGotoOrigin.
6107 (Goto.SetResolvedTarget): New. Callback to set the
6108 LabeledStatement that's the target of the goto.
6109 (Goto.DoEmit): Use Leave instead of Br when crossing an
6110 unwind-protect boundary.
6111 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
6112 LookupLabel and adjust to new semantics.
6113 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
6114 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
6115 Goto.SetResolvedTarget to update target.
6116 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
6117 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
6118 AddBreakOrigin & co. Delay propagation until ...
6119 (FlowBranchingException.Merge): ... this.
6121 * statement.cs (Block.Resolve): Always depend on flow-branching to
6122 determine unreachability. Kill workaround that originally emitted
6123 only one statement after an "unreachable" label (see infloop in
6126 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
6127 This is still "wrong", but anything better would probably need a
6128 multi-pass algorithm.
6129 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
6130 usage vector. Force current usage vector to be reachable, to
6131 optimistically signify backward jumps.
6132 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
6134 (FlowBranchingLabeled.Merge): New. If no backward jump was
6135 detected, return the original salted-away usage vector instead,
6136 updated with appropriate changes. Print unreachable warning if
6138 * statement.cs (Block.Resolve): Don't print unreachable warning on
6139 a labeled statement.
6141 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
6143 * driver.cs: Pass filename without path to AssemblyBuilder's
6144 AddResourceFile. Fixes bug #78407.
6146 2006-05-17 Raja R Harinath <rharinath@novell.com>
6148 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
6149 * flowanalysis.cs (FlowBranchingLabeled): ... here.
6150 (FlowBranching.MergeChild): Overwrite
6151 reachability information from Labeled branchings too.
6153 2006-05-16 Raja R Harinath <rharinath@novell.com>
6155 * statement.cs (Goto.Resolve): Merge jump origins here ...
6156 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
6158 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
6159 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
6160 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
6161 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
6163 * statement.cs (Goto.Resolve): ... not here.
6164 (Goto.Emit): Remove CS1632 check.
6166 2006-05-14 Marek Safar <marek.safar@seznam.cz>
6168 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
6171 2006-05-11 Raja R Harinath <rharinath@novell.com>
6173 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
6174 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
6175 (FlowBranchingException.Label): Likewise.
6177 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
6179 (MyBitVector.Or): Use it to avoid losing information (Count).
6180 (FlowBranching.MergeOrigins): Likewise.
6182 * flowanalysis.cs (UsageVector.IsDirty): Remove.
6183 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
6184 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
6185 (UsageVector.ToString): Simplify.
6186 (UsageVector.MergeSiblings): Move here from ...
6187 (FlowBranching.Merge): ... here.
6188 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
6191 2006-05-10 Raja R Harinath <rharinath@novell.com>
6193 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
6194 null bitvector is treated as all-true.
6196 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
6197 (MyBitVector): Rationalize invariants. 'vector != null' implies
6198 that we have our own copy of the bitvector. Otherwise,
6199 'InheritsFrom == null' implies all inherited bits are true.
6201 2006-05-09 Marek Safar <marek.safar@seznam.cz>
6203 * statement.cs (LocalInfo): Add IsConstant.
6204 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
6205 local variable for constants.
6207 2006-05-09 Raja R Harinath <rharinath@novell.com>
6209 * flowanalysis.cs (MyBitVector.Empty): New.
6210 (MyBitVector): Don't allow InheritedFrom to be null.
6211 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
6212 (UsageVector, FlowBranching): Update to changes.
6214 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
6215 recursion. The 'Parent == null' condition isn't sufficient for
6217 (FlowBranching.AddBreakOrigin): Likewise.
6218 (FlowBranching.AddContinueOrigin): Likewise.
6219 (FlowBranching.AddReturnOrigin): Likewise.
6220 (FlowBranching.StealFinallyClauses): Likewise.
6221 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
6222 (FlowBranching.CheckOutParameters): Likewise.
6223 (FlowBranchingToplevel): Terminate all the above recursions here.
6224 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
6225 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
6227 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
6229 (FlowBranchingToplevel): New. Empty for now.
6230 (FlowBranching.MergeTopBlock): Update.
6231 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
6232 branching for the anonymous delegate.
6233 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
6235 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
6236 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
6237 information at the start of the merge. Reorganize.
6239 2006-05-07 Marek Safar <marek.safar@seznam.cz>
6241 * class.cs (MethodData.Define): Method cannot implement interface accessor.
6243 2006-05-07 Marek Safar <marek.safar@seznam.cz>
6245 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
6246 to newly introduced ctor.
6248 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
6249 message to one place.
6250 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
6253 2006-05-07 Marek Safar <marek.safar@seznam.cz>
6255 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
6257 * ecore.cs (Expression.ResolveAsConstant): Updated.
6259 * statement.cs (ResolveMeta): Updated.
6261 2006-05-06 Marek Safar <marek.safar@seznam.cz>
6263 * cs-parser.jay: __arglist cannot be used in initializer.
6265 2006-05-06 Marek Safar <marek.safar@seznam.cz>
6268 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
6271 2006-05-05 Raja R Harinath <rharinath@novell.com>
6273 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
6274 (LabeledStatement): Add 'name' parameter.
6275 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
6276 (Block.AddLabel): Update to changes.
6277 * cs-parser.jay (labeled_statement): Likewise.
6279 * flowanalysis.cs (BranchingType.Labeled): New.
6280 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
6281 (FlowBranchingLabeled): New. Does nothing for now, but will
6282 eventually handle 'goto' flows.
6283 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
6284 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
6285 that's terminated ...
6286 (Block.Resolve): ... here.
6288 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
6289 (UsageVector.MergeFinallyOrigins): Likewise.
6290 (FlowBranching.InTryOrCatch): Likewise.
6291 (FlowBranching.AddFinallyVector): Likewise.
6292 (FlowBranchingException): Update to changes.
6295 * statement.cs (Return.Resolve): Move error checking to ...
6296 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
6297 (FlowBranchingException): Handle return origins like break and
6299 (FlowBranching.UsageVector.CheckOutParameters): Remove.
6301 2006-05-04 Marek Safar <marek.safar@seznam.cz>
6304 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
6307 2006-05-04 Marek Safar <marek.safar@seznam.cz>
6310 * class.cs (MethodData.Define): Do public accessor check only when method
6311 implements an interface.
6313 2006-05-04 Raja R Harinath <rharinath@novell.com>
6315 Remove special handling of 'break'
6316 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
6317 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
6318 (UsageVector.Break): Remove.
6319 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
6321 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
6323 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
6324 UsageVector.Breaks (). Don't set NeedsReturnLabel.
6326 2006-05-03 Marek Safar <marek.safar@seznam.cz>
6329 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
6330 be the interface member.
6332 2006-05-03 Marek Safar <marek.safar@seznam.cz>
6335 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
6336 for emitting small (int) values.
6338 2006-05-03 Raja R Harinath <rharinath@novell.com>
6341 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
6342 control-flow passes through the 'finally' after merging-in all the
6343 control-flows from 'try' and the 'catch' clauses.
6345 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
6346 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
6347 always true at the only non-recursive entry point.
6348 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
6349 FlowBranchingBreakable.
6350 (FlowBranchingLoop): Remove.
6351 * statement.cs (Return.DoResolve): Update to changes.
6354 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
6355 (FlowBranching.CreateBranching): Handle it: create a
6356 FlowBranchingContinuable.
6357 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
6358 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
6359 except that it handles the 'continue' command.
6360 (FlowBranching.UsageVector.MergeOrigins): Rename from
6362 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
6363 except that it overrides AddContinueOrigin.
6364 (FlowBranchingException): Override AddContinueOrigin, similar to
6366 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
6367 Create a new branching around the embedded statement.
6368 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
6369 control flow after the embedded statement.
6370 (Continue.Resolve): Move all error checking to AddContinueOrigin.
6372 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
6373 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
6374 FlowBranchingBreakable.
6375 (FlowBranchingSwitch): Remove.
6378 * statement.cs (Break.Resolve): Simplify. Move responsibility for
6379 error reporting to ...
6380 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
6381 Rename from 'AddBreakVector'. Add new location argument. Return
6382 a bool indicating whether the 'break' crosses an unwind-protect.
6383 (FlowBranchingException.AddBreakOrigin): Add.
6384 (FlowBranchingException.Merge): Propagate 'break's to surrounding
6385 flowbranching after updating with the effects of the 'finally'
6387 (FlowBranchingBreakable): New common base class for
6388 FlowBranchingLoop and FlowBranchingSwitch.
6390 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
6392 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
6394 2006-05-02 Raja R Harinath <rharinath@novell.com>
6396 * statement.cs (Do.Resolve): If the loop is infinite, set the
6398 (While.Resolve, For.Resolve): Set a barrier after the embedded
6399 statement. There's no direct control flow that goes from the end
6400 of the embedded statement to the end of the loop.
6401 * flowanalysis.cs (FlowBranching.Infinite): Remove.
6402 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
6403 above ensure that the reachability is correctly computed.
6405 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
6406 (UsageVector.MergeBreakOrigins): If the current path is
6407 unreachable, treat it as if all parameters/locals are initialized.
6408 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
6409 infinite loops before merging-in break origins.
6411 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
6412 (Reachability.Reachable): Split part into ...
6413 (Reachability.Unreachable): ... this. Simplify.
6414 (Reachability.IsUnreachable): Use 'Unreachable' instead.
6416 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
6417 (Reachability.SetThrowsSometimes): Likewise.
6418 (FlowBranchingBlock.MergeTopBlock): Don't compare against
6419 TriState.Always, use corresponding property.
6420 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
6421 (Block.Resolve): Likewise. Remove some redundant checks.
6423 2006-05-02 Raja R Harinath <harinath@gmail.com>
6425 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
6426 (Reachability.Meet): Don't bother checking AlwaysThrows --
6427 barrier is always set.
6428 (FlowBranchingBlock.Merge): Likewise.
6430 2006-05-01 Raja R Harinath <harinath@gmail.com>
6432 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
6433 checks for unreachable.
6435 2006-05-01 Marek Safar <marek.safar@seznam.cz>
6438 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
6440 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
6441 whether field is really assigned.
6443 2006-04-30 Raja R Harinath <harinath@gmail.com>
6445 * flowanalysis.cs (Reachability): Make 4-argument constructor
6447 (Reachability.Meet): Rename from 'And'. Remove static variant.
6448 (Reachability.Always): Rename from the highly misleading
6449 'Reachability.Never'.
6450 (FlowBranching.Merge): Update to changes. Mark an impossible
6451 situation with a 'throw'.
6452 (*): Update to changes.
6454 2006-04-29 Raja R Harinath <harinath@gmail.com>
6456 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
6458 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
6459 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
6460 (*): Update to changes.
6461 * statement.cs: Update to changes.
6463 2006-04-28 Marek Safar <marek.safar@seznam.cz>
6466 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
6468 2006-04-28 Raja R Harinath <harinath@gmail.com>
6470 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
6473 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
6474 argument to two arguments: an usage-vector and a bool. Move call
6475 to FlowBranching.Merge () ...
6476 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
6478 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
6479 handling of loop and switch reachability to ...
6480 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
6482 2006-04-27 Raja R Harinath <harinath@gmail.com>
6484 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
6485 handling to FlowBranchingLoop.InLoop.
6486 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
6488 2006-04-26 Marek Safar <marek.safar@seznam.cz>
6491 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
6492 anonymous method is allowed from AnonymousContainer here.
6494 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
6496 2006-04-24 Raja R Harinath <rharinath@novell.com>
6499 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
6501 2006-04-23 Marek Safar <marek.safar@seznam.cz>
6504 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
6505 (DoubleConstant.Reduce): Ditto.
6507 2006-04-23 Raja R Harinath <rharinath@novell.com>
6509 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
6510 Remove 'lvalue_right_side' argument. Move parts to ...
6511 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
6512 (LocalVariable.DoResolveLValue): ... these.
6514 2006-04-21 Raja R Harinath <rharinath@novell.com>
6517 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
6518 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
6519 (LocalVariableReference.DoResolveBase): Use it to implement new
6521 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
6522 (Argument.Resolve): Simplify. Move CS1510 check ...
6523 * ecore.cs (Expression.ResolveLValue): ... here.
6524 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
6525 (PropertyExpr.DoResolveLValue): Likewise.
6526 (FieldExpr.Report_AssignToReadonly): Likewise.
6527 (FieldExpr.DoResolve): Add 'out_access' argument. Use
6528 LValueMemberAccess or LValueMemberOutAccess on instance depending
6530 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
6531 DoResolve as appropriate.
6533 2006-04-20 Raja R Harinath <rharinath@novell.com>
6536 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
6537 implicit conversions on 'out' and 'ref' arguments.
6539 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
6540 improve clarity. Remove dead code.
6543 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
6544 (Catch.Resolve): Resolve VarBlock if it exists.
6546 2006-04-19 Miguel de Icaza <miguel@novell.com>
6548 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
6549 twice, this was some residual code, the enumerator was emitted
6550 properly in the two branche of if later.
6552 2006-04-19 Raja R Harinath <rharinath@novell.com>
6554 * expression.cs (Cast.ResolveLValue): Remove. The result of a
6555 cast is never an lvalue.
6556 (Cast.DoResolve, Cast.ResolveRest): Combine.
6557 (Argument.Emit): Simplify slightly. Move 'Expr is
6558 IMemoryLocation' check ...
6559 (Argument.Resolve): ... here.
6560 (Argument.Error_LValueRequired): Remove. Inline into only user.
6562 Simplifications. Fix cs0191-2.cs
6563 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
6564 CS1649 and CS1651 to ...
6565 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
6566 the actual selection of the error code and message to a lookup
6567 table. Add a dummy return value to simplify callsites.
6568 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
6569 readonly fields of other instances of the same type. Move CS0197
6571 * expression.cs (Argument.Resolve): ... here. Simplify code.
6572 Ensure that ec.InRefOutArgumentResolving is only set during LValue
6573 resolution of an out or ref argument. The code simplification
6574 above uses this invariant.
6576 2006-04-18 Raja R Harinath <rharinath@novell.com>
6578 Possibly fix #77752. Fix cs1690-[4-7].cs.
6579 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
6580 CheckMarshallByRefAccess. Drop parameter.
6581 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
6583 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
6585 * report.cs (AllWarnings): Add CS1690.
6586 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
6588 (LocalVariableReference.DoResolveBase): Update.
6590 2006-04-09 Marek Safar <marek.safar@seznam.cz>
6592 * class.cs (MethodOrOperator): Moved common parts from method class.
6593 detect obsolete attributes.
6594 (Method.Define): Simplified as it reuses code from base.
6595 (Constructor.ValidAttributeTargets): Fixed issue found during
6597 (Destructor.ValidAttributeTargets): Fixed issue found during
6599 (Operator): Finished refactoring set off by #78020. Operator class is now
6600 ordinary method class.
6602 * anonymous.cs: Updated.
6604 * decl.cs (DeclSpace): Add IsGeneric
6606 2006-04-09 Marek Safar <marek.safar@seznam.cz>
6608 * class.cs (Constructor.Emit): Don't emit the attributes twice.
6610 2006-04-09 Marek Safar <marek.safar@seznam.cz>
6612 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
6613 detect obsolete attributes.
6614 (Method.CreateEmitContext): Moved to MethodOrOperator.
6616 2006-04-09 Marek Safar <marek.safar@seznam.cz>
6619 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
6620 customized exception to make crash detection easier.
6621 (MethodOrOperator): Started to work on new base class for methods and
6623 (Method): Derives from MethodOrOperator.
6624 (Constructor.Emit): Emits its own attributes.
6625 (AbstractPropertyEventMethod.Emit): Ditto.
6626 (Operator): Derives from MethodOrOperator, will refactor fully in extra
6628 (Operator.Emit): It's temporary more tricky than should be.
6630 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
6632 * report.cs (InternalErrorException): Add ctor with inner exception.
6634 2006-04-08 Marek Safar <marek.safar@seznam.cz>
6637 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
6640 2006-04-07 Marek Safar <marek.safar@seznam.cz>
6643 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
6646 2006-04-06 Marek Safar <marek.safar@seznam.cz>
6648 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
6649 attribute is present and Guid not.
6650 (Interface.ApplyAttributeBuilder): Ditto.
6652 * attribute.cs: Add error message.
6654 2006-04-06 Marek Safar <marek.safar@seznam.cz>
6658 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
6659 sources (it's composite) so hold them in extra array as they are used in
6660 Emit phase only. It worked in the previous versions by mistake.
6661 (Attribute.Emit): Emit attribute for more owners when exist.
6663 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
6664 it has now different behaviour.
6666 2006-04-04 Marek Safar <marek.safar@seznam.cz>
6668 * constant.cs (Constant.IsDefaultInitializer): New method.
6670 * class.cs: Updated.
6672 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
6673 re-initialize default values. It saves KBs almost for every assembly.
6674 Thanks Zoltan for the idea.
6675 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
6676 (ArrayCreation.DoResolve): Resolve only once.
6677 (ArrayCreation.Emit): Emit static initializer only when it is faster.
6678 (ArrayCreation.GetAttributableValue): Cope with optimized values.
6680 2006-04-03 Zoltan Varga <vargaz@gmail.com>
6682 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
6685 2006-04-01 Marek Safar <marek.safar@seznam.cz>
6687 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
6688 in an embedded statement too.
6690 2006-04-01 Raja R Harinath <rharinath@novell.com>
6693 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
6695 2006-04-01 Marek Safar <marek.safar@seznam.cz>
6699 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
6702 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
6704 2006-03-31 Marek Safar <marek.safar@seznam.cz>
6706 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
6709 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
6710 LocalTemporary change.
6712 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
6714 (ClassOrStruct.DefineFieldInitializers): Implemented static field
6715 initializers optimization.
6716 (ClassOrStruct.TypeAttr): Moved from modifiers.
6717 (Constructor.CheckBase): Don't crash when static ctor has parameters.
6718 (FieldBase.ResolveInitializer): Resolves initializer.
6719 (FieldBase.HasDefaultInitializer): New property.
6721 * cs-parser.jay: Removed message.
6723 * expression.cs (CompilerGeneratedThis): New specialization.
6725 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
6727 2006-03-28 Marek Safar <marek.safar@seznam.cz>
6729 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
6731 2006-03-27 Marek Safar <marek.safar@seznam.cz>
6733 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
6734 be now EnumConstants only.
6736 2006-03-27 Marek Safar <marek.safar@seznam.cz>
6738 * attribute.cs, driver.cs: Reset more caches.
6740 2006-03-26 Marek Safar <marek.safar@seznam.cz>
6742 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
6744 2006-03-26 Marek Safar <marek.safar@seznam.cz>
6746 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
6747 for easier reuse. Updated all overrides.
6748 (IntegralConstant): New base class for all integral constants.
6749 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
6750 of the constant range, report custom error.
6751 (UIntConstant.Reduce): Fixed uint conversion.
6753 * ecore.cs, literal.cs: Reduce updates.
6755 2006-03-26 Marek Safar <marek.safar@seznam.cz>
6759 * class.cs (Constructor.Define): Removed extra if for default ctors.
6760 A patch from Atsushi Enomoto.
6762 2006-03-26 Marek Safar <marek.safar@seznam.cz>
6764 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
6765 GetAttributableValue.
6767 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
6770 * convert.cs (ImplicitConversionRequired): Error message moved to
6773 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
6774 automatic implicit conversion of an output value.
6775 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
6777 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
6779 (TypeOf.GetAttributableValue): Add extra handling for object type.
6781 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
6782 special error message.
6784 2006-03-25 Marek Safar <marek.safar@seznam.cz>
6786 * class.cs (Constructor.Emit): Don't crash when struct ctor is
6788 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
6789 compatible with MS runtime.
6791 2006-03-23 Marek Safar <marek.safar@seznam.cz>
6793 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
6794 attribute arguments here.
6796 * class.cs (Indexer.Define): The check was moved to attribute class.
6798 2006-03-22 Marek Safar <marek.safar@seznam.cz>
6800 * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
6801 expression.cs, typemanager.cs: Minor changes from gmcs to make merging
6804 2006-03-22 Raja R Harinath <rharinath@novell.com>
6806 Support ParameterDefaultValueAttribute in gmcs. Also applied to
6807 mcs to keep code differences small.
6808 * attribute.cs (Attribute.GetParameterDefaultValue): New.
6809 * typemanager.cs (parameter_default_value_attribute_type): New.
6810 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
6813 2006-03-21 Marek Safar <marek.safar@seznam.cz>
6815 * expression.cs (StringConcat.Append): Reverted back to no warning state.
6817 2006-03-21 Marek Safar <marek.safar@seznam.cz>
6819 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
6821 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
6824 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
6826 * doc-bootstrap.cs : fix build.
6828 2006-03-20 Marek Safar <marek.safar@seznam.cz>
6830 * expression.cs (StringConcat.Append): Issue a warning when empty string
6833 2006-03-20 Marek Safar <marek.safar@seznam.cz>
6835 * assign.cs (CompoundAssign.ResolveSource): Removed.
6837 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
6840 * class.cs (TypeContainer.FindMethods): Removed.
6841 (TypeContainer.CheckMemberUsage): Made static.
6843 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
6845 * constant.cs (CheckRange): Removed unused type argument.
6846 (CheckUnsigned): Removed unused type argument.
6848 * cs-parser.jay: Updated after MemberAccess clean up.
6849 Uses Length for empty string test.
6851 * cs-tokenizer.cs: Uses Length for empty string test.
6852 (IsCastToken): Made static.
6853 (is_hex): Made static.
6854 (real_type_suffix): Made static.
6856 * decl.cs (SetupCache): Made static.
6857 (OnGenerateDocComment): Removed unused ds argument.
6859 * delegate.cs (VerifyDelegate): Removed unused argument.
6861 * doc.cs: Uses Length for empty string test.
6863 * driver.cs: Uses Length for empty string test.
6865 * enum.cs (IsValidEnumType): Made static
6867 * expression.cs (EnumLiftUp): Removed unused argument.
6868 (ResolveMethodGroup): Ditto.
6869 (BetterConversion): Ditto.
6870 (GetVarargsTypes): Ditto.
6871 (UpdateIndices): Ditto.
6872 (ValidateInitializers): Ditto.
6873 (MemberAccess.ctor): Ditto.
6874 (GetIndexersForType): Ditto.
6876 * flowanalysis.cs: (MergeFinally): Removed unused argument.
6878 * iterators.cs: Updated after MemberAccess clean up.
6880 * location.cs: Uses Length for empty string test.
6882 * namespace.cs: Uses Length for empty string test.
6884 * report.cs (CheckWarningCode): Made static.
6886 * statement.cs (LabeledStatement): Removed unused argument.
6888 * typemanager.cs (FilterNone): Removed.
6890 2006-03-18 Marek Safar <marek.safar@seznam.cz>
6892 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
6895 * class.cs: Updated.
6897 2006-03-18 Marek Safar <marek.safar@seznam.cz>
6899 * cs-parser.jay.cs: __arglist is not allowed for delegates.
6901 2006-03-18 Marek Safar <marek.safar@seznam.cz>
6905 * expression.cs (VerifyArgumentsCompat): Reverted to double error
6906 reporting, it's more tricky than I thought.
6908 2006-03-18 Marek Safar <marek.safar@seznam.cz>
6912 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
6914 (AnonymousMethod.ImplicitStandardConversionExists): New method.
6915 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
6916 Add more error reporting; Fixed issue with params.
6918 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
6920 * cs-parser.jay: AnonymousMethod requires host container.
6922 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
6924 2006-03-18 Raja R Harinath <harinath@gmail.com>
6926 * class.cs: Change 'TypeContainer ds' constructor argument to
6927 'DeclSpace parent'. Some classes were missed below due to
6928 different naming convention.
6930 * class.cs (MemberCore.Parent): Delete. This makes the
6931 ParentContainer changes below enforceable by the compiler.
6933 Treat pointers to enclosing declaration space as 'DeclSpace', not
6935 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
6936 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
6938 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
6940 (Block.AddThisVariable): Likewise.
6941 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
6942 (AbstractPropertyEventMethod.Emit): Likewise.
6943 (AbstractPropertyEventMethod.EmitMethod): Likewise.
6944 (GetMethod.Define, SetMethod.Define): Likewise.
6945 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
6946 (DelegateMethod.EmitMethod): Likewise.
6948 Fix regression test-partial-13.cs.
6949 Rationalize use of PartialContainer. Ensure that the partial
6950 class semantics can be tied to type-correctness, i.e., any
6951 violation will cause a compile error.
6952 * class.cs, const.cs: Access all fields that belong to class
6953 TypeContainer via ParentContainer. Arguments of EmitContexts and
6954 Resolve()-like functions still use 'Parent'.
6956 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
6957 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
6958 (PropertyMethod.CheckModifiers): Remove unused argument.
6959 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
6962 2006-03-17 Raja R Harinath <harinath@gmail.com>
6964 Make semantics of PartialContainer simpler.
6965 * decl.cs (DeclSpace.IsPartial): Remove.
6966 * class.cs (TypeContainer.IsPartial): Likewise.
6967 (TypeContainer..ctor): Set PartialContainer to point to self.
6968 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
6969 (TypeContainer.FindNestedType): Likewise.
6970 (MemberCore.ParentContainer): Simplify. Remove deprecation.
6972 2006-03-17 Marek Safar <marek.safar@seznam.cz>
6974 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
6976 2006-03-15 Marek Safar <marek.safar@seznam.cz>
6978 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
6981 2006-03-15 Marek Safar <marek.safar@seznam.cz>
6983 * class.cs (Operator.Define): An error for base conversion was not
6986 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
6988 * iterator.cs : yield break is allowed in try statement which has
6989 catch clauses. Fixed bug #77767.
6991 2006-03-13 Marek Safar <marek.safar@seznam.cz>
6993 A fix for #77593, #77574.
6995 * class.cs (MethodCore.CheckBase): Another if for operator.
6997 2006-03-09 Marek Safar <marek.safar@seznam.cz>
6999 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
7002 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
7003 (DelegateCreation.ImplicitStandardConversionExists): New method for just
7006 *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
7009 * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
7010 Updated after another emitcontext usage was clean up. It should help us to
7011 synchronize with gmcs easier.
7013 2006-03-04 Marek Safar <marek.safar@seznam.cz>
7017 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
7018 (Event.Define): ditto
7019 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
7021 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
7022 Removed redundant code and set NewSlot for Invoke method too.
7024 * parameter.cs (Parameters.ctor): Add custom, type ctor.
7025 (Parameters.MergeGenerated): New method. Use this method when you merge
7026 compiler generated argument with user arguments.
7028 2006-03-03 Marek Safar <marek.safar@seznam.cz>
7030 * attribute.cs (ResolveAsTypeTerminal): Removed.
7032 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
7033 specialization for predefined types; 30% speed up.
7034 Finally placed obsolete check to right place.
7035 (Expression.ResolveType): Removed.
7037 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
7038 Updated after ResolveType was removed.
7040 * expression.cs (Cast.ctor): Check void cast.
7041 (Binary.ResolveAsTypeTerminal): Is never type.
7042 (Conditional.ResolveAsTypeTerminal): Is never type.
7044 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
7046 2006-03-01 Raja R Harinath <rharinath@novell.com>
7049 * expression.cs (ParameterReference.DoResolveBase): Change return
7051 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
7055 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
7058 * typemanager.cs (GetFullNameSignature): Don't nullref on
7059 protected accessors.
7061 2006-02-27 Marek Safar <marek.safar@seznam.cz>
7063 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
7064 these two separated members to simplify the code.
7065 (Attribute.Resolve): Refactored to use new fields and methods.
7066 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
7067 implemented obsolete attribute checking.
7068 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
7069 implemented obsolete checking again. It look line never ending quest ;-)
7070 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
7072 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
7074 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
7076 *class.cs (Property.Define): Add RegisterProperty call.
7078 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
7079 argument groups (only 2).
7081 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
7082 encoding expression to arguments.
7083 (Expression.ExprClassToResolveFlags): Just turned to property.
7085 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
7086 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
7087 optimized as well as implemented support for zero-length attributes.
7089 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
7090 Add caching of PropertyInfo's.
7092 2006-02-25 Marek Safar <marek.safar@seznam.cz>
7094 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
7095 error multiple times.
7097 2006-02-25 Marek Safar <marek.safar@seznam.cz>
7099 New partial class implementation.
7100 A fix for #77027, #77029, #77403
7102 * attribute.cs (Attributable): Made attributes protected.
7104 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
7105 the replacements of ClassPart and PartialContainer.
7106 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
7107 (TypeContainer.AddInterface): Ditto.
7108 (TypeContainer.AddPartial): The main method for partial classes. It checks
7109 for errors and merges ModFlags and attributes. At the end class is added to
7111 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
7113 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
7114 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
7115 from the rest of partial classes.
7116 (TypeContainer.GetClassBases): Simplified.
7117 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
7119 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
7120 (TypeContainer.HasExplicitLayout): Uses Flags now.
7121 (PartialContainer): Removed.
7122 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
7123 (StaticClass): Was merged with Class.
7124 (Class.GetClassBases): class and static class bases are verified here.
7125 (Class.TypeAttr): Added static attributes when class is static.
7126 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
7127 (MemberBase): In some cases we need to call parent container for partial
7128 class. It should be eliminated but it's not easy now.
7130 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
7132 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
7133 partial classed to accumulate class comments.
7134 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
7136 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
7138 * driver.cs (MainDriver): Tree.GetDecl was removed.
7140 * modifiers.cs (Modifiers): Add partial modifier.
7142 * tree.cs (Tree.decl): Removed.
7143 (RootTypes): Started to use this class more often for root types
7146 2006-02-22 Marek Safar <marek.safar@seznam.cz>
7150 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
7151 external interface does not have an attribute.
7153 2006-02-22 Marek Safar <marek.safar@seznam.cz>
7155 Another prerequisites for new partial classs implementation.
7157 * attribute.cs (Attribute.Equal): Implemented.
7158 (Attribute.Emit): Changed as attributes can be applied more than twice.
7159 (Attributes.Emit): Check for duplicate attributes here.
7161 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
7162 as a parameter, clean-up.
7164 2006-02-11 Marek Safar <marek.safar@seznam.cz>
7168 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
7169 contains obsolete attribute check which can in some cases look for base
7170 type of current class which is not initialized yet.
7171 (TypeContainer.BaseType): Replacement of ptype.
7173 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
7175 2006-02-11 Marek Safar <marek.safar@seznam.cz>
7177 First of prerequisites for new partial classs implemention.
7179 * attribute.cs (Attributable): Extended by ResolveContext;
7180 Attributes finally have correct context for resolving in all cases.
7181 (AttachTo): Attribute owner is assigned here.
7183 * codegen.cs (IResolveContext): Introduce new interface to hold
7184 all information needed in resolving phase.
7185 (EmitContext): Implements IResolveContext; more clean-up needed here.
7187 * decl.cs (MemberCore): Implemented IResolveContext.
7189 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
7190 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
7191 parameter.cs, statement.cs, tree.cs, typemanager.cs:
7192 Refactored to use new IResolveContext instead of EmitContext; cleanup
7194 2006-02-06 Miguel de Icaza <miguel@novell.com>
7196 * codegen.cs (EmitScopeInitFromBlock): check here the
7197 capture_context, there is no need to make two calls to the
7200 * anonymous.cs: Add some debugging messages that might help me
7201 track other instances of this problem in the future (the
7202 regression of test 467).
7204 * cs-parser.jay: track the variable block, as we need to initalize
7205 any captured variables declared in this block for the "catch"
7206 portion of the "Try" statement.
7208 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
7209 scope initialization for captured variables.
7211 Also, move the emit for the variables after the block location has
7214 2006-02-06 Marek Safar <marek.safar@seznam.cz>
7216 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
7218 2006-02-02 Miguel de Icaza <miguel@novell.com>
7220 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
7221 commit yesterday, the initialization for the roots is necessary.
7222 What is not necessary is the scope activation.
7224 2006-02-02 Raja R Harinath <rharinath@novell.com>
7226 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
7227 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
7229 (Argument.Resolve): Remove CS0206 checks.
7231 2006-02-01 Miguel de Icaza <miguel@novell.com>
7233 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
7234 scopes for all the roots, the scopes will now be emitted when the
7235 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
7237 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
7238 code. This reduces a lot of existing cruft.
7240 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
7241 that the ScopeInfo is generated as we enter the scope, not at the
7242 time of use, which is what we used to do before.
7244 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
7245 every time a Block is about to be emitted if we have a
7248 2006-02-01 Raja R Harinath <rharinath@novell.com>
7250 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
7252 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
7254 * typemanager.cs (cons_param_array_attribute): Make private.
7255 (Reset): Set it to null.
7256 (InitCoreHelpers): Don't initialize it.
7257 (ConsParamArrayAttribute): New. Initialize it as needed.
7258 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
7260 2006-01-31 Miguel de Icaza <miguel@novell.com>
7262 * expression.cs: There might be errors reported during the
7263 selection of applicable methods. If there are errors, do not
7264 continue execution as it will lead the compiler to crash.
7266 2006-01-30 Miguel de Icaza <miguel@novell.com>
7268 * expression.cs: Member access is not allowed on anonymous
7269 methods. Fixes #77402.
7271 2006-01-30 Raja R Harinath <rharinath@novell.com>
7274 * cs-parser.jay (VariableDeclaration): Don't set
7275 current_array_type to null.
7276 (field_declaration, event_declaration, declaration_statement):
7277 Set it to null here.
7279 2006-01-28 Raja R Harinath <harinath@gmail.com>
7281 * typemanager.cs (GenericParameterPosition): New.
7284 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
7286 * doc.cs : To process "include" elements, first we should create
7287 another list than XmlNodeList, because it could result in node
7288 removal, which could result in that the XmlNodeList gives up
7291 (Also made code identical to gmcs again.)
7293 2006-01-25 Miguel de Icaza <miguel@novell.com>
7295 * ecore.cs: Introduce an error report that we were not catching
7296 before, if not silent, we must report the error. Gonzalo ran into
7299 2006-01-23 Miguel de Icaza <miguel@novell.com>
7301 A fix for bug: #76957
7303 * iterators.cs (MoveNextMethod.CreateMethodHost): call
7304 ComputeMethodHost before creating the method, this is a new
7307 * anonymous.cs (AnonymousContainer): Now we track all the scopes
7308 that this method references (RegisterScope). The actual scope
7309 where the method is hosted is computed with the ComputeMethodHost
7310 before we create the method.
7312 Moved the Deepest routine here.
7314 (AnonymousContainer.ComputeMethodHost): New routine used to
7315 compute the proper ScopeInfo that will host the anonymous method.
7317 (ScopeInfo): Deal with multiple roots. The problem was that we
7318 did not have a unique root where all ScopeInfos could be hanged
7319 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
7322 Remove AdjustMethodScope which is now computed at the end. Remove
7323 LinkScope which did a partial link, instead link all ScopeInfos
7324 before code generation from the new "LinkScopes" routine.
7326 Simplify all the Add* routines as they no longer need to maintain
7327 the tree, they just need to record that they are using variables
7330 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
7331 routines to produce the forest of ScopeInfo trees.
7333 * class.cs (TypeContainer.AppendMethod): This is just like
7334 AddMethod, but ensures that an interface implementation method
7335 (IEnumerable.XXX) is not inserted at the beginning of the queue of
7336 methods, but at the end.
7338 We use this functionality to ensure that the generated MoveNext
7339 method in the iterator class is resolved/emitted before the
7340 enumerator methods created.
7342 This is required because the MoveNext method computes the right
7343 ScopeInfo for the method. And the other methods will eventually
7344 need to resolve and fetch information computed from the anonymous
7347 2006-01-21 Raja R Harinath <harinath@gmail.com>
7348 Carlos Alberto Cortez <calberto.cortez@gmail.com>
7351 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
7353 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
7354 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
7356 2006-01-18 Raja R Harinath <rharinath@novell.com>
7358 Fix #76656, cs0231-2.cs.
7359 * cs-parser.jay (formal_parameter_list): Make error case catch
7361 (parenthesized_expression_0): Add CS1026 check.
7362 (invocation_expression): Remove unused { $$ = lexer.Location }.
7364 2006-01-17 Raja R Harinath <rharinath@novell.com>
7367 * cs-parser.jay (statement_expression): Don't list out the
7368 individual statement-expressions. Convert syntax error into
7371 2006-01-16 Raja R Harinath <rharinath@novell.com>
7374 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
7375 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
7376 CheckIntermediateModification.
7377 (FieldExpr.DoResolve): Add new two-argument version that
7378 allows us to resolve the InstanceExpression as an lvalue.
7379 The one-argument variant is now just a wrapper.
7380 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
7381 Resolve the lhs as an lvalue if the it has a value type.
7382 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
7383 from Assign.DoResolve.
7384 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
7385 resolved as an lvalue.
7386 (PropertyExpr.DoResolve): Update.
7387 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
7388 has a value type. Move CS1612 check here from
7389 CheckIntermediateModification.
7390 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
7391 * expression.cs (EmptyExpression.OutAccess): New. Used as the
7392 'right_side' of a ResolveLValue on an 'out' argument.
7393 (EmptyExpression.LValueMemberAccess): New. Used as the
7394 'right_side' of a propagated ResolveLValue on a value type.
7395 (LocalVariableReference.DoResolveBase): Recognize
7396 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
7398 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
7399 EmptyExpression.Null.
7401 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
7403 * typemanager.cs : added IsGenericParameter(). In mcs it always
7405 * doc.cs : for generic parameters, use GenericParameterPosition,
7408 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
7410 * expression.cs: Fix Console.WriteLine ((this = x).foo);
7412 2006-01-12 Miguel de Icaza <miguel@novell.com>
7414 This fixes the problem where we used ldfld instead of ldflda to
7415 load the "THIS" pointer on captured parameters, when THIS is a
7416 value type. See bug #77205.
7418 * iterators.cs (CapturedThisReference.Emit): Pass false to
7419 EmitThis (we do not need the address).
7421 * codegen.cs (EmitThis): it needs to know whether we need the
7422 address of `this' or not. This is used by value types.
7424 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
7425 every other call passes false.
7427 2006-01-12 Raja R Harinath <rharinath@novell.com>
7430 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
7432 * expression.cs (Invocation.OverloadResolve): Update.
7433 (Invocation.DoResolve): Avoid double resolution of invocation.
7435 2006-01-11 Raja R Harinath <rharinath@novell.com>
7438 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
7439 unary negation of floating point types as 0-expr; negation cannot
7440 overflow in floating point types.
7443 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
7444 on operands of 'void' type.
7447 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
7448 and ExclusiveOr for boolean constants too.
7450 2006-01-09 Raja R Harinath <rharinath@novell.com>
7453 * expression.cs (Invocation.OverloadResolve): Replace reflected
7454 override methods with their base virtual methods, rather than
7456 * typemanager.cs (TypeManager.GetOverride): New.
7458 2006-01-05 Jb Evain <jbevain@gmail.com>
7460 * class.cs (Property.Define, Indexer.Define): do not tag the
7461 properties as SpecialName | RTSpecialName.
7463 2006-01-04 Miguel de Icaza <miguel@novell.com>
7465 * class.cs (MethodCore.IsDuplicateImplementation): This method was
7466 doing a low-level comparission of parameter types. It was lacking
7467 a check for __argslist.
7469 2005-12-30 Miguel de Icaza <miguel@novell.com>
7471 * expression.cs (ParameterReference.DoResolveBase): Allow
7472 reference parameters if they are local to this block.
7474 This allows the ref and out parameters of a delegate to be used in
7475 an anonymous method, for example:
7477 delegate void set (out int x);
7479 set s = delegate (out int x){
7483 This is used by functionality introduced late in the C# language.
7485 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
7486 method that take ref and out parameters.
7488 Fixes #77119 which was a late change in the spec.
7490 2005-12-23 Miguel de Icaza <miguel@novell.com>
7492 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
7493 parent if its the same scope. Fixes #77060.
7495 2005-12-21 Miguel de Icaza <miguel@novell.com>
7497 * driver.cs: Report the case of no source files and no -out:
7500 2005-12-20 Raja R Harinath <rharinath@novell.com>
7503 * expression.cs (ComposedCast.GetSignatureForError): Define.
7505 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
7509 * namespace.cs (NamespaceEntry): Add extern_aliases as a
7510 ListDictionary, to contain the ExternAliasEntry entries (in
7511 addition to the NamespaceEntry.aliases hashtable). This field is
7512 shared between the original entry and its doppelganger (bodyless
7514 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
7515 extern_aliases field.
7516 (NamespaceEntry.Lookup): Move the IsImplicit check after the
7517 lookup in extern_aliases.
7519 2005-12-16 Raja R Harinath <rharinath@novell.com>
7522 * class.cs (TypeContainer.Mark_HasEquals): New.
7523 (TypeContainer.Mark_HasGetHashCode): New.
7524 (ClassPart): Override them.
7525 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
7528 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
7529 'parent' argument to the base constructor.
7531 Remove all mention of TypeContainer from decl.cs.
7532 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
7533 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
7534 (DeclSpace.DeclSpace): Likewise.
7535 (DeclSpace.DefineMembers): Remove unused argument.
7536 * cs-parser.jay (pop_current_class): Update to changes. Simplify
7537 debugging check -- we don't care if the debug code throws an
7538 InvalidCastException instead of an InternalErrorException.
7539 * class.cs (TypeContainer.DefineMembers): Update to changes.
7540 (TypeContainer.DoDefineMembers): Likewise.
7541 (TypeContainer.GetMethods): Likewise.
7542 (PropertyMember.Define): Likewise.
7543 (MemberBase.Parent): New property that forwards to
7544 MemberCore.Parent, but ensures that we get a TypeContainer.
7545 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
7546 (RootContext.PopulateTypes): Likewise. Remove special case code
7547 for !RootContext.StdLib: DefineMembers is idempotent.
7549 2005-12-14 Miguel de Icaza <miguel@novell.com>
7551 * convert.cs (ExplicitConversionCore): Check the return value from
7552 ExplicitConversionCore which can return null on failure. Fixes #76914
7554 2005-12-13 Marek Safar <marek.safar@seznam.cz>
7556 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
7558 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
7560 * doc.cs : The search for referenced namespace was insufficient to
7561 get global one as it used to do. Fixed bug #76965.
7563 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
7565 * doc.cs : check name in cref in the last phase that whether it is
7568 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
7570 * cs-tokenizer.cs : reverted the latest change: it somehow broke
7573 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
7575 * doc.cs : so it turned out that we cannot skip override check for
7576 interface members. Fixed bug #76954.
7578 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
7580 * cs-tokenizer.cs : fixed bug #75984:
7581 - #warning and #error should not be handled when the source line
7583 - #line is not checked strictly when the source line is disabled.
7584 - #define and #undef is on the other hand checked strictly at any
7587 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
7589 * cs-tokenizer.cs : missing Location (actually, filename) in one of
7592 2005-12-05 Marek Safar <marek.safar@seznam.cz>
7594 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
7596 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
7598 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
7599 (FieldBase.Initializer): Initializer is now optional.
7600 (EventField.Define): Only event field can have initializer.
7602 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
7604 * const.cs (Const): Reuse initializer.
7606 * cs-parser.jay: Updated after FieldBase changes.
7607 Added current_array_type to simplify array initializers.
7609 * ecore.cs (NullCast.IsDefaultValue): Implemented.
7611 * expression.cs, iterators.cs: Updated.
7613 * namespace.cs (NamespaceEntry): Made UsingFound private.
7615 2005-12-05 Marek Safar <marek.safar@seznam.cz>
7617 * parameterCollection.cs: Obsolete, removed.
7618 * parser.cs: Obsolete, removed.
7620 2005-12-05 Marek Safar <marek.safar@seznam.cz>
7623 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
7625 * enum.cs (Enum.Define): Set obsolete context here.
7627 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
7630 - FindDocumentedMember() now expects 1) paramList as null
7631 when "we don't have to check the number of parameters" and
7632 2) Type.EmptyTypes when "there is no arguments".
7633 - Introduced FoundMember struct to hold the exact type which was
7634 used to find the documented member (the above change broke
7635 test-xml-044; it might be better just to use DeclaringType than
7636 what MS does, like this change does, but it depends on usage.)
7638 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
7640 * doc.cs : documented member might be from DeclaringType for nested
7641 types. Fixed bug #76782.
7643 2005-12-03 Ben Maurer <bmaurer@ximian.com>
7645 * anonymous.cs: Have the param code handle leaving copies on the
7646 stack etc. Allows anonymous params to take part in the assignment
7647 code (++, +=, etc). Fixes bug #76550
7649 * expression.cs: Handle the prepare_for_load/leave_copy by passing
7650 it down to the anon code.
7652 * iterators.cs: Use dummy var here
7654 * codegen.cs: Handle new vars
7656 2005-12-01 Marek Safar <marek.safar@seznam.cz>
7659 * class.cs (MethodData.Define): Set proper Obsolete context.
7661 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
7663 (FieldExpr.DoResolve): Ditto.
7665 2005-12-01 Marek Safar <marek.safar@seznam.cz>
7668 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
7669 parent is not obsolete.
7671 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
7673 * doc.cs : (FindDocumentedMember) find parameterless members first
7674 and get CS0419 in the early stage. Fixed first case of bug #76727.
7676 2005-11-30 Marek Safar <marek.safar@seznam.cz>
7679 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
7680 no error was reported.
7682 *expression.cs (Binary.DoResolve): left can be null.
7684 2005-11-22 Marek Safar <marek.safar@seznam.cz>
7687 * class.cs (MethodData.Emit): Parameters should be labeled first.
7689 2005-11-21 Marek Safar <marek.safar@seznam.cz>
7692 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
7694 2005-11-18 Marek Safar <marek.safar@seznam.cz>
7696 * attribute.cs (AreParametersCompliant): Moved to Parameter.
7698 * class.cs (MethodCore): Parameter clean up.
7699 (IMethodData): Added ParameterInfo.
7700 (MethodData): Parameter clean up.
7701 (Indexer.Define): Parameter clean up.
7713 * typemanager.cs: Parameter clean up.
7715 * delegate.cs (Define): Get rid of duplicated code.
7717 * expression.cs (ParameterReference): Removed useless parameters
7719 (Invocation): Ditto.
7721 * parameter.cs (ParamsParameter): New class, params specialization.
7722 (ArglistParameter): Attemp to separate arglist.
7723 (Parameter): Refactored to be reusable and faster.
7724 (Parameter.Modifier): Made understandable.
7725 (Parameters): Changed to be used as a class for `this' assembly
7726 parameters. Refactored to use new specialized classes.
7728 * support.cs (ParameterData): Added Types property.
7729 (InternalParameters): Deleted.
7731 2005-08-20 Martin Baulig <martin@ximian.com>
7733 Merging this patch from GMCS to fix #75867.
7735 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
7736 scope if we don't already have it.
7738 2005-11-17 Martin Baulig <martin@ximian.com>
7741 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
7742 inherit the scope from our parent. Fixes #76653.
7744 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
7746 * doc.cs : the previous patch does not actually fix the bug.
7747 PropertyInfo override check is now implemented and really fixed it.
7748 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
7750 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
7752 * doc.cs : apply "override filter" also to properties.
7755 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
7757 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
7758 no need to check overrides. For classes, omit those results from
7759 interfaces since they must exist in the class. Fixed bug #76726.
7761 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
7763 * typemanager.cs : (GetFullNameSignature) differentiate indexers
7764 with different parameters. Fixed the second problem in #76685.
7766 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
7768 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
7769 get expected 'protected' access in CheckValidFamilyAccess()).
7772 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
7774 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
7775 Fixed bug #76705. CS1569 was incorrectly commented out.
7777 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
7779 * doc.cs : use Invocation.IsOverride() to do real override check.
7780 * expression.cs : made Invocation.IsOverride() internal.
7782 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
7784 * doc.cs : use TypeManager.FindMembers() instead of (possible)
7785 TypeBuilder.FindMembers() and filter overriden base members out.
7788 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
7790 * doc.cs : ref/out parameters are represented as '@' (instead of
7791 '&' in type FullName). Fixed bug #76630 (additionally crefs).
7793 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
7795 * doc.cs : when there was no '.' in cref to methods in doc comment,
7796 then parameters were missing in the output. Fixed bug #76691.
7798 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
7800 * driver.cs : don't output docs when there is an error.
7803 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
7806 Now it should detect indexers. Fixed primary concern in bug #76685.
7807 Fixed CS0419 message to not show the identical member signature in
7810 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
7812 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
7813 instead of Type.FindMembers() since it does not handle events.
7816 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
7818 * codegen.cs: Fixed typo (speficied -> specified).
7820 2005-11-11 Marek Safar <marek.safar@seznam.cz>
7823 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
7825 2005-11-11 Marek Safar <marek.safar@seznam.cz>
7827 * attribute.cs: Changed error message.
7829 * cs-tokenizer.cs: One more check.
7831 2005-11-10 Marek Safar <marek.safar@seznam.cz>
7833 * statement.cs (Block.Resolve): Ignore empty statement.
7835 2005-11-10 Marek Safar <marek.safar@seznam.cz>
7837 * report.cs: Made error/warning methods more strict to avoid
7840 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
7841 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
7842 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
7843 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
7845 2005-11-08 Marek Safar <marek.safar@seznam.cz>
7847 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
7848 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
7850 * class.cs (TypeContainer.IsComImport): New property.
7851 (Constructor.Define): Create proper ctor for ComImport types.
7853 * expression.cs (New.CheckComImport): Fixed.
7855 2005-11-07 Miguel de Icaza <miguel@novell.com>
7857 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
7858 that a parameter has been captured does not mean that we do not
7859 have to do the rest of the processing. This fixes the second part
7860 of #76592. If there was another anonymous method capturing
7861 values in the past, the Scope would never be set for the second
7862 method that captured the same parameter.
7864 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
7865 properly manipulate the stack. Second part of fix for #76592.
7867 * expression.cs (New): Add support for invoking "new" on
7868 interfaces that have been flagged with the ComImport attribute and
7869 the CoClass. Fixes #76637
7871 * statement.cs (Try.DoEmit): When a variable is captured, do not
7872 try to emit the vi.LocalBuilder variable as it has been captured.
7873 Create a temporary variable and store the results on the
7874 FieldBuilder. Fixes #76642
7876 2005-11-07 Marek Safar <marek.safar@seznam.cz>
7878 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
7880 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
7882 * expression.cs (Binary.DoResolve): Added && optimalization.
7884 * typemanager.cs (AddUserType): Removed useless argument.
7886 2005-11-04 Marek Safar <marek.safar@seznam.cz>
7888 * statement.cs (Block.variables): Uses ListDictionary.
7890 2005-11-03 Marek Safar <marek.safar@seznam.cz>
7893 * class.cs (PartialContainer.EmitType): Customized to emit
7894 security attributes.
7895 (ClassPart.ApplyAttributeBuilder): Transform security attribute
7896 for partial classes.
7898 2005-11-03 Marek Safar <marek.safar@seznam.cz>
7901 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
7902 access has to be fixed.
7904 * typemanager.cs (IsUnmanagedType): Wrong common field type.
7906 2005-11-01 Marek Safar <marek.safar@seznam.cz>
7909 * ecore.cs (NullCast.Reduce): Implemented.
7911 * expression.cs (ArrayCreation.CheckIndices): Correcly check
7914 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
7916 (Foreach.Resolve): Catch null properly.
7918 2005-10-29 Marek Safar <marek.safar@seznam.cz>
7920 * cs-tokenizer.cs: Warning text fix.
7922 * driver.cs: AllWarningNumbers exposed on public interface.
7924 * report.cs (): Reviewed warning numbers.
7925 (IsValidWarning): Use binary search.
7927 2005-10-29 Marek Safar <marek.safar@seznam.cz>
7929 * driver.cs: Implemeted resource visibility.
7930 (Resources): New class for code sharing between /res: and
7933 2005-10-28 Marek Safar <marek.safar@seznam.cz>
7936 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
7939 * convert (Convert.ImplicitReferenceConversion): NullCast holds
7942 * ecore.cs (NullCast): Child is contant only.
7944 * literal.cs (NullLiteral.Reduce): null can be converted to any
7947 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
7949 * driver.cs: Use Encoding.Default as default code page instead
7952 2005-10-27 Raja R Harinath <rharinath@novell.com>
7955 * expression.cs (Invocation.Error_InvalidArguments): Handle
7956 __arglist parameters.
7957 (Invocation.VerifyArgumentsCompat): Likewise.
7958 * support.cs (ReflectionParameters.GetSignatureForError): Print
7959 __arglist parameters.
7960 (InternalParamters.GetSignatureForError): Likewise.
7961 * parameter.cs (Parameters.GetSignatureForError): Likewise.
7963 2005-10-26 Marek Safar <marek.safar@seznam.cz>
7965 * attribute.cs (GetPropertyValue): Made public.
7967 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
7969 Add new property WrapNonExceptionThrows to handle 2.0 assembly
7971 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
7974 * driver.cs: Reflect method name change.
7976 * statement.cs (Try.Resolve): Warn when try has both general
7979 * typemanager.cs: runtime_compatibility_attr_type new predefined
7982 2005-10-26 Raja R Harinath <harinath@gmail.com>
7985 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
7986 treat it as an empty parameter list.
7988 2005-10-26 Raja R Harinath <rharinath@novell.com>
7991 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
7992 ResolveAsTypeStep silent.
7993 * statement.cs (Block.AddConstant): Mark block as used.
7994 (Block.ResolveMeta): Avoid piling on error messages
7995 if a constant initializer resolution fails.
7997 2005-10-25 Raja R Harinath <rharinath@novell.com>
7999 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
8001 (NamespaceEntry.VerifyAllUsing): New.
8002 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
8003 behaviour. Delegates actual resolution of alias to ...
8004 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
8005 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
8007 * driver.cs (Driver.MainDriver): Update.
8009 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
8010 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
8012 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
8014 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
8015 RootNamespace.DefineNamespacesForAll.
8017 2005-10-24 Raja R Harinath <harinath@gmail.com>
8019 * typemanager.cs (assemblies, external_aliases, modules)
8020 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
8021 (ComputeNamespaces, GetRootNamespace): Remove extra staging
8022 overhead. Move resposibility ...
8023 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
8024 * driver.cs, attribute.cs, codegen.cs: Update to changes.
8026 2005-10-23 Raja R Harinath <harinath@gmail.com>
8028 * namespace.cs (RootNamespace.all_namespaces): Renamed from
8029 cached_namespaces. Improve usage.
8030 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
8031 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
8032 Move from GlobalRootNamespace and simplify.
8033 (RootNamespace.Global): Make instance variable.
8034 (RootNamespace.RootNamespace): Add "alias name" parameter.
8035 (GlobalRootNamespace): Simplify drastically.
8036 (Namespace.Lookup): Don't use GetNamespace.
8037 * typemanager.cs (GetRootNamespace): Rename from
8038 ComputeNamespaceForAlias.
8039 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
8041 2005-10-23 Marek Safar <marek.safar@seznam.cz>
8043 * anonymous.cs (AnonymousContainer): Don't crash when container
8046 2005-10-23 Marek Safar <marek.safar@seznam.cz>
8048 * expression.cs (Binary.DoResolve): Warn when comparing same
8051 2005-10-23 Marek Safar <marek.safar@seznam.cz>
8054 * expression.cs (Binary.DoResolve): It looks like there are no
8055 convetsion rules in enum context.
8057 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
8059 Add support for extern alias qualifiers.
8060 * typemanager.cs: Move some LookupTypeReflection code
8061 to namespace.cs, to have cleaner code. Added some methods
8062 to help us keep track of the extern aliased references.
8063 * driver.cs: Add suport for extern alias assemblies on command
8064 line and check for their warnings/errors. Also keep track of the
8065 extern aliased assemblies.
8066 * namespace.cs: Move the global functionality of Namespace
8067 to GlobalRootNamespace/RootNamespace. Now the global namespace
8068 is GlobalRootNamespace.Globa. Also the code moved from
8069 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
8070 Finally added LocalAliasEntry (AliasEntry before) and
8071 ExternAliasEntry, to handle alias statements.
8072 * cs-parser.jay: Add support in the grammar for extern alias
8074 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
8075 Update callings to Namespace (now in GlobalRootNamespace).
8077 2005-10-18 Raja R Harinath <rharinath@novell.com>
8080 * class.cs (TypeContainer.DefineType): Move updating of
8081 topological sort earlier in the code.
8082 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
8084 2005-10-18 Marek Safar <marek.safar@seznam.cz>
8087 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
8089 * constant.cs (Constant.TryReduce): Moved from Cast class.
8090 (Reduce): Made little bit more OO and fixed missing conversions.
8092 * ecore.cs (Reduce): Implemented.
8093 (Binary.EnumLiftUp): New method to upgrade values to enum values.
8095 * literal.cs (Reduce): Implemented.
8097 * class.cs: Reverted Miguel's wrong commit.
8099 2005-10-14 Miguel de Icaza <miguel@novell.com>
8101 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
8103 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
8105 * cs-parser.jay, expression.cs : CS0214 was missing error location
8106 for constants. Fixed bug #76404.
8108 2005-10-11 Marek Safar <marek.safar@seznam.cz>
8111 * convert.cs (ExplicitConversionCore): Fixed object->enum
8114 2005-10-10 Raja R Harinath <rharinath@novell.com>
8116 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
8118 (PropertyExpr.EmitCall): Likewise.
8119 * expression.cs (Invocation.EmitArguments): Handle case where
8121 (Invocation.EmitCall): Avoid allocating temporary variable if
8122 there are no arguments.
8124 2005-10-07 Raja R Harinath <rharinath@novell.com>
8127 * convert.cs (ImplicitConversionStandard): Move conversion of
8128 void* to arbitrary pointer types ...
8129 (ExplicitConversionStandard): .. here.
8130 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
8131 error to always print typenames.
8133 2005-10-07 Raja R Harinath <rharinath@novell.com>
8135 * convert.cs (GetConversionOperator): Rename from
8136 GetConversionOperators. Move operator selection code from ...
8137 (UserDefinedConversion): ... here.
8139 2005-10-06 Marek Safar <marek.safar@seznam.cz>
8141 * convert.cs (ExplicitConversionCore): Removed duplicate enum
8144 2005-10-05 Marek Safar <marek.safar@seznam.cz>
8146 * assign.cs (Assign.DoResolve): Error method changed.
8148 * cfold.cs (DoConstantNumericPromotions): Error method changed.
8150 * const.cs (ResolveValue): Reset in_transit immediately.
8152 * constant.cs: Error method changed.
8154 * convert.cs: Removed useless location parameter.
8155 (ExplicitNumericConversion): Don't do double enum check.
8156 (ExplicitConversionCore): Renamed from ExplicitConversion.
8157 (ExplicitUnsafe): Extracted from ExplicitConversion.
8158 (ExplicitConversion): Uses for error reporting.
8160 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
8162 (ResolveBoolean): Uses common error method.
8163 (CastToDecimal): Get rid of ec.
8164 (CastFromDecimal): Optimized.
8165 (ConvCast): Get rid of ec.
8167 * enum.cs (ResolveValue): Reset in_transit immediately.
8168 (Emit): Return after first error.
8170 * expression.cs: Convert changes.
8172 * literal.cs: Error method changed.
8174 * statement.cs: Error method changed.
8176 2005-10-03 Raja R Harinath <rharinath@novell.com>
8178 * support.cs (SeekableStreamReader.Position): Don't error out when
8179 the requested position is just beyond the end of the current
8182 2005-09-28 Raja R Harinath <rharinath@novell.com>
8184 * support.cs (SeekableStreamReader): Simplify drastically. Don't
8185 try to keep in sync with the byte count of the underlying Stream.
8186 However, this limits us to a window size of 2048 characters: i.e.,
8187 the maximum lookahead of our lexer/parser can be 2048 characters.
8189 2005-09-28 Marek Safar <marek.safar@seznam.cz>
8192 * driver.cs: Fix compilation files with full root path.
8194 2005-09-25 Miguel de Icaza <miguel@novell.com>
8196 * report.cs (SymbolRelatedToPreviousError): Format the output so
8197 it does not use an open parenthesis that is never closed.
8199 * driver.cs: Follow coding guidelines
8201 2005-09-27 Marek Safar <marek.safar@seznam.cz>
8204 * const.cs (Const.ResolveValue): Check for assigning non-null
8205 value to reference type.
8207 2005-09-27 Marek Safar <marek.safar@seznam.cz>
8209 * anonymous.cs: Implemented ExprClassName.
8211 * assign.cs (Assign.DoResolve): Don't chrash when type is not
8214 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
8217 * class.cs (StaticClass.DefineContainerMembers): Report protected
8220 * codegen.cs: if(ed) PRODUCTION.
8222 * convert.cs (Error_CannotImplicitConversion): Better error
8225 * cs-parser.jay: More error checks.
8227 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
8229 * driver.cs (CSCParseOption): Enabled wrong option check.
8231 * ecore.cs (Expression.ExprClassName): Turned to property.
8232 (MemberExpr.CheckIntermediateModification): For checking boxed
8233 value types modification.
8235 * statement.cs (Fixed.Resolve): Expression type must be
8236 convertible to fixed type.
8237 (CollectionForeach.GetEnumeratorFilter,TryType):
8238 Small refactoring for easier error checking.
8240 2005-09-26 Marek Safar <marek.safar@seznam.cz>
8242 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
8245 * class.cs (GeneratedBaseInitializer): New class for customization
8246 compiler generated initializers.
8247 (MemberBase.DoDefine): Check Obsolete attribute here.
8248 (FieldMember.DoDefine): Ditto.
8250 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
8253 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
8254 (MemberCore.GetObsoleteAttribute): Removed argument.
8255 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
8256 (MemberCore.CheckObsoleteType): New helper.
8260 * statement.cs: Updates after MemberCore changes.
8262 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
8263 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
8265 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
8266 obsolete attribute for compiler construct.
8267 (As.DoResolve): Cache result.
8269 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
8271 2005-09-26 Raja R Harinath <rharinath@novell.com>
8274 * expression.cs (This.VerifyFixed): In a value type T, the type of
8275 'this' is T&, iow, 'this' is either an out or ref parameter. In a
8276 value type R, 'this' is treated as a value parameter.
8278 2005-09-22 Miguel de Icaza <miguel@novell.com>
8280 * statement.cs (Lock): Use the TemporaryVariable class instead of
8281 manually using local variables as those do not work when variables
8284 * ecore.cs: Moved the TemporaryVariable class from being a nested
8285 class inside Foreach to be a public class that can be employed in
8288 2005-09-19 Marek Safar <marek.safar@seznam.cz>
8290 * cs-parser.jay: interface_accessors replaced by
8291 accessor_declarations.
8293 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
8296 * statement.cs (GotoCase.Resolve): Convert null constant to
8298 (SwitchLabel.ResolveAndReduce): Ditto.
8299 (SwitchLabel.NullStringCase): Custom null stamp.
8300 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
8302 typemanager.cs (CSharpSignature): Don't skip first argument
8305 2005-09-18 Miguel de Icaza <miguel@novell.com>
8307 * driver.cs: Set InEmacs based on the environment variable EMACS.
8309 * location.cs (InEmacs): in this mode, do not report column
8310 location as it confuses Emacs.
8312 2005-09-16 Marek Safar <marek.safar@seznam.cz>
8314 * cfold.cs, constant.cs, convert.cs, ecore.cs,
8315 expression.cs, iterators.cs, literal.cs: Store constants and
8318 * class.cs (MemberBase.ShortName): Pass location.
8320 * cs-parser.jay: Some location fixes.
8322 * ecore.cs (Expression.Location): Made virtual.
8324 2005-09-05 Miguel de Icaza <miguel@novell.com>
8326 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
8327 if the underlying types are the same, otherwise we need to produce
8328 code that will do the proper cast.
8330 This was exposed by Marek's constant rewrite which produced
8331 invalid code for the call site:
8334 void Method (X v) {}
8338 This fixes test-49.cs
8340 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
8342 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
8343 Type/Object should be allowed as well. Fixed bug #75968.
8345 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
8347 * expression.cs : (Binary.DoResolve): when one is enum constant and
8348 another is constant 0, then return enum one *as enum type*.
8351 2005-09-02 Raja R Harinath <rharinath@novell.com>
8353 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
8357 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
8358 flow-branching for LocalVariableReferences in case we were invoked
8359 from a MemberAccess.
8360 * expression.cs (LocalVariableReference.VerifyAssigned): New.
8362 (LocalVariableReference.DoResolveBase): ... this.
8363 (MemberAccess.Resolve): Do the check that was disabled during
8366 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
8369 (PartialContainer.Create): check abstract/sealed/static strictly
8370 but abstract/sealed can exist only at one side. Fixed bug #75883.
8372 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
8375 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
8376 specified, don't default to UnmanagedType.I4.
8378 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
8380 * expression.cs : conditional operator should check possibly
8381 incorrect assign expression. Fixed bug #75946.
8383 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
8385 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
8386 Reverting the change. gmcs is much complex than mcs on this matter.
8388 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
8390 * cs-tokenizer.cs : To read another token ahead of the actual
8391 consumption, use new SavedToken and cache token instead of moving
8392 back the stream with SeekableStreamReader (it seemed problematic).
8394 driver.cs : Thus use StreamReader directly.
8395 * support.cs : Thus removed SeekableStreamReader.
8397 2005-08-30 Raja R Harinath <rharinath@novell.com>
8400 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
8401 (ScopeInfo.EmitScopeType): Use it to construct field names from
8402 names of captured locals.
8405 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
8406 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
8407 Pass 'target_type' to BoxedCast. Don't default to 'object'.
8408 (ExplicitConversion): Remove enum cases already handled by
8409 implicit conversion. Move implicit conversion check to the beginning.
8410 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
8411 * expression.cs (ArrayCreation.EmitDynamicInitializers):
8412 Don't treat System.Enum as a struct.
8414 2005-08-30 Jb Evain <jbevain@gmail.com>
8416 * attribute.cs: handles as expression in parameters.
8418 2005-08-30 Raja R Harinath <rharinath@novell.com>
8421 * class.cs (TypeContainer.VerifyClsName): Don't use a
8422 PartialContainer when verifying CLS compliance.
8423 (AbstractPropertyEventMethod): Set Parent here, ...
8424 (PropertyMethod): ... not here.
8426 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
8428 * attribute.cs : escaped attribute name should not be allowed to be
8429 resolved (e.g. @class as classAttribute). Fixed bug #75930.
8431 2005-08-29 Raja R Harinath <rharinath@novell.com>
8434 * convert.cs (ImplicitStandardConversionExists): Allow zero also
8435 when converting a long constant to unsigned long.
8436 * expression.cs (Invocation.OverloadResolve): Add sanity check to
8437 detect where IsApplicable and VerifyArgumentsCompat disagree.
8439 2005-08-29 Raja R Harinath <rharinath@novell.com>
8440 and Carlos Alberto Cortez <carlos@unixmexico.org>
8443 * class.cs (TypeContainer.CanElideInitializer): New helper.
8444 (TypeContainer.EmitFieldInitializers): Use it to determine if we
8445 can safely emitting the initializer of a field.
8447 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
8449 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
8450 allowed inside a switch (without loop). Fixed bug #75433.
8452 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
8454 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
8455 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
8457 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
8459 * driver.cs : kinda reverting the default encoding changes (not exact
8460 revert since I noticed that "codepage:reset" might not work fine).
8462 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
8464 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
8465 Location. Now getter and setter store location correctly.
8466 (errors/cs0111-12.cs now reports the expected location.)
8468 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
8470 * driver.cs : Use default encoding on the environment.
8471 Removed (now that) extra parameter for SeekableStreamReader.
8472 * support.cs : (SeekableStreamReader) third .ctor() argument for
8473 StreamReader is not required (always true). preamble size could
8474 be acquired in simpler and safe way.
8476 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
8478 * cs-parser.jay: report CS0642 at warning level 3
8479 and report CS0642 for an if else statement also
8480 fixes bug #74745. Patch by John Luke (and a bit
8482 Removed extra CS0642 warning check for "while",
8484 * statement.cs: In Block.Resolve(), CS0642 check
8485 is reimplemented to check a sequence of an empty
8486 statement and a block.
8488 Both fix bug #66777.
8490 2005-08-24 Marek Safar <marek.safar@seznam.cz>
8492 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
8493 detection until I fix it.
8495 * cs-tokenizer.cs: Changed error message.
8497 * cs-parser.jay: Fixed 2 error locations.
8499 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
8500 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
8503 * enum.cs (GetSignatureForError): Fixed.
8505 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
8509 * typemanager.cs (RegisterProperty): Removed.
8511 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
8513 2005-08-24 Raja R Harinath <rharinath@novell.com>
8516 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
8517 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
8519 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
8521 * expression.cs : tiny fix is required for not warning positive ulong.
8524 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
8526 * expression.cs : add CS0652 check for constant and integral
8527 expression. Fixed bug #53974.
8529 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
8531 * expression.cs : in DoNumericPromotions(), check if there is implicit
8532 conversion overload for string (to check CS0034). Fixed bug #52492.
8534 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
8536 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
8538 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
8540 * ecore.cs : report location when it is *not* Null.
8542 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
8548 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
8549 correctly. Fixed bug #75721.
8551 2005-08-23 Raja R Harinath <rharinath@novell.com>
8553 * support.cs (SeekableStreamReader.Position): Avoid an expensive
8554 loop that performs 'min (pos, char_count)'.
8557 * expression.cs (Unary.ResolveOperator): Don't discard implicit
8558 converted value in Operator.OnesComplement.
8560 2005-08-22 Ben Maurer <bmaurer@ximian.com>
8562 * anonymous.cs: If the anon method is pulled into a helper class,
8563 it needs to be `internal' not `private'. Fixes runtime behavior on
8566 2005-08-20 Martin Baulig <martin@ximian.com>
8568 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
8569 scope if we don't already have it.
8571 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
8572 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
8575 2005-08-17 Marek Safar <marek.safar@seznam.cz>
8578 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
8581 2005-08-16 Marek Safar <marek.safar@seznam.cz>
8583 The big constants rewrite
8584 Fix #75746, #75685 and more
8585 As a side effect saved 1MB for MWF ;-)
8587 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
8588 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
8589 enum based for corlib compilation.
8591 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
8594 * class.cs (FixedField.Define): Use ResolveAsConstant.
8596 * const.cs (IConstant): Interface constants and enums.
8597 (Const.ResolveValue): New method for constant resolvning.
8598 (ExternalConstant): Constants from imported assemblies.
8600 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
8601 conversion; like enums.
8602 (Constant.ToType): Converts this constant to different type.
8603 (Constant.Increment): Adds 1.
8605 * convert.cs (ImplicitConversionRequired): Simplified.
8607 * cs-parser.jay: Create EnumMember directly.
8609 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
8611 * doc.cs (GenerateEnumDocComment): Removed.
8613 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
8614 (ConvertIntLiteral): Removed.
8615 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
8617 * enum.cs (EnumMember): Implement IConstant.
8618 (Enum.IsValidEnumConstant): Removed.
8619 (Enum.GetNextDefaultValue): Removed.
8620 (Enum.FindMembers): Updated.
8621 (Enum.GenerateDocComment): Iterate enum members.
8623 * expression.cs (Cast.TryReduce): Handle enums correctly.
8624 (New.Constantify): Made public.
8625 (MemberAccess.DoResolve): Removed contant specific if(s).
8627 * literal.cs (NullLiteral): Implement new abstract methods.
8629 * statement.cs (GotoCase.Resolve): Use new constant methods.
8630 (SwitchLabel.ResolveAndReduce): Use new constant methods.
8632 * typemanager.cs (LookupEnum): Removed.
8633 (IsEnumType): Fixed to work with corlib.
8634 (RegisterConstant): Removed.
8635 (LookupConstant): Removed.
8636 (GetConstant): Changed to work with IConstant.
8638 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
8640 * location.cs : Fixed overflown (>255) column number.
8642 2005-08-03 Raja R Harinath <rharinath@novell.com>
8644 First cut of the qualified-alias-member feature.
8645 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
8647 * cs-parser.jay (DOUBLE_COLON): New token.
8648 (namespace_or_type_name): Add rule for recognizing
8649 qualified-alias-members.
8650 (primary_expression): Likewise.
8651 (element_access): Allow QualifiedAliasMember as a possible
8652 type-bearing expression.
8653 (local_variable_type, local_variable_pointer_type): Likewise.
8654 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
8655 aliases in the current and enclosing namespace declarations.
8656 (NamespaceEntry.UsingAlias): Add CS0440 warning.
8657 * decl.cs (MemberName.is_double_colon): New.
8658 (MemberName.MemberName): Add new constructor for alias-member.
8659 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
8660 * expression.cs (QualifiedAliasMember): New expression type.
8662 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
8664 * location.cs : it borked when no argument was specified.
8666 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
8668 * location.cs : tiny ToString() format fix.
8670 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
8672 * statement.cs : oops, it was missing.
8674 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
8676 A set of fixes for precise line/column location.
8679 "token" field now holds a file/line "delta", a line number offset
8680 from the segment, and a column number. See also:
8681 http://lists.ximian.com/pipermail/mono-devel-list/2004-
8682 December/009508.html
8683 Removed static IsNull. Use instance IsNull property instead.
8685 For some tokens it stores Location. For Identifier it stores
8686 LocatedToken which is a pair of string name and location.
8687 Column numbers are adjusted only at getChar().
8689 Use Location.ToString() for reporting (it now contains column).
8691 Largely modified to use LocatedToken instead of
8692 string (IDENTIFIER), and to acquire Location from some tokens.
8693 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
8694 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
8696 Now MemberName holds Location. DeclSpace.ctor() receives Location
8697 as a parameter. Removed extra parameters to all derived classes.
8698 Replaced Location.IsNull() with instance property.
8699 * assign.cs, expression.cs :
8700 Added .ctor() overload that omits Location.
8702 Added "nameEscaped" flag that indicates the identifier was escaped
8703 in the source file. This fixes bug #57047.
8705 2005-08-02 Marek Safar <marek.safar@seznam.cz>
8707 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
8708 New method, looking for lo-case imported cls type.
8710 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
8713 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
8715 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
8717 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
8719 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
8721 Optimized to save 3.5 MB for SWF compilation.
8723 2005-08-01 Marek Safar <marek.safar@seznam.cz>
8725 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
8726 (PartialContainer.Create): Moved logic AddToContainer.
8727 (PartialContainer.MarkForDuplicationCheck): Shares name.
8729 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
8732 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
8734 (Namespace.GetSignatureForError): New method.
8736 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
8737 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
8739 2005-08-01 Raja R Harinath <rharinath@novell.com>
8742 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
8743 member lookup rather than qualifier_type, since qualifier_type can
8746 2005-08-01 Marek Safar <marek.safar@seznam.cz>
8748 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
8751 2005-07-31 Miguel de Icaza <miguel@novell.com>
8753 * statement.cs: Copy the local exception into the exception
8754 captured local. Fixes 75674
8756 2005-07-31 Raja R Harinath <harinath@gmail.com>
8759 * expression.cs (Invocation.OverloadResolve): Don't report error
8760 CS1501 if error CS1502 has been reported.
8761 (New.DoResolve): Delegate CS1501 reporting to
8762 Invocation.OverloadResolve.
8765 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
8766 invariant-meaning-in-block property in an enclosing block if
8769 2005-07-29 Marek Safar <marek.safar@seznam.cz>
8771 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
8772 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
8773 (Switch.CheckSwitch): Just save 50kb for SWF.
8775 2005-07-27 Martin Baulig <martin@ximian.com>
8777 * anonymous.cs (CaptureContext.AddField): Added
8778 `AnonymousContainer am' argument; compute its toplevel scope if
8779 it's not already computed. Fixes #75649.
8781 2005-07-26 Raja R Harinath <rharinath@novell.com>
8784 * class.cs (Constructor.Emit): Reset block to null if the block
8787 2005-07-25 Marek Safar <marek.safar@seznam.cz>
8789 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
8791 2005-07-25 Marek Safar <marek.safar@seznam.cz>
8793 * class.cs (MethodData.Define): Check whether accessor implementing
8794 interface is public.
8796 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
8798 2005-07-22 Marek Safar <marek.safar@seznam.cz>
8801 * namespace.cs (LookupType): Moved same type check to...
8803 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
8806 2005-07-21 Raja R Harinath <rharinath@novell.com>
8808 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
8809 already found a typebuilder.
8810 * class.cs (MethodCore.IsDuplicateImplementation): Compare
8811 MemberNames, not strings.
8813 * const.cs (Error_ExpressionMustBeConst):
8814 Rename from Error_EpressionMustBeConst.
8815 * const.cs, class.cs, statement.cd: Update.
8817 2005-07-21 Marek Safar <marek.safar@seznam.cz>
8821 * const.cs (Const.LookupConstantValue): Report missing contant expression
8823 (Error_EpressionMustBeConstant): Only one error method.
8825 * class.cs, statement.c: Updated.
8827 2005-07-20 Raja R Harinath <rharinath@novell.com>
8829 * statement.cs (Block.Flags): Add back HasVarargs.
8830 (Block.flags): Make protected.
8831 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
8833 * typemanager.cs (types, typecontainers, user_types): Remove.
8834 (UserTypes, TypeContainers): Likewise.
8835 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
8836 (CleanUp, Reset): Update.
8837 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
8838 (GetNestedType): Use Type.GetNestedType.
8839 (CoreLookupType): Take two arguments, the namespace and the
8840 basename of the type. Update to use the Namespace.Lookup
8842 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
8843 (RealMemberLookup): Use IsNestedChildOf instead of playing with
8844 string concatenation and substring matches.
8845 * class.cs, enum.cs, delegate.cs: Update to changes.
8847 2005-07-20 Marek Safar <marek.safar@seznam.cz>
8849 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
8850 Expression and made virtual.
8852 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
8853 (ImplicitStandardConversionExists): Fixed `byte' typo ?
8855 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
8857 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
8860 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
8863 2005-07-18 Marek Safar <marek.safar@seznam.cz>
8866 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
8867 AssemblyCultureAttribute is not used on executable.
8870 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
8872 2005-07-16 Raja R Harinath <rharinath@novell.com>
8875 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
8876 New. Reports CS0252/CS0253.
8877 Mostly taken from preliminary patch by Duncak Mak.
8878 (Binary.DoResolveOperator): Store results of operator lookup.
8879 Use them to detect if we need to warn about unintended reference
8882 2005-07-15 Raja R Harinath <rharinath@novell.com>
8885 * namespace.cs (Namespace.Lookup): Add back location parameter.
8886 (Namespace.LookupType): Add CS0436 report. Add location parameter.
8887 * delegate.cs, ecore.cs, expression.cs: Update to changes.
8889 * codegen.cs (EmitContext.DeclSpace): Make readonly.
8890 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
8891 (Namespace.LookupType): ... this.
8892 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
8894 * typemanager.cs (LookupTypeReflection): Remove buggy code that
8895 purported to handle pointers.
8896 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
8899 2005-07-15 Marek Safar <marek.safar@seznam.cz>
8901 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
8904 2005-07-15 Raja R Harinath <rharinath@novell.com>
8906 * namespace.cs (Namespace.Lookup): Drop location parameter.
8907 (NamespaceEntry.LookupAlias): Remove. Merge into ...
8908 (NamespaceEntry.Lookup): ... this.
8909 (NamespaceEntry.Error_AmbiguousTypeReference):
8910 Move here from DeclSpace.
8911 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
8913 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
8914 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
8915 Move to NamespaceEntry.
8916 * delegate.cs, expression.cs: Update to changes.
8918 2005-07-14 Marek Safar <marek.safar@seznam.cz>
8920 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
8921 CheckAttributeType and refactored.
8922 (Attribute.ResolvePossibleAttributeType): Changed to reuse
8923 ResolveAsTypeTerminal error handling.
8924 (ResolveAsTypeTerminal): Introduced because of global attributes extra
8926 (GetSignatureForError): Print errors in same way.
8929 * codegen.cs: Reflect attribute GetSignatureForError change.
8932 * expression.cs: Add silent parameter to ResolveAsTypeStep.
8934 * namespace.cs (UsingEntry): Refactored to make fields private.
8937 statement.cs: Error_UnexpectedKind has extra parameter.
8939 2005-07-14 Raja R Harinath <rharinath@novell.com>
8941 * ecore.cs (IAlias): Remove.
8942 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
8943 that implement the interface.
8944 * namespace.cs (Namespace): Likewise.
8945 (Namespace.declspaces): Renamed from 'defined_names'.
8946 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
8947 DeclSpace instead of an IAlias.
8948 * tree.cs (Tree.AddDecl): Update.
8950 2005-07-12 Raja R Harinath <rharinath@novell.com>
8952 * statement.cs (Block.Flags); Remove HasVarargs.
8953 (Block.HasVarargs): Move to ToplevelBlock.
8954 (Block.ThisVariable, Block.AddThisVariable): Likewise.
8955 (Block.Variables): Make protected. Initialize variable hashtable
8957 (Block.AddVariable): Update.
8958 (Block.Resolve): Update to changes.
8959 (ToplevelBlock.HasVarargs): New boolean.
8960 (ToplevelBlock.ThisVariable): Move here from Block.
8961 (ToplevelBlock.AddThisVariable): Likewise.
8962 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
8963 * expression.cs (This.ResolveBase): Update to changes.
8964 (ArglistAccess.DoResolve): Likewise.
8966 2005-07-11 Marek Safar <marek.safar@seznam.cz>
8969 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
8971 * class.cs (TypeContainer.VerifyMembers): Distinguish between
8972 not used and not used & assigned.
8973 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
8975 2005-07-11 Marek Safar <marek.safar@seznam.cz>
8978 * expression.cs (Is.DoResolve): null is never provided type.
8980 2005-07-08 Marek Safar <marek.safar@seznam.cz>
8983 * cs-parser.jay: Less strict event error rule to catch more errors.
8985 2005-07-08 Martin Baulig <martin@ximian.com>
8987 Fix test-iter-10.cs - distinguish whether we `yield' in a property
8988 gettter (allowed) or setter (not allowed).
8990 * class.cs (Accessor): Implement IIteratorContainer.
8991 (Accessor.Yields): New public field.
8992 (PropertyBase.PropertyMethod.Define): Handle iterators on a
8996 (get_accessor_declaration, set_accessor_declaration): Set the
8997 `yields' flag on the accessor, not the property.
8998 (property_declaration): Do the iterators check on a per-accessor
8999 basis and not for the whole property.
9001 2005-07-08 Martin Baulig <martin@ximian.com>
9003 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
9004 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
9006 2005-07-07 Marek Safar <marek.safar@seznam.cz>
9009 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
9010 (ExtractSecurityPermissionSet): Cope with self referencing security
9011 attributes properly.
9013 * driver.cs (SetOutputFile): Made public property OutputFile.
9015 2005-07-07 Raja R Harinath <rharinath@novell.com>
9018 * class.cs (TypeContainer.first_nonstatic_field): Rename from
9019 has_nonstatic_fields. Make into a FieldBase pointer.
9020 (TypeContainer.AddField): Add CS0282 check.
9021 (TypeContainer.EmitType): Update.
9023 2005-07-06 Miguel de Icaza <miguel@novell.com>
9025 * cs-tokenizer.cs (consume_identifier): Do not create strings to
9026 compare if they start with __.
9028 2005-07-06 Raja R Harinath <rharinath@novell.com>
9030 * statement.cs (Switch.SwitchGoverningType): Only look at
9031 UserCasts that don't need implicit standard conversions to one of
9032 the allowed switch types (Fixes test-322.cs).
9033 (LocalInfo.Resolve): Re-enable sanity-test.
9035 2005-07-06 Marek Safar <marek.safar@seznam.cz>
9037 * cs-tokenizer.cs (consume_identifier): Detect double undescores
9039 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
9041 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
9043 2005-07-06 Raja R Harinath <rharinath@novell.com>
9046 * ecore.cs (SimpleName.GetSignatureForError): Add.
9047 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
9048 (MemberAccess.GetSignatureForError): Add.
9050 2005-07-05 Marek Safar <marek.safar@seznam.cz>
9052 The big error and warning messages review.
9082 * typemanager.cs: Updated.
9084 * class.cs: (MethodCore.SetYields): Moved here to share.
9085 (PropertyMethod.Define): Moved iterator setup here.
9087 * iterators.cs: Add orig_method to have full access to parent
9090 2005-07-05 Raja R Harinath <rharinath@novell.com>
9092 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
9093 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
9094 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
9095 variable of struct type.
9096 * expression.cs (Unary.ResolveOperator): Update to change.
9097 (Indirection.VerifyFixed): Likewise.
9098 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
9099 (ParameterReference.VerifyFixed): Value parameters are fixed.
9100 (This.VerifyFixed): Treat 'this' as a value parameter.
9101 * statement.cs (LocalInfo.IsFixed): Remove.
9103 2005-07-01 Martin Baulig <martin@ximian.com>
9105 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
9106 `ec.EmitThis ()' to get the correct scope.
9108 2005-07-01 Martin Baulig <martin@ximian.com>
9110 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
9111 instance is a ParameterReference; fixes #75299.
9113 2005-07-01 Martin Baulig <martin@ximian.com>
9115 Reverted Marek's latest patch (r46725):
9116 - it contains structural changes which are neither mentioned in
9117 the ChangeLog nor explained anywhere; for example the additional
9118 argument of EmitContext's and Iterator's .ctor's and the
9119 TypeContainer.DefineMembers() change.
9120 - structural changes like this should go in in seperate patches
9121 and not be hidden in a huge patch which just seems to affect
9122 warnings and errors.
9123 a big and hard to understand patch.
9124 - it breaks iterators and causes regressions, for instance in
9127 2005-06-30 Raja R Harinath <rharinath@novell.com>
9130 * expression.cs (Indexers.map): Remove.
9131 (Indexers.Append): Filter out inaccessible setters and getters.
9132 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
9135 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
9137 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
9138 (FieldExpr.Emit, PropertyExpr.Emit): Update.
9139 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
9140 * expression.cs (Invocation.EmitCall): Add CS0120 check.
9142 2005-06-30 Marek Safar <marek.safar@seznam.cz>
9145 * class.cs (FieldBase.GetInitializerExpression): One more field
9148 2005-06-28 Miguel de Icaza <miguel@novell.com>
9150 * pending.cs: Do not define a proxy if the base method is virtual,
9151 it will be picked up by the runtime (bug 75270).
9153 2005-06-08 Martin Baulig <martin@ximian.com>
9155 The big Iterators rewrite :-)
9157 * iterators.cs: Rewrite this to use the anonymous methods framework.
9159 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
9160 before the TypeContainers; see 2test-21.cs.
9163 (TypeContainer.DefineType): Don't create a new EmitContext if we
9164 already have one (this only happens if we're an Iterator).
9165 (TypeContainer.Define): Also call Define() on all our iterators.
9166 (Method.CreateEmitContext): Added support for iterators.
9169 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
9170 (AnonymousContainer.CreateMethodHost): Moved here from
9171 AnonymousMethod and made abstract.
9172 (AnonymousContainer.CreateScopeType): New abstract method.
9173 (AnonymousContainer.IsIterator): New public property.
9174 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
9175 get the ScopeTypeBuilder rather than manually defining it here.
9176 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
9179 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
9180 before RootContext.DefineTypes().
9182 * codegen.cs (EmitContext.RemapToProxy): Removed.
9183 (EmitContext.CurrentAnonymousMethod): Changed type from
9184 AnonymousMethod -> AnonymousContainer.
9185 (EmitContext.ResolveTopBlock): Protect from being called twice.
9186 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
9187 (EmitContext.EmitThis): Removed the iterators hacks; use the
9188 anonymous methods framework for that.
9191 (ToplevelBlock.Container): Make this a property, not a field.
9192 (ToplevelBlock.ReParent): New public method; move the
9193 ToplevelBlock into a new container.
9194 (Foreach.TemporaryVariable): Simplify.
9196 2005-06-05 Martin Baulig <martin@ximian.com>
9198 * statement.cs (LocalInfo.CompilerGenerated): New flag.
9199 (Block.AddTemporaryVariable): New public method; creates a new
9200 `LocalInfo' for a temporary variable.
9201 (Block.EmitMeta): Create the LocalBuilders for all the temporary
9203 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
9204 non-iterator variables.
9206 2005-06-05 Martin Baulig <martin@ximian.com>
9208 * statement.cs (Foreach.TemporaryVariable): Create the
9209 LocalBuilder in the Emit phase and not in Resolve since in some
9210 situations, we don't have an ILGenerator during Resolve; see
9211 2test-19.cs for an example.
9213 2005-06-04 Martin Baulig <martin@ximian.com>
9215 **** Merged r45395 from GCS ****
9217 The big Foreach rewrite - Part II.
9219 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
9220 with `PropertyInfo ienumerator_getcurrent'.
9222 * codegen.cs (VariableStorage): Removed.
9225 (Foreach): Derive from Statement, not ExceptionStatement.
9226 (Foreach.CollectionForeach): New nested class. Moved all the code
9227 dealing with collection foreach here.
9228 (Foreach.ForeachHelperMethods): Removed.
9229 (Foreach.TemporaryVariable): Implement IMemoryLocation.
9231 2005-05-23 Martin Baulig <martin@ximian.com>
9233 * statement.cs (Try.DoResolve): Don't create a `finally' if we
9234 don't need to. Fix #75014.
9236 2005-05-20 Martin Baulig <martin@ximian.com>
9238 Merged r44808 from GMCS.
9240 * class.cs (TypeContainer.CircularDepException): Removed.
9241 (TypeContainer.DefineType): Removed the `InTransit' stuff.
9242 (TypeContainer.CheckRecursiveDefinition): Check for circular class
9243 (CS0146) and interface (CS0529) dependencies here.
9245 2005-06-21 Raja R Harinath <rharinath@novell.com>
9247 * expression.cs (Invocation.EmitCall): Fix initialization
9248 'this_call' to reflect current behaviour. Fix indentation.
9250 * convert.cs (FindMostEncompassedType): Add two trivial special
9251 cases (number_of_types == 0 || number_of_types == 1).
9252 (FindMostEncompasingType): Likewise.
9254 2005-06-17 Raja R Harinath <rharinath@novell.com>
9256 Some cleanups preparing for the fix of #75283.
9257 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
9259 (EventExpr.InstanceResolve): Likewise.
9260 (EventExpr.DoResolve): Remove redundant checks.
9262 2005-06-10 Duncan Mak <duncan@novell.com>
9264 * cs-tokenizer.cs (process_directives): New flag for controlling
9265 the processing of preprocessor directives.
9266 (x_token): After seeing a '#', return Token.NONE instead of going
9267 to handle_preprocessing_directive() when not processing
9268 directives. This avoids unnecessary processing during the token peek in
9273 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
9274 the existing error reporting methods instead of Report.Error.
9276 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
9277 after Raja's rewrite.
9279 2005-06-08 Miguel de Icaza <miguel@novell.com>
9281 * class.cs: Small fix.
9283 2005-06-08 Raja R Harinath <rharinath@novell.com>
9286 * class.cs (GetPartialBases): Fix return value check of
9289 2005-06-07 Raja R Harinath <rharinath@novell.com>
9291 Ensure that partial classes are registered in their enclosing
9292 namespace. Initial part of fix of #75160.
9293 * tree.cs (Tree.RecordDecl): Add new namespace argument.
9294 Register declspace with namespace here, not in
9295 DeclSpace.RecordDecl.
9296 * cs-parser.jay: Pass namespace to RecordDecl.
9297 * class.cs (PartialContainer.Create): Likewise.
9298 (ClassPart.DefineType): New sanity-check. Throws an exception if
9300 * decl.cs (Declspace.RecordDecl): Remove.
9301 * namespace.cs (NamespaceEntry.DefineName): Remove.
9303 2005-06-06 Marek Safar <marek.safar@seznam.cz>
9305 * rootcontext.cs: Reset TargetExt as well.
9307 2005-06-03 Raja R Harinath <rharinath@novell.com>
9309 * ecore.cs (Expression.Resolve): Emit CS0654 error when
9312 2005-06-02 Raja R Harinath <rharinath@novell.com>
9314 Fix #75080, cs0119.cs.
9315 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
9317 (Expression.Resolve): ... this. Use it. Remove bogus code
9318 allowing ExprClass.Type and ExprClass.Namespace for
9319 ResolveFlags.VariableOrValue.
9320 (Expression.Resolve) [1-argument variant]: Change default resolve
9321 flags based on language version.
9322 (Expression.Error_UnexpectedKind): Use a simple string array
9323 rather than an ArrayList.
9324 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
9326 (TypeOfVoid.DoResolve): Likewise.
9327 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
9328 flags argument -- it always has the same value.
9330 2005-05-31 Raja R Harinath <rharinath@novell.com>
9333 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
9334 Use it in the error message.
9335 * assign.cs, expression.cs, statement.cs: Update.
9337 2005-05-30 Raja R Harinath <rharinath@novell.com>
9340 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
9341 the "almostMatchedMember" case too.
9342 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
9343 that failed the accessibility checks to 'almost_match'.
9345 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
9347 * attribute.cs: Use internal MethodBuilder methods to set
9348 ExactSpelling and SetLastError on PInvoke methods, instead
9349 of passing them via charset. Fixes #75060.
9351 2005-05-27 Raja R Harinath <rharinath@novell.com>
9353 * parameter.cs (Parameter): Remove TODO comment.
9354 (Parameter.DefineParameter): Remove Location parameter.
9355 (Parameters.LabelParameters): Likewise.
9356 * class.cs (Constructor.Emit): Update to change.
9357 (MethodData.Emit): Likewise.
9358 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
9359 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
9361 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
9364 Removed Parameters.Location and added Parameter.Location instead.
9365 Removed Location parameter from Emit() and GetSignature().
9372 Modified all related calls.
9374 2005-05-26 Raja R Harinath <rharinath@novell.com>
9376 Improve user-defined conversion handling.
9377 * convert.cs (GetConversionOperators): Rewrite. Return only the
9378 applicable operators.
9379 (AddConversionOperators): New. Helper for GetConversionOperators.
9380 (FindMostEncompassedType, FindMostEncompassingType): Verify that
9381 there is only one most encompassed/encompassing type.
9382 (FindMostSpecificSource, FindMostSpecificTarget): Remove
9383 "applicable operator" handling.
9384 (UserConversion): Move cache here from GetConversionOperators.
9385 Directly cache the chosen operator, rather than the whole
9387 (ExplicitNumericConversion): Fix buggy implementation of Decimal
9388 case. Allow conversion of decimal to sbyte and byte too.
9389 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
9390 New static methods. Used to avoid allocating EmptyExpressions in
9393 2005-05-24 Duncan Mak <duncan@novell.com>
9395 * ecore.cs (CastFromDecimal): New class for casting a decimal to
9396 another class, used in Convert.ExplicitNumericConversion.
9397 (CastToDecimal): New class, similar to above, but casts to
9398 System.Decimal, used in Convert.ImplicitNumericConversion and also
9399 in explicit convesion from double/float to decimal.
9401 * convert.cs (ImplicitNumericConversion): Handle implicit
9402 conversions to System.Decimal.
9403 (ExplicitNumericConversion): handle explicit conversions to
9408 2005-05-20 Miguel de Icaza <miguel@novell.com>
9410 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
9411 know the type at this stage, just break through. Fixes #75008
9413 2005-05-19 Martin Baulig <martin@ximian.com>
9416 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
9417 to disable error reporting.
9419 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
9420 here since we don't want to report an error; see the new test-336.cs.
9422 2005-05-19 Raja R Harinath <rharinath@novell.com>
9424 * statement.cs (ToplevelBlock.GetParameterReference)
9425 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
9426 Move here from class Block.
9427 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
9428 * expression.cs (ParameterReference.DoResolveBase): Likewise.
9430 2005-05-18 Martin Baulig <martin@ximian.com>
9435 (FlowBranching.Reachability): Add non-static public And() and Or()
9437 (FlowBranchingSwitch): New class; do the `break_origins' thing
9438 like in FlowBranchingLoop.
9439 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
9440 reachability, not just locals and parameters.
9441 (FlowBranching.MergeChild): Remove some of the hacks for loop and
9442 switch; MergeBreakOrigins() now takes care of that.
9444 2005-05-18 Martin Baulig <martin@ximian.com>
9446 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9447 a loop and may leave it, reset the barrier; fixes #74974.
9449 2005-05-17 Marek Safar <marek.safar@seznam.cz>
9451 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
9454 * cs-parser.jay: Catch more lexical errors.
9456 * report.cs: Add one more Error method.
9459 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
9461 2005-05-17 Martin Baulig <martin@ximian.com>
9463 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
9466 2005-05-16 Raja R Harinath <rharinath@novell.com>
9468 Fix test-382.cs. Emit values of decimal constants.
9469 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
9471 (TypeContainer.AddField): ... this.
9472 (TypeContainer.EmitFieldInitializers): Allow the list of fields
9473 with initializers to include 'Const's.
9474 (ClassPart.RegisterFieldForInitialization): Forward to
9476 * const.cs (Const.Const): Pass initializer to base class.
9477 (Const.Define): In case of decimal constants, register them for
9478 initialization in a static constructor.
9480 2005-05-14 Martin Baulig <martin@ximian.com>
9482 * statement.cs (Block.Resolve): Correctly handle unreachable code;
9483 do not call ResolveUnreachable() on unreachable statements in
9484 here, see the comment in the source code.
9486 2005-05-13 Raja R Harinath <rharinath@novell.com>
9489 * expression.cs (BinaryResolveOperator): If one of the operands of
9490 an equality comparison is 'null' and the other is a pointer type,
9491 convert the null to a NullPointer.
9492 * convert.cs (ImplicitReferenceConversion): If the expression is a
9493 NullLiteral and the target type is a pointer type, return a
9494 NullPointer instead.
9495 (ImplicitConversionStandard): Likewise.
9497 2005-05-13 Marek Safar <marek.safar@seznam.cz>
9499 * cs-parser.jay: Set readonly context based on special constructs.
9501 * expression.cs (LocalVariableReference.DoResolveBase): Improved
9502 readonly variable error handling.
9504 * rootcontext.cs (EmitCode): Don't verify members when error
9507 * statement.cs (LocalInfo): Add reaodnly context information.
9508 (SetReadOnlyContext, GetReadOnlyContext): New methods.
9510 2005-05-13 Raja R Harinath <rharinath@novell.com>
9512 * statement.cs (Block.Resolve): Revert change below. Modify fix
9513 for #74041 to initialize 'resolved' to false only for explicit
9514 blocks. Fixes #74873.
9516 2005-05-12 Raja R Harinath <harinath@gmail.com>
9519 * typemanager.cs (unmanaged_enclosing_types): New.
9520 (IsUnmanagedType): Avoid infloops by using
9521 'unmanaged_enclosing_types' to talk with recursive invocations.
9523 2005-05-13 Martin Baulig <martin@ximian.com>
9525 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
9526 instance variable, not a local. Fix #74873.
9527 (Block.ResolveUnreachable): Set it to true here.
9529 2005-05-11 Duncan Mak <duncan@novell.com>
9531 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
9532 continuing to process for 'arg'.
9533 (handle_preprocessing_directive): Check the argument of the #endif
9534 directive and report error CS1025 if there are any trailing
9537 According to the C# spec, having even whitespace after the #endif
9538 directive is illegal; however, because we call arg.TrimEnd ()
9539 beforehand, we have the same behavior as csc, allowing whitespace
9540 after the directive.
9544 2005-05-11 Marek Safar <marek.safar@seznam.cz>
9548 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
9549 (Constructor.GetObsoleteAttribute): Implemented correctly.
9551 2005-05-10 Martin Baulig <martin@ximian.com>
9553 * support.cs (ReflectionParameters.ParameterModifier): Use
9554 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
9555 and `ParameterAttributes.In'. Fixes #74884.
9557 2005-05-10 Marek Safar <marek.safar@seznam.cz>
9559 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
9561 * expression.cs (Argument.GetParameterModifier): Turned to property.
9562 (Invocation.Error_InvalidArguments): Add more descriptive errors.
9564 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
9567 2005-05-09 Raja R Harinath <rharinath@novell.com>
9570 * decl.cs (MemberCache.AddMethods): Register override methods,
9571 rather than non-override methods.
9572 * typemanager.cs (RegisterOverride): New.
9573 (IsOverride): Update.
9575 2005-05-09 Marek Safar <marek.safar@seznam.cz>
9579 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
9580 recursive declaration.
9582 * statement.cs (Block.ResolveMeta): Report any error in resolving.
9584 2005-05-06 Marek Safar <marek.safar@seznam.cz>
9586 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
9588 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
9590 2005-05-05 Raja R Harinath <rharinath@novell.com>
9593 * decl.cs (DeclSpace.FamilyAccessible):
9594 Use TypeManager.IsNestedFamilyAccessible.
9596 Fix reopened #64812.
9597 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
9600 2005-05-04 Raja R Harinath <rharinath@novell.com>
9601 Abin Thomas <projectmonokochi@rediffmail.com>
9602 Anoob V E <projectmonokochi@rediffmail.com>
9603 Harilal P R <projectmonokochi@rediffmail.com>
9606 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
9607 allow access to all static members.
9609 2005-05-04 Martin Baulig <martin@ximian.com>
9611 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
9613 2005-05-04 Martin Baulig <martin@ximian.com>
9617 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
9618 section at the end; make things work if `default' is not the last
9621 2005-05-04 Martin Baulig <martin@ximian.com>
9625 * statement.cs (Switch): Replaced the `got_default' field with a
9626 `default_section' one.
9627 (Switch.CheckSwitch): Set `default_section' here.
9628 (Switch.Resolve): If we're a constant switch and the constant is
9629 not found, use the default section.
9631 2005-05-03 Martin Baulig <martin@ximian.com>
9633 * expression.cs (ArrayAccess.EmitGetLength): New public method.
9635 * statement.cs (Foreach.ArrayForeach): New nested class.
9636 (Foreach.TemporaryVariable): New nested class.
9637 (Foreach.EmitArrayForeach): Removed; this is now in the new
9640 2005-05-03 Raja R Harinath <rharinath@novell.com>
9642 * pending.cs (BaseImplements): Move the #74773 fix here. This is
9644 (VerifyPendingMethods): Revert change below.
9646 * typemanager.cs (IsOverride, RegisterNonOverride): New.
9647 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
9648 that used to trigger warning -28. Remove warning -28.
9649 * expression.cs (Invocation.OverloadResolve): Use
9650 TypeManager.IsOverride to distinguish override methods.
9653 * pending.cs (VerifyPendingMethods): If a base type implements the
9654 requested interface, don't bother checking individual methods of
9655 the base type. As a side-effect, this prevents the creation of
9656 unnecessary proxies.
9658 2005-05-02 Martin Baulig <martin@ximian.com>
9662 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
9663 Also `And' the locals if the old vector is null.
9664 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
9665 null; in this case we basically reset all the variables.
9667 2005-05-02 Martin Baulig <martin@ximian.com>
9671 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
9672 Added `FlowBranching branching' argument; always `and' the
9673 variables instead of `or'ing them unless we're an infinite loop.
9675 * statement.cs (While.Resolve): Create a new sibling unless we're
9678 2005-05-02 Martin Baulig <martin@ximian.com>
9682 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
9683 arguments; use it instead of creating a new TopLevelBlock.
9684 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
9685 our ConstructorInitializer.
9688 (TopLevelBlock.TopLevelBranching): New public property.
9689 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
9690 and create our `TopLevelBranching'.
9692 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
9693 anonymous method host, use `block.TopLevelBranching' rather than
9694 creating a new branching.
9696 2005-04-20 Miguel de Icaza <miguel@novell.com>
9698 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
9699 a ScopeInfo, if any of the current children is a child of the new
9700 entry, move those children there.
9702 2005-04-30 Martin Baulig <martin@ximian.com>
9704 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
9705 at the beginning of a SwitchSection. Fix #73335.
9707 2005-04-27 Marek Safar <marek.safar@seznam.cz>
9710 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
9712 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
9713 (FieldExpr.DoResolve): Obsolete members are ignored for field
9716 2005-04-26 Marek Safar <marek.safar@seznam.cz>
9718 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
9719 of arrays detection.
9721 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
9723 (Field.VerifyClsCompliance): Volatile fields are not compliant.
9725 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
9728 2005-04-25 Ben Maurer <bmaurer@ximian.com>
9730 * cs-parser.jay: Use the prefered version of -unsafe in error
9733 2005-04-22 Marek Safar <marek.safar@seznam.cz>
9735 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
9738 2005-04-20 John Luke <john.luke@gmail.com>
9740 * driver.cs: fix typo in error message, --outout to --output
9742 2005-04-20 Marek Safar <marek.safar@seznam.cz>
9744 * codegen.cs (InRefOutArgumentResolving): New field.
9746 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
9747 fields outside contructor.
9749 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
9751 2005-04-19 Miguel de Icaza <miguel@novell.com>
9753 * anonymous.cs (CaptureContext.EmitParameterInstance): The
9754 parameter code was not completed ever, so it was not as up-to-date
9755 as local variables. Must finish it.
9757 The bug fix was to compare the Toplevel of the block, not the
9758 current block. Thanks for Ben for pointing this out.
9760 2005-04-19 Raja R Harinath <rharinath@novell.com>
9762 * decl.cs (AddMethods): Use the declaring type of the problem
9763 method to determine if we want to squash a warning.
9765 2005-04-19 Marek Safar <marek.safar@seznam.cz>
9767 * attribute.cs: Removed debug output.
9769 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
9771 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
9774 2005-04-18 Raja R Harinath <rharinath@novell.com>
9777 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
9778 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
9779 all null comparisons against reference types.
9781 2005-04-18 Marek Safar <marek.safar@seznam.cz>
9784 * class.cs (TypeContainer.CircularDepException) New nested
9786 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
9787 (TypeContainer.DefineType): Removed error, reset InTransit before
9789 (Class.DefineType): Throw exception when is in Transit.
9790 Catch exception and report error.
9791 (Struct.DefineType): Throw exception when is in Transit.
9792 Catch exception and report error.
9793 (Interface.DefineType): Throw exception when is in Transit.
9794 Catch exception and report error.
9796 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
9797 handle nested exception handlers.
9799 * flowanalysis.cs (InTryWithCatch): New method, search for try with
9802 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
9803 InFinally and InCatch storage.
9805 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
9806 (Catch.Resolve): Set and Restore ec.InCatch.
9807 (Try.Resolve): Set and Restore ec.InFinally.
9808 (Try.HasCatch): True when try has catch.
9810 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
9812 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
9813 for the same event member, so exclude such cases from warning 419.
9816 2005-04-16 Miguel de Icaza <miguel@novell.com>
9818 * expression.cs (Binary.ResolveOperator): Apply patch from John
9819 Luke to fix bug 59864: operators &, | and ^ on enumerations
9820 require that the same enum type on both sides.
9822 * driver.cs: Add warnings to old flag usage, this is to assist
9823 people who produce Makefiles and hope that the Makefiles will be
9826 * class.cs (TypeContainer.EmitType): Moved the definition of the
9827 special $PRIVATE$ field from the resolve phase to the Emit phase.
9828 During resolve we do not know if we are a struct with
9829 HasExplicitLayout, we know this only after the attributes for the
9832 Set the FieldOffset to zero on the dummy field that we create for
9833 the class. Fixes 74590.
9835 2005-04-16 Raja R Harinath <rharinath@novell.com>
9838 * ecore.cs (PropertyExpr.resolved): New.
9839 (DoResolve): Use it to handle a case of double resolution here.
9840 Handle a case of identical-name-and-type-name.
9841 * expression.cs (ArrayCreation.CheckIndices): Avoid double
9842 resolution by storing the results of expression resolution back
9843 into the "probes" array.
9845 2005-04-15 Raja R Harinath <rharinath@novell.com>
9847 Fix cs0208-7.cs and cs0208-8.cs.
9848 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
9849 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
9850 error reporting to point out the reason a struct is not unmanaged.
9852 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
9854 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
9855 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
9857 2005-04-13 Raja R Harinath <rharinath@novell.com>
9860 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
9861 IdenticalNameAndTypeName here.
9862 (EventExpr.InstanceResolve): Likewise.
9864 2005-04-13 Marek Safar <marek.safar@seznam.cz>
9866 C# 2.0 DefaultCharSetAttribute implementation
9868 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
9869 which allows us to set GlobalNamespace for every resolve.
9870 (Attribute.ResolveArguments): Cut from Resolve.
9871 (Attribute.GetCharSetValue): Returns CharSet named argument.
9872 (Attribute.DefinePInvokeMethod): Gets default charset from
9874 (GlobalAttribute.ResolveAsTypeStep): Override.
9875 (GlobalAttribute.ResolveArguments): Override.
9877 * class.cs (TypeAttr): Is protected.
9879 * codegen.cs (ModuleClass.DefaultCharSet): New member.
9880 (ModuleClass.DefaultCharSetType): New memeber.
9881 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
9883 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
9884 charset from module.
9886 * delegate.cs (TypeAttr): Override.
9887 (Delegate.DefineType): Use this TypeAttr.
9889 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
9890 at very early stage (before types are defined) to resolve model
9891 module attributes. It will probably not work with corlib but it
9894 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
9895 charset from module.
9897 * typemanager.cs (default_charset_type): New type.
9899 2005-04-13 Raja R Harinath <rharinath@novell.com>
9901 * decl.cs (MemberCache.AddMethods): Don't warn if
9902 System.Object.Finalize has buggy MethodAttributes.
9904 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
9907 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
9909 * doc.cs : detect ambiguous reference to overloaded members.
9910 Fixed bug #71603. MS 1.1 csc does not detect it.
9912 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
9914 * doc.cs : delegates must not be referenced with parameters.
9917 2005-04-12 Miguel de Icaza <miguel@novell.com>
9919 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
9921 2005-04-10 Miguel de Icaza <miguel@novell.com>
9923 * driver.cs (MainDriver): Stop processing if the CLS stage found
9926 (CompilerCallableEntryPoint.InvokeCompiler): Always
9927 reset after execution; Take a TextWriter argument for the
9930 * report.cs: Use the error stream instead of hardcoding stderr.
9932 2005-04-09 Miguel de Icaza <miguel@novell.com>
9934 * class.cs: Reduce code paths to test, too small of an
9935 optimization to make it worth the extra testing. Always perform
9938 2005-04-08 Raja R Harinath <rharinath@novell.com>
9941 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
9942 operators that had errors reported on them.
9944 2005-04-08 Marek Safar <marek.safar@seznam.cz>
9946 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
9948 (Attribute.Resolve): Add named argument type checking.
9950 * class.cs (FixedField.Define): Use IsPrimitiveType
9952 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
9954 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
9955 unsafe parameter types.
9957 * statement.cs (Using.ResolveExpression): Add better error description.
9959 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
9961 2005-04-08 Raja R Harinath <rharinath@novell.com>
9964 * attribute.cs (Attribute.GetAttributeUsage): Resolve
9965 AttributeUsageAttribute in the emitcontext of the attribute class,
9966 not in the emitcontext of the attributable entity it was attached to.
9967 * cs-parser.jay: Use 'current_class', not 'current_container',
9968 when creating a GlobalAttribute.
9970 2005-04-08 Alp Toker <alp@atoker.com>
9972 * pending.cs: The fix to #58413 failed to compile methods implementing
9973 interfaces with/without params modifiers and vice versa, even though
9974 params modifiers aren't part of the signature. Make the modifier check
9975 less strict as in csc.
9977 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
9978 Anoob V E <projectmonokochi@rediffmail.com>
9979 Harilal P R <projectmonokochi@rediffmail.com>
9982 * pending.cs (TypeAndMethods.mods): New. Store the parameter
9983 modifiers of pending methods.
9984 (PendingImplementation.PendingImplementation): Initialize it.
9985 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
9986 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
9987 with ParameterData. Add check for modifiers.
9988 * class.cs (MethodData.Define): Update to changes.
9990 2005-04-07 Raja R Harinath <rharinath@novell.com>
9992 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
9994 2005-04-07 Marek Safar <marek.safar@seznam.cz>
9996 * class.cs (PropertyMethod.Define): Check private accessor in abstract
9999 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
10002 * typemanager.cs: Registered RequiredAttributeAttribute.
10004 2005-04-06 Marek Safar <marek.safar@seznam.cz>
10006 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
10007 Warning CS0169 is back at level 3.
10008 (IMethodData.SetMemberIsUsed): New method.
10010 * decl.cs (IsUsed): New value; moved from FieldBase.Status
10011 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
10013 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
10015 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
10017 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
10020 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
10023 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
10024 to avoid the problems with nested types.
10026 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
10027 Anoob V.E <projectmonokochi@rediffmail.com>
10028 Harilal P.R <projectmonokochi@rediffmail.com>
10029 Raja R Harinath <rharinath@novell.com>
10032 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
10034 * typemanager (GetConstructor): Make public.
10036 2005-04-05 John Luke <john.luke@gmail.com>
10037 Raja R Harinath <rharinath@novell.com>
10040 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
10041 struct too. Return false quicker in a few cases.
10042 (VerifyUnManaged): Use it.
10044 2005-04-05 Raja R Harinath <rharinath@novell.com>
10047 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
10048 not 'unreachable_seen'.
10050 2005-04-04 Marek Safar <marek.safar@seznam.cz>
10052 * attribute.cs (Attribute.GetValue): Removed unused.
10054 * codegen.cs (CodeGen.TrimExt): Removed unused.
10056 * cs-parser.jay (output): Removed unused.
10058 * cs-tokenizer.cs (hex_digits): Removed unused.
10060 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
10062 * expression.cs (Indirection.LoadExprValue): Removed unused.
10063 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
10065 * iterators.cs (Iterator.param_types): Removed unused.
10067 * statement.cs (Goto.block): Removed unused.
10068 (ToplevelBlock.did): Removed unused.
10069 (Switch.ResolveConstantSwitch): Removed unused.
10071 2005-04-01 Ben Maurer <bmaurer@ximian.com>
10073 * rootcontext.cs: Allow mcs to bootstrap with the compilation
10076 2005-04-01 Raja R Harinath <rharinath@novell.com>
10078 Fix #74232 and cs0208-3.cs.
10079 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
10080 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
10081 unmanaged type. Don't use FieldBuilders when 't' is a
10082 TypeBuilder. Use ModFlags and MemberType fields.
10083 * class.cs (MemberBase.member_type): Rename from MemberType.
10084 (MemberBase.MemberType): New property. Determines member_type on
10086 (MemberBase.DoDefine): Don't initialize MemberType here.
10087 (FieldMember.Define): Likewise.
10089 2005-04-01 Marek Safar <marek.safar@seznam.cz>
10092 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
10093 Attributes are emitted there.
10095 2005-04-01 Raja R Harinath <rharinath@novell.com>
10097 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
10098 keyword in 'partial enum' too.
10099 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
10101 Report from Kamil Skalski <nazgul@omega.pl>.
10104 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
10105 have partial containers too.
10107 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
10108 in block' checks to Block.CheckInvariantMeaningInBlock.
10109 * statement.cs (Block.GetKnownVariableInfo): Make private.
10110 (Block.IsVariableUsedInChildBlock): Remove.
10111 (Block.IsVariableUsedInBlock): Likewise.
10112 (Block.CheckInvariantMeaningInBlock): New. Show location of
10113 conflicting declaration.
10114 (Block.AddVariable): Make error messages less long-winded and more
10115 specific. Show location of conflicting declaration.
10116 * parameter.cs (Parameters.Location): New readonly property.
10118 2005-03-31 Raja R Harinath <rharinath@novell.com>
10120 Clean up semantics of invoking ResolveMemberAccess.
10121 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
10122 can have an instance, ensure that we pass in a non-TypeExpression
10123 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
10124 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
10125 argument. Update to changes and simplify.
10126 (FieldExpr.Emitinstance): Remove CS0120 check.
10127 (PropertyExpr.EmitInstance): Likewise.
10128 * expression.cs (Argument.Resolve): Likewise.
10129 (Invocation.DoResolve): Update to changes in semantics of
10130 InstanceExpression.
10132 2005-03-31 Marek Safar <marek.safar@seznam.cz>
10135 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
10138 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
10140 2005-03-31 Raja R Harinath <rharinath@novell.com>
10142 Fix difference in behaviour with commandline invocation.
10143 * driver.cs (Driver.Reset): New.
10144 (CompilerCallableEntryPoint): Call it.
10146 * statement.cs (If.Resolve): Avoid spurious "uninitialized
10147 variable" warnings if the boolean expression failed to resolve.
10149 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
10151 * attribute.cs: Fix the union of several permissions when some of them
10152 are unrestricted (so the result isn't an unrestricted permission set).
10155 2005-03-30 Raja R Harinath <rharinath@novell.com>
10157 * ecore.cs (MemberExpr): New class. Convert from interface
10159 (MemberExpr.ResolveMemberAccess): Refactor and move here from
10160 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
10162 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
10163 (MethodGroupExpr.IsExplicitImpl): Remove.
10164 (Expression.GetFieldFromEvent): Remove.
10165 (SimpleName.MemberStaticCheck): Remove.
10166 (SimpleName.DoSimpleNameResolve): Update to changes.
10167 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
10168 (MemberAccess.IdenticalNameAndTypeName): Remove.
10169 (MemberAccess.error176): Move to MemberExpr.
10170 (MemberAccess.DoResolve): Update to changes.
10171 (BaseAccess.DoResolve): Likewise.
10173 2005-03-30 Marek Safar <marek.safar@seznam.cz>
10175 C# 2.0 Conditional attribute class implementation
10177 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
10178 Analyzes class whether it has attribute which has ConditionalAttribute
10179 and its condition is not defined.
10181 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
10182 (Class.IsExcluded): New method. Search for at least one defined
10183 condition in ConditionalAttribute of attribute class.
10185 2005-03-30 Raja R Harinath <rharinath@novell.com>
10187 * ecore.cs (PropertyExpr): Derive from Expression, not
10188 ExpressionStatement.
10189 (PropertyExpr.EmitStatement): Remove.
10191 2005-03-29 Raja R Harinath <rharinath@novell.com>
10194 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
10195 internal field "value__" of an enum be private. The examples for
10196 "value__" that I found on MSDN all used FieldAttributes.Private.
10198 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
10199 Don't mention IL method attribute names.
10201 Fix #47991. Remove a TODO.
10202 * statement.cs (Block.Toplevel): Make into a field.
10203 (Block.Parameters): Move into ToplevelBlock.
10204 (Block.known_variables): Rename from child_variable_names.
10205 (Block.Block): Remove variants that take Parameters. Initialize
10206 'Toplevel' with the immediately surrounding toplevel block.
10207 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
10208 LocalInfo parameter.
10209 (Block.GetKnownVariableInfo): New.
10210 (Block.IsVariableNameUsedInChildBlock): Update.
10211 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
10212 the block, even though it may not be in scope.
10213 (Block.AddVariable): Remove Parameters parameter. Use
10214 Toplevel.Parameters instead.
10215 (Block.AddConstant): Remove Parameters parameter.
10216 (Block.GetParameterReference): Update to use Toplevel.Parameters.
10217 (Block.IsParamaterReference): Likewise.
10218 (Block.IsLocalParameter): Likewise. Simplify a lot.
10219 (ToplevelBlock.Parameters): New. Moved from Block.
10220 (ToplevelBlock.ToplevelBlock): Update to changes. Always
10221 initialize Parameters to a non-null value.
10222 * cs-parser.jay: Update to changes.
10223 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
10224 simple names that mean different things in the same block. Use
10225 Block.IsVariableNameUsedInBlock.
10227 2005-03-28 Raja R Harinath <rharinath@novell.com>
10229 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
10230 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
10231 GetTypeHandle. It is possible for a reflected type to derive from
10232 a TypeBuilder (e.g., int[] derives from the TypeBuilder
10233 System.Array during mscorlib compilation).
10234 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
10235 contain a method_hash, don't create one either. Don't create a
10236 deep copy of the base cache's method_hash.
10237 (MemberCache.SetupCache): Rename back from DeepCopy.
10238 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
10239 already initialized. If we see an override function, add its
10240 underlying base virtual function to the member_hash too.
10242 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
10244 2005-03-26 Raja R Harinath <harinath@acm.org>
10247 * assign.cs (Assign.DoResolve): When the RHS of an assignment
10248 fails to resolve, ensure that the LHS is still resolved as an
10251 2005-03-25 Raja R Harinath <harinath@acm.org>
10253 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
10255 (Enum.current_ec): Remove.
10256 (Enum.LookupEnumValue): Remove EmitContext argument.
10257 Just uses the one created during DefineType.
10258 (Enum.FindMembers): Update.
10259 * expression.cs (MemberAccess.DoResolve): Update.
10261 2005-03-22 Marek Safar <marek.safar@seznam.cz>
10263 * assign.cs (Assign.DoResolve): Check for CS1717 when
10264 source and target are same (uses Equals).
10266 * expression.cs (LocalVariableReference, ParameterReference,
10267 This): Implemented Equals, GetHashCode.
10269 * statement.cs (Block.GetParameterReference): Removed useless
10272 2005-03-22 Raja R Harinath <rharinath@novell.com>
10275 * statement.cs (Block.AddVariable): Ensure that we skip implicit
10276 blocks before deciding whether the error is cs0136 or cs0128.
10278 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
10279 (using_alias_directive, using_namespace_directive): Pass
10280 MemberName, not an expression to Namespace.UsingAlias and
10282 (MakeName): Use the MemberName of the namespace.
10283 * namespace.cs (Namespace.MemberName): New.
10284 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
10285 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
10287 * decl.cs (MemberName.Name): Make readonly.
10288 (MemberName.FromDotted): New "constructor".
10289 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
10290 (MemberCore.Name): Compute from MemberName on demand.
10291 (MemberCore.SetMemberName): Provide a way to change the
10293 (MemberCore.AddToContainer): Don't take a fullname parameter.
10294 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
10295 fully qualified name of the container to the member name.
10296 (TypeContainer.AddToTypeContainer): Use a fully qualified name
10297 only if the type is a member of the root container.
10298 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
10299 MemberName.Left rather than searching for an embedded ".".
10300 (PartialContainer.CreatePart): Update to changes in RootContext.
10301 (MemberBase.ShortName): Turn into a property. Use
10302 MemberCore.SetMemberName.
10303 (MemberBase.ExplicitInterfaceName): Remove.
10304 (MemberBase.UpdateMemberName): Remove.
10305 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
10306 (PropertyBase.SetMemberName): New override.
10307 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
10308 (Tree.GetDecl): New.
10309 (Tree.AllDecls): Rename from Decls.
10310 * attribute.cs, enum.cs, report.cs: Update to changes.
10311 * driver.cs (MainDriver): Use MemberName.FromDotted on
10312 RootContext.MainClass.
10314 2005-03-21 Marek Safar <marek.safar@seznam.cz>
10316 * class.cs (FixedField.Define): Check for CS1664 and more sanity
10319 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
10321 2005-03-18 Marek Safar <marek.safar@seznam.cz>
10323 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
10324 property accessor modifiers.
10326 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
10327 fixed buffer attribute (CS1716).
10328 (PropertyMethod.HasCustomAccessModifier): When property accessor
10329 has custom modifier.
10331 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
10333 (PropertyExpr.DoResolveLValue): Add CS0272.
10335 2005-03-17 Miguel de Icaza <miguel@novell.com>
10337 * convert.cs: When converting to a pointer, use the proper Conv.U
10338 or Conv.I depending on the source data type.
10340 * cs-tokenizer.cs: Make the size for large decimal constants,
10343 2005-03-17 Martin Baulig <martin@ximian.com>
10345 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
10346 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
10348 2005-03-17 Martin Baulig <martin@ximian.com>
10350 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
10351 to bool so we can return an error condition.
10352 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
10355 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
10357 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
10360 2005-03-16 Raja R Harinath <rharinath@novell.com>
10362 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
10363 Refactor to avoid traversing the list of assemblies, and to avoid
10364 string concatenation.
10365 * typemanager.cs (guid_attr_type): Remove.
10366 (negative_hits, pointers, references): Remove hashes.
10368 (GetConstructedType): New. Uses type_hash to handle constructed
10369 types (arrays, references, pointers).
10370 (GetReferenceType, GetPointerType): Use it.
10371 (GetNestedType): New. Uses type_hash to handle nested types of
10373 (LookupType, LookupTypeDirect): Remove.
10374 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
10375 'types' hash and LookupTypeReflection directly.
10376 (params_string, params_object): Use GetConstructedType.
10377 * namespace.cs (Namespace.cached_types): New. Cache of reflected
10379 (Namespace.Lookup): Use cached_types.
10380 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
10381 provided by old TypeManager.LookupType.
10382 * rootcontext.cs (MakeFQN): Remove.
10383 * decl.cs (DeclSpace.MakeFQN): Likewise.
10384 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
10385 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
10386 TypeManager.GetConstructedType.
10387 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
10389 2005-03-15 Marek Safar <marek.safar@seznam.cz>
10391 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
10394 * cs-parser.jay: Reports CS1527 for any namespace element.
10396 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
10399 * expression.cs (ParameterReference.IsAssigned): Changed error to
10401 (Error_WrongNumArguments): Moved CS0245 detection here.
10403 * statement.cs (Return.Resolve): Add CS1622 report.
10405 2005-03-11 Marek Safar <marek.safar@seznam.cz>
10407 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
10409 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
10411 * attribute.cs expression.cs: Get rid of some allocations.
10413 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
10415 * doc.cs : just eliminate the latest change.
10417 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
10419 * doc.cs : commented out the latest change. It breaks xml-030.cs
10421 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
10423 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
10424 fail. So invoke CreateType() in FindDocumentedType().
10426 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
10428 * cs-tokenizer.cs : added IsKeyword().
10429 * doc.cs : Detect keyword incorrectly used as identifier.
10430 Allow identifiers prefixed by @.
10432 2005-03-10 Marek Safar <marek.safar@seznam.cz>
10434 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
10435 It caused exception in namespace resolving (again!).
10437 * class.cs (Class.ctor): Removed exit.
10438 (PropertyMethod.ctor): ditto.
10440 * codegen.cs (Codegen.Reset): Reset static data.
10441 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
10443 * cs-tokenizer.cs (Cleanup): Removed.
10445 * driver.cs (GetSystemDir): Rewrote to one line command.
10446 It caused problem with unloaded dynamic modules.
10447 (UnixParseOption): Removed Exit.
10448 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
10449 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
10450 Now can be mcs used as library.
10452 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
10455 * location.cs (Reset): Reset static data.
10457 * namespace.cs (Reset): Reset static data.
10459 * report.cs (Report.Reset): Reset static data.
10461 * rootcontext.cs (RootContext.Reset): Reset static data.
10463 * tree.cs (RootTypes.ctor): Use Location.Null
10465 * typemanager.cs (TypeManager.Reset): Reset static data.
10466 (CoreLookupType): Removed Exit.
10467 (TypeHandle.Reset): Reset static data.
10469 2005-03-10 Raja R Harinath <rharinath@novell.com>
10472 * typemanager.cs (ComputeNamespaces): Import namespaces from
10473 referenced modules too.
10475 2005-03-09 Raja R Harinath <rharinath@novell.com>
10477 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
10480 2005-03-09 Raja R Harinath <rharinath@novell.com>
10482 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
10483 enclosing DeclSpace. This ensures that a name-lookup populates
10484 more caches and there are fewer 'TypeExpression's. Carve out
10485 nested type lookup into ...
10486 (LookupNestedTypeInHierarchy): ... this.
10488 2005-03-09 Raja R Harinath <rharinath@novell.com>
10490 Clean up a few partial-class semantics.
10491 Fixes test-357.cs and cs1618-2.cs.
10492 * cs-parser.jay (struct_declaration): Use 'current_class' as
10493 parent of newly-created struct. Remove call to Register ().
10494 Use 'pop_current_class' to complete handing the current struct.
10495 (interface_declaration): Likewise.
10496 (class_declaration): Likewise.
10497 (enum_declaration): Use 'current_class' as parent of newly created
10499 (delegate_declaration): Likewise.
10500 (pop_current_class): New function. This is used to handle closing
10501 up the 'current_class' and 'current_container', and pointing them
10502 to the enclosing class/container.
10503 (CSharpParser): Initialize 'current_class' too.
10504 * decl.cs (MemberCore): Add check for invariant: a partial
10505 container is not a parsed entity, and thus does not enclose any
10507 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
10508 (DeclSpace.BaseTypeExpr): Use it.
10509 (DeclSpace.LookupType): Add check for invariant.
10510 * class.cs (TypeContainer): Add check for invariant: a nested
10511 class should have the same NamespaceEntry as its enclosing class.
10512 (TypeContainer.EmitFieldInitializers): Make virtual.
10513 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
10515 (TypeContainer.Register): Remove.
10516 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
10517 null. Use TypeResolveEmitContext for resolving base types and
10518 interfaces. Move initialization of Parts.TypeBuilder here from
10520 (TypeContainer.DefineNestedTypes): ... here.
10521 (PartialContainer): Take a Namespace not a NamespaceEntry.
10522 (PartialContainer.Create): Don't use Register. Call the
10523 appropriate Add... function directly.
10524 (ClassPart): Take both the PartialContainer and the enclosing
10525 class as constructor arguments.
10526 (ClassPart.EmitFieldInitializers): Override.
10527 (ClassPart.PartFindNestedTypes): Remove.
10528 (FieldBase.GetInitializerExpression): Resolve the initializer
10529 expression in the emit context of the enclosing class.
10530 * tree.cs (RootTypes): Remove Register ().
10532 2005-03-08 Marek Safar <marek.safar@seznam.cz>
10534 * cs-parser.jay: Removed CS0134.
10536 * driver.cs: Removed CS1901.
10538 * expression.cs (SizeOf.DoResolve): Don't report CS0233
10539 for predefined types.
10541 2005-03-07 Duncan Mak <duncan@novell.com>
10543 * codegen.cs (Save): Catch UnauthorizedAccessException as
10544 well. Fixes bug #73454.
10546 2005-03-07 Marek Safar <marek.safar@seznam.cz>
10548 * cs-tokenizer.cs (xtoken): Add CS1035.
10550 * class.cs (MethodData.Define): Add CS0683.
10551 (FieldMember.ctor): Add CS0681.
10553 2005-03-07 Raja R Harinath <rharinath@novell.com>
10555 * ecore.cs (SimpleName.DoResolve): Rename from
10556 SimpleName.DoResolveAllowStatic.
10557 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
10558 Pass 'intermediate' flag to MemberStaticCheck.
10559 (SimpleName.MemberStaticCheck): Skip "static check" only in case
10560 of "intermediate" lookups via MemberAccess.
10561 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
10562 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
10564 2005-03-07 Raja R Harinath <rharinath@novell.com>
10567 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
10568 slipped in because of variable names that are identical to a
10569 builtin type's BCL equivalent ('string String;', 'int Int32;').
10570 (PropertyExpr.EmitInstance): Likewise.
10572 2005-03-04 Marek Safar <marek.safar@seznam.cz>
10574 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
10576 * report.cs (warning_ignore_table): Made public.
10578 2005-03-04 Raja R Harinath <rharinath@novell.com>
10581 * class.cs (MethodData.Emit): Pass 'container' to
10582 container.GetObsoleteAttribute instead of 'container.Parent'.
10584 2005-03-03 Marek Safar <marek.safar@seznam.cz>
10586 * cs-parser.jay: Add 1534 error test.
10588 * iterators.cs (Yield.CheckContext): Add error 1629.
10589 (Iterator.ctor): Save unsafe modifier.
10590 (MoveNextMethod.DoEmit): Restore unsafe context.
10592 * namespace.cs (UsingAlias): Better error message.
10594 2005-03-03 Dan Winship <danw@novell.com>
10596 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
10597 the warning message [#73219]
10599 2005-03-03 Raja R Harinath <rharinath@novell.com>
10601 Fix compile with MCS 1.0.0.0.
10602 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
10603 w_restore to not depend on string constant folding.
10605 2005-03-03 Raja R Harinath <rharinath@novell.com>
10607 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
10608 CS0246 check to users who passed 'silent = false'.
10609 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
10611 (SimpleName.SimpleNameResolve): Update.
10612 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
10613 (MemberAccess.IdenticalNameAndTypeName): Update.
10614 * doc.cs (FindDocumentedTypeNonArray): Update.
10616 2005-03-03 Raja R Harinath <rharinath@novell.com>
10618 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
10619 * parameters.cs (ComputeAndDefineParameters): Remove.
10620 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
10621 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
10622 Use GetParameterInfo.
10624 2005-03-02 Marek Safar <marek.safar@seznam.cz>
10626 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
10628 2005-03-02 Raja R Harinath <rharinath@novell.com>
10630 Unify DeclSpace.LookupType and DeclSpace.FindType.
10631 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
10632 is in charge of defining nested types on demand.
10633 (DeclSpace.LookupType): Use it when the current_type is a
10634 TypeBuilder. Use LookupTypeDirect for reflected types.
10635 (DeclSpace.FindType): Remove.
10636 (DeclSpace.LookupInterfaceOrClass): Likewise.
10637 (DeclSpace.DefineTypeAndParents): Likewise.
10638 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
10639 DeclSpace.LookupType.
10640 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
10641 * typemanager.cs (LookupType): Simplify.
10642 (AddUserType): Remove type from negative_hits.
10643 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
10644 * class.cs (TypeContainer.FindMembers): Move handling of nested
10646 (TypeContainer.FindMembers_NestedTypes): ... here.
10647 (TypeContainer.FindNestedType): Implement override.
10648 (ClassPart.FindNestedType): Delegate to PartialContainer.
10649 (ClassPart.PartFindNestedType): Looks up the nested types of the
10652 2005-03-02 Martin Baulig <martin@ximian.com>
10654 * class.cs (TypeContainer.DoDefineMembers): We also need a default
10655 static constructor in static classes.
10657 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
10659 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
10660 sizeParamIndex is not specified.
10662 2005-03-01 Marek Safar <marek.safar@seznam.cz>
10665 * report.cs (WarningMessage.IsEnabled): Missing null check.
10667 2005-02-28 Marek Safar <marek.safar@seznam.cz>
10669 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
10670 in the fields and not in the properties.
10672 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
10674 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
10677 2005-02-28 Marek Safar <marek.safar@seznam.cz>
10679 * attribute.cs: Small refactoring (improved robustness).
10680 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
10681 (ValidateGuid): Removed.
10682 (Resolve): Removed referenced to above mentioned.
10683 (GetAttributeUsage): Made private and changed to work without
10685 (GetIndexerAttributeValue): Don't crash.
10686 (GetConditionalAttributeValue): Ditto.
10687 (GetClsCompliantAttributeValue): Ditto.
10688 (ExtractSecurityPermissionSet): All attributes exceptions are
10690 (GetPropertyValue): New helper.
10691 (GetMethodImplOptions): New method.
10692 (DefinePInvokeMethod): Reuse common code. Implemented handling of
10693 some missing properties.
10695 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
10696 (Method.ApplyAttributeBuilder): Updated.
10698 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
10701 2005-02-28 Raja R Harinath <rharinath@novell.com>
10704 * report.cs (Report.SymbolRelatedToPreviousError): Handle
10705 non-simple types (array, pointer, reference).
10707 2005-02-28 Marek Safar <marek.safar@seznam.cz>
10709 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
10711 * class.cs (MethodCore.IsDuplicateImplementation): Special error
10713 (Method.CheckBase): Catch wrong destructor here.
10714 (MethodData.Define): Add errors 550, 668.
10716 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
10718 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
10720 * pending.cs (VerifyPendingMethods): Add error 551.
10722 * typemanager.cs (CSharpName): Next error report helper.
10724 2005-02-25 Marek Safar <marek.safar@seznam.cz>
10726 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
10727 attributes. Removed useless attribute double check.
10728 It saves almost 2MBs for corlib.
10730 2005-02-25 Raja R Harinath <rharinath@novell.com>
10733 * statement.cs (ExpressionStatement.Resolve): Make robust to being
10734 called twice in case of error.
10736 2005-02-23 Chris Toshok <toshok@ximian.com>
10738 Fix compiler portions of #72827.
10739 * statement.cs (Block.Emit): call Begin/EndScope on the
10740 EmitContext instead of the ILGenerator.
10742 * codegen.cs (EmitContext.BeginScope): new method, call
10743 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
10745 (EmitContext.BeginScope): same, but EndScope and CloseScope
10747 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
10748 offset and call the superclass's OpenScope(int) with it.
10749 (SymbolWriter.CloseScope): get the current il
10750 offset and call superclass's CloseScope(int) with it.
10752 2005-02-23 Marek Safar <marek.safar@seznam.cz>
10754 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
10755 CS1677 for out and ref as well.
10757 * class.cs (Method.Define): Add error CS1599 detection.
10759 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
10761 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
10763 * delegate.cs (Delegate.Define): Add error CS1599 detection.
10765 * support.cs.cs (ModifierDesc): New helper method.
10767 2005-02-23 Raja R Harinath <rharinath@novell.com>
10768 Abin Thomas <projectmonokochi@rediffmail.com>
10769 Anoob V E <projectmonokochi@rediffmail.com>
10770 Harilal P R <projectmonokochi@rediffmail.com>
10772 Fix #57851, #72718.
10773 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
10774 MemberLookup (used for error reporting) actually returns a result.
10775 Fix error report number (122, not 112).
10777 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
10778 Anoob V E <projectmonokochi@rediffmail.com>
10779 Harilal P R <projectmonokochi@rediffmail.com>
10782 * pending.cs (PendingImplementation.GetAbstractMethods):
10783 Find NonPublic members too.
10785 2005-02-22 Marek Safar <marek.safar@seznam.cz>
10787 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
10790 * class.cs (MethodCore.CheckMethodAgainstBase):
10791 Add error 239 report.
10793 2005-02-21 Raja R Harinath <rharinath@novell.com>
10796 * expression.cs (Invocation.IsApplicable): Make public.
10797 (Invocation.IsParamsMethodApplicable): Likewise.
10798 * delegate.cs (Delegate.VerifyApplicability): Don't use
10799 Invocation.VerifyArgumentCompat for parameter applicability
10800 testing. Use Invocation.IsApplicable and
10801 Invocation.IsParamsMethodApplicable.
10803 2005-02-21 Marek Safar <marek.safar@seznam.cz>
10805 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
10807 * class.cs (Operator.Define): Add error 217 report.
10809 2005-02-21 Raja R Harinath <rharinath@novell.com>
10811 * namespace.cs (UsingEntry.Resolve): Undo change below.
10813 2005-02-21 Raja R Harinath <rharinath@novell.com>
10816 * ecore.cs (Expression.MemberLookupFailed): Add argument to
10817 disable the error message when the extended MemberLookup also
10819 (Expression.MemberLookupFinal): Update.
10820 (SimpleName.DoSimpleNameResolve): Update.
10821 * expression.cs (MemberAccess.ResolveNamespaceOrType):
10822 Don't use MemberLookupFinal.
10823 (New.DoResolve): Update.
10824 (BaseAccess.CommonResolve): Update.
10826 2005-02-21 Raja R Harinath <rharinath@novell.com>
10829 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
10830 occured previously, don't resolve again.
10832 2005-02-21 Marek Safar <marek.safar@seznam.cz>
10835 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
10836 argument. Call ResolveAttributeUsage for unresolved.
10837 when types doesn't match ctor arguments.
10839 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
10840 for nested attribute classes.
10841 (Class.attribute_usage): Removed.
10842 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
10843 for attribute class.
10845 * ecore.cs (IsAttribute): Removed.
10847 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
10849 * rootcontext.cs (RegisterAttribute): Removed, attributes are
10851 (attribute_types): Removed.
10852 (EmitCode): Global attributes are emited as the latest.
10854 2005-02-18 Marek Safar <marek.safar@seznam.cz>
10856 * class.cs (EmitFieldInitializers): Don't emit field initializer
10857 for default values when optimilization is on.
10859 * constant.cs (Constant.IsDefaultValue): New property.
10861 * driver.cs: Add /optimize handling.
10865 * literal.cs: Implement new IsDefaultValue property.
10867 * rootcontext.cs (Optimize): New field, holds /optimize option.
10869 2005-02-18 Raja R Harinath <rharinath@novell.com>
10871 Fix crasher in re-opened #72347.
10872 * namespace.cs (Namespace.Lookup): Return null if
10873 DeclSpace.DefineType returns null.
10876 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
10878 2005-02-18 Raja R Harinath <rharinath@novell.com>
10880 Fix remainder of #63202. Change semantics of DoResolveLValue: it
10881 now returns null if it cannot resolve to an lvalue.
10882 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
10883 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
10884 returned null. Remove check for SimpleName.
10885 (EventExpr.DoResolveLValue): New.
10886 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
10887 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
10889 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
10890 avoid CS0131 error.
10891 (Unary.ResolveOperator): Move CS0211 check ...
10892 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
10894 (Unary.DoResolveLValue): Simplify.
10895 (AddressOf.DoResolveLValue): New.
10896 (ArrayAccess.DoResolveLValue): New.
10898 2005-02-16 Marek Safar <marek.safar@seznam.cz>
10900 * attribute.cs (Attribute.Resolve): Add arguments casting for
10901 when types doesn't match ctor arguments.
10903 2005-02-16 Raja R Harinath <rharinath@novell.com>
10905 Fix parts of #63202.
10906 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
10907 lookup of operator in base type. Ensure that all checks happen
10908 when the operator resolves to an "op_..." method.
10910 2005-02-15 Raja R Harinath <rharinath@novell.com>
10913 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
10914 'ignore_cs0104' parameter. Pass it to ...
10915 (NamespaceEntry.Lookup): ... this.
10916 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
10917 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
10918 (TypeLookupExpression.DoResolveAsTypeStep): Update.
10919 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
10920 Update. Request that cs0104 errors be ignored.
10921 (ComposedCast.ResolveAsTypeStep): Update.
10923 2005-02-14 Raja R Harinath <rharinath@novell.com>
10926 * expression.cs (Invocation.BetterFunction): Remove support for
10927 comparing virtual functions and their overrides.
10928 (Invocation.IsOverride): New.
10929 (Invocation.OverloadResolve): Don't consider 'override' functions
10930 during candidate selection. Store them in a lookaside list.
10931 If the selected method is a 'virtual' function, use the list to
10932 find any overrides that are closer to the LHS type.
10934 2005-02-14 Marek Safar <marek.safar@seznam.cz>
10936 * expression.cs (New.DoResolve): Add complex core type reduction.
10937 (New.Constantify): Converts complex core type syntax like 'new int ()'
10938 to simple constant.
10940 2005-02-14 Raja R Harinath <rharinath@novell.com>
10942 * decl.cs (EntryType.EntryType): New constructor to create an
10943 updated copy of a cache entry.
10944 (MemberCache.AddMethods): Use it.
10945 (MemberCache.ClearDeclaredOnly): Remove.
10946 (MemberCache.MemberCache): Update.
10948 2005-02-11 Miguel de Icaza <miguel@novell.com>
10950 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
10951 variable. This one is represents the actual low-level declaration
10952 of the method, as opposed to the semantic level `IsStatic'.
10954 An anonymous method which is hosted into a static method might be
10955 actually an instance method. IsStatic would reflect the
10956 container, while MethodIsStatic represents the actual code
10959 * expression.cs (ParameterReference): Use the new MethodIsStatic
10960 instead of IsStatic.
10962 * anonymous.cs (AnonymousMethod.Compatible): Pass the
10963 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
10964 set on the current EmitContext.
10966 * expression.cs (Cast): Overload DoResolveLValue so we can pass
10967 resolve our casted expression as an LValue. This triggers the
10968 proper LValue processing that is later required by Assign.
10972 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
10974 2005-02-11 Marek Safar <marek.safar@seznam.cz>
10976 C# 2.0 Fixed buffer implementation
10978 * anonymous.cs: Update after RegisterHelperClass renaming.
10980 * attribute.cs (AttributeTester.fixed_buffer_cache):
10981 Cache of external fixed buffers.
10982 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
10983 implementation if field is fixed buffer else null.
10986 (TypeContainer.AddField): Accept FieldMember instead of Field.
10987 (FieldBase.IsFieldClsCompliant): Extracted code from
10988 VerifyClsCompliance descendant customization.
10989 (FixedField): New class handles fixed buffer fields.
10990 (FixedFieldExternal): Keeps information about imported fixed
10992 (IFixedField): Make access to internal or external fixed buffer
10995 * cs-parser.jay: Add fixed buffer parsing.
10997 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
11000 * expression.cs (Indirection): Extended implementation to accept
11001 fixed buffer field.
11002 (PointerArithmetic.Emit): Get element from fixed buffer as well.
11003 (ElementAccess.MakePointerAccess): Get type as parameter.
11004 (DoResolve): Add fixed buffer field expression conversion.
11005 (DoResolveLValue): Ditto.
11006 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
11007 (ArrayPtr): Derives from FixedBufferPtr.
11008 (ArrayPtr.Emit): Add extra emit for array elements.
11010 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
11012 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
11013 for compiler generated types.
11014 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
11016 * statement.cs (Fixed): Refactored to be easier add fixed buffer
11017 and consume less memory.
11018 (Fixed.Resolve): Add fixed buffer case.
11020 * typemanager.cs (compiler_generated_attr_ctor,
11021 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
11022 (HasElementType): Add our own implementation to work on every
11025 2005-02-11 Miguel de Icaza <miguel@novell.com>
11027 * anonymous.cs (CaptureContext): Track whether `this' has been
11030 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
11031 only captured `this' if it was implicitly done (instance
11032 methods/variables were used).
11034 * codegen.cs (EmitContext.CaptureThis): New method to flag that
11035 `this' must be captured.
11037 2005-01-30 Miguel de Icaza <miguel@novell.com>
11039 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
11040 is null it means that there has been no need to capture anything,
11041 so we just create a sibling.
11043 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
11045 Just a partial fix. The other half is fairly elusive.
11047 2005-02-10 Raja R Harinath <rharinath@novell.com>
11049 Fix #52586, cs0121-4.cs.
11050 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
11051 and return a hashtable.
11052 (MemberCache.ClearDeclaredOnly): New.
11053 (MemberCache.MemberCache): Update to change. Make a deep copy of
11054 the method_hash of a base type too.
11055 (MemberCache.AddMethods): Adapt to having a deep copy of the base
11056 type methods. Overwrite entries with the same MethodHandle so
11057 that the ReflectedType is correct. The process leaves in base
11058 virtual functions and their overrides as distinct entries.
11059 (CacheEntry): Now a class instead of a struct. It shouldn't alter
11060 matters since it was boxed in a ArrayList before.
11061 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
11063 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
11064 case of a virtual function and its override (choose the overload
11066 (Invocation.OverloadResolve): Avoid 'override' members during
11067 'applicable_type' calculation.
11069 2005-02-09 Raja R Harinath <rharinath@novell.com>
11071 Combine two near-redundant caches.
11072 * typemanager.cs (method_params): Rename from method_internal_params.
11073 (TypeManager.GetParameterData): New. Replace
11074 Invocation.GetParameterData.
11075 (TypeManager.LookupParametersByBuilder): Remove.
11076 * expression.cs (Invocation.method_parameter_cache): Remove.
11077 (Invocation.GetParameterData): Remove.
11079 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
11082 2005-02-08 Raja R Harinath <rharinath@novell.com>
11085 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
11086 TypeManager.multicast_delegate_type is null, resolve it by looking
11087 up "System.MulticastDelegate".
11088 * rootcontext.cs (RootContext.ResolveCore): Simplify.
11090 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
11091 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
11092 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
11095 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
11096 (LabeledStatement.AddReference): New. Set 'referenced'.
11097 (Goto.Resolve): Use it.
11099 2005-02-05 John Luke <john.luke@gmail.com>
11101 * driver.cs: remove duplicate -doc line in Usage ()
11103 2005-02-04 Raja R Harinath <rharinath@novell.com>
11105 * location.cs (Location.AddFile): Fix CS2002 error report.
11107 2005-02-02 Martin Baulig <martin@ximian.com>
11109 * delegate.cs (Delegate.DefineType): Report an internal error if
11110 TypeManager.multicast_delegate_type is null. See bug #72015 for
11113 2005-02-02 Raja R Harinath <rharinath@novell.com>
11115 Fix a crasher in a variant of #31984.
11116 * const.cs (Constant.CheckBase): New override that defers the
11117 new-or-override check in case the base type hasn't been populated
11119 (Constant.Define): Ensure the new-or-override check is performed.
11121 2005-02-01 Duncan Mak <duncan@ximian.com>
11123 * const.cs (LookupConstantValue): Check that `ce' is not null
11124 before calling GetValue ().
11126 2005-02-01 Raja R Harinath <rharinath@novell.com>
11128 Fix test-334.cs (#69519).
11129 * cs-parser.jay (using_alias_directive): Pass in an expression to
11130 NamespaceEntry.UsingAlias.
11131 (using_namespace_directive): Pass in an expression to
11132 NamespaceEntry.Using.
11133 (namespace_name): Don't flatten to a string.
11134 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
11135 (NamespaceEntry.AliasEntry.Resolve): Lookup using
11137 (NamespaceEntry.UsingEntry): Likewise.
11138 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
11140 (NamespaceEntry.LookupForUsing): Remove.
11141 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
11143 (NamespaceEntry.Lookup): Remove support for dotted names.
11145 2005-02-01 Raja R Harinath <rharinath@novell.com>
11147 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
11149 (NamespaceEntry.ImplicitParent): Compute on demand.
11150 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
11151 parallels the current.
11152 (NamespaceEntry.LookupForUsing): Use it.
11153 (NamespaceEntry.Lookup): If the current namespace-entry is
11154 implicit, don't search aliases and using tables.
11156 2005-02-01 Raja R Harinath <rharinath@novell.com>
11159 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
11161 (TypeContainer.BaseCache): Compute on demand.
11162 (TypeContainer.FindMembers): Define constants and types if they're
11163 not already created.
11164 (FieldMember.Define): Move resetting of ec.InUnsafe before error
11166 * const.cs (Constant.Define): Make idempotent.
11168 2005-01-29 Miguel de Icaza <miguel@novell.com>
11170 * pending.cs: Produce better code (no nops produced by using Ldarg
11173 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
11174 i - 1' it should be arg + 1.
11178 2005-01-28 Raja R Harinath <rharinath@novell.com>
11180 * attribute.cs (Attribute.CheckAttributeType): Make private
11182 (Attribute.ResolveType): Make virtual.
11183 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
11184 handling of RootContext.Tree.Types.
11186 2005-01-27 Raja R Harinath <rharinath@novell.com>
11188 Update attribute-handling to use the SimpleName/MemberAccess
11190 * cs-parser.jay (attribute): Pass in an expression to the
11191 constructors of Attribute and GlobalAttribute.
11192 * attribute.cs (Attribute): Take an expression for the name.
11193 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
11194 passed in attribute name expression.
11195 (Attribute.CheckAttributeType): Use it.
11196 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
11197 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
11198 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
11199 argument to prevent error messages if the lookup fails.
11201 2005-01-27 Marek Safar <marek.safar@seznam.cz>
11203 * expression.cs (Indirection): Implemented IVariable interface
11204 to support indirection in AddressOf operator.
11205 (PointerArithmetic.Emit): Add optimalization for case where
11206 result can be precomputed.
11208 2005-01-26 Martin Baulig <martin@ximian.com>
11210 * class.cs (TypeContainer.AttributeTargets): Return the correct
11211 AttributeTargets depending on our `Kind' instead of throwing an
11212 exception; fixes #71632.
11214 2005-01-26 Marek Safar <marek.safar@seznam.cz>
11217 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
11220 2005-01-25 Raja R Harinath <rharinath@novell.com>
11223 * expression.cs (MemberAccess.DoResolve): Don't complain with
11224 cs0572 when the LHS of a member access has identical name and type
11227 2005-01-25 Marek Safar <marek.safar@seznam.cz>
11230 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
11232 Create custom PermissionSet only for PermissionSetAttribute.
11234 2005-01-24 Marek Safar <marek.safar@seznam.cz>
11237 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
11238 delegates in static class.
11240 2005-01-24 Martin Baulig <martin@ximian.com>
11242 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
11243 merging an implicit block, just use its reachability.
11245 * statement.cs (Block.Resolve): Make the unreachable code check
11246 work wrt. implicit blocks; see test-337 from #63842.
11248 2005-01-21 Alp Toker <alp@atoker.com>
11250 * cs-parser.jay: destructor_declaration's container is PartialContainer
11251 not Class when partial types are used, so use Kind prop instead of
11254 2005-01-22 Miguel de Icaza <miguel@ximian.com>
11256 * cs-parser.jay: Improve error reporting when an interface
11257 declares new types.
11259 2005-01-20 Dick Porter <dick@ximian.com>
11261 * support.cs: SeekableStreamReader fix from Sandor Dobos
11262 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
11263 chars are read. Fixes bug 70369.
11265 2005-01-20 Raja R Harinath <rharinath@novell.com>
11267 * cs-parser.jay (catch_clause): Simplify current_block handling
11270 2005-01-17 Miguel de Icaza <miguel@ximian.com>
11272 * convert.cs (ImplicitStandardConversionExists): Synchronize the
11273 code with ImplicitStandardConversion to handle the implicit
11274 conversion of method groups into valid delegate invocations.
11276 The problem is that in parameter handling we were using this code
11277 path. Fixes bug #64698
11279 2005-01-19 Raja R Harinath <rharinath@novell.com>
11281 * cs-parser.jay: Fix several infelicities.
11282 - Avoid assigning to the parser value stack. Code like
11283 '$3 = null' is unclean. Synthesize a value for the code block
11285 - Avoid using oob_stack for storing location information. Use ...
11286 (_mark_): ... this. New (empty) rule. Saves the current location
11288 (foreach_statement): Avoid using oob_stack for current_block
11289 handling. Use technique used in for_statement and
11290 using_statement. Synthesize a value for the code block to store
11291 additional intermediate information.
11293 2005-01-13 Miguel de Icaza <miguel@ximian.com>
11295 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
11296 of a different type is only allowed to private fields of a
11297 containing type, not on fields of a base class.
11299 See test-174.cs and error cs0122-9.cs
11301 2005-01-13 Raja R Harinath <rharinath@novell.com>
11303 Fix test-335.cs (bug #58126).
11304 * cs-parser.jay (argument): Split out non-expression parts of the
11305 rule into 'non_simple_argument'.
11306 (invocation_expression): Support parenthesized invocations with
11307 multiple arguments, and with single non-simple arguments.
11309 2005-01-13 Raja R Harinath <rharinath@novell.com>
11311 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
11314 2005-01-12 Raja R Harinath <rharinath@novell.com>
11316 Fix cs0038-1.cs, cs1640-6.cs.
11317 * ecore.cs (Expression.Resolve): Remove special-case for
11318 SimpleName in error-handling.
11319 (Expression.almostMatchedMembers): Relax access permission to
11321 (Expression.MemberLookupFailed): Handle duplicates in
11322 almostMatchedMembers list.
11323 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
11324 * expression.cs (New.DoResolve): Report CS1540 for more cases.
11325 * typemanager.cs (GetFullNameSignature): Use the MethodBase
11326 overload if the passed in MemberInfo is a MethodBase.
11328 2005-01-12 Marek Safar <marek.safar@seznam.cz>
11331 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
11332 for non-CAS & merge permission sets properly.
11334 2005-01-11 Raja R Harinath <rharinath@novell.com>
11336 Improve standard-compliance of simple name and member access
11337 resolution. Fixes bugs #52697, #57200, #67520, #69519.
11338 * ecore.cs (FullNamedExpression): New abstract base class
11339 for Namespaces and TypeExpressions.
11340 (ResolveFlags.SimpleName): Remove.
11341 (SimpleName): Remove support for dotted names.
11342 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
11343 DeclSpace.FindType and DeclSpace.LookupType.
11344 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
11345 (Expression.ExprClassName): Make member function.
11346 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
11347 a namespace. Remove creation of dotted "SimpleName"s.
11348 (MemberAccess.DoResolve): Likewise.
11349 * decl.cs (DeclSpace.Cache): Make private.
11350 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
11351 (DeclSpace.FindType): Update.
11352 (DeclSpace.LookupType): Move here from RootContext. Return a
11353 FullNamedExpression.
11354 * namespace.cs (Namespace): Derive from FullNamedExpression
11355 so that it can be part of expression resolution.
11356 (Namespace.Lookup): Return an FullNamedExpression.
11357 (NamespaceEntry.LookupAlias): Lookup aliases only in current
11359 * rootcontext.cs (NamespaceLookup): Remove.
11360 (LookupType): Move to DeclSpace.
11361 * attribute.cs (CheckAttributeType): Update.
11362 * doc.cs (FindDocumentedType): Remove allowAlias argument.
11363 (FindDocumentedTypeNonArray): Likewise.
11365 2005-01-11 Raja R Harinath <rharinath@novell.com>
11367 Fix cs0509.cs, cs1632.cs.
11368 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
11369 is the same as IsInterface.
11370 (TypeContainer.GetClassBases): Likewise.
11371 * statement.cs (LabeledStatement.ig): New field.
11372 (LabeledStatement.LabelTarget): Save ILGenerator which created the
11374 (LabeledStatement.DoEmit): Check that the label was created with
11375 the same ILGenerator.
11377 2005-01-10 Marek Safar <marek.safar@seznam.cz>
11380 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
11381 accessors to its properties.
11383 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
11384 from accessors to property.
11386 2005-01-10 Marek Safar <marek.safar@seznam.cz>
11389 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
11390 only for overrides.
11392 2005-01-08 Miguel de Icaza <miguel@ximian.com>
11394 * attribute.cs: Check for null and empty strings.
11396 I have lost another battle to Paolo.
11398 2005-01-07 Marek Safar <marek.safar@seznam.cz>
11401 * class.cs (PropertyMethod): Set Parent field in ctors.
11402 (SetMethod.InternalParameters): Add unsafe switch hack.
11403 Override MarkForDuplicationCheck where it is appropriate.
11405 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
11406 It says whether container allows members with the same name.
11407 Base default is no.
11408 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
11409 Removed is_method parameter.
11411 2005-01-06 Duncan Mak <duncan@ximian.com>
11413 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
11414 because the previous change led to incorrect reporting of CS1032
11415 ("Cannot define/undefine preprocessor symbols after first token in
11416 file"). Instead of using `tokens_seen' as the only flag that
11417 triggers CS1040, introduce `comments_seen'. This new flag is used
11418 to signify having seen comments on the current line, so it is
11419 unset after a newline.
11421 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
11423 * doc.cs : When searching for a type, find nested type too.
11424 This fixes bug #71040.
11426 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
11429 - Warn missing member comment on those classes which also does not
11430 have doc comments. Fixed bug #71041.
11431 - Don't warn missing doc comment on default constructor.
11434 2005-01-06 Duncan Mak <duncan@ximian.com>
11436 * cs-tokenizer.cs (xtoken): After handling traditional C-style
11437 comments, set `tokens_seen' to true. This allows us to detect
11438 misplaced preprocessor directives (i.e. not at the beginning of
11439 the a line, nor after whitespaces). In that case, report error
11440 CS1040. This fixes bug #56460.
11442 * cs-parser.jay (interface_member_declaration): Add checks for
11443 IsExplicitImpl, and report CS0541 error if an interface member is
11444 defined as an explicit interface declaration.
11446 2005-01-06 Marek Safar <marek.safar@seznam.cz>
11449 * class.cs (PropertyMethod): Set Parent field in ctors.
11450 (SetMethod.InternalParameters): Add unsafe switch hack.
11452 * decl.cs (MemberCore.Parent): Cannot be readonly.
11454 2005-01-06 Raja R Harinath <rharinath@novell.com>
11456 * decl.cs (DeclSpace.ResolveType): Remove.
11457 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
11458 Merge in code from ...
11459 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
11460 * class.cs, enum.cs: Update to changes.
11462 2005-01-06 Miguel de Icaza <miguel@ximian.com>
11464 * anonymous.cs: Ensure that we init the scope of our parent if it
11465 has not been initialized yet.
11467 2004-12-30 Duncan Mak <duncan@ximian.com>
11469 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
11470 if field.FieldBuilder is null. Fixes #70758.
11472 * convert.cs: Fixed some typos and updated some of the comments.
11473 (ImplicitStandardConversionExists):
11474 (TryImplicitIntConversion): If `target_type' is an interface and
11475 the type of `ic' implements this interface, return true or a new
11476 BoxedCast instead of null. This fixes #70468.
11478 2004-12-29 Duncan Mak <duncan@ximian.com>
11480 * expression.cs (Argument.Emit): Check that Expr is
11481 IMemoryLocation before casting to it, and report CS1510 otherwise.
11485 2004-12-21 Ben Maurer <bmaurer@ximian.com>
11487 * statement.cs (Block.ThisVariable): remove the recursion here, to
11488 make the --profile more sane.
11490 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
11492 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
11493 assembly, by JB Evain.
11495 2004-12-17 Raja R Harinath <rharinath@novell.com>
11497 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
11498 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
11499 "parent" refers to enclosing type/class. "base" refers to superclass.
11501 2004-12-17 Raja R Harinath <rharinath@novell.com>
11503 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
11504 Ensure that we only have GlobalAttributes.
11505 * attribute.cs (Attribute.Emit): Make non-virtual.
11506 (GlobalAttribute.Emit): Remove.
11507 (Attribute.Resolve): Make virtual.
11508 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
11509 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
11510 the argument. Don't create one.
11511 (Attribute.GetObsoleteAttribute): Likewise.
11512 (Attribute.GetClsCompliantAttributeValue): Likewise.
11513 * class.cs, decl.cs: Update to changes.
11515 2004-12-17 Marek Safar <marek.safar@seznam.cz>
11517 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
11519 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
11521 * statement.cs (Foreach.Resolve): Add error 186 report.
11523 2004-12-16 Marek Safar <marek.safar@seznam.cz>
11525 * expression.cs (Conditional.DoResolve): Add warning 429.
11527 * statement.cs (If.Resolve): Add warning 665.
11529 2004-12-16 Raja R Harinath <rharinath@novell.com>
11531 New invariant: RootContext.Tree.Types.NamespaceEntry == null
11532 except when in the parser, and in GlobalAttribute.
11533 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
11534 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
11535 RootContext.Tree.Types.NamespaceEntry once work is done.
11536 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
11537 and resets RootContext.Tree.Types.NamespaceEntry.
11539 2004-12-15 Marek Safar <marek.safar@seznam.cz>
11541 * cs-parser.jay: Don't create a block for every variable.
11543 2004-12-14 Miguel de Icaza <miguel@ximian.com>
11545 * location.cs: Provide extra information.
11547 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
11548 variables from the captured environment, it is the ldarg_0.
11550 2004-12-14 Marek Safar <marek.safar@seznam.cz>
11552 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
11555 * class.cs: Changed warning level for 169 to avoid developer
11556 displeasure from warning flooding. It will be changed back when they
11557 fix most of current BCL warnings.
11559 * RootContext.cs: Pushed default WarningLevel to 3.
11561 * statement.cs: Removed unused variable.
11563 2004-12-14 Marek Safar <marek.safar@seznam.cz>
11565 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
11566 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
11567 Add error 502 report.
11568 (StaticClass.DefineType): Add error 441 report.
11569 (Class.AllowedModifiersProp): New virtual property as temporary
11570 extension to AllowedModifiers.
11571 (Class.DefineType): Add error 418 report. Moved ModFlags check here
11572 to share implementation with StaticClass and don't call virtual
11575 * driver.cs (MainDriver): Add error 1558 test.
11577 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
11578 report. Moved error 36 test here.
11580 * statement.cs (Throw.Resolve): Add error 724 report.
11582 * typemanager.cs: Add out_attribute_type core type.
11584 2004-12-13 Marek Safar <marek.safar@seznam.cz>
11586 * class.cs (TypeContainer.VerifyClsCompliance): Add error
11588 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
11590 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
11593 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
11595 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
11596 Add error 3023 report.
11597 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
11599 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
11602 2004-12-12 John Luke <john.luke@gmail.com>
11604 * driver.cs (AddArgs): take -- into account when
11605 adding arguments, fixes bug 65710
11607 2004-12-12 Martin Baulig <martin@ximian.com>
11609 * expression.cs (Unary.TryReduceNegative): Added support for
11610 SByteConstant and ByteConstant.
11611 (Unary.Reduce): Check error values from TryReduceNegative().
11613 2004-12-10 Marek Safar <marek.safar@seznam.cz>
11615 * attributes.cs (Attribute.Resolve): Avoid multiple error report
11616 and report exception as error 182.
11618 2004-12-10 Raja R Harinath <rharinath@novell.com>
11620 * driver.cs (Main): Fix message when there are warnings.
11622 2004-12-09 Miguel de Icaza <miguel@ximian.com>
11624 * delegate.cs: Fixed my fix from yesterday, sorry about that.
11626 2004-12-09 Marek Safar <marek.safar@seznam.cz>
11628 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
11629 Reduced number of warnings.
11631 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
11633 2004-12-08 Miguel de Icaza <miguel@ximian.com>
11635 * driver.cs: Removed message.
11637 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
11639 2004-12-08 <vargaz@freemail.hu>
11641 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
11643 2004-12-08 Martin Baulig <martin@ximian.com>
11645 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
11646 instead of a CS3002 for properties and indexer.
11648 2004-12-08 Martin Baulig <martin@ximian.com>
11650 * decl.cs (MemberName.ToString): Make this work again.
11652 2004-12-08 Marek Safar <marek.safar@seznam.cz>
11654 * attribute.cs (Resolve): Add error 591 detection.
11656 * class.cs (FieldMember.Define): Add error 1547 detection.
11657 (Indexer.Define): Add error 620 detection.
11658 (Operator.Define): Add error 590 detection.
11660 * ecore.cs: Missing argument for error 79.
11662 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
11665 2004-12-07 Marek Safar <marek.safar@seznam.cz>
11668 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
11671 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
11673 * cs-parser.jay : handle doc comments on implicit/explicit operators.
11674 Some operator comments were suppressed.
11675 * doc.cs : Implicit/explicit operator name in doc comments are like
11676 "op_Explicit(type)~returnType", so added suffix handling.
11678 2004-12-07 Martin Baulig <martin@ximian.com>
11681 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
11682 (MemberCore.GetClsCompliantAttributeValue): Likewise.
11683 (DeclSpace.ec): New protected field; store the EmitContext here.
11684 (DeclSpace.EmitContext): New public property; moved here from
11686 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
11689 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
11690 (Enum.Emit): Don't create a new EmitContext.
11692 * delegate.cs (Delegate.DefineType): Always create the
11695 * iterators.cs (Iterators.DefineIterator): Create a new
11696 EmitContext and store it in `ec'.
11698 2004-08-24 Martin Baulig <martin@ximian.com>
11701 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
11702 this for accessibility checks.
11703 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
11704 IsNestedFamilyAccessible.
11705 (TypeManager.IsSubclassOf): New method, do what the name actually
11708 2004-12-06 Raja R Harinath <rharinath@novell.com>
11710 Fix crash on cs0657-17.cs.
11711 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
11712 Use RootContext.Tree.Types, not 'new RootTypes ()'.
11713 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
11714 the case where the NamespaceEntry gets overwritten.
11716 2004-12-06 Marek Safar <marek.safar@seznam.cz>
11718 Fixed #69195, #56821
11719 * ecore.cs (ResolveBoolean): Tiny refactoring.
11721 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
11722 of right expression resolving when left is false constant and
11723 operator is LogicalAnd OR true constant and operator is LogicalOr.
11725 * statement.cs (ResolveUnreachable): Always reports warning.
11727 2004-12-05 Miguel de Icaza <miguel@ximian.com>
11729 * class.cs: Distinguish between 1721 and 1722 (just a little help
11730 for the programmer).
11732 2004-12-03 Miguel de Icaza <miguel@ximian.com>
11734 * delegate.cs: Only allow this on new versions of the language.
11736 2004-12-02 Duncan Mak <duncan@ximian.com>
11738 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
11740 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
11741 here as a static method. Take an additional bool out parameter
11742 `must_do_cs1540_check' for signaling to InstanceResolve.
11743 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
11744 member field from PropertyExpr class and made it an argument of
11745 the method instead.
11746 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
11747 check for MarshalByRefObject, and report CS0122 instead of CS1540.
11748 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
11749 and `remove_accessor' as well as InstanceResolve: report CS0122
11754 2004-12-03 Raja R Harinath <rharinath@novell.com>
11756 Fix test-327.cs, test-328.cs, and put in early infrastructure
11757 for eventually fixing #52697.
11758 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
11759 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
11760 from other methods.
11761 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
11762 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
11763 (VerifyUsing, error246): Update.
11764 * rootcontext.cs (RootContext.NamespaceLookup): Just use
11765 'NamespaceEntry.LookupNamespaceOrType'.
11767 2004-12-03 Martin Baulig <martin@ximian.com>
11769 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
11770 method as our child, call AnonymousMethod.Compatible() on it.
11772 2004-12-03 Raja R Harinath <rharinath@novell.com>
11774 Disable XML documentation support in 'basic' profile.
11775 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
11776 Redirect XmlElement to System.Object.
11777 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
11778 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
11779 * mcs.exe.sources: Add doc-bootstrap.cs.
11780 * doc-bootstrap.cs: New file. Contains empty stub implementation
11783 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
11785 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
11786 comments are allowed.
11788 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
11790 * delegate.cs: Add checks for subtypes in paramaters and return values
11791 in VerifyMethod () to add support for Covariance/Contravariance
11794 2004-12-02 Miguel de Icaza <miguel@ximian.com>
11796 * report.cs: Remove extra closing parenthesis.
11798 * convert.cs (Error_CannotImplicitConversion): If the name of the
11799 types are the same, provide some extra information.
11801 * class.cs (FieldBase): Use an unused bit field from the field to
11802 encode the `has_offset' property from the FieldMember. This saves
11803 a couple of Ks on bootstrap compilation.
11805 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
11806 method as our child, return the AnonymousMethod resolved
11809 * expression.cs (New.DoResolve): Allow return values from
11810 NewDelegate to also include AnonymousMethods.
11814 2004-12-02 Marek Safar <marek.safar@seznam.cz>
11817 * attribute.cs (Resolve): Improved implementation of params
11818 attribute arguments.
11820 * support.cs (ParameterData): Add HasParams to be faster.
11822 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
11824 all things are for /doc support:
11826 * doc.cs: new file that supports XML documentation generation.
11827 * mcs.exe.sources: added doc.cs.
11829 Handle /doc command line option.
11830 Report error 2006 instead of 5 for missing file name for /doc.
11831 Generate XML documentation when required, after type resolution.
11833 Added support for picking up documentation (/// and /** ... */),
11834 including a new XmlCommentState enumeration.
11836 Added lines to fill Documentation element for field, constant,
11837 property, indexer, method, constructor, destructor, operator, event
11838 and class, struct, interface, delegate, enum.
11839 Added lines to warn incorrect comment.
11841 Added Documentation field (passed only when /doc was specified).
11843 Added DocComment, DocCommentHeader, GenerateDocComment() and
11844 OnGenerateDocComment() and some supporting private members for
11845 /doc feature to MemberCore.
11847 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
11849 Added overriden DocCommentHeader.
11851 Added overriden DocCommentHeader and GenerateDocComment().
11853 2004-12-01 Miguel de Icaza <miguel@ximian.com>
11855 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
11856 unwrapping the enumeration values, chain to
11857 DoConstantNumericPromotions again, so we can promote things to the
11858 fundamental types (takes care of enums that are bytes, sbytes).
11862 2004-12-01 Raja R Harinath <rharinath@novell.com>
11864 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
11865 Fix long-standing bug in type-lookup. Use FindType instead of
11866 LookupType when ec.ResolvingTypeTree.
11867 (Attribute.ResolveType, Attribute.Resolve)
11868 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
11870 (Attributes.Search): Remove internal version. Update.
11871 (Attributes.SearchMulti): Update.
11872 (Attributes.GetClsCompliantAttribute): Remove.
11873 (Attributes.GetIndexerNameAttribute): Remove.
11874 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
11875 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
11876 * class.cs (Indexer.Define): Likewise.
11878 2004-12-01 Marek Safar <marek.safar@seznam.cz>
11881 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
11882 MarshallByReference members access.
11884 * expression.cs: Use CheckMarshallByRefAccess;
11885 Better error CS0197 message.
11887 * report.cs: Print whole related error message.
11889 2004-11-30 Raja R Harinath <rharinath@novell.com>
11891 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
11892 the current directory to help debugging.
11894 2004-11-29 Marek Safar <marek.safar@seznam.cz>
11896 * class (GetClassBases): Better error 60 report.
11897 (EventProperty): Disabled warning 67 detection.
11899 2004-11-29 Marek Safar <marek.safar@seznam.cz>
11902 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
11904 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
11907 2004-11-29 Marek Safar <marek.safar@seznam.cz>
11910 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
11912 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
11914 2004-11-26 Miguel de Icaza <miguel@ximian.com>
11916 * attribute.cs (Attribute.Resolve): Refine error reporting and
11917 report a cs0117 if the identifier does not exist, to distinguish
11918 from 0617 which is a miss-use of the actual identifier.
11920 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
11921 between cs0070 and cs0079.
11923 * class.cs (MemberBase.DoDefine): When reporting a wrong
11924 accessibility level, we use MethodCore to compare instead of
11925 Method (this was a regression in some refactoring effort).
11927 So now we correctly report cs0056 again.
11929 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
11930 testing the target_type (which was known to be object_type) and
11931 not the source type (which is anonymous_method).
11933 Fixed reporting of error cs1660.
11935 * expression.cs (UserCast.Source): Expose the underlying cast.
11937 * statement.cs (Switch.SwitchGoverningType): Sort the list of
11938 allowed types to find a match to int32 first (most common).
11940 In addition, it ignores any ImplicitUserConversions that did an
11941 internal implicit conversion (as the switch statement allows only
11942 one integral conversion to exist).
11944 * class.cs (PartialContainer.Create): rename `name' to
11945 `member_name' for clarity. Then replace the string calls with a
11946 call to MemberName.GetPartialName, as now using
11947 MemberName.ToString is an error (this is due to the side effects
11948 it had, that were fixed in the past).
11950 This will restore the error reporting on a number of partial class
11951 errors that were missusing this (and getting an exception as a
11952 results, which is now just a plain textual warning, because
11953 yyparse debug output would crash otherwise).
11955 2004-11-26 Raja R Harinath <rharinath@novell.com>
11957 * Makefile (PROGRAM_INSTALL_DIR): Remove.
11959 2004-11-25 Ben Maurer <bmaurer@ximian.com>
11961 * rootcontext.cs (LookupType): Make sure to cache lookups that
11962 don't give us a negative result. This saves about 5% of corlib
11965 2004-11-25 Miguel de Icaza <miguel@ximian.com>
11967 * report.cs (AbstractMessage.Print): messages are sent to stderr
11969 * class.cs (TypeContainer.GetClassBases): It is an error to have a
11970 non-interface in the list of interfaces (at this point, either
11971 parent was properly set, or a base class is being listed in the
11972 interfaces section).
11974 This flags error 1722, and resolves the crash from bug 69259.
11976 2004-11-25 Ben Maurer <bmaurer@ximian.com>
11978 * statement.cs (Using.EmitExpressionFinally): make this work right
11979 for valuetypes. Fixes 69926.
11981 2004-11-25 Miguel de Icaza <miguel@ximian.com>
11983 * const.cs (Const.ChangeType): Cope with the "0 literal can be
11984 converted to an enum" here, before we try to change the underlying
11985 type. This code exists, but it is a different code path than the
11986 one used while encoding constants.
11988 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
11989 old bug: when converting from the null literal to a pointer,
11990 return an EmptyCast, not the NullLiteral.
11992 This fixes #69921, the recent null_type changes probably made this
11993 bug more prominent.
11995 (ImplicitReferenceConversionExists): In addition, resynchronized
11996 the code here, so it matches the same code in
11997 ImplicitReferenceConversionExists for the `from any class-type S
11998 to any interface-type T'.
12001 2004-11-25 Marek Safar <marek.safar@seznam.cz>
12003 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
12005 2004-11-24 Miguel de Icaza <miguel@ximian.com>
12007 * cs-parser.jay: Use verbosity accordingly.
12009 2004-11-24 Marek Safar <marek.safar@seznam.cz>
12011 * expression.cs (Unary.ResolveOperator): Do not report warning;
12012 AddressOf reads from variable.
12014 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
12016 2004-11-24 Marek Safar <marek.safar@seznam.cz>
12020 * attribute.cs (Attributable): Removed CheckTargets.
12021 (Attributes.Emit): Explicit attribute targets are tested here.
12023 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
12024 not enabled for interfaces.
12026 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
12027 (GetAssemblyName): Ouch next bug there.
12029 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
12031 * expression.cs: Error 275 added.
12033 2004-11-23 Marek Safar <marek.safar@seznam.cz>
12035 Fix bug #69177 (Implemented decimal constant support)
12037 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
12038 (BinaryFold): Add DecimalConstant.
12040 * const.cs (Define): Decimal constant
12042 (ChangeType): Add decimal type handling.
12043 (LookupConstantValue): Don't set value for decimal type but
12044 emit DecimalConstantAttribute. Needed for constant optimization.
12046 * constant.cs (ToDecimal): New method.
12047 (ConvertToDecimal): New method.
12048 (IntConstant): Implemented ConvertToDecimal.
12049 (DecimalConstant.Emit): Emit optimized version for decimals in
12052 * expression.cs (ResolveOperator): Changed order of constant
12053 reduction to work correctly with native types which have
12054 overloaded operators.
12055 (ResolveMemberAccess): Extract constant value from attribute
12058 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
12060 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
12061 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
12062 (ChangeType): Decimal is special.
12063 (TypeToCoreType): Add decimal type.
12065 2004-11-22 Marek Safar <marek.safar@seznam.cz>
12067 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
12070 2004-11-22 Marek Safar <marek.safar@seznam.cz>
12072 * class.cs (EventField.ApplyAttributeBuilder): Fix error
12075 2004-11-19 Marek Safar <marek.safar@seznam.cz>
12077 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
12079 * pending.cs (PendingImplementation): Grab only interfaces.
12081 2004-11-19 Marek Safar <marek.safar@seznam.cz>
12083 * statement.cs (ForeachHelperMethods): Add location member and
12084 error 202 detection.
12086 2004-11-19 Raja R Harinath <rharinath@novell.com>
12088 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
12089 automatically handled by executable.make.
12090 (PROGRAM): Make profile-specific.
12092 2004-11-18 Marek Safar <marek.safar@seznam.cz>
12094 * expression.cs (DoResolveBase): Fixed wrong warning for out
12097 2004-11-18 Martin Baulig <martin@ximian.com>
12099 Merged latest changes into gmcs. Please keep this comment in
12100 here, it makes it easier for me to see what changed in MCS since
12101 the last time I merged.
12103 2004-11-17 Raja R Harinath <rharinath@novell.com>
12105 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
12106 (TypeHandle.GetMemberCache): New.
12107 (TypeHandle.TypeHandle): Update.
12108 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
12109 (TypeManager.LookupParentInterfacesCache):
12110 Rename from LookupInterfaceCache. Optimize slightly.
12111 (TypeManager.MemberLookup_FindMembers): Update.
12112 * decl.cs (MemberCache.MemberCache): Set Container to null in the
12113 multi-type variant.
12114 (AddCacheContents): Rename from AddHashtable.
12115 * class.cs (TypeContainer.parent_container): Remove.
12116 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
12117 (TypeContainer.DoDefineMembers): Don't initialize it.
12118 Update to name changes.
12120 2004-11-17 Miguel de Icaza <miguel@ximian.com>
12122 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
12123 that factors the code to check access modifiers on override.
12125 (PropertyBase): Use the code here.
12127 Patch from Lluis S'anchez, fixes bug #69361.
12129 2004-11-15 Miguel de Icaza <miguel@ximian.com>
12131 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
12132 routine that is used to report the use of a captured variable
12133 whose address has been taken.
12135 There are two checks: one when variables are being captured and
12136 the other check is when the address of a variable is taken.
12138 (because an anonymous methods might be resolved before *or* after
12139 the address has been taken) and
12141 * expression.cs (Conditional.DoResolve): Remove the special
12142 casing that Martin added to trueExpr and falseExpr being both
12143 NullLiteral. We get the right behavior now just by introducing
12144 the null_type into the compiler.
12146 * convert.cs (ExplicitConversion): Change the code to use
12147 null_type instead of testing `expr is NullLiteral'.
12148 (ImplicitConversionStandard): use null_type too.
12149 (ImplicitReferenceConversionExists): use null_type too.
12150 (ImplicitReferenceConversion): use null_type too.
12152 * literal.cs: The type of `NullLiteral' is now null_type instead
12154 (Resolve): Set the type here.
12156 * typemanager.cs: Introduce null_type.
12158 2004-11-17 Martin Baulig <martin@ximian.com>
12160 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
12161 direction, like FindMembers() does. Fixes #69546, testcase is in
12164 2004-11-16 Martin Baulig <martin@ximian.com>
12166 This is based on a patch from Marek Safar, see bug #69082.
12167 Fixes bugs #63705 and #67130.
12169 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
12170 method; create a MemberCache for an interface type and cache the
12173 * decl.cs (IMemberContainer.ParentContainer): Removed.
12174 (IMemberContainer.ParentCache): New property.
12175 (MemberCache.SetupCacheForInterface): Removed.
12176 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
12177 to create a cache for an interface's "parent".
12179 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
12182 2004-11-16 Martin Baulig <martin@ximian.com>
12184 Merged back from gmcs; these changes already went into gmcs a
12185 couple of weeks ago.
12188 (TypeManager.AddUserType): Removed the `ifaces' argument.
12189 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
12191 (TypeManager.AddUserInterface): Removed.
12192 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
12194 (TypeManager.GetInterfaces): Likewise.
12195 (TypeManager.GetExplicitInterfaces): Likewise.
12197 * ecore.cs (TypeExpr.GetInterfaces): Removed.
12199 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
12200 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
12202 2004-11-14 Ben Maurer <bmaurer@ximian.com>
12204 * statement.cs: Avoid adding bools to a hashtable.
12206 2004-11-07 Miguel de Icaza <miguel@ximian.com>
12208 * expression.cs (Invocation.OverloadResolve): Flag error if we are
12209 calling an unsafe method from a safe location.
12211 2004-11-06 Marek Safar <marek.safar@seznam.cz>
12214 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
12216 2004-11-06 Miguel de Icaza <miguel@ximian.com>
12218 * namespace.cs (VerifyUsing): use GetPartialName instead of
12221 2004-11-05 Miguel de Icaza <miguel@ximian.com>
12223 * statement.cs (Return.Resolve): Fix regression in typo: if
12224 `in_exc', we have to request a NeedReturnLabel, this was a typo
12225 introduced in the anonymous method check-in. Fixes #69131.
12227 * Indexers were using the ShortName when defining themselves,
12228 causing a regression in the compiler bootstrap when applying the
12229 patch from 2004-11-02 (first part), now they use their full name
12230 and the bug is gone.
12232 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
12234 * driver.cs: Strip the path from the names of embedded resources. Fixes
12237 2004-11-04 Raja R Harinath <rharinath@novell.com>
12239 Fix error message regression: cs0104-2.cs.
12240 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
12241 (AliasEntry.Resolve): Update.
12242 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
12244 (RootContext.LookupType): Update.
12246 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
12248 * cs-parser.jay: Add support for handling accessor modifiers
12249 * class: Add support port accessor modifiers and error checking,
12250 define PropertyMethod.Define as virtual (not abstract anymore)
12251 * ecore.cs: Add checking for proeprties access with access modifiers
12252 * iterators.cs: Modify Accessor constructor call based in the modified
12254 2004-11-02 Ben Maurer <bmaurer@ximian.com>
12256 * expression.cs (StringConcat): Handle being called twice,
12257 as when we have a concat in a field init with more than two
12260 2004-11-02 Miguel de Icaza <miguel@ximian.com>
12262 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
12263 special case explicit implementations, we should always produce
12264 the .property or .event declaration.
12266 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
12267 since it will not return correct data if people use this
12268 unresolved in the presence of using statements (see test-313).
12270 * class.cs (MethodData.Define): If we are an explicit interface
12271 implementation, set the method name to the full name of the
12272 interface plus the name of the method.
12274 Notice that using the method.MethodName.GetFullName() does not
12275 work, as it will only contain the name as declared on the source
12276 file (it can be a shorthand in the presence of using statements)
12277 and not the fully qualifed type name, for example:
12281 class D : ICloneable {
12282 object ICloneable.Clone () {
12286 Would produce a method called `ICloneable.Clone' instead of
12287 `System.ICloneable.Clone'.
12289 * namespace.cs (Alias.Resolve): Use GetPartialName.
12291 2004-11-01 Marek Safar <marek.safar@seznam.cz>
12293 * cs-parser.jay: Add error 1055 report.
12295 2004-11-01 Miguel de Icaza <miguel@ximian.com>
12297 * assign.cs (Assign.DoResolve): Only do the transform of
12298 assignment into a New if the types are compatible, if not, fall
12299 through and let the implicit code deal with the errors and with
12300 the necessary conversions.
12302 2004-11-01 Marek Safar <marek.safar@seznam.cz>
12304 * cs-parser.jay: Add error 1031 report.
12306 * cs-tokenizer.cs: Add location for error 1038.
12308 2004-10-31 Marek Safar <marek.safar@seznam.cz>
12310 * cs-parser.jay: Add error 1016 report.
12312 2004-10-31 Marek Safar <marek.safar@seznam.cz>
12314 * cs-parser.jay: Add errors 1575,1611 report.
12316 2004-10-31 Marek Safar <marek.safar@seznam.cz>
12318 * cs-parser.jay: Add error 1001 report.
12320 2004-10-31 Marek Safar <marek.safar@seznam.cz>
12323 * attribute.cs (GetMarshal): Add method argument for
12324 caller identification.
12326 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
12327 agument for GetMarshal and RuntimeMissingSupport.
12329 2004-10-31 Marek Safar <marek.safar@seznam.cz>
12331 * attribute.cs (ExtractSecurityPermissionSet): Removed
12332 TypeManager.code_access_permission_type.
12334 * typemanager.cs: Removed TypeManager.code_access_permission_type.
12336 2004-10-27 Miguel de Icaza <miguel@ximian.com>
12338 * expression.cs (LocalVariableReference.DoResolveLValue): Check
12339 for obsolete use of a variable here. Fixes regression on errors
12340 cs0619-25 and cs0619-26.
12342 2004-10-27 Marek Safar <marek.safar@seznam.cz>
12344 Fix #62358, implemented security attribute encoding.
12346 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
12347 Tests permitted SecurityAction for assembly or other types.
12348 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
12349 data from SecurityPermissionAttribute to PermisionSet class.
12351 * class.cs (ApplyAttributeBuilder): Added special handling
12352 for System.Security.Permissions.SecurityAttribute based types.
12354 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
12355 special handling for System.Security.Permissions.SecurityAttribute
12358 * enum.cs (ApplyAttributeBuilder): Added special handling
12359 for System.Security.Permissions.SecurityAttribute based types.
12361 * parameter.cs (ApplyAttributeBuilder): Added special handling
12362 for System.Security.Permissions.SecurityAttribute based types.
12364 * rootcontext.cs: Next 2 core types.
12366 * typemanager.cs (TypeManager.security_permission_attr_type):
12367 Built in type for the SecurityPermission Attribute.
12368 (code_access_permission_type): Build in type.
12370 2004-10-17 Miguel de Icaza <miguel@ximian.com>
12372 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
12373 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
12374 all of this information into
12375 EmitContext.EmitCapturedVariableInstance.
12377 * codegen.cs (EmitCapturedVariableInstance): move here the
12378 funcionality of emitting an ldarg.0 in the presence of a
12379 remapping. This centralizes the instance emit code.
12381 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
12382 then emit a load of this: it means that we have reached the
12383 topmost ScopeInfo: the one that contains the pointer to the
12384 instance of the class hosting the anonymous method.
12386 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
12387 captures to the topmost CaptureContext.
12389 2004-10-12 Miguel de Icaza <miguel@ximian.com>
12391 * expression.cs (LocalVariableReference): Move the knowledge about
12392 the iterators into codegen's EmitCapturedVariableInstance.
12394 2004-10-11 Miguel de Icaza <miguel@ximian.com>
12396 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
12397 all code paths return a value from an anonymous method (it is the
12398 same as the 161 error, but for anonymous methods).
12400 2004-10-08 Miguel de Icaza <miguel@ximian.com>
12402 The introduction of anonymous methods in the compiler changed
12403 various ways of doing things in the compiler. The most
12404 significant one is the hard split between the resolution phase
12405 and the emission phases of the compiler.
12407 For instance, routines that referenced local variables no
12408 longer can safely create temporary variables during the
12409 resolution phase: they must do so from the emission phase,
12410 since the variable might have been "captured", hence access to
12411 it can not be done with the local-variable operations from the runtime.
12415 (Block.Flags): New flag `IsTopLevel' to indicate that this block
12416 is a toplevel block.
12418 (ToplevelBlock): A new kind of Block, these are the blocks that
12419 are created by the parser for all toplevel method bodies. These
12420 include methods, accessors and anonymous methods.
12422 These contain some extra information not found in regular blocks:
12423 A pointer to an optional CaptureContext (for tracking captured
12424 local variables and parameters). A pointer to the parent
12427 (Return.Resolve): Catch missmatches when returning a value from an
12428 anonymous method (error 1662).
12429 Invoke NeedReturnLabel from the Resolve phase instead of the emit
12432 (Break.Resolve): ditto.
12434 (SwitchLabel): instead of defining the labels during the
12435 resolution phase, we now turned the public ILLabel and ILLabelCode
12436 labels into methods called GetILLabelCode() and GetILLabel() that
12437 only define the label during the Emit phase.
12439 (GotoCase): Track the SwitchLabel instead of the computed label
12440 (its contained therein). Emit the code by using
12441 SwitchLabel.GetILLabelCode ().
12443 (LocalInfo.Flags.Captured): A new flag has been introduce to track
12444 whether the Local has been captured or not.
12446 (LocalInfo.IsCaptured): New property, used to tell whether the
12447 local has been captured.
12449 * anonymous.cs: Vastly updated to contain the anonymous method
12452 The main classes here are: CaptureContext which tracks any
12453 captured information for a toplevel block and ScopeInfo used to
12454 track the activation frames for various local variables.
12456 Each toplevel block has an optional capture context associated
12457 with it. When a method contains an anonymous method both the
12458 toplevel method and the anonymous method will create a capture
12459 context. When variables or parameters are captured, they are
12460 recorded on the CaptureContext that owns them, for example:
12464 MyDelegate d = delegate {
12469 Here `a' will be recorded as captured on the toplevel
12470 CapturedContext, the inner captured context will not have anything
12471 (it will only have data if local variables or parameters from it
12472 are captured in a nested anonymous method.
12474 The ScopeInfo is used to track the activation frames for local
12475 variables, for example:
12477 for (int i = 0; i < 10; i++)
12478 for (int j = 0; j < 10; j++){
12479 MyDelegate d = delegate {
12484 At runtime this captures a single captured variable `i', but it
12485 captures 10 different versions of the variable `j'. The variable
12486 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
12487 recorded on a child.
12489 The toplevel ScopeInfo will also track information like the `this'
12490 pointer if instance variables were referenced (this is necessary
12491 as the anonymous method lives inside a nested class in the host
12492 type of the method).
12494 (AnonymousMethod): Expanded to track the Toplevel, implement
12495 `AnonymousMethod.Compatible' to tell whether an anonymous method
12496 can be converted to a target delegate type.
12498 The routine now also produces the anonymous method content
12500 (AnonymousDelegate): A helper class that derives from
12501 DelegateCreation, this is used to generate the code necessary to
12502 produce the delegate for the anonymous method that was created.
12504 * assign.cs: API adjustments for new changes in
12505 Convert.ImplicitStandardConversionExists.
12507 * class.cs: Adjustments to cope with the fact that now toplevel
12508 blocks are of type `ToplevelBlock'.
12510 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
12511 insteda of standard blocks.
12513 Flag errors if params arguments are passed to anonymous methods.
12515 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
12516 `CurrentAnonymousMethod' which points to the current Anonymous
12517 Method. The variable points to the AnonymousMethod class that
12518 holds the code being compiled. It is set in the new EmitContext
12519 created for the anonymous method.
12521 (EmitContext.Phase): Introduce a variable and an enumeration to
12522 assist in enforcing some rules about when and where we are allowed
12523 to invoke certain methods (EmitContext.NeedsReturnLabel is the
12524 only one that enfonces this right now).
12526 (EmitContext.HaveCaptureInfo): new helper method that returns
12527 whether we have a CapturedContext initialized.
12529 (EmitContext.CaptureVariable): New method used to register that a
12530 LocalInfo must be flagged for capturing.
12532 (EmitContext.CapturedParameter): New method used to register that a
12533 parameters must be flagged for capturing.
12535 (EmitContext.CapturedField): New method used to register that a
12536 field must be flagged for capturing.
12538 (EmitContext.HaveCapturedVariables,
12539 EmitContext.HaveCapturedFields): Return whether there are captured
12540 variables or fields.
12542 (EmitContext.EmitMethodHostInstance): This is used to emit the
12543 instance for the anonymous method. The instance might be null
12544 (static methods), this (for anonymous methods that capture nothing
12545 and happen to live side-by-side with the current method body) or a
12546 more complicated expression if the method has a CaptureContext.
12548 (EmitContext.EmitTopBlock): Routine that drives the emission of
12549 code: it will first resolve the top block, then emit any metadata
12550 and then emit the code. The split is done so that we can extract
12551 any anonymous methods and flag any captured variables/parameters.
12553 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
12554 during this phase, the ILGenerator should not be used as labels
12555 and local variables declared here might not be accessible to any
12556 code that is part of an anonymous method.
12558 Exceptions to this include the temporary variables that are
12559 created by some statements internally for holding temporary
12562 (EmitContext.EmitMeta): New routine, in charge of emitting all the
12565 (EmitContext.TemporaryReturn): This method is typically called
12566 from the Emit phase, and its the only place where we allow the
12567 ReturnLabel to be defined other than the EmitMeta. The reason is
12568 that otherwise we would have to duplicate a lot of logic in the
12569 Resolve phases of various methods that today is on the Emit
12572 (EmitContext.NeedReturnLabel): This no longer creates the label,
12573 as the ILGenerator is not valid during the resolve phase.
12575 (EmitContext.EmitThis): Extended the knowledge in this class to
12576 work in anonymous methods in addition to iterators.
12578 (EmitContext.EmitCapturedVariableInstance): This emits whatever
12579 code is necessary on the stack to access the instance to a local
12580 variable (the variable will be accessed as a field).
12582 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
12583 EmitContext.EmitAddressOfParameter): Routines to support
12584 parameters (not completed at this point).
12586 Removals: Removed RemapLocal and RemapLocalLValue. We probably
12587 will also remove the parameters.
12589 * convert.cs (Convert): Define a `ConstantEC' which points to a
12590 null. This is just to prefity some code that uses
12591 ImplicitStandardConversion code and do not have an EmitContext
12594 The idea is to flag explicitly that at that point in time, it is
12595 known that the conversion will not trigger the delegate checking
12596 code in implicit conversions (which requires a valid
12599 Everywhere: pass new EmitContext parameter since
12600 ImplicitStandardConversionExists now requires it to check for
12601 anonymous method conversions.
12603 (Convert.ImplicitStandardConversionExists): If the type of an
12604 expression is the anonymous_method_type, and the type is a
12605 delegate, we invoke the AnonymousMethod.Compatible method to check
12606 whether an implicit conversion is possible.
12608 (Convert.ImplicitConversionStandard): Only do implicit method
12609 group conversions if the language level is not ISO_1.
12611 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
12612 MethodInfo for the Invoke method. used by Delegate and
12615 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
12616 method conversions if the target type is a delegate.
12618 Removed extra debugging nops.
12620 (LocalVariableReference): Turn the `local_info' into a public
12623 Add `prepared' field, the same hack used for FieldExprs to cope
12624 with composed assignments, as Local variables do not necessarily
12625 operate purely on the stack as they used to: they can be captured
12628 Add `temp' for a temporary result, like fields.
12630 Refactor DoResolve and DoResolveLValue into DoResolveBase.
12632 It now copes with Local variables that are captured and emits the
12633 proper instance variable to load it from a field in the captured
12636 (ParameterReference.DoResolveBase): During the resolve phase,
12637 capture parameters if we are in an anonymous method.
12639 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
12640 anonymous method, use the EmitContext helper routines to emit the
12641 parameter reference.
12643 * iterators.cs: Set RemapToProxy to true/false during the
12646 * parameters.cs (GetParameterByName): New helper method.
12648 * typemanager.cs (anonymous_method_type) a new type that
12649 represents an anonyous method. This is always an internal type,
12650 used as a fencepost to test against the anonymous-methodness of an
12653 2004-10-20 Marek Safar <marek.safar@seznam.cz>
12655 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
12657 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
12659 2004-10-18 Martin Baulig <martin@ximian.com>
12661 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
12662 `Type' directly, but call ResolveType() on it.
12663 (Catch.Resolve): Likewise.
12664 (Foreach.Resolve): Likewise.
12666 2004-10-18 Martin Baulig <martin@ximian.com>
12668 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
12669 `Type' directly, but call ResolveType() on it.
12670 (Probe.DoResolve): Likewise.
12671 (ArrayCreation.LookupType): Likewise.
12672 (TypeOf.DoResolve): Likewise.
12673 (SizeOf.DoResolve): Likewise.
12675 2004-10-18 Martin Baulig <martin@ximian.com>
12677 * expression.cs (Invocation.BetterFunction): Put back
12678 TypeManager.TypeToCoreType().
12680 2004-10-18 Raja R Harinath <rharinath@novell.com>
12682 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
12685 2004-10-18 Martin Baulig <martin@ximian.com>
12687 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
12688 `Type' directly, but call ResolveType() on it.
12690 2004-10-18 Martin Baulig <martin@ximian.com>
12692 * class.cs (FieldMember.Define): Don't access the TypeExpr's
12693 `Type' directly, but call ResolveType() on it.
12694 (MemberBase.DoDefine): Likewise.
12696 * expression.cs (New.DoResolve): Don't access the TypeExpr's
12697 `Type' directly, but call ResolveType() on it.
12698 (ComposedCast.DoResolveAsTypeStep): Likewise.
12700 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
12701 `Type' directly, but call ResolveType() on it.
12703 2004-10-17 John Luke <john.luke@gmail.com>
12705 * class.cs (Operator.GetSignatureForError): use CSharpName
12707 * parameter.cs (Parameter.GetSignatureForError): Returns
12708 correct name even if was not defined.
12710 2004-10-13 Raja R Harinath <rharinath@novell.com>
12713 * class.cs (TypeContainer.EmitContext): New property.
12714 (DefineNestedTypes): Create an emitcontext for each part.
12715 (MethodCore.DoDefineParameters): Use container's emitcontext.
12716 Pass type array to InternalParameters.
12717 (MemberBase.DoDefine): Use container's emitcontext.
12718 (FieldMember.Define): Likewise.
12719 (Event.Define): Likewise.
12720 (SetMethod.GetParameterInfo): Change argument to EmitContext.
12721 Pass type array to InternalParameters.
12722 (SetIndexerMethod.GetParameterInfo): Likewise.
12723 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
12724 * delegate.cs (Define): Pass emitcontext to
12725 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
12726 array to InternalParameters.
12727 * expression.cs (ParameterReference.DoResolveBase): Pass
12728 emitcontext to GetParameterInfo.
12729 (ComposedCast.DoResolveAsTypeStep): Remove check on
12730 ec.ResolvingTypeTree.
12731 * parameter.cs (Parameter.Resolve): Change argument to
12732 EmitContext. Use ResolveAsTypeTerminal.
12733 (Parameter.GetSignature): Change argument to EmitContext.
12734 (Parameters.ComputeSignature): Likewise.
12735 (Parameters.ComputeParameterTypes): Likewise.
12736 (Parameters.GetParameterInfo): Likewise.
12737 (Parameters.ComputeAndDefineParameterTypes): Likewise.
12738 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
12739 * support.cs (InternalParameters..ctor): Remove variant that takes
12741 * typemanager.cs (system_intptr_expr): New.
12742 (InitExpressionTypes): Initialize it.
12744 2004-10-12 Chris Toshok <toshok@ximian.com>
12746 * cs-parser.jay: fix location for try_statement and catch_clause.
12748 2004-10-11 Martin Baulig <martin@ximian.com>
12750 * report.cs: Don't make --fatal abort on warnings, we have
12751 -warnaserror for that.
12753 2004-10-07 Raja R Harinath <rharinath@novell.com>
12755 More DeclSpace.ResolveType avoidance.
12756 * decl.cs (MemberCore.InUnsafe): New property.
12757 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
12758 with newly created EmitContext.
12759 (FieldMember.Define): Likewise.
12760 * delegate.cs (Delegate.Define): Likewise.
12761 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
12762 only if normal name-lookup fails.
12763 (TypeExpr.DoResolve): Enable error-checking.
12764 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
12765 (SizeOf.DoResolve): Likewise.
12766 (ComposedCast.DoResolveAsTypeStep): Likewise.
12767 (StackAlloc.DoResolve): Likewise.
12768 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
12769 (Block.Unsafe): New property.
12770 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
12771 (Unsafe): Set 'unsafe' flag of contained block.
12772 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
12773 (Fixed.Resolve): Likewise.
12774 (Catch.Resolve): Likewise.
12775 (Using.ResolveLocalVariableDecls): Likewise.
12776 (Foreach.Resolve): Likewise.
12778 2004-10-05 John Luke <john.luke@gmail.com>
12780 * cs-parser.jay: add location to error CS0175
12782 2004-10-04 Miguel de Icaza <miguel@ximian.com>
12784 * ecore.cs (Expression.Constantity): Add support for turning null
12787 * const.cs (Const.Define): Allow constants to be reference types
12788 as long as the value is Null.
12790 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
12792 * namespace.cs (NamespaceEntry.Using): No matter which warning
12793 level is set, check if this namespace name has already been added.
12795 2004-10-03 Ben Maurer <bmaurer@ximian.com>
12797 * expression.cs: reftype [!=]= null should always use br[true,false].
12800 2004-10-03 Marek Safar <marek.safar@seznam.cz>
12803 * attribute.cs: Enum conversion moved to
12804 GetAttributeArgumentExpression to be applied to the all
12807 2004-10-01 Raja R Harinath <rharinath@novell.com>
12809 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
12810 * class.c (TypeContainer.DefineType): Flag error if
12811 base types aren't accessible due to access permissions.
12812 * decl.cs (DeclSpace.ResolveType): Move logic to
12813 Expression.ResolveAsTypeTerminal.
12814 (DeclSpace.ResolveTypeExpr): Thin layer over
12815 Expression.ResolveAsTypeTerminal.
12816 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
12817 Refactor code into NestedAccess. Use it.
12818 (DeclSpace.NestedAccess): New.
12819 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
12820 argument to silence errors. Check access permissions.
12821 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
12822 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
12823 (Cast.DoResolve): Likewise.
12824 (New.DoResolve): Likewise.
12825 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
12826 (TypeOf.DoResolve): Likewise.
12828 * expression.cs (Invocation.BetterConversion): Return the Type of
12829 the better conversion. Implement section 14.4.2.3 more faithfully.
12830 (Invocation.BetterFunction): Make boolean. Make correspondence to
12831 section 14.4.2.2 explicit.
12832 (Invocation.OverloadResolve): Update.
12833 (Invocation): Remove is_base field.
12834 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
12835 (Invocation.Emit): Likewise.
12837 2004-09-27 Raja R Harinath <rharinath@novell.com>
12839 * README: Update to changes.
12841 2004-09-24 Marek Safar <marek.safar@seznam.cz>
12843 * cs-parser.jay: Reverted 642 warning fix.
12845 2004-09-23 Marek Safar <marek.safar@seznam.cz>
12848 * decl.cs (FindMemberWithSameName): Indexer can have more than
12851 2004-09-23 Marek Safar <marek.safar@seznam.cz>
12853 * expression.cs (LocalVariableReference.DoResolveLValue):
12854 Do not report warning 219 for out values.
12855 (EmptyExpression.Null): New member to avoid extra allocations.
12857 2004-09-23 Marek Safar <marek.safar@seznam.cz>
12859 * cs-parser.jay: Fix wrong warning 642 report.
12861 * cs-tokenizer.cs (CheckNextToken): New helper;
12862 Inspect next character if is same as expected.
12864 2004-09-23 Martin Baulig <martin@ximian.com>
12866 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
12867 (Convert.ImplicitReferenceConversionExists): Likewise.
12869 2004-09-23 Marek Safar <marek.safar@seznam.cz>
12871 * class.cs (Operator.Define): Add error 448 and 559 report.
12873 2004-09-22 Marek Safar <marek.safar@seznam.cz>
12875 * class.cs (MemberBase.IsTypePermitted): New protected
12876 method for checking error CS0610.
12878 2004-09-22 Marek Safar <marek.safar@seznam.cz>
12880 * class.cs (TypeContainer.HasExplicitLayout): New property
12881 Returns whether container has StructLayout attribute set Explicit.
12882 (FieldMember): New abstract class for consts and fields.
12883 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
12884 (Field): Reuse FieldMember.
12886 * const.cs (Const): Reuse FieldMember.
12888 * rootcontext.cs: EmitConstants call moved to class.
12890 2004-09-22 Martin Baulig <martin@ximian.com>
12892 Thanks to Peter Sestoft for this bug report.
12894 * expression.cs (Conditional): If both the `trueExpr' and the
12895 `falseExpr' is a NullLiteral, return a NullLiteral.
12897 2004-09-22 Martin Baulig <martin@ximian.com>
12899 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
12900 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
12901 for the "get_Current" call.
12903 2004-09-22 Martin Baulig <martin@ximian.com>
12905 Marek and me just fixed one of our oldest bugs: #28562 :-)
12907 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
12909 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
12910 we're an EnumConstant, just return that.
12911 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
12912 an EnumConstant. In this case, we need to use GetValueAsEnumType()
12913 to get the value which'll actually be written into the attribute.
12914 However, we have to use GetValue() to access the attribute's value
12917 2004-09-22 Marek Safar <marek.safar@seznam.cz>
12919 * constant.cs (Constant.IsNegative): New abstract property
12922 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
12923 (StackAlloc.DoResolve): Reused IsNegative.
12925 2004-09-21 Martin Baulig <martin@ximian.com>
12927 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
12928 if we're used in an iterator, we may be called from different
12931 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
12932 we actually have an exception block.
12934 2004-09-20 John Luke <jluke@cfl.rr.com>
12936 * class.cs, cs-parser.jay: Improve the error report for 1520:
12937 report the actual line where the error happens, not where the
12938 class was declared.
12940 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
12941 Pass location information that was available elsewhere.
12943 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
12945 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
12946 runtime to delay sign assemblies.
12948 2004-09-19 Miguel de Icaza <miguel@ximian.com>
12950 * cs-parser.jay: Do not report the stack trace, this is barely
12953 2004-08-22 John Luke <john.luke@gmail.com>
12955 * driver.cs : check that a resource id is not already used
12956 before adding it, report CS1508 if it is, bug #63637
12958 2004-09-19 Miguel de Icaza <miguel@ximian.com>
12960 * ecore.cs: Removed dead code.
12962 2004-09-18 Marek Safar <marek.safar@seznam.cz>
12964 * class.cs: Do not report warning CS0067 on the interfaces.
12966 2004-09-16 Marek Safar <marek.safar@seznam.cz>
12968 * cs-parser.jay: Add error 504 report.
12970 2004-09-16 Marek Safar <marek.safar@seznam.cz>
12972 * rootcontext.cs: WarningLevel is 4 by default now.
12974 * statement.cs (Fixed.Resolve): Do not null
12977 2004-09-16 Marek Safar <marek.safar@seznam.cz>
12980 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
12981 deep search when property is not virtual.
12982 (PropertyExpr.ResolveAccessors): Make one call for both
12985 2004-09-15 Marek Safar <marek.safar@seznam.cz>
12988 * statement.cs: Error 152 report constains also location.
12990 2004-09-15 Marek Safar <marek.safar@seznam.cz>
12993 * const.cs: Explicitly set constant as static.
12995 2004-09-15 Marek Safar <marek.safar@seznam.cz>
12998 * cs-parser.jay: Add error 1017 report.
13000 2004-09-15 Marek Safar <marek.safar@seznam.cz>
13002 Fixed bug #59980, #64224
13003 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
13005 * typemanager.cs (IsSpecialMethod): Simplified
13007 2004-09-14 Marek Safar <marek.safar@seznam.cz>
13009 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
13010 condition with better params.
13012 2004-09-14 Marek Safar <marek.safar@seznam.cz>
13015 * attribute.cs (Resolve): Property has to have both
13018 2004-09-14 Martin Baulig <martin@ximian.com>
13020 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
13022 2004-09-14 Marek Safar <marek.safar@seznam.cz>
13025 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
13026 called and is obsolete then this member suppress message
13027 when call is inside next [Obsolete] method or type.
13029 * expression.cs: Use TestObsoleteMethodUsage member.
13031 2004-09-14 Martin Baulig <martin@ximian.com>
13033 * cs-parser.jay: Sync a bit with the GMCS version.
13035 2004-09-14 Martin Baulig <martin@ximian.com>
13037 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
13038 (CSharpParser.yacc_verbose_flag): New public field.
13040 * genericparser.cs: Removed.
13042 2004-09-14 Raja R Harinath <rharinath@novell.com>
13044 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
13046 2004-09-13 Marek Safar <marek.safar@seznam.cz>
13048 * class.cs (MethodCore.CheckBase): Fix bug #65757.
13050 2004-09-10 Martin Baulig <martin@ximian.com>
13052 Backported my MemberName changes from GMCS into MCS.
13054 - we are now using a special `MemberName' class instead of using
13055 strings; in GMCS, the `MemberName' also contains the type
13058 - changed the grammar rules a bit:
13059 * the old `member_name' is now a `namespace_or_type_name':
13060 The rule is that we use `namespace_or_type_name' everywhere
13061 where we expect either a "member name" (GetEnumerator) or a
13062 "member name" with an explicit interface name
13063 (IEnumerable.GetEnumerator).
13064 In GMCS, the explicit interface name may include type arguments
13065 (IEnumerable<T>.GetEnumerator).
13066 * we use `member_name' instead of just `IDENTIFIER' for
13068 The rule is that we use `member_name' wherever a member may
13069 have type parameters in GMCS.
13071 * decl.cs (MemberName): New public class.
13072 (MemberCore.MemberName): New public readonly field.
13073 (MemberCore.ctor): Take a `MemberName' argument, not a string.
13074 (DeclSpace): Likewise.
13076 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
13077 * enum.cs (Enum.ctor): Likewise.
13079 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
13081 (AliasEntry.ctor): Take a MemberName, not an Expression.
13082 (AliasEntry.UsingAlias): Likewise.
13084 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
13085 (IMethodData.MemberName): Changed type from string to MemberName.
13086 (MemberBase.ExplicitInterfaceName): Likewise.
13087 (AbstractPropertyEventMethod.SetupName): Make this private.
13088 (AbstractPropertyEventMethod.ctor): Added `string prefix'
13089 argument; compute the member name here.
13090 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
13091 on the `member.MemberName' and the `prefix'.
13093 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
13095 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
13096 thus, we get a `MemberName' instead of a `string'. These
13097 declarations may have type parameters in GMCS.
13098 (interface_method_declaration, delegate_declaration): Likewise.
13099 (class_declaration, interface_declaration): Likewise.
13100 (method_header): Use `namespace_or_type_name' instead of
13101 `member_name'. We may be an explicit interface implementation.
13102 (property_declaration, event_declaration): Likewise.
13103 (member_name): This is now just an `IDENTIFIER', not a
13104 `namespace_or_type_name'.
13105 (type_name, interface_type): Removed.
13106 (namespace_or_type_name): Return a MemberName, not an Expression.
13107 (primary_expression): Use `member_name' instead of `IDENTIFIER';
13108 call GetTypeExpression() on the MemberName to get an expression.
13109 (IndexerDeclaration.interface_type): Changed type from string to
13111 (MakeName): Operate on MemberName's instead of string's.
13113 2004-09-13 Raja R Harinath <rharinath@novell.com>
13116 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
13117 (NamespaceEntry.Lookup): Add new argument to flag if we want the
13118 lookup to avoid symbols introduced by 'using'.
13119 * rootcontext.cs (NamespaceLookup): Update.
13121 2004-09-12 Marek Safar <marek.safar@seznam.cz>
13123 * class.cs (TypeContainer.DoDefineMembers): Do not call
13124 DefineDefaultConstructor for static classes.
13126 2004-09-12 Marek Safar <marek.safar@seznam.cz>
13128 * attribute.cs (Attribute.Resolve): Add error 653 report.
13130 * class.cs (Class.ApplyAttributeBuilder): Add error 641
13132 (Method.ApplyAttributeBuilder): Add error 685 report.
13133 (Operator.Define): Add error 564 report.
13135 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
13137 * expression.cs (Invocation.DoResolve): Add error
13138 245 and 250 report.
13140 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
13143 2004-09-11 Marek Safar <marek.safar@seznam.cz>
13145 * class.cs (ConstructorInitializer.Resolve):
13146 Wrong error number (515->516).
13148 2004-09-11 Marek Safar <marek.safar@seznam.cz>
13150 * class.cs (Indexer.Define): Add error 631 report.
13152 2004-09-11 Marek Safar <marek.safar@seznam.cz>
13154 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
13156 2004-09-11 Marek Safar <marek.safar@seznam.cz>
13158 * expression.cs (Probe.DoResolve): Add error CS0241 report.
13160 2004-09-10 Marek Safar <marek.safar@seznam.cz>
13162 * cs-parser.jay: Added error CS0241 report.
13164 2004-09-10 Raja R Harinath <rharinath@novell.com>
13166 * cs-parser.jay (fixed_statement): Introduce a scope for the
13167 declaration in the 'fixed' statement.
13169 2004-09-09 Marek Safar <marek.safar@seznam.cz>
13171 * cs-parser.jay: Added CS0230 error report.
13173 2004-09-09 Marek Safar <marek.safar@seznam.cz>
13175 * cs-parser.jay: Added errors CS0231 and CS0257 report.
13177 2004-09-09 Marek Safar <marek.safar@seznam.cz>
13179 * expression.cs (Argument.Resolve): Added error CS0192 and
13182 2004-09-09 Marek Safar <marek.safar@seznam.cz>
13184 C# 2.0 #pragma warning feature
13186 * cs-tokenizer.cs (PreProcessPragma): New method;
13187 Handles #pragma directive.
13189 * report.cs (WarningRegions): New class; Support
13190 class for #pragma warning directive. It tests whether
13191 warning is enabled for a given line.
13193 2004-09-08 Miguel de Icaza <miguel@ximian.com>
13195 * const.cs: Add more descriptive error report, tahnks to
13198 2004-09-08 Marek Safar <marek.safar@seznam.cz>
13200 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
13202 2004-09-07 Miguel de Icaza <miguel@ximian.com>
13204 * expression.cs: Apply patch from Ben: Remove dead code from
13205 ArrayCreation, and remove the TurnintoConstant call in const.cs,
13206 as that code just threw an exception anwyays.
13208 * const.cs: Remove the call to the turnintoconstant, for details
13211 * literal.cs: The type of the null-literal is the null type; So
13212 we use a placeholder type (literal.cs:System.Null, defined here)
13215 * expression.cs (Conditional.DoResolve): Remove some old code that
13216 is no longer needed, conversions have been fixed.
13218 (ArrayCreationExpression.DoResolve): Return false if we fail to
13219 resolve the inner expression.
13221 2004-09-07 Raja R Harinath <rharinath@novell.com>
13224 * cs-parser.jay (delegate_declaration): Record a delegate
13225 declaration as a type declaration.
13226 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
13228 2004-09-06 Miguel de Icaza <miguel@ximian.com>
13230 * parameter.cs: Do not crash if the type can not be resolved.
13232 * expression.cs: Report errors with unsafe pointers, fixes #64896
13234 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
13236 * expression.cs: Pointer arith always needs to do a conv.i
13237 if the operand is a long. fix 65320
13239 2004-09-04 Marek Safar <marek.safar@seznam.cz>
13241 Fixed cs0619-37.cs, cs0619-38.cs
13243 * enum.cs (GetObsoleteAttribute): Removed.
13245 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
13246 on Enum member is double staged. The first is tested member
13249 2004-09-04 Marek Safar <marek.safar@seznam.cz>
13251 Fixed #56986, #63631, #65231
13253 * class.cs: (TypeContainer.AddToMemberContainer): New method,
13254 adds member to name container.
13255 (TypeContainer.AddToTypeContainer): New method, adds type to
13257 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
13258 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
13259 AddOperator): Simplified by reusing AddToMemberContainer.
13260 (TypeContainer.UserDefinedStaticConstructor): Changed to property
13262 (Method.CheckForDuplications): Fixed implementation to test all
13264 (MemberBase): Detection whether member is explicit interface
13265 implementation is now in constructor.
13266 (MemberBase.UpdateMemberName): Handles IndexerName.
13267 (Accessor): Changed to keep also location information.
13268 (AbstractPropertyEventMethod): Is derived from MemberCore.
13269 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
13270 will be emited or not.
13271 (PropertyBase.AreAccessorsDuplicateImplementation):
13272 Tests whether accessors are not in collision with some method.
13273 (Operator): Is derived from MethodCore to simplify common
13276 * decl.cs (Flags.TestMethodDuplication): Test for duplication
13278 (DeclSpace.AddToContainer): Adds the member to defined_names
13279 table. It tests for duplications and enclosing name conflicts.
13281 * enum.cs (EnumMember): Clean up to reuse the base structures
13283 2004-09-03 Martin Baulig <martin@ximian.com>
13285 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
13286 into TypeContainer, to make partial classes work again.
13288 2004-09-03 Martin Baulig <martin@ximian.com>
13290 * rootcontext.cs (RootContext.V2): Removed.
13292 2004-03-23 Martin Baulig <martin@ximian.com>
13294 * expression.cs (Invocation.OverloadResolve): Added `bool
13295 may_fail' argument and use it instead of the Location.IsNull() hack.
13297 2004-09-03 Martin Baulig <martin@ximian.com>
13299 Merged latest changes into gmcs. Please keep this comment in
13300 here, it makes it easier for me to see what changed in MCS since
13301 the last time I merged.
13303 2004-09-03 Raja R Harinath <rharinath@novell.com>
13306 * expression.cs (BetterConversion): Don't allow either conversion
13307 to be null. Remove redundant implicit conversion test when 'q ==
13308 null' -- when this function is invoked, we already know that the
13309 implicit conversion exists.
13310 (BetterFunction): Assume that 'best' is non-null. Remove
13311 redundant reimplementation of IsApplicable when 'best' is null.
13312 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
13313 number of arguments.
13314 (IsAncestralType): Extract from OverloadResolve.
13315 (OverloadResolve): Make robust to the MethodGroupExpr being
13316 unsorted. Implement all the logic of Section 14.5.5.1, and
13317 support overloading of methods from multiple applicable types.
13318 Clean up logic somewhat. Don't pass null methods to BetterFunction.
13320 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
13321 (RealError, Warning): Append type of report to related symbol.
13323 2004-09-03 Marek Safar <marek.safar@seznam.cz>
13325 * enum.cs: Fixed CLS-Compliance checks for enum members.
13326 Error tests cs3008-8.cs, cs3014-8.cs
13328 2004-09-02 Marek Safar <marek.safar@seznam.cz>
13330 Fixed bug #62342, #63102
13331 * class.cs: ImplementIndexer uses member.IsExplicitImpl
13332 like ImplementMethod.
13334 2004-09-02 Marek Safar <marek.safar@seznam.cz>
13336 * attribute.cs (Attribute.GetAttributeArgumentExpression):
13339 2004-09-02 Martin Baulig <martin@ximian.com>
13341 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
13342 TypeManager.GetArgumentTypes() rather than calling GetParameters()
13345 2004-09-01 Marek Safar <marek.safar@seznam.cz>
13347 C# 2.0 Static classes implemented
13349 * class.cs (TypeContainer): instance_constructors,
13350 initialized_fields, initialized_static_fields,
13351 default_constructor, base_inteface_types are protected to be
13352 accessible from StaticClass.
13353 (TypeContainer.DefineDefaultConstructor): New virtual method
13354 for custom default constructor generating
13355 (StaticClass): New class to handle "Static classes" feature.
13357 * cs-parser.jay: Handle static keyword on class like instance
13360 * driver.cs: Added "/langversion" command line switch with two
13361 options (iso-1, default).
13363 2004-08-31 Marek Safar <marek.safar@seznam.cz>
13365 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
13367 2004-08-31 Miguel de Icaza <miguel@ximian.com>
13369 * delegate.cs: Style.
13371 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
13373 * delegate.cs: Add seperate instance expr field for miguel.
13375 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
13377 * PointerArithmetic (Resolve): make sure we are not doing
13378 pointer arith on void*. Also, make sure we are resolved
13379 by not setting eclass until resolve.
13381 All callers: Make sure that PointerArithmetic gets resolved.
13383 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
13385 * ArrayCreation (LookupType): If the type does not resolve
13386 to an array, give an error.
13388 2004-08-27 Marek Safar <marek.safar@seznam.cz>
13390 * statement.cs (Try.Resolve): Fixed bug #64222
13392 2004-08-27 Martin Baulig <martin@ximian.com>
13395 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
13398 2004-08-26 Marek Safar <marek.safar@seznam.cz>
13400 * ecore.cs (Constantify): Get underlying type via
13401 System.Enum.GetUnderlyingType to avoid StackOverflow on the
13402 Windows in special cases.
13404 2004-08-26 Marek Safar <marek.safar@seznam.cz>
13406 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
13407 for obtaining also private methods.
13408 (GetRemoveMethod): Used GetRemoveMethod (true)
13409 for obtaining also private methods.
13411 2004-08-24 Martin Baulig <martin@ximian.com>
13413 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
13414 MethodAttributes.HideBySig for operators.
13416 2004-08-23 Martin Baulig <martin@ximian.com>
13418 Back to the old error reporting system :-)
13420 * report.cs (Message): Removed.
13421 (Report.MessageData, ErrorData, WarningData): Removed.
13422 (Report.Error, Warning): Back to the old system.
13424 2004-08-23 Martin Baulig <martin@ximian.com>
13426 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
13428 * class.cs (TypeContainer.ParentContainer): New public virtual
13429 method; replaces the explicit interface implementation.
13430 (ClassPart.ParentContainer): Override.
13432 2004-08-23 Martin Baulig <martin@ximian.com>
13434 * statement.cs (Switch): Added support for constant switches; see
13435 #59428 or test-285.cs.
13437 2004-08-22 Marek Safar <marek.safar@seznam.cz>
13440 * statement.cs (GetEnumeratorFilter): Removed useless
13441 logic because C# specs is strict. GetEnumerator must be
13444 2004-08-22 Martin Baulig <martin@ximian.com>
13446 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
13447 a switch and may break, reset the barrier. Fixes #59867.
13449 2004-08-22 Marek Safar <marek.safar@seznam.cz>
13451 CLS-Compliance speed up (~5% for corlib)
13453 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
13454 New method. Tests container for CLS-Compliant names
13456 * class.cs (TypeContainer.VerifyClsName): New method.
13457 Checks whether container name is CLS Compliant.
13458 (Constructor): Implements IMethodData.
13460 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
13461 low-case table for CLS Compliance test.
13462 (MemberCache.VerifyClsParameterConflict): New method.
13463 Checks method parameters for CS3006 error.
13465 * enum.cs (EnumMember): Is derived from MemberCore.
13466 (Enum.VerifyClsName): Optimized for better performance.
13468 2004-08-06 Marek Safar <marek.safar@seznam.cz>
13470 * report.cs: Renamed Error_T to Error and changed all
13473 2004-08-06 Marek Safar <marek.safar@seznam.cz>
13475 * class.cs (TypeContainer.IndexerArrayList): New inner class
13476 container for indexers.
13477 (TypeContainer.DefaultIndexerName): New constant for default
13478 indexer name. Replaced all "Item" with this constant.
13479 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
13481 * typemanager.cs (TypeManager.default_member_ctor): Cache here
13482 DefaultMemberAttribute constructor.
13484 2004-08-05 Martin Baulig <martin@ximian.com>
13486 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
13489 2004-08-05 Marek Safar <marek.safar@seznam.cz>
13491 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
13492 multi platforms problem.
13494 * compiler.csproj: Included shared files.
13496 2004-08-04 Marek Safar <marek.safar@seznam.cz>
13498 Fix bug 60333, 55971 in the more general way
13499 * attribute.cs (Attribute.GetAttributeArgumentExpression):
13500 Added arg_type argument for constant conversion.
13501 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
13503 2004-08-04 Marek Safar <marek.safar@seznam.cz>
13506 * class.cs (TypeContainer ): New inner classes MethodArrayList,
13507 OperatorArrayList, MethodCoreArrayList for typecontainer
13508 containers. Changed class member types to these new types.
13509 (MethodArrayList.DefineMembers): Added test for CS0659.
13511 2004-08-04 Miguel de Icaza <miguel@ximian.com>
13513 * cfold.cs: Synchronize the folding with the code in expression.cs
13514 Binary.DoNumericPromotions for uint operands.
13516 * attribute.cs: Revert patch from Raja, it introduced a regression
13517 while building Blam-1.2.1 (hard to isolate a test case).
13519 2004-08-04 Marek Safar <marek.safar@seznam.cz>
13523 (TypeContainer.Define): Renamed to DefineContainerMembers because of
13525 (MethodCore.parent_method): New member. The method we're overriding
13526 if this is an override method.
13527 (MethodCore.CheckBase): Moved from Method class and made common.
13528 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
13530 (MethodCore.CheckForDuplications): New abstract method. For custom
13531 member duplication search in a container
13532 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
13533 method and its return type.
13534 (Event.conflict_symbol): New member. Symbol with same name in the
13538 (MemberCache.FindMemberWithSameName): New method. The method
13539 is looking for conflict with inherited symbols.
13541 2004-08-04 Martin Baulig <martin@ximian.com>
13543 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
13545 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
13547 2004-08-03 Marek Safar <marek.safar@seznam.cz>
13549 * report.cs (Message): New enum for better error, warning reference in
13551 (MessageData): New inner abstract class. It generally handles printing of
13552 error and warning messages.
13553 Removed unused Error, Warning, Message methods.
13555 2004-08-03 Marek Safar <marek.safar@seznam.cz>
13557 Fix for cs0592-8.cs test
13559 (Attributable.ValidAttributeTargets): Made public.
13560 (Attribute.ExplicitTarget): New member for explicit target value.
13561 (Attribute.CheckTargets): Now we translate explicit attribute
13562 target to Target here.
13564 2004-08-03 Ben Maurer <bmaurer@ximian.com>
13566 * ecore.cs (MethodGroupExpr): new IsBase property.
13568 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
13570 * delegate.cs (DelegateCreation): store a MethodGroupExpr
13571 rather than an instance expr.
13573 (DelegateCreation.Emit): Use the method group rather than
13574 the instance expression. Also, if you have base.Foo as the
13575 method for a delegate, make sure to emit ldftn, not ldftnvirt.
13577 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
13579 (NewDelegate.DoResolve): Only check for the existance of Invoke
13580 if the method is going to be needed. Use MethodGroupExpr.
13582 (NewDelegate.Emit): Remove, DelegateCreation implements this.
13584 * expression.cs: For pointer arith., make sure to use
13585 the size of the type, not the size of the pointer to
13588 2004-08-03 Marek Safar <marek.safar@seznam.cz>
13591 * class.cs (Class): Added error CS0502 test.
13593 2004-08-03 John Luke <jluke@cfl.rr.com>
13594 Raja R Harinath <rharinath@novell.com>
13597 * attribute.cs (Attribute.complained_before): New flag.
13598 (Attribute.ResolveType, Attribute.Resolve),
13599 (Attribute.DefinePInvokeMethod): Set it.
13600 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
13602 2004-08-03 Martin Baulig <martin@ximian.com>
13604 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
13605 use a user-defined operator; we still need to do numeric
13606 promotions in case one argument is a builtin type and the other
13607 one has an implicit conversion to that type. Fixes #62322.
13609 2004-08-02 Martin Baulig <martin@ximian.com>
13611 * statement.cs (LocalInfo.Flags): Added `IsThis'.
13612 (LocalInfo.IsThis): New public property.
13613 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
13615 2004-08-01 Martin Baulig <martin@ximian.com>
13617 * class.cs (TypeContainer.GetClassBases): Don't set the default
13618 here since we may get called from GetPartialBases().
13619 (TypeContainer.DefineType): If GetClassBases() didn't return a
13620 parent, use the default one.
13622 2004-07-30 Duncan Mak <duncan@ximian.com>
13624 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
13626 2004-07-30 Martin Baulig <martin@ximian.com>
13628 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
13630 * class.cs (SourceMethod): New public class, derive from the
13631 symbol writer's ISourceMethod.
13632 (Method): Use the new symbol writer API.
13634 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
13635 as argument and use the new symbol writer.
13638 (SourceFile): Implement the symbol writer's ISourceFile.
13639 (Location.SymbolDocument): Removed.
13640 (Location.SourceFile): New public property.
13642 * symbolwriter.cs: Use the new symbol writer API.
13644 2004-07-30 Raja R Harinath <rharinath@novell.com>
13646 * Makefile (install-local): Remove. Functionality moved to
13649 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
13651 * Makefile: Install mcs.exe.config file together with mcs.exe.
13652 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
13653 correct runtime version.
13655 2004-07-25 Martin Baulig <martin@ximian.com>
13658 (TypeContainer.RegisterOrder): Removed, this was unused.
13659 (TypeContainer, interface_order): Removed.
13660 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
13661 TypeContainer as argument since we can also be called with a
13662 `PartialContainer' for a partial class/struct/interface.
13663 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
13664 of checking whether we're an `Interface' - we could be a
13665 `PartialContainer'.
13666 (PartialContainer.Register): Override; call
13667 AddClass()/AddStruct()/AddInterface() on our parent.
13669 * cs-parser.jay (interface_member_declaration): Add things to the
13670 `current_container', not the `current_class'.
13672 * rootcontext.cs (RegisterOrder): The overloaded version which
13673 takes an `Interface' was unused, removed.
13675 * typemanager.cs (TypeManager.LookupInterface): Return a
13676 `TypeContainer', not an `Interface'.
13677 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
13678 contain a `PartialContainer' for an interface, so check it's
13679 `Kind' to figure out what it is.
13681 2004-07-25 Martin Baulig <martin@ximian.com>
13683 * class.cs (Class.DefaultTypeAttributes): New public constant.
13684 (Struct.DefaultTypeAttributes): Likewise.
13685 (Interface.DefaultTypeAttributes): Likewise.
13686 (PartialContainer.TypeAttr): Override this and add the
13687 DefaultTypeAttributes.
13689 2004-07-25 Martin Baulig <martin@ximian.com>
13691 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
13692 we can just use the `Parent' field instead.
13694 2004-07-25 Martin Baulig <martin@ximian.com>
13696 * class.cs (TypeContainer.Emit): Renamed to EmitType().
13698 2004-07-25 Martin Baulig <martin@ximian.com>
13700 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
13701 our parts before defining any methods.
13702 (TypeContainer.VerifyImplements): Make this virtual.
13703 (ClassPart.VerifyImplements): Override and call VerifyImplements()
13704 on our PartialContainer.
13706 2004-07-25 Martin Baulig <martin@ximian.com>
13708 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
13710 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
13711 argument, we can just use the `Parent' field instead.
13714 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
13715 (MemberBase.DoDefine): Likewise.
13717 2004-07-24 Martin Baulig <martin@ximian.com>
13719 * decl.cs (MemberCore.Parent): New public field.
13720 (DeclSpace.Parent): Moved to MemberCore.
13722 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
13723 (MemberBase.ctor): Added TypeContainer argument, pass it to our
13725 (FieldBase, Field, Operator): Likewise.
13726 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
13727 (EventField, Event): Likewise.
13729 2004-07-23 Martin Baulig <martin@ximian.com>
13731 * class.cs (PartialContainer): New public class.
13732 (ClassPart): New public class.
13733 (TypeContainer): Added support for partial classes.
13734 (TypeContainer.GetClassBases): Splitted some of the functionality
13735 out into GetNormalBases() and GetPartialBases().
13737 * cs-tokenizer.cs (Token.PARTIAL): New token.
13738 (Tokenizer.consume_identifier): Added some hacks to recognize
13739 `partial', but only if it's immediately followed by `class',
13740 `struct' or `interface'.
13742 * cs-parser.jay: Added support for partial clases.
13744 2004-07-23 Martin Baulig <martin@ximian.com>
13746 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
13747 a `DeclSpace' and also made it readonly.
13748 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
13749 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
13750 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
13752 * cs-parser.jay: Pass the `current_class', not the
13753 `current_container' (at the moment, this is still the same thing)
13754 to a new Method, Property, Event, Indexer or Constructor.
13756 2004-07-23 Martin Baulig <martin@ximian.com>
13758 * cs-parser.jay (CSharpParser): Added a new `current_class' field
13759 and removed the `current_interface' one.
13760 (struct_declaration, class_declaration, interface_declaration):
13761 Set `current_class' to the newly created class/struct/interface;
13762 set their `Bases' and call Register() before parsing their body.
13764 2004-07-23 Martin Baulig <martin@ximian.com>
13766 * class.cs (Kind): New public enum.
13767 (TypeContainer): Made this class abstract.
13768 (TypeContainer.Kind): New public readonly field.
13769 (TypeContainer.CheckDef): New public method; moved here from
13771 (TypeContainer.Register): New public abstract method.
13772 (TypeContainer.GetPendingImplementations): New public abstract
13774 (TypeContainer.GetClassBases): Removed the `is_class' and
13775 `is_iface' parameters.
13776 (TypeContainer.DefineNestedTypes): Formerly known as
13778 (ClassOrStruct): Made this class abstract.
13780 * tree.cs (RootTypes): New public type.
13782 2004-07-20 Martin Baulig <martin@ximian.com>
13784 * tree.cs (Tree.RecordNamespace): Removed.
13785 (Tree.Namespaces): Removed.
13787 * rootcontext.cs (RootContext.IsNamespace): Removed.
13789 * cs-parser.jay (namespace_declaration): Just create a new
13790 NamespaceEntry here.
13792 2004-07-20 Martin Baulig <martin@ximian.com>
13794 * statement.cs (ExceptionStatement): New abstract class. This is
13795 now used as a base class for everyone who's using `finally'.
13796 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
13797 our local variables before using them.
13799 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
13800 virtual method. This is used by Yield.Resolve() to "steal" an
13801 outer block's `finally' clauses.
13802 (FlowBranchingException): The .ctor now takes an ExceptionStatement
13805 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
13806 version which takes an ExceptionStatement. This version must be
13807 used to create exception branchings.
13810 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
13811 (Iterator.EmitMoveNext): Added exception support; protect the
13812 block with a `fault' clause, properly handle 'finally' clauses.
13813 (Iterator.EmitDispose): Run all the `finally' clauses here.
13815 2004-07-20 Martin Baulig <martin@ximian.com>
13817 * iterator.cs: This is the first of a set of changes in the
13818 iterator code. Match the spec more closely: if we're an
13819 IEnumerable, then GetEnumerator() must be called. The first time
13820 GetEnumerator() is called, it returns the current instance; all
13821 subsequent invocations (if any) must create a copy.
13823 2004-07-19 Miguel de Icaza <miguel@ximian.com>
13825 * expression.cs: Resolve the constant expression before returning
13828 2004-07-19 Martin Baulig <martin@ximian.com>
13830 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
13831 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
13832 the return type of the new EmitContext.
13834 2004-07-18 Martin Baulig <martin@ximian.com>
13836 * class.cs (Property.Define): Fix iterators.
13838 * iterators.cs (Iterator.Define): Moved the
13839 `container.AddInterator (this)' call here from the .ctor; only do
13840 it if we resolved successfully.
13842 2004-07-17 Miguel de Icaza <miguel@ximian.com>
13844 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
13845 `true' for preprocessing directives that we parse. The return
13846 value indicates whether we should return to regular tokenizing or
13847 not, not whether it was parsed successfully.
13849 In the past if we were in: #if false ... #line #endif, we would
13850 resume parsing after `#line'. See bug 61604.
13852 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
13853 building: IsEnumType should return true only for enums, not for
13854 enums or System.Enum itself. This fixes #61593.
13856 Likely what happened is that corlib was wrong: mcs depended on
13857 this bug in some places. The bug got fixed, we had to add the
13858 hack, which caused bug 61593.
13860 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
13861 that was a workaround for the older conditions.
13863 2004-07-16 Ben Maurer <bmaurer@ximian.com>
13865 * assign.cs: IAssignMethod has a new interface, as documented
13866 inline. All assignment code now uses this new api.
13868 * ecore.cs, expression.cs: All classes which implement
13869 IAssignMethod now use the new interface.
13871 * expression.cs (Invocation): add a hack to EmitCall so that
13872 IndexerAccess can be the target of a compound assignment without
13873 evaluating its arguments twice.
13875 * statement.cs: Handle changes in Invocation api.
13877 2004-07-16 Martin Baulig <martin@ximian.com>
13879 * iterators.cs: Rewrote this. We're now using one single Proxy
13880 class for both the IEnumerable and the IEnumerator interface and
13881 `Iterator' derives from Class so we can use the high-level API.
13883 * class.cs (TypeContainer.AddIterator): New method.
13884 (TypeContainer.DoDefineType): New protected virtual method, which
13885 is called from DefineType().
13886 (TypeContainer.DoDefineMembers): Call DefineType() and
13887 DefineMembers() on all our iterators.
13888 (TypeContainer.Emit): Call Emit() on all our iterators.
13889 (TypeContainer.CloseType): Call CloseType() on all our iterators.
13891 * codegen.cs (EmitContext.CurrentIterator): New public field.
13893 2004-07-15 Martin Baulig <martin@ximian.com>
13896 (TypeManager.not_supported_exception_type): New type.
13898 2004-07-14 Martin Baulig <martin@ximian.com>
13900 * iterators.cs: Use real error numbers.
13902 2004-07-14 Martin Baulig <martin@ximian.com>
13904 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
13905 requires this to be a System.Collection.IEnumerable and not a
13906 class implementing that interface.
13907 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
13909 2004-07-13 Marek Safar <marek.safar@seznam.cz>
13911 * class.cs: Fixed previous fix, it broke some error tests.
13913 2004-07-12 Martin Baulig <martin@ximian.com>
13915 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
13918 2004-07-09 Miguel de Icaza <miguel@ximian.com>
13920 * assign.cs (LocalTemporary): Add new argument: is_address,If
13921 `is_address' is true, then the value that we store is the address
13922 to the real value, and not the value itself.
13924 * ecore.cs (PropertyExpr): use the new local temporary
13925 stuff to allow us to handle X.Y += z (where X is a struct)
13927 2004-07-08 Martin Baulig <martin@ximian.com>
13929 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
13930 not always return, just like we're doing in Using.Resolve().
13932 2004-07-07 Miguel de Icaza <miguel@ximian.com>
13934 * cs-parser.jay (fixed_statement): flag this as Pinned.
13936 2004-07-06 Miguel de Icaza <miguel@ximian.com>
13938 * typemanager.cs (TypeManager): Removed MakePinned method, this
13939 mechanism is replaced with the .NET 2.x compatible mechanism of
13940 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
13942 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
13943 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
13944 `IsFixed' property which has a different meaning.
13946 2004-07-02 Raja R Harinath <rharinath@novell.com>
13948 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
13949 visible from inside a nested class, not just the names of the
13950 immediately enclosing class.
13951 Fix for bug #60730.
13953 2004-06-24 Raja R Harinath <rharinath@novell.com>
13955 * expression.cs (BetterConversion): Remove buggy special-case
13956 handling of "implicit constant expression conversions". At this
13957 point, we already know that the conversion is possible -- we're
13958 only checking to see which is better.
13960 2004-06-24 Marek Safar <marek.safar@seznam.cz>
13962 * cs-parser.jay: Added error CS0210 test.
13964 2004-06-24 Marek Safar <marek.safar@seznam.cz>
13966 * cs-parser.jay: Added error CS0134 test.
13968 2004-06-24 Marek Safar <marek.safar@seznam.cz>
13971 * cs-parser.jay: Added error CS0145 test.
13973 2004-06-24 Marek Safar <marek.safar@seznam.cz>
13975 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
13977 2004-06-23 Ben Maurer <bmaurer@ximian.com>
13979 * expression.cs (StackAlloc.Resolve): The argument may not
13980 be a constant; deal with this case.
13982 2004-06-23 Marek Safar <marek.safar@seznam.cz>
13984 * attribute.cs (IndexerName_GetIndexerName): Renamed to
13985 GetIndexerAttributeValue.
13986 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
13988 * class.cs (Indexer.Define): Added error tests for CS0415,
13991 2004-06-23 Miguel de Icaza <miguel@ximian.com>
13993 * attribute.cs (Attribute.Resolve): Keep field code in sync with
13996 2004-06-23 Martin Baulig <martin@ximian.com>
13998 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
13999 neither return nor throw, reset the barrier as well. Fixes #60457.
14001 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
14003 * class.cs : EventAttributes is now set to None by default.
14004 This fixes bug #60459.
14006 2004-06-18 Marek Safar <marek.safar@seznam.cz>
14009 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
14010 Don't throw exception but return null (it's sufficient now).
14012 2004-06-18 Marek Safar <marek.safar@seznam.cz>
14014 * typemanager.cs (GetArgumentTypes): Faster implementation.
14016 2004-06-18 Martin Baulig <martin@ximian.com>
14018 * attribute.cs (Attribute.Resolve): Check whether we're an
14019 EmptyCast which a Constant child. Fixes #60333.
14021 2004-06-17 Ben Maurer <bmaurer@ximian.com>
14023 * statement.cs (EmitCollectionForeach): Account for the fact that
14024 not all valuetypes are in areas which we can take the address of.
14025 For these variables, we store to a temporary variable. Also, make
14026 sure that we dont emit a `callvirt' on a valuetype method.
14028 2004-06-15 Marek Safar <marek.safar@seznam.cz>
14030 * expression.cs (StackAlloc.DoReSolve): Added test for
14031 negative parameter (CS0247).
14033 2004-06-15 Marek Safar <marek.safar@seznam.cz>
14036 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
14038 2004-06-15 Marek Safar <marek.safar@seznam.cz>
14041 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
14044 2004-06-14 Marek Safar <marek.safar@seznam.cz>
14046 Fix bug #58254 & cs1555.cs, cs1556.cs
14047 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
14049 2004-06-14 Marek Safar <marek.safar@seznam.cz>
14051 * cs-parser.jay: Added error CS1669 test for indexers.
14053 2004-06-11 Martin Baulig <martin@ximian.com>
14055 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
14056 call this twice: for params and varargs methods.
14058 2004-06-11 Marek Safar <marek.safar@seznam.cz>
14061 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
14063 2004-06-11 Marek Safar <marek.safar@seznam.cz>
14065 * attribute.cs (Attribute.GetValidTargets): Made public.
14068 (AbstractPropertyEventMethod): New class for better code sharing.
14069 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
14071 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
14073 2004-06-11 Raja R Harinath <rharinath@novell.com>
14076 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
14077 that the call to Resolve is part of a MemberAccess.
14078 (Expression.Resolve): Use it for SimpleName resolution.
14079 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
14080 Add 'intermediate' boolean argument.
14081 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
14082 error message when the SimpleName can be resolved ambiguously
14083 between an expression and a type.
14084 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
14086 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
14087 call on the left-side.
14089 2004-06-11 Marek Safar <marek.safar@seznam.cz>
14092 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
14094 2004-06-11 Marek Safar <marek.safar@seznam.cz>
14096 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
14098 2004-06-11 Martin Baulig <martin@ximian.com>
14100 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
14101 varargs methods if applicable.
14103 2004-06-11 Martin Baulig <martin@ximian.com>
14105 * expression.cs (Invocation.EmitCall): Don't use
14106 `method.CallingConvention == CallingConventions.VarArgs' since the
14107 method could also have `CallingConventions.HasThis'.
14109 2004-06-11 Marek Safar <marek.safar@seznam.cz>
14111 * class.cs (Event.GetSignatureForError): Implemented.
14112 Fixed crash in error test cs3010.cs
14114 2004-06-10 Miguel de Icaza <miguel@ximian.com>
14116 * cs-tokenizer.cs: Change the way we track __arglist to be
14117 consistent with the other keywords.
14119 2004-06-09 Miguel de Icaza <miguel@ximian.com>
14121 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
14124 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
14126 * codegen.cs: Check that all referenced assemblies have a strongname
14127 before strongnaming the compiled assembly. If not report error CS1577.
14128 Fix bug #56563. Patch by Jackson Harper.
14129 * typemanager.cs: Added a method to return all referenced assemblies.
14130 Fix bug #56563. Patch by Jackson Harper.
14132 2004-06-08 Marek Safar <marek.safar@seznam.cz>
14135 (Method.ApplyAttributeBuilder): Moved and added conditional
14136 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
14139 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
14141 2004-06-08 Marek Safar <marek.safar@seznam.cz>
14144 * class.cs: (EventField.attribute_targets): Changed default target.
14146 2004-06-08 Martin Baulig <martin@ximian.com>
14148 * expression.cs (Invocation.EmitCall): Enable varargs methods.
14150 2004-06-08 Martin Baulig <martin@ximian.com>
14152 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
14154 2004-06-07 Martin Baulig <martin@ximian.com>
14156 Added support for varargs methods.
14158 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
14161 * cs-parser.jay: Added support for `__arglist'.
14163 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
14165 * expression.cs (Argument.AType): Added `ArgList'.
14166 (Invocation): Added support for varargs methods.
14167 (ArglistAccess): New public class.
14168 (Arglist): New public class.
14170 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
14172 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
14173 a method's top-level block if the method has varargs.
14175 * support.cs (ReflectionParameters, InternalParameters): Added
14176 support for varargs methods.
14178 2004-06-07 Miguel de Icaza <miguel@ximian.com>
14180 * class.cs: Provide location in indexer error report.
14182 * driver.cs: Use standard names.
14184 * namespace.cs: Catch the use of using after a namespace has been
14185 declared also on using aliases.
14187 2004-06-03 Raja R Harinath <rharinath@novell.com>
14190 * typemanager.cs (closure_private_ok, closure_invocation_type)
14191 (closure_qualifier_type, closure_invocation_assembly)
14192 (FilterWithClosure): Move to ...
14193 (Closure): New internal nested class.
14194 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
14195 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
14196 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
14197 (MemberLookup, MemberLookupFailed): Use it.
14198 * expression.cs (New.DoResolve): Treat the lookup for the
14199 constructor as being qualified by the 'new'ed type.
14200 (Indexers.GetIndexersForTypeOrInterface): Update.
14202 2004-06-03 Marek Safar <marek.safar@seznam.cz>
14205 (GetConditionalAttributeValue): New method. Returns
14206 condition of ConditionalAttribute.
14207 (SearchMulti): New method. Returns all attributes of type 't'.
14208 Use it when attribute is AllowMultiple = true.
14209 (IsConditionalMethodExcluded): New method.
14212 (Method.IsExcluded): Implemented. Returns true if method has conditional
14213 attribute and the conditions is not defined (method is excluded).
14214 (IMethodData): Extended interface for ConditionalAttribute support.
14215 (PropertyMethod.IsExcluded): Implemented.
14218 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
14221 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
14224 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
14226 * expression.cs (ArrayCreationExpression): Make this just an
14227 `expression'. It can't be a statement, so the code here was
14230 2004-06-02 Marek Safar <marek.safar@seznam.cz>
14233 * typemanager.cs (GetFullNameSignature): New method for
14236 2004-06-02 Marek Safar <marek.safar@seznam.cz>
14239 * class.cs (MemberBase.GetSignatureForError): New virtual method.
14240 Use this method when MethodBuilder is null.
14241 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
14242 Added test for error CS0626 (MONO reports error for this situation).
14243 (IMethodData.GetSignatureForError): Extended interface.
14245 2004-06-01 Marek Safar <marek.safar@seznam.cz>
14248 (AttributeTester.GetObsoleteAttribute): Returns instance of
14249 ObsoleteAttribute when type is obsolete.
14252 (TypeContainer.VerifyObsoleteAttribute): Override.
14253 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
14254 (MethodCode.VerifyObsoleteAttribute): Override.
14255 (MemberBase.VerifyObsoleteAttribute): Override.
14258 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
14259 and report proper error.
14262 Delegate.VerifyObsoleteAttribute): Override.
14265 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
14266 and report proper error.
14267 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
14270 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
14274 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
14275 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
14276 Added test for ObsoleteAttribute.
14279 (Catch): Derived from Statement.
14281 2004-06-01 Marek Safar <marek.safar@seznam.cz>
14283 Fixed bug #59071 & cs0160.cs
14285 * statement.cs (Try.Resolve): Check here whether order of catch
14286 clauses matches their dependencies.
14288 2004-05-31 Miguel de Icaza <miguel@ximian.com>
14290 * Reverted patch to namespace.cs (Use lookuptypedirect). This
14291 caused a regression: #59343. Referencing nested classes from an
14292 assembly stopped working.
14294 2004-05-31 Martin Baulig <martin@ximian.com>
14296 MCS is now frozen for beta 2.
14298 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
14300 * convert.cs: add a trivial cache for overload operator resolution.
14302 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
14304 * decl.cs: If possible, use lookuptypedirect here. We can only do
14305 this if there is no `.' after the namespace. Avoids using
14306 LookupType, which does lots of slow processing.
14307 (FindNestedType) New method, does what it says :-).
14308 * namespace.cs: use LookupTypeDirect.
14309 * rootcontext.cs: use membercache, if possible.
14310 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
14312 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
14315 According to the spec,
14317 In a member access of the form E.I, if E is a single identifier,
14318 and if the meaning of E as a simple-name (§7.5.2) is a constant,
14319 field, property, localvariable, or parameter with the same type as
14320 the meaning of E as a type-name (§3.8), then both possible
14321 meanings of E are permitted.
14323 We did not check that E as a simple-name had the same type as E as
14326 This trivial check gives us 5-7% on bootstrap time.
14328 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
14330 * expression.cs (Invocation.OverloadResolve): Avoid the
14331 use of hashtables and boxing here by allocating on demand.
14333 2004-05-30 Martin Baulig <martin@ximian.com>
14335 * rootcontext.cs (RootContext.LookupType): Don't cache things if
14336 we're doing a silent lookup. Don't try to lookup nested types in
14337 TypeManager.object_type (thanks to Ben Maurer).
14339 2004-05-30 Martin Baulig <martin@ximian.com>
14341 Committing a patch from Ben Maurer.
14343 * rootcontext.cs (RootContext.LookupType): Cache negative results.
14345 2004-05-29 Martin Baulig <martin@ximian.com>
14347 * class.cs (IMethodData.ShouldIgnore): New method.
14349 * typemanager.cs (TypeManager.MethodFlags): Don't take a
14350 `Location' argument, we don't need it anywhere. Use
14351 `IMethodData.ShouldIgnore ()' instead of
14352 `MethodData.GetMethodFlags ()'.
14353 (TypeManager.AddMethod): Removed.
14354 (TypeManager.AddMethod2): Renamed to AddMethod.
14356 2004-05-29 Martin Baulig <martin@ximian.com>
14358 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
14360 * convert.cs (Convert.ImplicitReferenceConversion): If we're
14361 converting from a class type S to an interface type and we already
14362 have an object on the stack, don't box it again. Fixes #52578.
14364 2004-05-29 Martin Baulig <martin@ximian.com>
14366 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
14367 Added support for `params' parameters. Fixes #59267.
14369 2004-05-29 Martin Baulig <martin@ximian.com>
14371 * literal.cs (NullPointer): Provide a private .ctor which sets
14372 `type' to TypeManager.object_type. Fixes #59048.
14374 2004-05-29 Martin Baulig <martin@ximian.com>
14376 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
14377 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
14379 * ecore.cs (EventExpr.instance_expr): Make the field private.
14381 2004-05-26 Marek Safar <marek.safar@seznam.cz>
14383 Fixed bug #50080 & cs0214-2.cs
14384 * expression.cs (Cast.DoResolve): Check unsafe context here.
14386 * statement.cs (Resolve.DoResolve): Likewise.
14388 2004-05-26 Martin Baulig <martin@ximian.com>
14390 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
14392 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
14393 (RootContext.LookupType): Pass down the `silent' flag.
14395 2004-05-25 Martin Baulig <martin@ximian.com>
14398 (MethodGroupExpr.IdenticalTypeName): New public property.
14399 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
14400 expression actually refers to a type.
14402 2004-05-25 Martin Baulig <martin@ximian.com>
14404 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
14405 for #56176 and made it actually work.
14407 2004-05-25 Martin Baulig <martin@ximian.com>
14409 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
14410 (FieldExpr, PropertyExpr): Override and implement
14411 CacheTemporaries. Fixes #52279.
14413 2004-05-25 Miguel de Icaza <miguel@ximian.com>
14415 * location.cs: In the new compiler listing a file twice is a
14416 warning, not an error.
14418 2004-05-24 Martin Baulig <martin@ximian.com>
14420 * enum.cs (Enum.DefineType): For the `BaseType' to be a
14421 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
14423 2004-05-24 Martin Baulig <martin@ximian.com>
14425 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
14426 walking the `using' list. Fixes #53921.
14428 2004-05-24 Martin Baulig <martin@ximian.com>
14430 * const.cs (Const.LookupConstantValue): Added support for
14431 EmptyCast's; fixes #55251.
14433 2004-05-24 Martin Baulig <martin@ximian.com>
14435 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
14436 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
14437 which does the CS0135 check. The reason is that we first need to
14438 check whether the variable actually exists.
14440 2004-05-24 Martin Baulig <martin@ximian.com>
14442 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
14443 than RootContext.LookupType() to find the explicit interface
14444 type. Fixes #58584.
14446 2004-05-24 Raja R Harinath <rharinath@novell.com>
14448 * Makefile: Simplify. Use executable.make.
14449 * mcs.exe.sources: New file. List of sources of mcs.exe.
14451 2004-05-24 Anders Carlsson <andersca@gnome.org>
14455 Use the invariant culture when doing String.Compare for CLS case
14458 2004-05-23 Martin Baulig <martin@ximian.com>
14460 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
14461 don't have any dots. Fixes #52622, added cs0246-8.cs.
14463 * namespace.cs (NamespaceEntry.Lookup): Likewise.
14465 2004-05-23 Marek Safar <marek.safar@seznam.cz>
14467 * class.cs (MemberBase.Define): Reuse MemberType member for
14468 resolved type. Other methods can use it too.
14470 2004-05-23 Martin Baulig <martin@ximian.com>
14472 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
14473 the variable also exists in the current block (otherwise, we need
14474 to report a CS0103). Fixes #58670.
14476 2004-05-23 Martin Baulig <martin@ximian.com>
14478 * flowanalysis.cs (Reachability.Reachable): Compute this
14479 on-the-fly rather than storing it as a field.
14481 2004-05-23 Martin Baulig <martin@ximian.com>
14483 * flowanalysis.cs (Reachability.And): Manually compute the
14484 resulting `barrier' from the reachability.
14486 2004-05-23 Marek Safar <marek.safar@seznam.cz>
14489 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
14490 instance of ObsoleteAttribute when symbol is obsolete.
14493 (IMethodData): Extended interface for ObsoleteAttribute support.
14495 2004-05-22 Marek Safar <marek.safar@seznam.cz>
14497 * attribute.cs: Fix bug #55970
14499 2004-05-22 Marek Safar <marek.safar@seznam.cz>
14503 (GetObsoleteAttribute): New method. Creates the instance of
14505 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
14506 ObsoleteAttribute when member is obsolete.
14507 (AttributeTester.Report_ObsoleteMessage): Common method for
14508 Obsolete error/warning reporting.
14511 (TypeContainer.base_classs_type): New member for storing parent type.
14514 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
14515 for this MemberCore.
14517 2004-05-21 Marek Safar <marek.safar@seznam.cz>
14519 * attribute.cs, const.cs: Fix bug #58590
14521 2004-05-21 Martin Baulig <martin@ximian.com>
14523 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
14524 out parameters if the end of the method is unreachable. Fixes
14527 2004-05-21 Marek Safar <marek.safar@seznam.cz>
14529 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
14530 Hari was right, why extra method.
14532 2004-05-21 Marek Safar <marek.safar@seznam.cz>
14534 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
14536 2004-05-20 Martin Baulig <martin@ximian.com>
14538 Merged this back from gmcs to keep the differences to a minumum.
14540 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
14541 instead of a Declspace.
14542 (Attribute.ResolveType): Likewise.
14543 (Attributes.Search): Likewise.
14544 (Attributes.Contains): Likewise.
14545 (Attributes.GetClsCompliantAttribute): Likewise.
14547 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
14549 (MethodData.ApplyAttributes): Take an EmitContext instead of a
14552 2004-05-19 Marek Safar <marek.safar@seznam.cz>
14554 Fix bug #58688 (MCS does not report error when the same attribute
14557 * attribute.cs (Attribute.Emit): Distinction between null and default.
14559 2004-05-19 Raja R Harinath <rharinath@novell.com>
14561 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
14562 of a top-level attribute without an attribute target.
14563 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
14565 (Attribute.Conditional_GetConditionName),
14566 (Attribute.Obsolete_GetObsoleteMessage): Update.
14567 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
14568 part of ScanForIndexerName.
14569 (Attribute.CanIgnoreInvalidAttribute): New function.
14570 (Attribute.ScanForIndexerName): Move to ...
14571 (Attributes.ScanForIndexerName): ... here.
14572 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
14573 (Attributes.Search): New internal variant that can choose not to
14574 complain if types aren't resolved. The original signature now
14576 (Attributes.GetClsCompliantAttribute): Use internal variant, with
14577 complaints suppressed.
14578 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
14579 only if it not useful.
14580 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
14581 top-level for attributes that are shared between the assembly
14582 and a top-level class.
14583 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
14584 * class.cs: Update to reflect changes.
14585 (DefineIndexers): Fuse loops.
14586 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
14587 a couple more variants of attribute names.
14589 2004-05-18 Marek Safar <marek.safar@seznam.cz>
14591 Fix bug #52585 (Implemented explicit attribute declaration)
14594 (Attributable.ValidAttributeTargets): New abstract method. It gets
14595 list of valid attribute targets for explicit target declaration.
14596 (Attribute.Target): It holds target itself.
14597 (AttributeSection): Removed.
14598 (Attribute.CheckTargets): New method. It checks whether attribute
14599 target is valid for the current element.
14602 (EventProperty): New class. For events that are declared like
14603 property (with add and remove accessors).
14604 (EventField): New class. For events that are declared like field.
14607 * cs-parser.jay: Implemented explicit attribute target declaration.
14609 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
14610 Override ValidAttributeTargets.
14613 (ReturnParameter): Class for applying custom attributes on
14615 (ParameterAtribute): New class. Class for applying custom
14616 attributes on the parameter type.
14618 2004-05-17 Miguel de Icaza <miguel@ximian.com>
14620 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
14623 (Method): Allow UNSAFE here.
14625 * modifiers.cs: Support unsafe reporting.
14627 2004-05-17 Marek Safar <marek.safar@seznam.cz>
14629 * decl.cs: Fix bug #58478.
14631 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14633 * statement.cs: When checking for unreachable code on an EmptyStatement,
14634 set the location. Fixes bug #58488.
14636 2004-05-13 Miguel de Icaza <miguel@ximian.com>
14638 * driver.cs: Add -pkg handling.
14640 From Gonzalo: UseShelLExecute=false
14642 2004-05-12 Marek Safar <marek.safar@seznam.cz>
14645 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
14647 (Attribute.IsClsCompliaceRequired): Moved to base for better
14649 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
14650 when attribute is AttributeUsageAttribute.
14651 (Attribute.GetValidTargets): Simplified.
14652 (Attribute.GetAttributeUsage): New method returns AttributeUsage
14653 attribute for this type.
14654 (Attribute.ApplyAttributes): Method renamed to Emit and make
14656 (GlobalAttributeSection): New class for special handling of global
14657 attributes (assembly, module).
14658 (AttributeSection.Emit): New method.
14660 * class.cs: Implemented Attributable abstract methods.
14661 (MethodCore.LabelParameters): Moved to Parameter class.
14662 (Accessor): Is back simple class.
14663 (PropertyMethod): Implemented Attributable abstract class.
14664 (DelegateMethod): Implemented Attributable abstract class.
14665 (Event): New constructor for disctintion between normal Event
14666 and Event with accessors.
14668 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
14670 * codegen.cs, const.cs, decl.cs, delegate.cs:
14671 (CommonAssemblyModulClass): Implemented Attributable abstract class
14674 * enum.cs: Implement IAttributeSupport interface.
14675 (EnumMember): New class for emum members. Implemented Attributable
14679 (ParameterBase): Is abstract.
14680 (ReturnParameter): New class for easier [return:] attribute handling.
14682 * typemanager.cs: Removed builder_to_attr.
14684 2004-05-11 Raja R Harinath <rharinath@novell.com>
14687 * attribute.cs (Attribute.GetPositionalValue): New function.
14688 * class.cs (TypeContainer.VerifyMembers): New function.
14689 (TypeContainer.Emit): Use it.
14690 (ClassOrStruct): New base class for Class and Struct.
14691 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
14692 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
14694 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
14695 then each non-static field should have a FieldOffset attribute.
14696 Otherwise, none of the fields should have a FieldOffset attribute.
14697 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
14698 and FieldOffset attributes.
14699 * typemanager.cs (TypeManager.struct_layout_attribute_type)
14700 (TypeManager.field_offset_attribute_type): New core types.
14701 (TypeManager.InitCoreTypes): Initialize them.
14703 2004-05-11 Michal Moskal <malekith@pld-linux.org>
14705 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
14706 Return correct type.
14709 2004-05-09 Miguel de Icaza <miguel@ximian.com>
14711 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
14712 be implicitly converted to ulong.
14714 * expression.cs: The logic for allowing operator &, | and ^ worked
14715 was wrong, it worked before because we did not report an error in
14716 an else branch. Fixes 57895.
14718 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
14719 allow volatile fields to be reference types.
14721 2004-05-07 Miguel de Icaza <miguel@ximian.com>
14723 * driver.cs: Add support for /debug-
14725 2004-05-07 Raja R Harinath <rharinath@novell.com>
14727 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
14728 Add a 'complain' parameter to silence errors.
14729 (Attribute.Resolve): Update to changes. Put in sanity check to catch
14730 silently overlooked type-resolutions.
14731 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
14732 to reflect changes.
14733 (Attributes.Search): New function.
14734 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
14735 (Attributes.GetAttributeFullName): Remove hack.
14736 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
14737 Update to reflect changes.
14738 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
14739 Use Attributes.Search instead of nested loops.
14741 2004-05-07 Marek Safar <marek.safar@seznam.cz>
14744 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
14745 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
14746 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
14748 * report.cs: (Report.Warning): Renamed to Warning_T because of
14749 parameter collision.
14751 2004-05-05 Raja R Harinath <rharinath@novell.com>
14753 * expression.cs (MemberAccess.ResolveMemberAccess):
14754 Exit with non-zero status after Report.Error.
14755 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
14757 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
14759 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
14761 * support.cs: Don't hang when the file is empty.
14763 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
14765 * support.cs: In SeekableStreamReader, compute the preamble size of the
14766 underlying stream. Position changes should take into account that initial
14769 2004-05-03 Todd Berman <tberman@sevenl.net>
14771 * driver.cs: remove unused GetSysVersion function.
14773 2004-05-03 Todd Berman <tberman@sevenl.net>
14775 * driver.cs: Remove the hack from saturday, as well as the hack
14776 from jackson (LoadAssemblyFromGac), also adds the CWD to the
14777 link_paths to get that bit proper.
14779 2004-05-01 Todd Berman <tberman@sevenl.net>
14781 * driver.cs: Try a LoadFrom before a Load, this checks the current
14782 path. This is currently a bug in mono that is be fixed, however, this
14783 provides a workaround for now. This will be removed when the bug
14786 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
14788 * CryptoConvert.cs: Updated to latest version. Fix issue with
14789 incomplete key pairs (#57941).
14791 2004-05-01 Todd Berman <tberman@sevenl.net>
14793 * driver.cs: Remove '.' from path_chars, now System.* loads properly
14796 2004-04-30 Jackson Harper <jackson@ximian.com>
14798 * codegen.cs: Open keys readonly.
14800 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14802 * typemanager.cs: don't report cyclic struct layout when a struct
14803 contains 2 or more fields of the same type. Failed for Pango.AttrShape
14804 which has 2 Pango.Rectangle fields.
14806 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
14808 * expression.cs: Handle IntPtr comparisons with IL code
14809 rather than a method call.
14811 2004-04-29 Martin Baulig <martin@ximian.com>
14813 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
14814 the list of PropertyInfo's in class hierarchy and find the
14815 accessor. Fixes #56013.
14817 2004-04-29 Martin Baulig <martin@ximian.com>
14819 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
14821 2004-04-29 Martin Baulig <martin@ximian.com>
14823 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
14825 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
14827 2004-04-29 Martin Baulig <martin@ximian.com>
14829 * class.cs (ConstructorInitializer.Resolve): Check whether the
14830 parent .ctor is accessible. Fixes #52146.
14832 2004-04-29 Martin Baulig <martin@ximian.com>
14834 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
14836 * statement.cs (Using.EmitLocalVariableDecls): Use
14837 TypeManager.idisposable_type, not typeof (IDisposable).
14838 (Foreach.EmitCollectionForeach): Added support for valuetypes.
14840 2004-04-29 Martin Baulig <martin@ximian.com>
14842 * class.cs (Event.Define): Don't emit the field and don't set
14843 RTSpecialName and SpecialName for events on interfaces. Fixes
14846 2004-04-29 Raja R Harinath <rharinath@novell.com>
14848 Refactor Attribute.ApplyAttributes.
14849 * attribute.cs (Attributable): New base class for objects that can
14850 have Attributes applied on them.
14851 (Attribute): Make AttributeUsage fields public.
14852 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
14853 (Attribute.IsInternalCall): New property.
14854 (Attribute.UsageAttr): Convert to a public read-only property.
14855 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
14856 (Attribute.ResolveType, Attribute.Resolve)
14857 (Attribute.ScanForIndexerName): Update to reflect changes.
14858 (Attribute.CheckAttributeTarget): Re-format.
14859 (Attribute.ApplyAttributes): Refactor, to various
14860 Attributable.ApplyAttributeBuilder methods.
14861 * decl.cs (MemberCore): Make Attributable.
14862 * class.cs (Accessor): Make Attributable.
14863 (MethodData.ApplyAttributes): Use proper attribute types, not
14865 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
14866 (TypeContainer.ApplyAttributeBuilder)
14867 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
14868 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
14869 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
14870 (Operator.ApplyAttributeBuilder): New factored-out methods.
14871 * const.cs (Const.ApplyAttributeBuilder): Likewise.
14872 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
14873 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
14874 * parameter.cs (ParameterBase): New Attributable base class
14875 that can also represent Return types.
14876 (Parameter): Update to the changes.
14878 2004-04-29 Jackson Harper <jackson@ximian.com>
14880 * driver.cs: Prefer the corlib system version when looking for
14881 assemblies in the GAC. This is still a hack, but its a better hack
14884 2004-04-29 Marek Safar <marek.safar@seznam.cz>
14886 * decl.cs, enum.cs: Improved error 3005 reporting.
14888 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
14889 (related_symbols): New private member for list of symbols
14890 related to reported error/warning.
14892 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
14894 2004-04-29 Martin Baulig <martin@ximian.com>
14896 * ecore.cs (Expression.Constantify): If we're an enum and
14897 TypeManager.TypeToCoreType() doesn't give us another type, use
14898 t.UnderlyingSystemType. Fixes #56178.
14900 2004-04-29 Martin Baulig <martin@ximian.com>
14902 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
14903 interfaces and for each interface, only add members directly
14904 declared in that interface. Fixes #53255.
14906 2004-04-28 Martin Baulig <martin@ximian.com>
14908 * expression.cs (ConditionalLogicalOperator): Use a temporary
14909 variable for `left' to avoid that we evaluate it more than once;
14912 2004-04-28 Martin Baulig <martin@ximian.com>
14914 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
14917 2004-04-28 Martin Baulig <martin@ximian.com>
14919 * statement.cs (LocalInfo.Resolve): Check whether the type is not
14922 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
14923 whether the type is not void (CS1547).
14925 2004-04-28 Martin Baulig <martin@ximian.com>
14927 * expression.cs (Unary.DoResolveLValue): Override this and report
14928 CS0131 for anything but Operator.Indirection.
14930 2004-04-28 Martin Baulig <martin@ximian.com>
14932 Committing a patch from Ben Maurer; see bug #50820.
14934 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
14937 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
14940 2004-04-28 Martin Baulig <martin@ximian.com>
14942 Committing a patch from Ben Maurer; see bug #50820.
14944 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
14947 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
14950 2004-04-28 Martin Baulig <martin@ximian.com>
14952 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
14953 (Block.AddLabel): Call DoLookupLabel() to only search in the
14956 2004-04-28 Martin Baulig <martin@ximian.com>
14958 * cfold.cs (ConstantFold.BinaryFold): Added special support for
14959 comparing StringConstants and NullLiterals in Equality and Inequality.
14961 2004-04-28 Jackson Harper <jackson@ximian.com>
14963 * driver.cs: Attempt to load referenced assemblies from the
14964 GAC. This is the quick and dirty version of this method that
14965 doesnt take into account versions and just takes the first
14966 canidate found. Will be good enough for now as we will not have more
14967 then one version installed into the GAC until I update this method.
14969 2004-04-28 Martin Baulig <martin@ximian.com>
14971 * typemanager.cs (TypeManager.CheckStructCycles): New public
14972 static method to check for cycles in the struct layout.
14974 * rootcontext.cs (RootContext.PopulateTypes): Call
14975 TypeManager.CheckStructCycles() for each TypeContainer.
14976 [Note: We only need to visit each type once.]
14978 2004-04-28 Martin Baulig <martin@ximian.com>
14980 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
14982 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
14983 success and added `out object value'. Use a `bool resolved' field
14984 to check whether we've already been called rather than
14985 `ConstantValue != null' since this breaks for NullLiterals.
14987 2004-04-28 Raja R Harinath <rharinath@novell.com>
14989 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
14990 setting of this flag, since the 'set' method may be non-public.
14992 2004-04-28 Raja R Harinath <rharinath@novell.com>
14994 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
14995 check on current_vector.Block.
14997 2004-04-27 Martin Baulig <martin@ximian.com>
14999 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
15000 a field initializer. Fixes #56459.
15002 2004-04-27 Martin Baulig <martin@ximian.com>
15004 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
15005 we're not attempting to use an indexer. Fixes #52154.
15007 2004-04-27 Martin Baulig <martin@ximian.com>
15009 * statement.cs (Return): Don't create a return label if we don't
15010 need it; reverts my change from January 20th. Thanks to Ben
15013 2004-04-27 Martin Baulig <martin@ximian.com>
15015 According to the spec, `goto' can only leave a nested scope, but
15018 * statement.cs (Block.LookupLabel): Only lookup in the current
15019 block, don't recurse into parent or child blocks.
15020 (Block.AddLabel): Check in parent and child blocks, report
15021 CS0140/CS0158 if we find a duplicate.
15022 (Block): Removed this indexer for label lookups.
15023 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
15024 this already does the error reporting for us.
15027 (FlowBranching.UsageVector.Block): New public variable; may be null.
15028 (FlowBranching.CreateSibling): Added `Block' argument.
15029 (FlowBranching.LookupLabel): New public virtual method. Lookup a
15030 label for the target of a `goto' and check whether we're not
15031 leaving a `finally'.
15033 2004-04-27 Martin Baulig <martin@ximian.com>
15035 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
15036 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
15039 2004-04-27 Martin Baulig <martin@ximian.com>
15041 * statement.cs (Block.AddLabel): Also check for implicit blocks
15042 and added a CS0158 check.
15044 2004-04-27 Martin Baulig <martin@ximian.com>
15046 * flowanalysis.cs (FlowBranchingLoop): New class.
15047 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
15048 UsageVector's instead of an ArrayList.
15049 (FlowBranching.Label): Likewise.
15050 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
15051 (FlowBranching.AddBreakVector): New method.
15053 2004-04-27 Miguel de Icaza <miguel@ximian.com>
15055 * attribute.cs: Small regression fix: only convert the type if we
15056 the type is different, fixes System.Drawing build.
15058 2004-04-27 Martin Baulig <martin@ximian.com>
15060 * attribute.cs (Attribute.Resolve): If we have a constant value
15061 for a named field or property, implicity convert it to the correct
15064 2004-04-27 Raja R Harinath <rharinath@novell.com>
15066 * statement.cs (Block.Block): Implicit blocks share
15067 'child_variable_names' fields with parent blocks.
15068 (Block.AddChildVariableNames): Remove.
15069 (Block.AddVariable): Mark variable as "used by a child block" in
15070 every surrounding block.
15071 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
15072 been used in a child block, complain about violation of "Invariant
15073 meaning in blocks" rule.
15074 * cs-parser.jay (declare_local_variables): Don't use
15075 AddChildVariableNames.
15076 (foreach_statement): Don't create an implicit block: 'foreach'
15077 introduces a scope.
15079 2004-04-23 Miguel de Icaza <miguel@ximian.com>
15081 * convert.cs (ImplicitNumericConversion): 0 is also positive when
15082 converting from 0L to ulong. Fixes 57522.
15084 2004-04-22 Marek Safar <marek.safar@seznam.cz>
15086 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
15087 derived class hides via 'new' keyword field from base class (test-242.cs).
15088 TODO: Handle this in the more general way.
15090 * class.cs (CheckBase): Ditto.
15092 2004-04-22 Marek Safar <marek.safar@seznam.cz>
15094 * decl.cs (caching_flags): New member for storing cached values
15096 (MemberCore.Flags): New enum where bit flags for caching_flags
15098 (MemberCore.cls_compliance): Moved to caching_flags.
15099 (DeclSpace.Created): Moved to caching_flags.
15101 * class.cs: Use caching_flags instead of DeclSpace.Created
15103 2004-04-21 Miguel de Icaza <miguel@ximian.com>
15105 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
15106 if we are only a derived class, not a nested class.
15108 * typemanager.cs: Same as above, but do this at the MemberLookup
15109 level (used by field and methods, properties are handled in
15110 PropertyExpr). Allow for the qualified access if we are a nested
15113 2004-04-21 Marek Safar <marek.safar@seznam.cz>
15115 * class.cs: Refactoring.
15116 (IMethodData): New inteface; Holds links to parent members
15117 to avoid member duplication (reduced memory allocation).
15118 (Method): Implemented IMethodData interface.
15119 (PropertyBase): New inner classes for get/set methods.
15120 (PropertyBase.PropertyMethod): Implemented IMethodData interface
15121 (Event): New inner classes for add/remove methods.
15122 (Event.DelegateMethod): Implemented IMethodData interface.
15124 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
15125 EmitContext (related to class.cs refactoring).
15127 2004-04-21 Raja R Harinath <rharinath@novell.com>
15129 * delegate.cs (Delegate.VerifyApplicability): If the number of
15130 arguments are the same as the number of parameters, first try to
15131 verify applicability ignoring any 'params' modifier on the last
15135 2004-04-16 Raja R Harinath <rharinath@novell.com>
15137 * class.cs (TypeContainer.AddIndexer): Use
15138 'ExplicitInterfaceName' to determine if interface name was
15139 explicitly specified. 'InterfaceType' is not initialized at this time.
15140 (TypeContainer.DefineIndexers): Remove use of temporary list. The
15141 Indexers array is already in the required order. Initialize
15142 'IndexerName' only if there are normal indexers.
15143 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
15144 (TypeContainer.Emit): Emit DefaultMember attribute only if
15145 IndexerName is initialized.
15148 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
15150 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
15153 2004-04-15 Raja R Harinath <rharinath@novell.com>
15155 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
15159 * attribute.cs (Attribute.Resolve): Check for duplicate named
15163 2004-04-15 Miguel de Icaza <miguel@ximian.com>
15165 * iterators.cs (MarkYield): track whether we are in an exception,
15166 and generate code accordingly. Use a temporary value to store the
15167 result for our state.
15169 I had ignored a bit the interaction of try/catch with iterators
15170 since their behavior was not entirely obvious, but now it is
15171 possible to verify that our behavior is the same as MS .NET 2.0
15175 2004-04-14 Miguel de Icaza <miguel@ximian.com>
15177 * iterators.cs: Avoid creating temporaries if there is no work to
15180 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
15181 Enumerations, use TypeManager.EnumToUnderlying and call
15184 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
15187 (This.Emit): Use EmitContext.EmitThis to emit our
15190 (This.EmitAssign): Ditto.
15192 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
15193 codepaths, we will move all the functionality into
15196 (FieldExpr.EmitAssign): Ditto.
15198 This fixes several hidden bugs that I uncovered while doing a code
15199 review of this today.
15201 * codegen.cs (EmitThis): reworked so the semantics are more clear
15202 and also support value types "this" instances.
15204 * iterators.cs: Changed so that for iterators in value types, we
15205 do not pass the value type as a parameter.
15207 Initialization of the enumerator helpers is now done in the caller
15208 instead of passing the parameters to the constructors and having
15209 the constructor set the fields.
15211 The fields have now `assembly' visibility instead of private.
15213 2004-04-11 Miguel de Icaza <miguel@ximian.com>
15215 * expression.cs (Argument.Resolve): Check if fields passed as ref
15216 or out are contained in a MarshalByRefObject.
15218 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
15219 another compiler type.
15221 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
15223 * class.cs (Indexer.Define): use the new name checking method.
15224 Also, return false on an error.
15225 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
15226 (is_identifier_[start/part]_character): make static.
15228 2004-04-10 Miguel de Icaza <miguel@ximian.com>
15230 * expression.cs (Binary.ResolveOperator): Do no append strings
15231 twice: since we can be invoked more than once (array evaluation)
15232 on the same concatenation, take care of this here. Based on a fix
15233 from Ben (bug #56454)
15235 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
15237 * codegen.cs: Fix another case where CS1548 must be reported (when
15238 delay-sign isn't specified and no private is available #56564). Fix
15239 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
15240 error when MCS is used on the MS runtime and we need to delay-sign
15241 (which seems unsupported by AssemblyBuilder - see #56621).
15243 2004-04-08 Marek Safar <marek.safar@seznam.cz>
15245 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
15246 (TypeManager.ComputeNamespaces): Faster implementation for
15249 * compiler.csproj: Updated AssemblyName to mcs.
15251 2004-04-07 Miguel de Icaza <miguel@ximian.com>
15253 * rootcontext.cs: Add new types to the boot resolution.
15255 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
15256 MulticastDelegate is not allowed.
15258 * typemanager.cs: Add new types to lookup: System.TypedReference
15261 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
15262 check for TypedReference or ArgIterator, they are not allowed.
15264 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
15265 makes us properly catch 1510 in some conditions (see bug 56016 for
15268 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
15270 * CryptoConvert.cs: update from corlib version
15273 2004-04-05 Miguel de Icaza <miguel@ximian.com>
15275 * class.cs (Indexer.Define): Check indexername declaration
15277 2004-04-05 Marek Safar <marek.safar@seznam.cz>
15279 * attribute.cs (IsClsCompliant): Fixed problem with handling
15280 all three states (compliant, not-compliant, undetected).
15282 2004-03-30 Marek Safar <marek.safar@seznam.cz>
15284 * attribute.cs (Attribute): Location is now public.
15285 (Resolve): Store resolved arguments (pos_values) in attribute class.
15286 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
15287 (GetClsCompliantAttributeValue): New method that gets
15288 CLSCompliantAttribute value.
15289 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
15290 if exists else null.
15291 (AttributeTester): New class for CLS-Compliant verification routines.
15293 * class.cs (Emit): Add CLS-Compliant verification.
15294 (Method.GetSignatureForError): Implemented.
15295 (Constructor.GetSignatureForError): Implemented
15296 (Constructor.HasCompliantArgs): Returns if constructor has
15297 CLS-Compliant arguments.
15298 (Constructor.Emit): Override.
15299 (Construcor.IsIdentifierClsCompliant): New method; For constructors
15300 is needed to test only parameters.
15301 (FieldBase.GetSignatureForError): Implemented.
15302 (TypeContainer): New member for storing base interfaces.
15303 (TypeContainer.FindMembers): Search in base interfaces too.
15305 * codegen.cs (GetClsComplianceAttribute): New method that gets
15306 assembly or module CLSCompliantAttribute value.
15307 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
15309 (ModuleClass.Emit): Add error 3012 test.
15311 * const.cs (Emit): Override and call base for CLS-Compliant tests.
15313 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
15314 state for all decl types.
15315 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
15316 if CLS-Compliant tests are required.
15317 (IsClsCompliaceRequired): New method. Analyze whether code
15318 must be CLS-Compliant.
15319 (IsExposedFromAssembly): New method. Returns true when MemberCore
15320 is exposed from assembly.
15321 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
15322 value or gets cached value.
15323 (HasClsCompliantAttribute): New method. Returns true if MemberCore
15324 is explicitly marked with CLSCompliantAttribute.
15325 (IsIdentifierClsCompliant): New abstract method. This method is
15326 used to testing error 3005.
15327 (IsIdentifierAndParamClsCompliant): New method. Common helper method
15328 for identifier and parameters CLS-Compliant testing.
15329 (VerifyClsCompliance): New method. The main virtual method for
15330 CLS-Compliant verifications.
15331 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
15332 null. I don't know why is null (too many public members !).
15333 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
15334 and get value of first CLSCompliantAttribute that found.
15336 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
15337 (VerifyClsCompliance): Override and add extra tests.
15339 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
15340 clscheck- disable CLS-Compliant verification event if assembly is has
15341 CLSCompliantAttribute(true).
15343 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
15344 ApllyAttribute is now called in emit section as in the other cases.
15345 Possible future Emit integration.
15346 (IsIdentifierClsCompliant): New override.
15347 (VerifyClsCompliance): New override.
15348 (GetEnumeratorName): Returns full enum name.
15350 * parameter.cs (GetSignatureForError): Implemented.
15352 * report.cs (WarningData): New struct for Warning message information.
15353 (LocationOfPreviousError): New method.
15354 (Warning): New method. Reports warning based on the warning table.
15355 (Error_T): New method. Reports error based on the error table.
15357 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
15358 verifications are done here.
15360 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
15362 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
15363 CLSCompliantAttribute.
15364 (all_imported_types): New member holds all imported types from other
15366 (LoadAllImportedTypes): New method fills static table with exported types
15367 from all referenced assemblies.
15368 (Modules): New property returns all assembly modules.
15370 2004-03-30 Miguel de Icaza <miguel@ximian.com>
15372 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
15373 throwing a parser error.
15375 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
15376 which removes the hardcoded get_/set_ prefixes for properties, as
15377 IL allows for the properties to be named something else.
15381 * expression.cs: Do not override operand before we know if it is
15382 non-null. Fix 56207
15384 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
15386 * typemanager.cs: support for pinned variables.
15388 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
15390 * decl.cs, typemanager.cs: Avoid using an arraylist
15391 as a buffer if there is only one result set.
15393 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
15395 * expression.cs: Make sure you cant call a static method
15396 with an instance expression, bug #56174.
15398 2004-03-29 Miguel de Icaza <miguel@ximian.com>
15400 * class.cs (IsDuplicateImplementation): Improve error reporting to
15401 flag 663 (method only differs in parameter modifier).
15403 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
15404 in preprocessor directives.
15406 * location.cs (LookupFile): Allow for the empty path.
15408 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
15409 better approach for some of that patch, but its failing with the
15410 CharSet enumeration. For now try/catch will do.
15412 * typemanager.cs: Do not crash if a struct does not have fields.
15415 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
15417 * expression.cs: cs0213, cant fix a fixed expression.
15420 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
15422 * cs-parser.jay: detect invalid embeded statements gracefully.
15425 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
15427 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
15430 the invocation type may not be a subclass of the tye of the item/
15431 The type of the item must be a subclass of the invocation item.
15436 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
15438 * attribute.cs: Added methods to get a string and a bool from an
15439 attribute. Required to information from AssemblyKeyFileAttribute,
15440 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
15441 * codegen.cs: Modified AssemblyName creation to include support for
15442 strongnames. Catch additional exceptions to report them as CS1548.
15443 * compiler.csproj: Updated include CryptoConvert.cs.
15444 * compiler.csproj.user: Removed file - user specific configuration.
15445 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
15446 Mono.Security assembly. The original class is maintained and tested in
15447 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
15448 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
15449 like CSC 8.0 (C# v2) supports.
15450 * Makefile: Added CryptoConvert.cs to mcs sources.
15451 * rootcontext.cs: Added new options for strongnames.
15453 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
15455 * driver.cs: For --expect-error, report error code `2'
15456 if the program compiled with no errors, error code `1' if
15457 it compiled with an error other than the one expected.
15459 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
15461 * compiler.csproj: Updated for Visual Studio .NET 2003.
15462 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
15463 * compiler.sln: Updated for Visual Studio .NET 2003.
15465 2004-03-24 Ravi Pratap M <ravi@ximian.com>
15467 * expression.cs: Fix bug #47234. We basically need to apply the
15468 rule that we prefer the conversion of null to a reference type
15469 when faced with a conversion to 'object' (csc behaviour).
15471 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
15473 * statement.cs: Shorter form for foreach, eliminates
15474 a local variable. r=Martin.
15476 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
15478 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
15479 checks if we can use brtrue/brfalse to test for 0.
15480 * expression.cs: use the above in the test for using brtrue/brfalse.
15481 cleanup code a bit.
15483 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
15485 * expression.cs: Rewrite string concat stuff. Benefits:
15487 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
15488 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
15489 rather than a concat chain.
15491 * typemanager.cs: Add lookups for more concat overloads.
15493 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
15495 * expression.cs: Emit shorter il code for array init.
15512 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
15514 * statement.cs: Before, two switch blocks would be merged if the
15515 total size of the blocks (end_item - begin_item + 1) was less than
15516 two times the combined sizes of the blocks.
15518 Now, it will only merge if after the merge at least half of the
15523 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
15525 * class.cs : csc build fix for GetMethods(). See bug #52503.
15527 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
15529 * expression.cs: Make sure fp comparisons work with NaN.
15530 This fixes bug #54303. Mig approved this patch a long
15531 time ago, but we were not able to test b/c the runtime
15534 2004-03-19 Miguel de Icaza <miguel@ximian.com>
15536 * ecore.cs (TypExpr.GetHashCode): implement this overload.
15538 2004-03-19 Martin Baulig <martin@ximian.com>
15540 * class.cs (MemberCore.IsDuplicateImplementation): Report the
15541 error here and not in our caller.
15543 2004-03-19 Martin Baulig <martin@ximian.com>
15545 * interface.cs: Completely killed this file.
15546 (Interface): We're now a TypeContainer and live in class.cs.
15548 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
15549 argument; we're now also called for interfaces.
15550 (TypeContainer.DefineMembers): Allow this method being called
15552 (TypeContainer.GetMethods): New public method; formerly known as
15553 Interface.GetMethod(). This is used by PendingImplementation.
15554 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
15555 it's now private and non-static.
15556 (Interface): Moved this here; it's now implemented similar to
15558 (Method, Property, Event, Indexer): Added `bool is_interface'
15559 argument to their .ctor's.
15560 (MemberBase.IsInterface): New public field.
15562 * cs-parser.jay: Create normal Method, Property, Event, Indexer
15563 instances instead of InterfaceMethod, InterfaceProperty, etc.
15564 (opt_interface_base): Removed; we now use `opt_class_base' instead.
15565 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
15567 2004-03-19 Martin Baulig <martin@ximian.com>
15569 * class.cs (MethodCore.IsDuplicateImplementation): New private
15570 method which does the CS0111 checking.
15571 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
15572 Use IsDuplicateImplementation().
15574 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
15576 * decl.cs (FindMemberToOverride): New method to find the correct
15577 method or property to override in the base class.
15579 - Make Method/Property use the above method to find the
15580 version in the base class.
15581 - Remove the InheritableMemberSignatureCompare as it is now
15584 This patch makes large code bases much faster to compile, as it is
15585 O(n) rather than O(n^2) to do this validation.
15587 Also, it fixes bug 52458 which is that nested classes are not
15588 taken into account when finding the base class member.
15590 Reviewed/Approved by Martin.
15592 2004-03-17 Marek Safar <marek.safar@seznam.cz>
15594 * interface.cs: In all interface classes removed redundant
15595 member initialization.
15597 2004-03-16 Martin Baulig <martin@ximian.com>
15599 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
15601 2004-03-15 Miguel de Icaza <miguel@ximian.com>
15603 * decl.cs (DefineTypeAndParents): New helper method to define a
15604 type's containers before the type itself is defined; This is a
15605 bug exposed by the recent changes to Windows.Forms when an
15606 implemented interface was defined inside a class that had not been
15609 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
15611 (Check): Loop correctly to report errors modifiers
15612 (UNSAFE was not in the loop, since it was the same as TOP).
15614 * interface.cs: Every interface member now takes a ModFlags,
15615 instead of a "is_new" bool, which we set on the base MemberCore.
15617 Every place where we called "UnsafeOk" in the interface, now we
15618 call the proper member (InterfaceMethod.UnsafeOK) instead to get
15619 the unsafe settings from the member declaration instead of the
15620 container interface.
15622 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
15624 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
15625 `set_indexer_name' to the pending bits (one per type).
15627 We fixed a bug today that was picking the wrong method to
15628 override, since for properties the existing InterfaceMethod code
15629 basically ignored the method name. Now we make sure that the
15630 method name is one of the valid indexer names.
15632 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
15634 * support.cs (SeekableStreamReader): Keep track of stream byte
15635 positions and don't mix them with character offsets to the buffer.
15637 Patch from Gustavo Giráldez
15639 2004-03-15 Marek Safar <marek.safar@seznam.cz>
15641 * interface.cs (InterfaceSetGetBase): Removed double member
15642 initialization, base class does it as well.
15644 2004-03-13 Martin Baulig <martin@ximian.com>
15646 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
15647 when compiling corlib.
15649 2004-03-13 Miguel de Icaza <miguel@ximian.com>
15651 * convert.cs (ExplicitConversion): We were reporting an error on
15652 certain conversions (object_type source to a value type, when the
15653 expression was `null') before we had a chance to pass it through
15654 the user defined conversions.
15656 * driver.cs: Replace / and \ in resource specifications to dots.
15659 * class.cs: Add check for duplicate operators. Fixes 52477
15661 2004-03-11 Miguel de Icaza <miguel@ximian.com>
15663 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
15664 that are in the middle of the statements, not only at the end.
15667 * class.cs (TypeContainer.AddField): No longer set the
15668 `HaveStaticConstructor' flag, now we call it
15669 `UserDefineStaticConstructor' to diferentiate the slightly
15670 semantic difference.
15672 The situation is that we were not adding BeforeFieldInit (from
15673 Modifiers.TypeAttr) to classes that could have it.
15674 BeforeFieldInit should be set to classes that have no static
15679 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
15681 And most importantly Zoltan's comment:
15683 http://bugzilla.ximian.com/show_bug.cgi?id=44229
15685 "I think beforefieldinit means 'it's ok to initialize the type sometime
15686 before its static fields are used', i.e. initialization does not need
15687 to be triggered by the first access to the type. Setting this flag
15688 helps the JIT to compile better code, since it can run the static
15689 constructor at JIT time, and does not need to generate code to call it
15690 (possibly lots of times) at runtime. Unfortunately, mcs does not set
15691 this flag for lots of classes like String.
15693 csc sets this flag if the type does not have an explicit static
15694 constructor. The reasoning seems to be that if there are only static
15695 initalizers for a type, and no static constructor, then the programmer
15696 does not care when this initialization happens, so beforefieldinit
15699 This bug prevents the AOT compiler from being usable, since it
15700 generates so many calls to mono_runtime_class_init that the AOT code
15701 is much slower than the JITted code. The JITted code is faster,
15702 because it does not generate these calls if the vtable is type is
15703 already initialized, which is true in the majority of cases. But the
15704 AOT compiler can't do this."
15706 2004-03-10 Miguel de Icaza <miguel@ximian.com>
15708 * class.cs (MethodData.Emit): Refactor the code so symbolic
15709 information is generated for destructors; For some reasons we
15710 were taking a code path that did not generate symbolic information
15713 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
15715 * class.cs: Create a Constructor.CheckBase method that
15716 takes care of all validation type code. The method
15717 contains some code that was moved from Define.
15719 It also includes new code that checks for duplicate ctors.
15720 This fixes bug #55148.
15722 2004-03-09 Joshua Tauberer <tauberer@for.net>
15724 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
15725 a { ... }-style array creation invokes EmitStaticInitializers
15726 which is not good for reference-type arrays. String, decimal
15727 and now null constants (NullCast) are not counted toward
15728 static initializers.
15730 2004-03-05 Martin Baulig <martin@ximian.com>
15732 * location.cs (SourceFile.HasLineDirective): New public field;
15733 specifies whether the file contains or is referenced by a "#line"
15735 (Location.DefineSymbolDocuments): Ignore source files which
15736 either contain or are referenced by a "#line" directive.
15738 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
15740 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
15741 direct access to our parent, so check the method inline there.
15743 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
15745 * expression.cs (Invocation.EmitCall): Miguel's last commit
15746 caused a regression. If you had:
15751 In Foo the implict this would be null.
15753 2004-02-27 Miguel de Icaza <miguel@ximian.com>
15755 * expression.cs (Invocation.EmitCall): If the method is not
15756 virtual, do not emit a CallVirt to it, use Call.
15758 * typemanager.cs (GetFullNameSignature): Improve the method to
15759 cope with ".ctor" and replace it with the type name.
15761 * class.cs (ConstructorInitializer.Resolve): Now the method takes
15762 as an argument the ConstructorBuilder where it is being defined,
15763 to catch the recursive constructor invocations.
15765 2004-02-26 Miguel de Icaza <miguel@ximian.com>
15767 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
15768 routines to check if a type is an enumerable/enumerator allow
15769 classes that implement the IEnumerable or IEnumerator interfaces.
15771 * class.cs (Property, Operator): Implement IIteratorContainer, and
15772 implement SetYields.
15774 (Property.Define): Do the block swapping for get_methods in the
15775 context of iterators. We need to check if Properties also
15776 include indexers or not.
15778 (Operator): Assign the Block before invoking the
15779 OperatorMethod.Define, so we can trigger the Iterator code
15782 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
15783 Property and Operator classes are not created when we parse the
15784 declarator but until we have the block completed, so we use a
15785 singleton SimpleIteratorContainer.Simple to flag whether the
15786 SetYields has been invoked.
15788 We propagate this setting then to the Property or the Operator to
15789 allow the `yield' to function.
15791 2004-02-25 Marek Safar <marek.safar@seznam.cz>
15793 * codegen.cs: Implemented attribute support for modules.
15794 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
15795 Assembly/Module functionality.
15797 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
15798 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
15799 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
15801 2004-02-16 Marek Safar <marek.safar@seznam.cz>
15803 * interface.cs (FindMembers): The operation is performed on all base
15804 interfaces and not only on the first. It is required for future CLS Compliance patch.
15806 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
15808 * statement.cs, codegen.cs:
15809 This patch deals with patterns such as:
15811 public class List : IEnumerable {
15813 public MyEnumerator GetEnumerator () {
15814 return new MyEnumerator(this);
15817 IEnumerator IEnumerable.GetEnumerator () {
15821 public struct MyEnumerator : IEnumerator {
15826 Before, there were a few things we did wrong:
15827 1) we would emit callvirt on a struct, which is illegal
15828 2) we emited ldarg when we needed to emit ldarga
15829 3) we would mistakenly call the interface methods on an enumerator
15830 type that derived from IEnumerator and was in another assembly. For example:
15832 public class MyEnumerator : IEnumerator
15834 Would have the interface methods called, even if there were public impls of the
15835 method. In a struct, this lead to invalid IL code.
15837 2004-02-11 Marek Safar <marek.safar@seznam.cz>
15839 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
15842 * delegate.cs (Define): Fixed crash when delegate type is undefined.
15844 2004-02-11 Miguel de Icaza <miguel@ximian.com>
15846 * cs-parser.jay: Fix small regression: we were not testing V2
15847 compiler features correctly.
15849 * interface.cs: If the emit context is null, then create one
15851 2004-02-09 Marek Safar <marek.safar@seznam.cz>
15853 * decl.cs (GetSignatureForError): New virtual method to get full name
15854 for error messages.
15856 * attribute.cs (IAttributeSupport): New interface for attribute setting.
15857 Now it is possible to rewrite ApplyAttributes method to be less if/else.
15859 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
15860 Duplicated members and code in these classes has been removed.
15861 Better encapsulation in these classes.
15863 2004-02-07 Miguel de Icaza <miguel@ximian.com>
15865 * assign.cs (Assign.DoResolve): When dealing with compound
15866 assignments, there is a new rule in ECMA C# 2.4 (might have been
15867 there before, but it is documented here) that states that in:
15871 If b is of type int, and the `op' is a shift-operator, then the
15872 above is evaluated as:
15876 * expression.cs (Binary.ResolveOperator): Instead of testing for
15877 int/uint/long/ulong, try to implicitly convert to any of those
15878 types and use that in pointer arithmetic.
15880 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
15881 method to print information for from the type, not from the
15882 null-method we were given.
15884 2004-02-01 Duncan Mak <duncan@ximian.com>
15886 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
15887 parsing for cmd, fixes bug #53694.
15889 2004-02-04 Marek Safar <marek.safar@seznam.cz>
15891 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
15892 in the member name duplication tests. Property and operator name duplication
15893 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
15895 2004-02-03 Marek Safar <marek.safar@seznam.cz>
15897 * interface.cs (PopulateMethod): Fixed crash when interface method
15898 returns not existing type (error test cs0246-3.cs).
15900 2004-02-02 Ravi Pratap M <ravi@ximian.com>
15902 * cs-parser.jay (interface_accessors): Re-write actions to also
15903 store attributes attached to get and set methods. Fix spelling
15906 (inteface_property_declaration): Modify accordingly.
15908 (InterfaceAccessorInfo): New helper class to store information to pass
15909 around between rules that use interface_accessors.
15911 * interface.cs (Emit): Apply attributes on the get and set
15912 accessors of properties and indexers too.
15914 * attribute.cs (ApplyAttributes): Modify accordingly to use the
15915 right MethodBuilder when applying attributes to the get and set accessors.
15917 2004-01-31 Miguel de Icaza <miguel@ximian.com>
15919 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
15921 2004-01-26 Miguel de Icaza <miguel@ximian.com>
15923 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
15925 2004-01-25 Miguel de Icaza <miguel@ximian.com>
15927 * cs-parser.jay: Remove YIELD token, instead use the new grammar
15928 changes that treat `yield' specially when present before `break'
15929 or `return' tokens.
15931 * cs-tokenizer.cs: yield is no longer a keyword.
15933 2004-01-23 Marek Safar <marek.safar@seznam.cz>
15935 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
15936 setting for default constructors.
15937 For default constructors are almost every time set wrong Modifier. The
15938 generated IL code has been alright. But inside mcs this values was
15939 wrong and this was reason why several of my CLS Compliance tests
15942 2004-01-22 Martin Baulig <martin@ximian.com>
15944 * cs-parser.jay (namespace_or_type_name): Return an Expression,
15945 not a QualifiedIdentifier. This is what `type_name_expression'
15946 was previously doing.
15947 (type_name_expression): Removed; the code is now in
15948 `namespace_or_type_name'.
15949 (qualified_identifier): Removed, use `namespace_or_type_name'
15951 (QualifiedIdentifier): Removed this class.
15953 2004-01-22 Martin Baulig <martin@ximian.com>
15955 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
15956 not a string as alias name.
15958 2004-01-21 Miguel de Icaza <miguel@ximian.com>
15960 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
15961 #52730 bug, and instead compute correctly the need to use a
15962 temporary variable when requesting an address based on the
15963 static/instace modified of the field and the constructor.
15965 2004-01-21 Martin Baulig <martin@ximian.com>
15967 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
15968 class and namespace before looking up aliases. Fixes #52517.
15970 2004-01-21 Martin Baulig <martin@ximian.com>
15972 * flowanalysis.cs (UsageVector.Merge): Allow variables being
15973 assinged in a 'try'; fixes exception4.cs.
15975 2004-01-21 Marek Safar <marek.safar@seznam.cz>
15976 * class.cs : Implemented parameter-less constructor for TypeContainer
15978 * decl.cs: Attributes are now stored here. New property OptAttributes
15980 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
15982 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
15984 2004-01-21 Marek Safar <marek.safar@seznam.cz>
15986 * typemanager.cs (CSharpSignature): Now reports also inner class name.
15987 (CSharpSignature): New method for indexer and property signature.
15989 2004-01-21 Marek Safar <marek.safar@seznam.cz>
15991 * pending.cs (IsVirtualFilter): Faster implementation.
15993 2004-01-21 Marek Safar <marek.safar@seznam.cz>
15995 * typemanager.cs: Avoid inclusion of same assembly more than once.
15997 2004-01-21 Marek Safar <marek.safar@seznam.cz>
15999 * cs-parser.jay: Fixed problem where the last assembly attribute
16000 has been applied also to following declaration (class, struct, etc.)
16002 2004-01-21 Marek Safar <marek.safar@seznam.cz>
16004 * class.cs: Added error CS0538, CS0539 reporting.
16005 Fixed crash on Microsoft runtime when field type is void.
16007 * cs-parser.jay: Added error CS0537 reporting.
16009 * pending.cs: Added error CS0535 reporting.
16010 Improved error report for errors CS0536, CS0534.
16012 2004-01-20 Miguel de Icaza <miguel@ximian.com>
16014 Merge a few bits from the Anonymous Method MCS tree.
16016 * statement.cs (ToplevelBlock): New class for toplevel methods,
16017 will hold anonymous methods, lifted variables.
16019 * cs-parser.jay: Create toplevel blocks for delegates and for
16020 regular blocks of code.
16022 2004-01-20 Martin Baulig <martin@ximian.com>
16024 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
16025 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
16026 and `NeedExplicitReturn'; added `IsLastStatement'.
16027 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
16028 have a `ReturnLabel' or we're not unreachable.
16030 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
16031 child's reachability; don't just override ours with it. Fixes
16032 #58058 (lluis's example).
16033 (FlowBranching): Added public InTryOrCatch(), InCatch(),
16034 InFinally(), InLoop(), InSwitch() and
16035 BreakCrossesTryCatchBoundary() methods.
16037 * statement.cs (Return): Do all error checking in Resolve().
16038 Unless we are the last statement in a top-level block, always
16039 create a return label and jump to it.
16040 (Break, Continue): Do all error checking in Resolve(); also make
16041 sure we aren't leaving a `finally'.
16042 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
16043 statement in a top-level block.
16044 (Block.Flags): Added `IsDestructor'.
16045 (Block.IsDestructor): New public property.
16047 2004-01-20 Martin Baulig <martin@ximian.com>
16049 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
16051 2004-01-20 Martin Baulig <martin@ximian.com>
16053 * statement.cs (Statement.ResolveUnreachable): New public method.
16054 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
16055 (Block.Resolve): Resolve unreachable statements.
16057 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
16059 * expression.cs: We need to fix the case where we do
16060 not have a temp variable here.
16062 * assign.cs: Only expression compound assignments need
16063 temporary variables.
16065 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
16067 * flowanalysis.cs: Reduce memory allocation in a few ways:
16068 - A block with no variables should not allocate a bit
16070 - A method with no out parameters does not need any tracking
16071 for assignment of the parameters, so we need not allocate
16074 public readonly Type[] VariableTypes;
16075 public readonly string[] VariableNames;
16076 Are redundant. The data is already stored in the variable
16077 map, so we need not allocate another array for it.
16078 - We need to add alot of checks for if (params | locals) == null
16079 due to the first two changes.
16081 2004-01-18 Miguel de Icaza <miguel@ximian.com>
16083 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
16084 implement IMemoryLocation, we store a copy on a local variable and
16085 take the address of it. Patch from Benjamin Jemlich
16087 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
16088 to use a special "type_name_expression" rule which reduces the
16089 number of "QualifiedIdentifier" classes created, and instead
16090 directly creates MemberAccess expressions.
16092 2004-01-17 Miguel de Icaza <miguel@ximian.com>
16094 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
16095 that fixes #52853. Null literal assignment to ValueType
16097 * class.cs (MethodData.Emit): Instead of checking the name of the
16098 method to determine if its a destructor, create a new derived
16099 class from Method called Destructor, and test for that.
16101 * cs-parser.jay: Create a Destructor object instead of a Method.
16103 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
16107 2004-01-16 Miguel de Icaza <miguel@ximian.com>
16109 * expression.cs (Binary.ResolveOperator): Perform an implicit
16110 conversion from MethodGroups to their delegate types on the
16111 Addition operation.
16113 * delegate.cs: Introduce a new class DelegateCreation that is the
16114 base class for `NewDelegate' and `ImplicitDelegateCreation',
16115 factor some code in here.
16117 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
16118 conversion from MethodGroups to compatible delegate types.
16120 * ecore.cs (Expression.Resolve): Do not flag error 654
16121 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
16122 we allow conversions from MethodGroups to delegate types now.
16124 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
16125 assignments in v2 either.
16127 2004-01-10 Miguel de Icaza <miguel@ximian.com>
16129 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
16130 static read-only fields in ctors.
16132 Applied patch from Benjamin Jemlich
16134 * expression.cs (UnaryMutator): Avoid leaking local variables.
16136 2004-01-09 Miguel de Icaza <miguel@ximian.com>
16138 * cs-tokenizer.cs (IsCastToken): Allow the various native types
16139 here to return true, as they can be used like this:
16141 (XXX) int.MEMBER ()
16143 Fixed 49836 and all the other dups
16145 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
16147 * driver.cs: Implement /win32res and /win32icon.
16149 2004-01-08 Miguel de Icaza <miguel@ximian.com>
16151 * cs-parser.jay: Add a rule to improve error handling for the
16152 common mistake of placing modifiers after the type.
16154 2004-01-07 Miguel de Icaza <miguel@ximian.com>
16156 * cs-parser.jay (interface_event_declaration): Catch
16157 initialization of events on interfaces, and report cs0068
16159 * cs-parser.jay (interface_event_declaration): Catch
16160 initialization of events.
16162 * ecore.cs: Better report missing constructors.
16164 * expression.cs (Binary.ResolveOperator): My previous bug fix had
16165 the error reporting done in the wrong place. Fix.
16167 * expression.cs (Binary.ResolveOperator): Catch the
16168 operator + (E x, E y) error earlier, and later allow for implicit
16169 conversions in operator +/- (E e, U x) from U to the underlying
16172 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
16173 52596, if the container class is abstract, the default constructor
16174 is protected otherwise its public (before, we were always public).
16176 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
16179 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
16180 Jemlich that fixes bug #52597, MCS was generating invalid code for
16181 idisposable structs. Thanks to Ben for following up with this
16184 2004-01-06 Miguel de Icaza <miguel@ximian.com>
16186 * driver.cs: Allow assemblies without code to be generated, fixes
16189 2004-01-07 Nick Drochak <ndrochak@gol.com>
16191 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
16193 2004-01-05 Miguel de Icaza <miguel@ximian.com>
16195 * cs-parser.jay: Add rules to improve error reporting if fields or
16196 methods are declared at the namespace level (error 116)
16198 * Add rules to catch event add/remove
16200 2004-01-04 David Sheldon <dave-mono@earth.li>
16202 * expression.cs: Added matching ")" to error message for
16205 2004-01-03 Todd Berman <tberman@gentoo.org>
16207 * ecore.cs, attribute.cs:
16208 Applying fix from #52429.
16210 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
16212 * ecore.cs, expression.cs, statement.cs:
16213 Total rewrite of how we handle branching. We
16214 now handle complex boolean expressions with fewer
16215 jumps. As well if (x == 0) no longer emits a ceq.
16217 if (x is Foo) is much faster now, because we generate
16220 Overall, we get a pretty big improvement on our benchmark
16221 tests. The code we generate is smaller and more readable.
16223 I did a full two-stage bootstrap. The patch was reviewed
16224 by Martin and Miguel.
16226 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
16228 * cs-parser.jay: Make primary_expression not take a QI.
16229 we dont need this because the member_access rule covers
16230 us here. So we replace the rule with just IDENTIFIER.
16232 This has two good effects. First, we remove a s/r conflict.
16233 Second, we allocate many fewer QualifiedIdentifier objects.
16235 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
16237 * attribute.cs: Handle MarshalAs attributes as pseudo, and
16238 set the correct information via SRE. This prevents
16239 hanging on the MS runtime. Fixes #29374.
16241 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
16243 * convert.cs: correctly handle conversions to value types
16244 from Enum and ValueType as unboxing conversions.
16246 Fixes bug #52569. Patch by Benjamin Jemlich.
16248 2004-01-02 Ravi Pratap <ravi@ximian.com>
16250 * expression.cs (BetterConversion): Prefer int -> uint
16251 over int -> ulong (csc's behaviour). This fixed bug #52046.
16253 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
16255 * decl.cs (MemberCache.FindMembers): now returns a
16258 * typemanager.cs: In general, go with with ^^.
16259 (CopyNewMethods): take an IList.
16260 (RealMemberLookup): Only allocate an arraylist
16261 if we copy from two sets of methods.
16263 This change basically does two things:
16264 1) Fewer array lists allocated due to CopyNewMethods.
16265 2) the explicit cast in MemberList costed ALOT.
16267 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
16269 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
16270 a hashtable to avoid needless string allocations when an identifier is
16271 used more than once (the common case).
16273 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
16275 * pending.cs: MS's TypeBuilder.GetInterfaces ()
16276 is broken, it will not return anything. So, we
16277 have to use the information we have in mcs to
16280 * typemanager.cs: Add a cache for GetInterfaces,
16281 since this will now be used more often (due to ^^)
16283 (GetExplicitInterfaces) New method that gets the
16284 declared, not effective, interfaces on a type
16285 builder (eg, if you have interface IFoo, interface
16286 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
16289 This patch makes MCS able to bootstrap itself on
16292 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
16294 * expression.cs: Remove the Nop's that Miguel put
16297 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
16299 * report.cs, codegen.cs: Give the real stack trace to
16300 the error when an exception is thrown.
16302 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
16304 * decl.cs: only allocate hashtables for ifaces if
16307 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
16309 * expression.cs: fix the error from cs0121-2.cs
16310 (a parent interface has two child interfaces that
16311 have a function with the same name and 0 params
16312 and the function is called through the parent).
16314 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
16316 * class.cs, rootcontext.cs, typmanager.cs: do not
16319 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
16321 * codegen.cs: remove stack for the ec flow branching.
16322 It is already a linked list, so no need.
16324 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
16326 * Makefile: Allow custom profiler here.
16328 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
16330 * typemanager.cs (LookupType):
16331 - Use a static char [], because split takes
16332 a param array for args, so it was allocating
16334 - Do not store true in a hashtable, it boxes.
16336 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
16338 * flowanalysis.cs: bytify common enums.
16340 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
16342 * modifiers.cs: Add a new set of flags for the
16343 flags allowed on explicit interface impls.
16344 * cs-parser.jay: catch the use of modifiers in
16345 interfaces correctly.
16346 * class.cs: catch private void IFoo.Blah ().
16348 All related to bug #50572.
16350 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
16352 * decl.cs: Rewrite the consistant accessability checking.
16353 Accessability is not linear, it must be implemented in
16354 a tableish way. Fixes #49704.
16356 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
16358 * expression.cs: Handle negation in a checked context.
16359 We must use subtraction from zero. Fixes #38674.
16361 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
16363 * class.cs: Ignore static void main in DLLs.
16364 * rootcontext.cs: Handle the target type here,
16365 since we are have to access it from class.cs
16366 * driver.cs: account for the above.
16368 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
16370 * report.cs: Give line numbers and files if available.
16372 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
16374 * driver.cs: Implement /addmodule.
16376 * typemanager.cs: Change 'modules' field so it now contains Modules not
16379 2003-12-20 Martin Baulig <martin@ximian.com>
16381 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
16382 (FieldBase.IsAssigned): Removed this field.
16383 (FieldBase.SetAssigned): New public method.
16384 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
16386 2003-12-20 Martin Baulig <martin@ximian.com>
16388 * expression.cs (LocalVariableReference.DoResolve): Don't set
16389 `vi.Used' if we're called from DoResolveLValue().
16391 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
16392 returns the usage vector it just merged into the current one -
16393 pass this one to UsageWarning().
16394 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
16395 of the `EmitContext', don't call this recursively on our children.
16397 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
16399 * driver.cs: Implement /target:module.
16401 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
16403 * support.cs (CharArrayHashtable): New helper class.
16405 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
16406 char arrays, not strings, so we can avoid creating a string in
16407 consume_identifier if the identifier is a keyword.
16409 2003-12-16 Martin Baulig <martin@ximian.com>
16411 * statement.cs (LocalInfo.Assigned): Removed this property.
16412 (LocalInfo.Flags): Removed `Assigned'.
16413 (LocalInfo.IsAssigned): New public method; takes the EmitContext
16414 and uses flow analysis.
16415 (Block.UsageWarning): Made this method private.
16416 (Block.Resolve): Call UsageWarning() if appropriate.
16418 * expression.cs (LocalVariableReference.DoResolve): Always set
16419 LocalInfo.Used here.
16421 2003-12-13 Martin Baulig <martin@ximian.com>
16423 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
16424 any value here; we're now using flow analysis to figure out
16425 whether a statement/block returns a value.
16427 2003-12-13 Martin Baulig <martin@ximian.com>
16429 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
16431 (FlowBranching.MergeFinally): Don't call
16432 `branching.CheckOutParameters()' here, this is called in
16434 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
16435 when adding the `finally' vector.
16437 2003-12-13 Martin Baulig <martin@ximian.com>
16440 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
16441 actually work and also fix #48962.
16443 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
16445 * decl.cs: Do not check System.Object for nested types,
16446 since we know it does not have any. Big bang for buck:
16449 Run 1: 8.35 seconds
16450 Run 2: 8.32 seconds
16451 corlib: 17.99 seconds
16453 Run 1: 8.17 seconds
16454 Run 2: 8.17 seconds
16455 corlib: 17.39 seconds
16457 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
16459 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
16460 time we are returning 0 members, so we save alot here.
16462 2003-12-11 Martin Baulig <martin@ximian.com>
16464 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
16465 `MergeChild()', also just take the `FlowBranching' as argument;
16466 call Merge() on it and return the result.
16467 (FlowBranching.Merge): We don't need to do anything if we just
16470 2003-12-11 Martin Baulig <martin@ximian.com>
16472 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
16473 them in an `ArrayList' to reduce memory usage. Thanks to Ben
16474 Maurer for this idea.
16476 2003-12-11 Martin Baulig <martin@ximian.com>
16478 * flowanalysis.cs (MergeResult): This class is now gone; we now
16479 use the `UsageVector' for this. The reason for this is that if a
16480 branching just has one sibling, we don't need to "merge" them at
16481 all - that's the next step to do.
16482 (FlowBranching.Merge): We now return a `UsageVector' instead of a
16485 2003-12-11 Martin Baulig <martin@ximian.com>
16487 Reworked flow analyis and made it more precise and bug-free. The
16488 most important change is that we're now using a special `Reachability'
16489 class instead of having "magic" meanings of `FlowReturns'. I'll
16490 do some more cleanups and optimizations and also add some more
16491 documentation this week.
16493 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
16494 largely reworked this class.
16495 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
16496 the new `Reachability' class instead of having "magic" values here.
16497 (FlowBranching): We're now using an instance of `Reachability'
16498 instead of having separate `Returns', `Breaks' etc. fields.
16500 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
16501 based on flow analysis; ignore the return value of block.Emit ().
16503 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
16505 * driver.cs typemanager.cs: Find the mono extensions to corlib even
16506 if they are private.
16508 2003-12-09 Martin Baulig <martin@ximian.com>
16510 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
16511 call them directly on the UsageVector.
16513 2003-12-09 Martin Baulig <martin@ximian.com>
16515 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
16516 Changed return type from `FlowReturns' to `Reachability'.
16518 2003-12-09 Martin Baulig <martin@ximian.com>
16520 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
16521 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
16522 `Reachable' fields with a single `Reachability' one.
16524 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
16526 * class.cs (FindMembers): Remove foreach's.
16531 Run 1: 8.74 seconds
16532 Run 2: 8.71 seconds
16535 Run 1: 8.64 seconds
16536 Run 2: 8.58 seconds
16539 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
16544 This patch does a few things:
16545 1. EmptyStatement is now a singleton, so it is never reallocated.
16546 2. All blah is EmptyStatement constructs have been changed to
16547 blah == EmptyStatement.Value, which is much faster and valid
16548 now that EmptyStatement is a singleton.
16549 3. When resolving a block, rather than allocating a new array for
16550 the non-empty statements, empty statements are replaced with
16551 EmptyStatement.Value
16552 4. Some recursive functions have been made non-recursive.
16553 Mainly the performance impact is from (3), however (1) and (2) are needed for
16554 this to work. (4) does not make a big difference in normal situations, however
16555 it makes the profile look saner.
16560 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
16561 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
16562 Total memory allocated: 56397 KB
16565 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
16566 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
16567 Total memory allocated: 55666 KB
16569 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
16571 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
16572 than the hashtable in a hashtable version
16574 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
16575 we always end up concating a string. This results in a huge perf
16576 loss, because many strings have to be tracked by the GC. In this
16577 patch, we first use a hashtable that works with two keys, so that
16578 the strings do not need to be concat'ed.
16582 Run 1: 8.74 seconds
16583 Run 2: 8.71 seconds
16586 Run 1: 8.65 seconds
16587 Run 2: 8.56 seconds
16589 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
16591 * Makefile: Add a new target `do-time' that does a quick and simple
16592 profile, leaving easy to parse output.
16594 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
16596 * codegen.cs (Init): Create the dynamic assembly with
16597 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
16599 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
16601 * support.cs: Make the PtrHashtable use only one
16602 instance of its comparer.
16604 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
16606 * typemanager.cs: Fix lookup of GetNamespaces.
16608 2003-11-29 Miguel de Icaza <miguel@ximian.com>
16610 * expression.cs: Removed redundant line.
16612 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
16613 ArrayLists, use for loops with bounds.
16615 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
16618 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
16619 arraylists, use for loop with bounds.
16621 The above three changes give us a 0.071 second performance
16622 improvement out of 3.294 seconds down to 3.223. On my machine
16623 the above changes reduced the memory usage by 1,387 KB during
16624 compiler bootstrap.
16626 * cs-parser.jay (QualifiedIdentifier): New class used to represent
16627 QualifiedIdentifiers. Before we created a new string through
16628 concatenation, and mostly later on, the result would be
16629 manipulated by DecomposeQI through string manipulation.
16631 This reduced the compiler memory usage for bootstrapping from
16632 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
16633 compile times in 0.05 seconds.
16635 2003-11-28 Dick Porter <dick@ximian.com>
16637 * support.cs: Do string compares with the Invariant culture.
16645 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
16646 the comparison is done with the Invariant culture.
16648 2003-11-27 Miguel de Icaza <miguel@ximian.com>
16650 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
16651 GetEnumerator method.
16653 (ProbeCollectionType): Iterate starting at the most specific type
16654 upwards looking for a GetEnumerator
16656 * expression.cs: Shift count can be up to 31 for int/uint and 63
16659 2003-11-26 Miguel de Icaza <miguel@ximian.com>
16661 * statement.cs (Block.LookupLabel): Also look for the label on the
16662 children blocks. Use a hash table to keep track of visited
16665 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
16666 we actually did transform the other operand, otherwise fall back
16667 to the common codepath that casts to long.
16669 * cs-tokenizer.cs: Use the same code pattern as the int case.
16670 Maybe I should do the parsing myself, and avoid depending on the
16671 Parse routines to get this done.
16673 2003-11-25 Miguel de Icaza <miguel@ximian.com>
16675 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
16676 which fixes bug 51347. This time test it.
16678 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
16679 attributes for example can not tell the difference between these.
16680 The difference was only a syntax feature of the language.
16682 * attribute.cs: Apply attributes to delegates.
16684 * delegate.cs: Call the apply attributes method.
16686 2003-11-24 Miguel de Icaza <miguel@ximian.com>
16688 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
16689 comparing 0 vs Byte.MinValue, not the value
16691 (ImplicitConversionRequired): When reporting a conversion error,
16692 use error 31 to print out the constant error instead of the
16695 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
16696 which fixes bug 51347.
16698 2003-11-22 Miguel de Icaza <miguel@ximian.com>
16700 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
16701 which fixes the -warnaserror command line option.
16703 2003-11-21 Miguel de Icaza <miguel@ximian.com>
16705 * cfold.cs (DoNumericPromotions): During constant folding of
16706 additions on UIntConstant, special case intconstants with
16707 IntConstants like we do on the expression binary operator.
16709 2003-11-12 Miguel de Icaza <miguel@ximian.com>
16711 * convert.cs (ImplicitReferenceConversion): We were missing a case
16712 (System.Enum are not value types or class types, so we need to
16713 classify them separatedly).
16715 * driver.cs: We do not support error 2007.
16717 2003-11-12 Jackson Harper <jackson@ximian.com>
16719 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
16720 system directory. Also use the full file name so users can
16721 libraries names mscorlib-o-tron.dll in a non system dir.
16723 2003-11-10 Martin Baulig <martin@ximian.com>
16725 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
16726 (TypeManager.InitCoreTypes): Initialize them here, but instead of
16727 calling `ResolveType()' on them, directly assign their `Type'.
16729 2003-11-08 Martin Baulig <martin@ximian.com>
16731 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
16732 return value and the `out parent' parameter.
16733 (TypeContainer.DefineType): Moved the CS0644 check into
16734 GetClassBases(). Don't pass the interface types to the
16735 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
16736 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
16738 * ecore.cs (TypeExpr.IsAttribute): New property.
16739 (TypeExpr.GetInterfaces): New method.
16741 * interface.cs (Interface.GetInterfaceTypeByName): Return a
16742 TypeExpr instead of a Type.
16743 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
16744 (Interface.DefineType): Don't pass the interface types to the
16745 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
16746 them later and then call `TypeBulider.AddInterfaceImplementation()'.
16748 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
16749 instead of a `Type[]'.
16750 (TypeManager.RegisterBuilder): Likewise.
16751 (TypeManager.AddUserInterface): Likewise.
16752 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
16753 `Type[]' and also return a `TypeExpr[]'.
16754 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
16756 2003-11-08 Martin Baulig <martin@ximian.com>
16758 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
16761 2003-11-08 Martin Baulig <martin@ximian.com>
16763 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
16764 TypeManager.ResolveExpressionTypes().
16766 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
16767 instead of an Expression.
16768 (TypeExpr): This is now an abstract base class for `TypeExpression'.
16769 (TypeExpression): New public class; formerly known as `TypeExpr'.
16771 * expression.cs (ComposedCast): Derive from TypeExpr.
16773 * typemanager.cs (TypeManager.system_*_expr): These are now
16774 TypExpr's instead of Expression's.
16775 (TypeManager.ResolveExpressionTypes): New public static function;
16776 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
16779 2003-11-06 Miguel de Icaza <miguel@ximian.com>
16781 * expression.cs (New.DoResolve): Do not dereference value that
16782 might be a null return.
16784 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
16785 sure that the constant value has the right type. Fixes an
16786 unreported bug, similar to 50425.
16788 * const.cs (Const.LookupConstantValue): Call
16789 ImplicitStandardConversionExists before doing a conversion to
16790 avoid havng the TypeManager.ChangeType do conversions.
16792 Reduced the number of casts used
16794 (Const.ChangeType): New routine to enable reuse of the constant
16795 type changing code from statement.
16797 * typemanager.cs (ChangeType): Move common initialization to
16798 static global variables.
16802 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
16803 every value type to go through, even if it was void. Fix that.
16805 * cs-tokenizer.cs: Use is_identifier_start_character on the start
16806 character of the define, and the is_identifier_part_character for
16807 the rest of the string.
16809 2003-11-05 Miguel de Icaza <miguel@ximian.com>
16811 * expression.cs (UnaryMutator.EmitCode): When I updated
16812 LocalVariableReference.DoResolve, I overdid it, and dropped an
16813 optimization done on local variable references.
16815 2003-11-04 Miguel de Icaza <miguel@ximian.com>
16817 * ecore.cs: Convert the return from Ldlen into an int.
16819 2003-10-20 Miguel de Icaza <miguel@ximian.com>
16821 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
16822 the accessibility, this is a special case for toplevel non-public
16823 classes (internal for instance).
16825 2003-10-20 Nick Drochak <ndrochak@gol.com>
16827 * ecore.cs: Fix typo and build. Needed another right paren.
16829 2003-10-19 Miguel de Icaza <miguel@ximian.com>
16831 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
16832 `internal' case regular and protected, but not allowing protected
16833 to be evaluated later. Bug 49840
16835 2003-10-15 Miguel de Icaza <miguel@ximian.com>
16837 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
16838 to kb.Nlast, and not the kb.nFirst to isolate the switch
16841 Extract the underlying type, so enumerations of long/ulong are
16842 treated like long/ulong.
16844 2003-10-14 Miguel de Icaza <miguel@ximian.com>
16846 * expression.cs (New): Overload the meaning of RequestedType to
16847 track the possible creation of the NewDelegate type, since
16848 DoResolve is invoked more than once for new constructors on field
16851 See bugs: #48800 and #37014
16853 * cs-parser.jay (declare_local_constants): Take an arraylist
16854 instead of a single constant.
16856 (local_constant_declaration): It should take a
16857 constant_declarators, not a constant_declarator. Fixes 49487
16859 * convert.cs: Fix error report.
16861 2003-10-13 Jackson Harper <jackson@ximian.com>
16863 * typemanager.cs (TypeToCoreType): Add float and double this fixes
16866 2003-10-09 Martin Baulig <martin@ximian.com>
16868 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
16870 (MethodCore.DoDefineParameters): Removed the TypeContainer
16871 argument; use the DeclSpace which was passed to the .ctor instead.
16872 (MethodCore.CheckParameter): Take a DeclSpace instead of a
16873 TypeContainer; we only need a DeclSpace here.
16875 2003-10-09 Martin Baulig <martin@ximian.com>
16877 * class.cs (MethodData): Added additional `DeclSpace ds' argument
16879 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
16880 EmitContext's .ctor.
16882 2003-10-09 Martin Baulig <martin@ximian.com>
16884 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
16885 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
16886 AsAccessible(), moved them as well.
16888 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
16890 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
16892 * cs-parser.jay : Renamed yyName to yyNames related to jay.
16894 2003-10-07 Miguel de Icaza <miguel@ximian.com>
16896 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
16897 generation for >=, as spotted by Paolo, bug 48679.
16898 Patch from David Waite.
16900 * cs-tokenizer.cs: Add handling for #pragma.
16902 * cs-parser.jay: Allow for both yield and yield return in the
16903 syntax. The anti-cobolization of C# fight will go on!
16905 * class.cs (TypeBuilder.DefineType): Catch error condition here
16906 (Parent.DefineType erroring out and returning null).
16908 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
16909 coping with enumerations variables, we were mistakenly processing
16910 them as a regular value type instead of built-in types. Fixes the
16913 * typemanager.cs (IsBuiltinOrEnum): New method.
16915 2003-09-30 Miguel de Icaza <miguel@ximian.com>
16917 * cs-parser.jay: Upgrade: yield now needs the return clause.
16919 2003-09-19 Martin Baulig <martin@ximian.com>
16921 * decl.cs (MemberCache.SetupCacheForInterface): Take a
16922 `MemberCache parent' argument. Normally, an interface doesn't
16923 have a parent type except System.Object, but we use this in gmcs
16924 for generic type parameters.
16926 2003-09-18 Martin Baulig <martin@ximian.com>
16928 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
16929 on `type.IsInterface'; don't check whether the type has a parent
16930 to determine whether it's an interface.
16932 2003-09-15 Martin Baulig <martin@ximian.com>
16934 * class.cs (TypeContainer.DefineType): Added an error flag to
16935 avoid reporting duplicate CS0146's ("class definition is
16938 * driver.cs (Driver.MainDriver): Abort if
16939 RootContext.ResolveTree() reported any errors.
16941 2003-09-07 Martin Baulig <martin@ximian.com>
16943 * report.cs (Error, Warning): Added overloaded versions which take
16944 a `params object[] args' and call String.Format().
16946 2003-09-07 Martin Baulig <martin@ximian.com>
16948 * decl.cs (DeclSpace..ctor): Don't call
16949 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
16950 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
16951 (DeclSpace.RecordDecl): New method.
16953 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
16955 2003-09-02 Ravi Pratap <ravi@ximian.com>
16957 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
16958 value attributes to be applied to ParameterBuilders.
16960 * class.cs (MethodCore.LabelParameters): Make static and more
16961 generic so that it can be used from other places - like interface
16962 methods, for instance.
16964 * interface.cs (Interface.Emit): Call LabelParameters before
16965 emitting attributes on the InterfaceMethod.
16967 2003-08-26 Martin Baulig <martin@ximian.com>
16969 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
16970 resolving aliases; fixes #47927.
16972 2003-08-26 Martin Baulig <martin@ximian.com>
16974 * statement.cs (Using.DoResolve): This is internally emitting a
16975 try/finally clause, so we need to set ec.NeedExplicitReturn if we
16976 do not always return. Fixes #47681.
16978 2003-08-26 Martin Baulig <martin@ximian.com>
16980 * decl.cs (MemberCore): Moved WarningNotHiding(),
16981 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
16983 (AdditionResult): Make this nested in DeclSpace.
16984 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
16985 argument; call NamespaceEntry.Define() unless we're nested in a
16988 * namespace.cs (Namespace.DefineName): New public function. This
16989 is called from DeclSpace's .ctor to add
16990 (Namespace.Lookup): Include DeclSpaces in the lookup.
16992 * class.cs (Operator): Derive from MemberBase, not MemberCore.
16994 * const.cs (Const): Derive from MemberBase, not MemberCore.
16996 2003-08-25 Martin Baulig <martin@ximian.com>
16998 * convert.cs (Convert.ExplicitReferenceConversion): When
16999 converting from an interface type to a class, unbox if the target
17000 type is a struct type. Fixes #47822.
17002 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17004 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
17007 2003-08-22 Martin Baulig <martin@ximian.com>
17009 * class.cs (TypeManager.DefineType): When defining a nested type,
17010 call DefineType() on our parent; fixes #47801.
17012 2003-08-22 Martin Baulig <martin@ximian.com>
17014 * class.cs (MethodData.Define): While checking if a method is an
17015 interface implementation, improve the test a bit more to fix #47654.
17017 2003-08-22 Martin Baulig <martin@ximian.com>
17019 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
17020 correctly; fixes #47722.
17022 2003-08-22 Martin Baulig <martin@ximian.com>
17024 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
17025 LocalVariableReference, ensure it's not read-only. Fixes #47536.
17027 * statement.cs (Fixed.DoResolve): Make all variables read-only.
17029 2003-08-22 Martin Baulig <martin@ximian.com>
17031 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
17032 can only be assigned in static constructors. Fixes #47161.
17034 2003-08-22 Martin Baulig <martin@ximian.com>
17036 Rewrote and improved the flow analysis code.
17038 * flowbranching.cs (FlowBranching): Make this class abstract.
17039 (FlowBranching.CreateBranching): New static function to create a
17040 new flow branching.
17041 (FlowBranchingBlock, FlowBranchingException): New classes.
17042 (FlowBranching.UsageVector.Type): New public readonly field.
17043 (FlowBranching.UsageVector.Breaks): Removed the setter.
17044 (FlowBranching.UsageVector.Returns): Removed the setter.
17045 (FlowBranching.UsageVector): Added Break(), Return(),
17046 NeverReachable() and Throw() methods to modify the reachability.
17047 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
17048 done by FlowBranching.Merge().
17049 (FlowBranching.UsageVector.MergeChild): New method; merges the
17050 merge result into the current vector.
17051 (FlowBranching.Merge): New abstract method to merge a branching.
17053 2003-08-12 Martin Baulig <martin@ximian.com>
17055 * expression.cs (Indirection.CacheTemporaries): Create the
17056 LocalTemporary with the pointer type, not its element type.
17058 2003-08-10 Miguel de Icaza <miguel@ximian.com>
17060 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
17061 token was a keyword or not.
17063 Add `error' options where an IDENTIFIER was expected; Provide
17064 CheckToken and CheckIdentifierToken convenience error reporting
17067 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
17069 * decl.cs: Rename `NamespaceEntry Namespace' public field into
17070 NameSpaceEntry NameSpaceEntry.
17072 (LookupInterfaceOrClass): Avoid creating a full qualified name
17073 from namespace and name: avoid doing lookups when we know the
17074 namespace is non-existant. Use new Tree.LookupByNamespace which
17075 looks up DeclSpaces based on their namespace, name pair.
17077 * driver.cs: Provide a new `parser verbose' to display the
17078 exception thrown during parsing. This is turned off by default
17079 now, so the output of a failure from mcs is more graceful.
17081 * namespace.cs: Track all the namespaces defined in a hashtable
17084 (IsNamespace): New method
17086 2003-08-09 Miguel de Icaza <miguel@ximian.com>
17088 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
17089 we know that we need to concatenate (full typename can never be
17094 * statement.cs: Use a bitfield; Do not initialize to null things
17095 which are done by the constructor by default.
17097 * cs-parser.jay: bug fix, parameter was 4, not 3.
17099 * expression.cs: Just use the property;
17101 * statement.cs: No need for GetVariableInfo method.
17103 2003-08-08 Martin Baulig <martin@ximian.com>
17105 * flowanalysis.cs (FlowReturns): This is now nested in the
17106 `FlowBranching' class.
17107 (MyBitVector): Moved this here from statement.cs.
17108 (FlowBranching.SiblingType): New enum type.
17109 (FlowBranching.CreateSibling): Added `SiblingType' argument.
17111 2003-08-07 Martin Baulig <martin@ximian.com>
17113 * flowanalysis.cs (FlowBranchingType): This is now nested in the
17114 `FlowBranching' class and called `BranchingType'.
17116 2003-08-07 Martin Baulig <martin@ximian.com>
17118 * flowanalysis.cs: Moved all the control flow analysis code into
17121 2003-08-07 Martin Baulig <martin@ximian.com>
17123 * assign.cs (Assign.DoResolve): `target' must either be an
17124 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
17127 2003-08-07 Miguel de Icaza <miguel@ximian.com>
17129 * expression.cs (BinaryMethod): This kind of expression is created by the
17130 Binary class if it determines that the operator has to be handled
17133 (BinaryDelegate): This kind of expression is created if we are
17134 dealing with a + or - operator on delegates.
17136 (Binary): remove method, argumetns, and DelegateOperator: when
17137 dealing with methods,
17139 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
17141 * statement.cs (Block): use bitfields for the three extra booleans
17142 we had in use. Remove unused topblock parameter.
17144 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
17146 * assign.cs: Drop extra unneeded tests.
17148 2003-08-06 Miguel de Icaza <miguel@ximian.com>
17150 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
17152 * statement.cs (Foreach): Use VariableStorage instead of
17155 * codegen.cs (VariableStorage): New class used by clients that
17156 require a variable stored: locals or fields for variables that
17157 need to live across yield.
17159 Maybe provide a convenience api for EmitThis+EmitLoad?
17161 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
17164 2003-08-05 Miguel de Icaza <miguel@ximian.com>
17166 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
17167 RemapParameterLValue): New methods that are used to turn a
17168 precomputed FieldInfo into an expression like this:
17172 The idea is to use this instead of making LocalVariableReference
17173 have more than one meaning.
17175 * cs-parser.jay: Add error production to BASE.
17177 * ecore.cs: Deal with TypeManager.GetField returning null, which
17178 is now a valid return value.
17180 (FieldExprNoAddress): New expression for Fields whose address can
17183 * expression.cs (LocalVariableReference): During the resolve
17184 phases, create new expressions if we are in a remapping context.
17185 Remove code that dealt with remapping here.
17187 (ParameterReference): same.
17189 (ProxyInstance): New expression, like the `This' expression, but
17190 it is born fully resolved. We know what we are doing, so remove
17191 the errors that are targeted to user-provided uses of `this'.
17193 * statement.cs (Foreach): our variable is now stored as an
17194 Expression; During resolution, follow the protocol, dont just
17195 assume it will return this.
17197 2003-08-06 Martin Baulig <martin@ximian.com>
17199 * support.cs (SeekableStreamReader.cs): New public class.
17201 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
17202 SeekableStreamReader instead of the normal StreamReader.
17204 2003-08-04 Martin Baulig <martin@ximian.com>
17206 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
17207 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
17208 deambiguate casts and delegate invocations.
17209 (parenthesized_expression): Use the new tokens to ensure this is
17210 not a cast of method invocation.
17212 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
17213 when reading a `)' and Deambiguate_CloseParens () was previously
17216 * expression.cs (ParenthesizedExpression): New class. This is
17217 just used for the CS0075 test.
17218 (Binary.DoResolve): Check for CS0075.
17220 2003-07-29 Ravi Pratap <ravi@ximian.com>
17222 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
17223 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
17224 reference comparison.
17226 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
17227 examine the ReturnType for equality - this is necessary in the
17228 cases of implicit and explicit operators whose signature also
17229 includes the return type.
17231 2003-07-26 Miguel de Icaza <miguel@ximian.com>
17233 * namespace.cs: Cache the result of the namespace computation,
17234 instead of computing it every time.
17236 2003-07-24 Miguel de Icaza <miguel@ximian.com>
17238 * decl.cs: Use a global arraylist that we reuse over invocations
17239 to avoid excesive memory consumption. Reduces memory usage on an
17240 mcs compile by one meg (45 average).
17242 * typemanager.cs (LookupTypeReflection): In .NET pointers are
17243 private, work around that.
17245 2003-07-23 Miguel de Icaza <miguel@ximian.com>
17247 * literal.cs (IntLiteral): Define Zero and One static literals.
17249 * cs-parser.jay (integer_literal): use static literals to reduce
17250 memory usage for the most used literals (0, 1 and -1). 211kb
17251 reduced in memory usage.
17253 Replace all calls to `new ArrayList' with `new
17254 ArrayList(4)' which is a good average number for most allocations,
17255 and also requires only 16 bytes of memory for its buffer by
17258 This reduced MCS memory usage in seven megabytes for the RSS after
17261 2003-07-28 Ravi Pratap <ravi@ximian.com>
17263 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
17264 handle params methods the correct way by forming only one
17265 applicable set with params and normal methods in them. Earlier we
17266 were looking at params methods only if we found no normal methods
17267 which was not the correct thing to do.
17269 (Invocation.BetterFunction): Take separate arguments indicating
17270 when candidate and the best method are params methods in their
17273 This fixes bugs #43367 and #46199.
17275 * attribute.cs: Documentation updates.
17277 (CheckAttribute): Rename to CheckAttributeTarget.
17278 (GetValidPlaces): Rename to GetValidTargets.
17280 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
17281 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
17285 2003-07-28 Martin Baulig <martin@ximian.com>
17287 * class.cs (TypeContainer.DefineMembers): Use the base type's full
17288 name when looking up the base class of a nested class. Fixes #46977.
17290 2003-07-26 Martin Baulig <martin@ximian.com>
17292 * expression.cs (Indexers.Indexer): New nested struct; contains
17293 getter, setter and the indexer's type.
17294 (Indexers.Properties): This is now an ArrayList of
17295 Indexers.Indexer's.
17296 (IndexerAccess.DoResolveLValue): Correctly set the type if the
17297 indexer doesn't have any getters.
17299 * assign.cs (Assign.DoResolve): Also do the implicit conversions
17300 for embedded property and indexer assignments.
17302 2003-07-26 Martin Baulig <martin@ximian.com>
17304 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
17305 preprocessor directive is not the first non-whitespace character
17308 2003-07-26 Martin Baulig <martin@ximian.com>
17310 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
17311 namespace parsing, follow the spec more closely.
17313 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
17314 NamespaceEntry.Lookup().
17316 2003-07-25 Martin Baulig <martin@ximian.com>
17318 * MethodCore.cs (OverridesSomething): New public field; it's set
17319 from TypeContainer.DefineMembers if this method overrides
17320 something (which doesn't need to be a method). Fix #39462.
17322 2003-07-25 Ravi Pratap <ravi@ximian.com>
17324 * typemanager.cs (GetMembers): Ensure that the list of members is
17325 reversed. This keeps things in sync.
17327 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
17328 find an AttributeUsage attribute.
17330 * expression.cs (Invocation.OverloadResolve): Perform the check
17331 which disallows Invoke to be directly called on a Delegate.
17333 (Error_InvokeOnDelegate): Report error cs1533.
17335 2003-07-25 Martin Baulig <martin@ximian.com>
17337 * expression.cs (Indexers.GetIndexersForType): Only look in the
17338 interface hierarchy if the requested type is already an
17339 interface. Fixes #46788 while keeping #46502 fixed.
17341 2003-07-25 Martin Baulig <martin@ximian.com>
17343 * class.cs (TypeContainer.DefineMembers): Check whether all
17344 readonly fields have been assigned and report warning CS0649 if
17347 * statement.cs (LocalInfo.IsFixed): Always return true if this is
17350 2003-07-24 Ravi Pratap <ravi@ximian.com>
17352 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
17353 returned from GetMethods to make things consistent with the
17354 assumptions MCS makes about ordering of methods.
17356 This should comprehensively fix bug #45127 and it does :-)
17358 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
17359 ordering is actually reverse.
17361 * Clean up some debug messages I left lying around.
17363 * interface.cs (Populate*): Get rid of code which emits attributes
17364 since the stage in which we emit attributes is the 'Emit' stage,
17365 not the define stage.
17367 (Emit): Move attribute emission for interface members here.
17369 2003-07-22 Ravi Pratap <ravi@ximian.com>
17371 * expression.cs (Invocation.OverloadResolve): Follow the spec more
17372 closely: we eliminate methods in base types when we have an
17373 applicable method in a top-level type.
17375 Please see section 14.5.5.1 for an exact description of what goes
17378 This fixes bug #45127 and a host of other related to corlib compilation.
17380 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
17381 array is the method corresponding to the top-level type (this is
17382 because of the changes made to icall.c) so we change this
17385 (MethodGroupExpr.Name): This too.
17387 * typemanager.cs (GetElementType): New method which does the right
17388 thing when compiling corlib.
17390 * everywhere: Make use of the above in the relevant places.
17392 2003-07-22 Martin Baulig <martin@ximian.com>
17394 * cs-parser.jay (invocation_expression): Moved
17395 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
17396 `cast_expression', but create a InvocationOrCast which later
17397 resolves to either an Invocation or a Cast.
17399 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
17400 method; call this before EmitStatement() to make sure that this
17401 expression can be used as a statement.
17403 * expression.cs (InvocationOrCast): New class; resolves to either
17404 an Invocation or a Cast.
17406 * statement.cs (StatementExpression): Call ResolveStatement() on
17407 the ExpressionStatement before emitting it.
17409 2003-07-21 Martin Baulig <martin@ximian.com>
17411 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
17412 `ref' and `out' attributes match; fixes #46220.
17413 (MemberAccess.ResolveMemberAccess): You can't reference a type
17414 through an expression; fixes #33180.
17415 (Indexers.GetIndexersForType): Don't return the indexers from
17416 interfaces the class implements; fixes #46502.
17418 2003-07-21 Martin Baulig <martin@ximian.com>
17420 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
17421 CS0661 checks; fixes bug #30442.
17423 2003-07-21 Martin Baulig <martin@ximian.com>
17425 * decl.cs (AdditionResult): Added `Error'.
17427 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
17429 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
17430 makes cs0031.cs actually work.
17432 2003-07-20 Martin Baulig <martin@ximian.com>
17434 * namespace.cs: Fixed that bug which caused a crash when compiling
17435 the debugger's GUI.
17437 2003-07-20 Miguel de Icaza <miguel@ximian.com>
17439 * typemanager.cs (LookupTypeReflection): Never expose types which
17440 are NotPublic, NestedPrivate, NestedAssembly, or
17441 NestedFamANDAssem. We used to return these, and later do a check
17442 that would report a meaningful error, but the problem is that we
17443 would not get the real match, if there was a name override.
17445 2003-07-18 Miguel de Icaza <miguel@ximian.com>
17447 * namespace.cs (Namespace, Name): Do not compute the namespace
17448 name dynamically, compute it in the constructor. This reduced
17449 memory usage by 1697 KB.
17451 * driver.cs: Use --pause to pause at the end.
17453 2003-07-17 Peter Williams <peter@newton.cx>
17455 * Makefile: Change the name of the test target so that it doesn't
17456 conflict with the recursive test target.
17458 2003-07-17 Miguel de Icaza <miguel@ximian.com>
17460 * expression.cs (LocalVariableReference.Emit, EmitAssign,
17461 AddressOf): Do not use EmitThis, that was wrong, use the actual
17464 2003-07-15 Miguel de Icaza <miguel@ximian.com>
17466 * class.cs (MethodData.Define): While checking if a method is an
17467 interface implementation, improve the test: If we are not public
17468 (use new test here: use the computed MethodAttributes directly,
17469 instead of the parsed modifier flags) check if the `implementing'
17470 method comes from an interface or not.
17472 * pending.cs (VerifyPendingMethods): Slightly better error
17475 * makefile: add test target that does the mcs bootstrap.
17477 2003-07-16 Ravi Pratap <ravi@ximian.com>
17479 * interface.cs (Define): Do nothing here since there are no
17480 members to populate etc. Move the attribute emission out of here
17481 since this was just totally the wrong place to put it. Attribute
17482 application happens during the 'Emit' phase, not in the 'Define'
17485 (Emit): Add this method and move the attribute emission here
17487 * rootcontext.cs (EmitCode): Call the Emit method on interface
17490 2003-07-14 Ravi Pratap M <ravi@ximian.com>
17492 * expression.cs (OverloadResolve): Report error only if Location
17493 is not 'Null' which means that there was a probe going on.
17495 2003-07-14 Martin Baulig <martin@ximian.com>
17497 * expression.cs (ConditionalLogicalOperator): New public class to
17498 implement user defined conditional logical operators.
17499 This is section 14.11.2 in the spec and bug #40505.
17501 2003-07-14 Martin Baulig <martin@ximian.com>
17503 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
17505 2003-07-14 Martin Baulig <martin@ximian.com>
17507 * codegen.cs (EmitContext.InFixedInitializer): New public field.
17509 * ecore.cs (IVariable.VerifyFixed): New interface method.
17511 * expression.cs (Unary.ResolveOperator): When resolving the `&'
17512 operator, check whether the variable is actually fixed. Fixes bug
17513 #36055. Set a variable definitely assigned when taking its
17514 address as required by the spec.
17516 * statement.cs (LocalInfo.IsFixed): New field.
17517 (LocalInfo.MakePinned): Set `IsFixed' to true.
17519 2003-07-14 Ravi Pratap M <ravi@ximian.com>
17521 * attribute.cs (Attribute.Resolve): While doing a Member lookup
17522 for .ctors, ensure that we only ask for members declared in the
17523 attribute type (BindingFlags.DeclaredOnly).
17527 * expression.cs (Error_WrongNumArguments): Report error 1501
17528 correctly the way CSC does.
17530 2003-07-13 Martin Baulig <martin@ximian.com>
17532 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
17533 lookup on the fully qualified name, to make things like "X.X" work
17534 where "X.X" is a fully qualified type name, but we also have a
17535 namespace "X" in the using list. Fixes #41975.
17537 2003-07-13 Martin Baulig <martin@ximian.com>
17539 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
17540 function. If we're a CompoundAssign, we need to create an embedded
17541 CompoundAssign, not an embedded Assign.
17542 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
17545 2003-07-13 Martin Baulig <martin@ximian.com>
17547 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
17548 work to fix bug #46088.
17550 2003-07-13 Ravi Pratap <ravi@ximian.com>
17552 * class.cs (Operator.Emit): Do not emit attributes here - it is
17553 taken care of by the Method class that we delegate too. This takes
17554 care of bug #45876.
17556 2003-07-10 Martin Baulig <martin@ximian.com>
17558 * expression.cs (TypeOfVoid): New class.
17559 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
17561 2003-07-10 Martin Baulig <martin@ximian.com>
17563 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
17566 2003-07-10 Martin Baulig <martin@ximian.com>
17568 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
17569 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
17571 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
17573 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
17575 2003-07-10 Martin Baulig <martin@ximian.com>
17577 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
17578 of decimal. Fixes #42850.
17580 NOTE: I also fixed the created byte blob, but this doesn't work on
17581 the MS runtime and csc never produces any byte blobs for decimal
17584 2003-07-10 Martin Baulig <martin@ximian.com>
17586 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
17587 structs; fixes #32068.
17588 (Block.AddChildVariableNames): Fixed #44302.
17590 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17592 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
17594 2003-07-07 Miguel de Icaza <miguel@ximian.com>
17596 * attribute.cs: And this test is onger needed.
17598 2003-07-08 Martin Baulig <martin@ximian.com>
17600 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
17601 inaccessible types. Fixes #36313.
17603 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
17605 * namespace.cs (NamespaceEntry): Create implicit entries for all
17606 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
17607 implicit entries for N1.N2 and N1.
17609 2003-07-08 Martin Baulig <martin@ximian.com>
17611 Rewrote the handling of namespaces to fix a lot of the issues
17612 wrt. `using' aliases etc.
17614 * namespace.cs (Namespace): Splitted this class into a
17615 per-assembly `Namespace' and a per-file `NamespaceEntry'.
17617 * typemanager.cs (TypeManager.IsNamespace): Removed.
17618 (TypeManager.ComputeNamespaces): Only compute namespaces from
17619 loaded assemblies here, not the namespaces from the assembly we're
17620 currently compiling.
17622 2003-07-08 Martin Baulig <martin@ximian.com>
17624 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
17626 2003-07-07 Miguel de Icaza <miguel@ximian.com>
17628 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
17631 I thought about the memory savings here, but LookupTypeReflection
17632 is used under already very constrained scenarios. Compiling
17633 corlib or mcs only exposes one hit, so it would not really reduce
17634 any memory consumption.
17636 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17638 * typemanager.cs: fixes bug #45889 by only adding public types from
17639 other assemblies to the list of known types.
17641 2003-07-07 Miguel de Icaza <miguel@ximian.com>
17643 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
17644 on the type we resolved.
17646 2003-07-05 Martin Baulig <martin@ximian.com>
17648 * pending.cs (PendingImplementation.ParentImplements): Don't
17649 create the proxy if the parent is abstract.
17651 * class.cs (TypeContainer.DefineIndexers): Process explicit
17652 interface implementations first. Fixes #37714.
17654 2003-07-04 Miguel de Icaza <miguel@ximian.com>
17656 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
17657 defined recursively; but since we modify the input parameters
17658 (left is set to `this' temporarily), we reset this value if the
17659 left_is_explicit is false, which gives the original semantics to
17662 * literal.cs (NullPointer): new class used to represent a null
17663 literal in a pointer context.
17665 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
17666 type is a pointer, use a NullPointer object instead of a
17667 NullLiteral. Closes 43687
17669 (ExplicitConversion): Convert pointer values using
17670 the conv opcode to the proper type.
17672 * ecore.cs (New): change ValueTypeVariable property into a method,
17673 that returns whether the valuetype is suitable for being used.
17675 * expression.cs (Binary.DoNumericPromotions): Only return if we
17676 the int constant was a valid uint, and we can return both left and
17677 right as uints. If not, we continue processing, to trigger the
17678 type conversion. This fixes 39018.
17680 * statement.cs (Block.EmitMeta): During constant resolution, set
17681 the CurrentBlock property on the emitcontext, so that we resolve
17682 constants propertly.
17684 2003-07-02 Martin Baulig <martin@ximian.com>
17686 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
17687 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
17689 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
17690 than emitting it here.
17692 * statement.cs: Fixed some more flow analysis bugs.
17694 2003-07-02 Martin Baulig <martin@ximian.com>
17696 * class.cs (MethodData.Define): When implementing interface
17697 methods, set Final unless we're Virtual.
17699 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
17700 check work for interface methods.
17702 2003-07-01 Martin Baulig <martin@ximian.com>
17704 * ecore.cs (EmitContext.This): Replaced this property with a
17705 GetThis() method which takes a Location argument. This ensures
17706 that we get the correct error location for a CS0188.
17708 2003-07-01 Miguel de Icaza <miguel@ximian.com>
17710 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
17711 ImplicitStandardConversion.
17713 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
17715 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
17717 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
17720 2003-06-30 Miguel de Icaza <miguel@ximian.com>
17722 * class.cs (Constructor.Define): Turn off initlocals for unsafe
17725 (MethodData.Define): Turn off initlocals for unsafe methods.
17727 2003-06-29 Miguel de Icaza <miguel@ximian.com>
17729 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
17730 complete; Fixes #37521.
17732 * delegate.cs: Use Modifiers.TypeAttr to compute the
17733 TypeAttributes, instead of rolling our own. This makes the flags
17734 correct for the delegates.
17736 2003-06-28 Miguel de Icaza <miguel@ximian.com>
17738 * class.cs (Constructor.Define): Set the private flag for static
17739 constructors as well.
17741 * cs-parser.jay (statement_expression): Set the return value to
17742 null, to avoid a crash when we catch an error.
17744 2003-06-24 Miguel de Icaza <miguel@ximian.com>
17746 * cs-parser.jay: Applied patch from Jackson that adds support for
17747 extern and unsafe modifiers to destructor declarations.
17749 * expression.cs: Report error 21 if the user is trying to index a
17752 * driver.cs: Add an error message, suggested by the bug report.
17754 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
17755 if we do not have a ": this ()" constructor initializer. Fixes 45149
17757 2003-06-14 Miguel de Icaza <miguel@ximian.com>
17759 * namespace.cs: Add some information to reduce FAQs.
17761 2003-06-13 Miguel de Icaza <miguel@ximian.com>
17763 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
17764 underlying enumeration types. Fixes #43915.
17766 * expression.cs: Treat ushort/short as legal values to be used in
17767 bitwise operations.
17769 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
17771 * delegate.cs: transfer custom attributes for paramenters from
17772 the delegate declaration to Invoke and BeginInvoke.
17774 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
17776 * attribute.cs: handle custom marshalers and emit marshal info
17779 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
17781 * makefile.gnu: Added anonymous.cs to the compiler sources.
17783 2003-05-28 Miguel de Icaza <miguel@ximian.com>
17785 * iterators.cs: Change the name of the proxy class to include two
17788 * cs-parser.jay: Update grammar to include anonymous methods.
17790 * anonymous.cs: new file.
17792 2003-05-27 Miguel de Icaza <miguel@ximian.com>
17794 * class.cs (Field.Define): Add missing test for pointers and
17797 2003-05-27 Ravi Pratap <ravi@ximian.com>
17799 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
17800 we use the stobj opcode.
17802 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
17803 since it wasn't the correct fix.
17805 It still is puzzling that we are required to use stobj for IntPtr
17806 which seems to be a ValueType.
17808 2003-05-26 Miguel de Icaza <miguel@ximian.com>
17810 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
17811 during regular simple name resolution. Now, the trick is that
17812 instead of returning for processing the simplename, we do a
17813 TypeManager.LookupType (ie, a rooted lookup as opposed to a
17814 contextual lookup type). If a match is found, return that, if
17815 not, return for further composition.
17817 This fixes long-standing 30485.
17819 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
17820 using the address to initialize an object, do an Stobj instead of
17821 using the regular Stelem.
17823 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
17824 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
17825 Because if we are a BaseIndexerAccess that value will be true.
17828 * statement.cs (GotoCase.Resolve): Return after reporting an
17829 error, do not attempt to continue.
17831 * expression.cs (PointerArithmetic.Emit): If our operand is a
17832 long, convert our constants to match the operand before
17833 multiplying. Convert to I type before adding. Fixes 43670.
17835 2003-05-14 Ravi Pratap <ravi@ximian.com>
17837 * enum.cs (ImplicitConversionExists) : Rename to
17838 ImplicitEnumConversionExists to remove ambiguity.
17840 * ecore.cs (NullCast): New type of cast expression class which
17841 basically is very similar to EmptyCast with the difference being
17842 it still is a constant since it is used only to cast a null to
17844 (eg. (string) null)
17846 * convert.cs (ImplicitReferenceConversion): When casting a null
17847 literal, we return a NullCast.
17849 * literal.cs (NullLiteralTyped): Remove - I don't see why this
17850 should be around anymore.
17852 The renaming (reported was slightly wrong). Corrections:
17854 ConvertImplicitStandard -> ImplicitConversionStandard
17855 ConvertExplicitStandard -> ExplicitConversionStandard
17857 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
17858 before passing them in !
17860 * convert.cs (ImplicitConversionStandard): When comparing for
17861 equal expr and target types, ensure that expr is not a
17864 In general, we must not be checking (expr_type ==
17865 target_type) in the top level conversion methods
17866 (ImplicitConversion, ExplicitConversion etc). This checking is
17867 done in the methods that they delegate to.
17869 2003-05-20 Miguel de Icaza <miguel@ximian.com>
17871 * convert.cs: Move Error_CannotConvertType,
17872 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
17873 ImplicitNumericConversion, ImplicitConversionExists,
17874 ImplicitUserConversionExists, StandardConversionExists,
17875 FindMostEncompassedType, FindMostSpecificSource,
17876 FindMostSpecificTarget, ImplicitUserConversion,
17877 ExplicitUserConversion, GetConversionOperators,
17878 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
17879 TryImplicitIntConversion, Error_CannotConvertImplicit,
17880 ConvertImplicitRequired, ConvertNumericExplicit,
17881 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
17882 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
17885 Perform the following renames:
17887 StandardConversionExists -> ImplicitStandardConversionExists
17888 ConvertImplicit -> ImplicitConversion
17889 ConvertImplicitStandard -> ImplicitStandardConversion
17890 TryImplicitIntConversion -> ImplicitIntConversion
17891 ConvertImplicitRequired -> ImplicitConversionRequired
17892 ConvertNumericExplicit -> ExplicitNumericConversion
17893 ConvertReferenceExplicit -> ExplicitReferenceConversion
17894 ConvertExplicit -> ExplicitConversion
17895 ConvertExplicitStandard -> ExplicitStandardConversion
17897 2003-05-19 Martin Baulig <martin@ximian.com>
17899 * statement.cs (TypeInfo.StructInfo): Made this type protected.
17900 (TypeInfo): Added support for structs having structs as fields.
17902 * ecore.cs (FieldExpr): Implement IVariable.
17903 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
17904 VariableInfo for the field.
17906 2003-05-18 Martin Baulig <martin@ximian.com>
17908 * expression.cs (This.DoResolve): Report a CS0027 if we're
17909 emitting a field initializer.
17911 2003-05-18 Martin Baulig <martin@ximian.com>
17913 * expression.cs (This.ResolveBase): New public function.
17914 (This.DoResolve): Check for CS0188.
17916 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
17919 * ecore.cs (MethodGroupExpr.DoResolve): Set the
17920 `instance_expression' to null if we don't have any non-static
17923 2003-05-18 Martin Baulig <martin@ximian.com>
17925 Reworked the way how local variables and parameters are handled by
17926 the flow analysis code.
17928 * statement.cs (TypeInfo, VariableMap): New public classes.
17929 (VariableInfo): New public class. This is now responsible for
17930 checking whether a variable has been assigned. It is used for
17931 parameters and local variables.
17932 (Block.EmitMeta): Take the InternalParameters as argument; compute
17933 the layout of the flow vectors here.
17934 (Block.LocalMap, Block.ParameterMap): New public properties.
17935 (FlowBranching): The .ctor doesn't get the InternalParameters
17936 anymore since Block.EmitMeta() now computes the layout of the flow
17938 (MyStructInfo): This class is now known as `StructInfo' and nested
17939 in `TypeInfo'; we don't access this directly anymore.
17941 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
17942 property and removed IsAssigned(), IsFieldAssigned(),
17943 SetAssigned() and SetFieldAssigned(); we now call them on the
17944 VariableInfo so we don't need to duplicate this code everywhere.
17946 * expression.cs (ParameterReference): Added `Block block' argument
17948 (LocalVariableReference, ParameterReference, This): The new
17949 VariableInfo class is now responsible for all the definite
17952 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
17953 IsParameterAssigned, SetParameterAssigned): Removed.
17955 2003-05-18 Martin Baulig <martin@ximian.com>
17957 * typemanager.cs (InitCoreTypes): Try calling
17958 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
17959 the 3-args-version. Corlib now also needs our `void_type'.
17960 (GetMethod): Added overloaded version which takes an optional
17961 `bool report_errors' to allow lookups of optional methods.
17963 2003-05-12 Martin Baulig <martin@ximian.com>
17965 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
17966 only used for locals and not for parameters.
17968 2003-05-12 Miguel de Icaza <miguel@ximian.com>
17970 * support.cs (InternalParameters.ParameterType): Return the
17971 ExternalType of the parameter.
17973 * parameter.cs (Parameter.ExternalType): drop the two arguments,
17976 2003-05-11 Miguel de Icaza <miguel@ximian.com>
17978 * class.cs (MethodData.Define): Do not set the `newslot' on
17979 interface members, if they are also flagged as "override".
17981 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
17982 better code for ++i and i++. This only works for static fields
17983 and local variables.
17985 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
17986 want to pull the DeclSpace out of the builder_to_declspace instead
17987 of the TypeBuilder (like in TypeContainer.FindMembers).
17989 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
17990 instead of LookupTypeContainer. Fixes the crash on .NET for
17991 looking up interface members.
17993 * const.cs: Create our own emit context during the Definition
17994 stage, so that constants are evaluated in the proper context, when
17995 a recursive definition happens.
17997 2003-05-11 Martin Baulig <martin@ximian.com>
17999 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
18000 new block for a switch section.
18001 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
18002 the adding/lookup in the switch block. Fixes #39828.
18004 2003-05-09 Miguel de Icaza <miguel@ximian.com>
18006 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
18007 functionality: I needed to convert the data after I had performed
18008 the add/sub operation into the operands type size.
18010 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
18011 pass the type for the box operation, otherwise the resulting
18012 object would have been of type object.
18014 (BoxedCast): Add constructor to specify the type to box as.
18016 2003-05-07 Miguel de Icaza <miguel@ximian.com>
18018 * iterators.cs: I was reusing the `count' variable inadvertently,
18019 take steps to not allow this to happen.
18021 2003-05-06 Miguel de Icaza <miguel@ximian.com>
18023 * attribute.cs (Attribute.Resolve): Params attributes are encoded
18024 by creating an array at the point where the params starts and
18025 putting all those arguments there, then adjusting the size of the
18028 2003-05-05 Miguel de Icaza <miguel@ximian.com>
18030 * expression.cs (New.AddressOf): Implement interface
18031 IMemoryLocation. This is used when the `new' operator is used in
18032 the context of an invocation to a method on a value type.
18034 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
18037 * namespace.cs: Also check the using aliases here.
18039 * driver.cs: Move the test for using validity after the types have
18040 been entered, so we do a single pass that also includes the using
18043 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
18044 in the regular case. CreateSiblingForFinally is doing extra
18047 * attribute.cs (GetAttributeArgumentExpression): Store the result
18048 on an out value, and use the return value to indicate failure
18049 instead of using null (which is a valid return for Constant.GetValue).
18051 * statement.cs: Perform the analysis flow for the increment
18052 portion after the statement, because this will be the real flow of
18053 execution. Fixes #42385
18055 * codegen.cs (EmitContext.EmitArgument,
18056 EmitContext.EmitStoreArgument): New helper functions when the
18057 RemapToProxy flag is set.
18059 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
18062 Add support for remapping parameters.
18064 * iterators.cs: Propagate parameter values; Store parameter
18065 values in the proxy classes.
18067 2003-05-04 Miguel de Icaza <miguel@ximian.com>
18069 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
18070 need a proxy reference; I do not know what I was thinking
18072 * cs-parser.jay (constructor_initializer): catch another error,
18073 and display nice message.
18075 (field_declaration): catch void field declaration
18076 to flag a better error.
18078 * class.cs (MemberBase.CheckBase): Report an error instead of a
18079 warning if a new protected member is declared in a struct.
18080 (Field.Define): catch the error of readonly/volatile.
18082 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
18084 (FieldExpr.AddressOf): ditto. Catch error where the address of a
18085 volatile variable is taken
18087 2003-05-02 Miguel de Icaza <miguel@ximian.com>
18089 * statement.cs (Fixed.Resolve): Report an error if we are not in
18092 2003-05-01 Miguel de Icaza <miguel@ximian.com>
18094 * typemanager.cs: reuse the code that handles type clashes for
18095 delegates and enumerations.
18097 * class.cs (Report28): Always report.
18099 * expression.cs (EncodeAsAttribute): Allow nulls here.
18101 2003-04-28 Miguel de Icaza <miguel@ximian.com>
18103 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
18104 the functionality for testing whether an expression is valid for
18105 an attribute here. Also handle the case of arrays of elements
18108 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
18109 encoding a linear array into an array of objects that are suitable
18110 to be passed to an CustomAttributeBuilder.
18112 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
18114 * ecore.cs: (FieldExpr): Handle field remapping here.
18116 * iteratators.cs: Pass the instance variable (if the method is an
18117 instance method) to the constructors, so we can access the field
18118 variables on the class.
18120 TODO: Test this with structs. I think the THIS variable on
18121 structs might have to be a pointer, and not a refenrece
18123 2003-04-27 Miguel de Icaza <miguel@ximian.com>
18125 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
18126 local variables to fields in a proxy class.
18128 * iterators.cs (PopulateProxy): Rename our internal fields to
18130 Create a <THIS> field if we are an instance method, so we can
18131 reference our parent container variables.
18132 (MapVariable): Called back from the EmitContext code to enter a
18133 new variable to field mapping into the proxy class (we just create
18137 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
18138 for using the remapped locals to fields.
18140 I placed the code here, because that gives the same semantics to
18141 local variables, and only changes the Emit code.
18143 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
18144 statements inside iterators.
18145 (VariableInfo): Add a FieldBuilder for the cases when we are
18146 remapping local variables to fields in a proxy class
18148 * ecore.cs (SimpleNameResolve): Avoid testing two times for
18149 current_block != null.
18151 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
18152 not cope with strings, as it has been moved to the
18153 TableSwitchEmit. Fixed bug in switch generation.
18155 * expression.cs (New.DoResolve): Provide more context for the user
18156 when reporting an error.
18158 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
18161 * expression.cs (MemberAccess.DoResolve): When we get a type back,
18162 check the permissions for it. Note than in a type-resolution
18163 context the check was already present in DeclSpace.ResolveType,
18164 but was missing from the MemberAccess.
18166 (ArrayCreation.CheckIndices): warn if the user has
18167 more nested levels of expressions, but there are no more
18168 dimensions specified. Avoids crash on bug 41906.
18170 2003-04-26 Miguel de Icaza <miguel@ximian.com>
18172 * statement.cs (Block): replace Implicit bool, for a generic
18174 New flag: `Unchecked'. This is used during the EmitMeta phase
18175 (which is out-of-line with the regular Resolve/Emit process for a
18176 statement, as this is done ahead of time, but still gets a chance
18177 to call constant resolve).
18179 (Block.Flags): new enum for adding a new flag.
18181 (Block.EmitMeta): track the state of unchecked.
18183 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
18184 to enable constant resolution to work there as well.
18186 2003-04-22 Miguel de Icaza <miguel@ximian.com>
18188 * typemanager.cs (ienumerable_type): Also look up
18189 System.Collections.IEnumerable.
18191 2003-04-21 Miguel de Icaza <miguel@ximian.com>
18193 TODO: Test more than one conditional per method.
18195 * class.cs (Indexer.Define): Report the location where the user is
18196 referencing the unsupported feature.
18198 (MethodData): Overload the use of `conditionals' to
18199 minimize the creation of needless ArrayLists. This saves roughly
18200 212kb on my machine.
18202 (Method): Implement the new IIteratorContainer interface.
18203 (Method.SetYields): Implement the method by setting the ModFlags
18204 to contain METHOD_YIELDS.
18206 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
18207 which just got set to null.
18209 * iterators.cs: New file.
18211 (Yield, YieldBreak): New statements.
18213 * statement.cs (Return.Resolve): Flag an error if we are used in
18214 an iterator method.
18216 * codegen.cs (InIterator): New flag set if the code is being
18217 compiled in an iterator method.
18219 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
18220 internal modifier, and we just use it to avoid adding extra
18221 fields, as this is seldom used.
18223 * cs-parser.jay: Add yield_statement (yield and yield break).
18225 * driver.cs: New flag -v2 to turn on version 2 features.
18227 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
18228 hashtable when v2 is enabled.
18230 2003-04-20 Miguel de Icaza <miguel@ximian.com>
18232 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
18233 there is already a namespace defined with this name.
18235 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
18236 people upgraded their corlibs.
18238 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
18239 always use fully qualified types, no need to use the compiler
18242 (TypeManager.IsNamespace): Use binarysearch.
18244 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
18245 AddDelegate): I did not quite use the new IsValid API properly: I
18246 have to pass the short-name and the fullname. I was passing only
18247 the basename instead of the fullname sometimes.
18249 (TypeContainer.DefineType): call NamespaceClash.
18251 * interface.cs (Interface.DefineType): use NamespaceClash before
18254 * delegate.cs (Delegate.DefineType): use NamespaceClash before
18257 * enum.cs: (Enum.DefineType): use NamespaceClash before
18260 * typemanager.cs (: 3-line patch that gives us some tasty 11%
18261 speed increase. First, use the negative_hits cache when we get a
18262 negative. Second, add the type with its full original name
18263 instead of the new . and + encoded name (reflection uses + to
18264 separate type from a nested type). Use LookupTypeReflection
18265 directly which bypasses the type->name hashtable (that we already
18266 know does not contain the type.
18268 * decl.cs (DeclSpace.ResolveTypeExpr): track the
18269 location/container type.
18271 * driver.cs: When passing utf8, use directly the UTF8Encoding.
18273 2003-04-19 Miguel de Icaza <miguel@ximian.com>
18275 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
18277 * delegate.cs (NewDelegate.Resolve): Test whether an instance
18278 method is being referenced in the method group from a static
18279 context, and report error 120 if so.
18281 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
18284 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
18285 is created, we create the A namespace).
18287 * cs-parser.jay: A namespace also introduces a DeclarationFound.
18290 2003-04-18 Miguel de Icaza <miguel@ximian.com>
18292 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
18293 invocation to ModuleBuilder.GetType with the same values will
18294 return a new type instance, so we need to cache its return
18297 * expression.cs (Binary.ResolveOperator): Only allow the compare
18298 operators on enums if they are of the same type.
18300 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
18301 types of ValueType on their own case. Before we were giving them
18302 the same treatment as objects.
18304 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
18305 fullname. Short name is used to compare against container name.
18306 Fullname is used to check against defined namespace names.
18308 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
18309 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
18311 (Method.CheckBase): Call parent.
18312 (MemberBase.CheckBase): Check for protected members on sealed
18314 (PropertyBase.CheckBase): Call parent.
18315 (Field.Define): Call parent.
18317 * report.cs: Negative error codes are now mapped to 8000 - code,
18318 so that the display is render more nicely.
18320 * typemanager.cs: Do not use try/catch, instead report a regular
18323 (GetPointerType, GetReferenceType): These methods provide
18324 mechanisms to obtain the T* and T& from a T. We had the code
18325 previously scattered around the code base, and it also used
18326 TypeManager.LookupType that would go through plenty of caches.
18327 This one goes directly to the type source.
18329 In some places we did the Type.GetType followed by
18330 ModuleBuilder.GetType, but not in others, so this unifies the
18331 processing as well.
18333 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
18334 statements now that we have namespace information.
18336 * typemanager.cs (IsNamespace): New method, returns whether the
18337 string presented is a namespace or not.
18339 (ComputeNamespaces): New public entry point, computes the list of
18340 available namespaces, using the GetNamespaces API call in Mono, or
18341 the slower version in MS.NET.
18343 Now before we start the semantic analysis phase, we have a
18344 complete list of namespaces including everything that the user has
18347 Deleted old code to cache namespaces in .nsc files.
18349 2003-04-17 Miguel de Icaza <miguel@ximian.com>
18351 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
18352 class/struct location definition Location for the implicit
18353 constructor location.
18355 (Operator.Define): Use the location of the operator for the
18356 implicit Method definition.
18358 (Constructor.Emit): use the constructor location for the implicit
18359 base initializer constructor.
18361 * ecore.cs: Remove ITypeExpression. This interface is now gone,
18362 and the Expression class now contains two new methods:
18364 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
18365 isolate type lookup from the rest of the resolution process.
18367 Since we use Expressions to hold type definitions due to the way
18368 we parse the input we have historically overloaded Resolve to
18369 perform the Type lookups if a special flag is passed. Now this is
18370 eliminated and two methods take their place.
18372 The differences in the two methods between xStep and xTerminal is
18373 that xStep is involved in our current lookup system that uses
18374 SimpleNames to compose a name, while xTerminal is used just to
18375 catch the case where the simplename lookup failed.
18377 2003-04-16 Miguel de Icaza <miguel@ximian.com>
18379 * expression.cs (ResolveMemberAccess): Remove redundant code.
18380 TypeExpr expressions are always born fully resolved.
18382 * interface.cs (PopulateMethod): Do not lookup the types twice.
18383 We were doing it once during SemanticAnalysis and once during
18386 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
18387 in local variable type definitions, were being returned as a
18388 SimpleName (we decomposed everything into a string), that is
18389 because primary_expression was being used instead of a type in the
18390 grammar (reduce/reduce conflicts).
18392 The part that was wrong is that we converted the expression into a
18393 string (an oversimplification in one hand, compounded with primary
18394 expressions doing string concatenation).
18400 Would return "A.B.C[]" as a SimpleName. This stopped things like
18401 using clauses from working on this particular context. And a type
18402 was being matched directly against "A.B.C[]".
18404 We now use the correct approach, and allow for ComposedCast to be
18405 part of the unary expression. So the "A.B.C []" become a composed
18406 cast of "A.B.C" (as a nested group of MemberAccess with a
18407 SimpleName at the end) plus the rank composition "[]".
18411 2003-04-10 Miguel de Icaza <miguel@ximian.com>
18413 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
18414 for the access level checking.
18416 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
18417 `TypeContainer container', because I kept getting confused when I
18418 was debugging this code.
18420 * expression.cs (Indexers): Instead of tracking getters/setters,
18421 we now track them in parallel. We create one arraylist less, but
18422 most importantly it is possible now for the LValue code to find a
18423 matching get for a set.
18425 (IndexerAccess.DoResolveLValue): Update the code.
18426 GetIndexersForType has been modified already to extract all the
18427 indexers from a type. The code assumed it did not.
18429 Also make the code set the correct return type for the indexer.
18430 This was fixed a long time ago for properties, but was missing for
18431 indexers. It used to be void_type.
18433 (Binary.Emit): Test first for doubles instead of
18434 floats, as they are more common.
18436 (Binary.EmitBranchable): Use the .un version of the branch opcodes
18437 when dealing with floats and the <=, >= operators. This fixes bug
18440 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
18441 to load the array value by emitting a load on the foreach variable
18442 type. This was incorrect.
18444 We now emit the code to load an element using the the array
18445 variable type, and then we emit the conversion operator.
18449 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
18451 * attribute.cs: Avoid allocation of ArrayLists in the common case.
18453 2003-04-09 Miguel de Icaza <miguel@ximian.com>
18455 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
18456 test for protection before we test for signatures.
18458 (MethodSignature.ToString): implement.
18460 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
18461 to the case where we reduced into a LongConstant.
18463 * decl.cs (CheckAccessLevel): If the type is an array, we can not
18464 depend on whether the information is acurrate, because the
18465 Microsoft runtime will always claim that the array type is public,
18466 regardless of the real state.
18468 If the type is a pointer, another problem happens: the type is
18469 reported as non-public in Microsoft.
18471 In both cases we have to call CheckAccessLevel recursively with
18472 the underlying type as the argument to be tested.
18474 2003-04-08 Miguel de Icaza <miguel@ximian.com>
18476 * assign.cs (Assign.Emit): If we are dealing with a compound
18477 assignment expression, we should use the code path that stores the
18478 intermediate result in a temporary value. This fixes #40903.
18480 *expression.cs (Indirection.ToString): Provide ToString method for
18483 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
18485 * class.cs: Null out fields holding references to Block objects so
18486 they can be garbage collected.
18488 * expression.cs (OverloadResolve): Remove unused local.
18490 2003-04-07 Martin Baulig <martin@ximian.com>
18492 * codegen.cs (EmitContext.CurrentFile): New public field.
18493 (EmitContext.Mark): Use the CurrentFile to check whether the
18494 location is in the correct file.
18495 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
18497 2003-04-07 Martin Baulig <martin@ximian.com>
18499 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
18501 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
18502 location. [FIXME: The location argument which gets passed to this
18503 method is sometimes wrong!]
18505 2003-04-07 Nick Drochak <ndrochak@gol.com>
18507 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
18509 2003-04-07 Miguel de Icaza <miguel@ximian.com>
18511 * expression.cs (Indirection.EmitAssign): We were using the
18512 temporary, but returning immediately instead of continuing the
18515 2003-04-06 Martin Baulig <martin@ximian.com>
18517 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
18518 if it's a nested child, but also deriving from the outer class.
18521 * typemanager.cs (IsNestedChildOf): Make this work if it's a
18522 nested child, but also deriving from the outer class. See
18524 (FilterWithClosure): We may access private members of the outer
18525 class if we're a nested child and deriving from the outer class.
18526 (RealMemberLookup): Only set `closure_private_ok' if the
18527 `original_bf' contained BindingFlags.NonPublic.
18529 2003-04-05 Martin Baulig <martin@ximian.com>
18531 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
18533 2003-04-02 Miguel de Icaza <miguel@ximian.com>
18535 * class.cs (Event.Define): Do not allow abstract events to have
18538 2003-04-01 Miguel de Icaza <miguel@ximian.com>
18540 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
18541 block in event declarations.
18543 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
18544 value type, get its address.
18546 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
18547 leaving a class on the stack instead of a boolean value (int
18548 0/1). Change the code so we compare against null, and then the
18549 result against zero.
18551 * class.cs (TypeContainer.GetClassBases): We were checking for the
18552 parent class being sealed too late.
18554 * expression.cs (Binary.Emit): For <= and >= when dealing with
18555 floating point values, use cgt.un and clt.un instead of cgt and
18558 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
18560 * statement.cs: Apply the same optimization as MS: skip the
18561 GetEnumerator returning an IEnumerator, and use the one returning a
18562 CharEnumerator instead. This allows us to avoid the try-finally block
18565 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
18567 * cs-parser.jay: Attributes cannot be applied to
18568 namespaces. Fixes #40473
18570 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18573 (Add*): check if the name is valid using the full name for constants,
18574 fields, properties and events.
18576 2003-03-28 Miguel de Icaza <miguel@ximian.com>
18578 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
18579 char constants to be part of the enumeration.
18581 * expression.cs (Conditional.DoResolve): Add support for operator
18582 true. Implements the missing functionality from 14.12
18584 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
18585 operator true/false as required by the spec.
18587 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
18588 implicit conversion to boolean.
18590 * statement.cs (Statement.ResolveBoolean): A boolean expression is
18591 also one where the type implements `operator true'.
18593 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
18594 get an expression that will invoke operator true based on an
18597 (GetConversionOperators): Removed the hack that called op_True
18600 (Expression.ResolveBoolean): Move this from Statement.
18602 2003-03-17 Miguel de Icaza <miguel@ximian.com>
18604 * ecore.cs (FieldExpr): do not allow initialization of initonly
18605 fields on derived classes
18607 2003-03-13 Martin Baulig <martin@ximian.com>
18609 * statement.cs (Block.Emit): Call ig.BeginScope() and
18610 ig.EndScope() when compiling with debugging info; call
18611 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
18613 2003-03-08 Miguel de Icaza <miguel@ximian.com>
18615 * expression.cs (Indexers): Do not construct immediately, allow
18616 for new members to be appended as we go. Fixes 38143
18618 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18620 * expression.cs: save/restore context when resolving an unchecked
18623 2003-03-05 Miguel de Icaza <miguel@ximian.com>
18625 * cfold.cs: Catch division by zero in modulus operator during
18628 2003-03-03 Miguel de Icaza <miguel@ximian.com>
18630 * interface.cs (Interface.DefineMembers): Avoid defining members
18633 2003-02-27 Miguel de Icaza <miguel@ximian.com>
18635 * driver.cs: handle the +/- options for -noconfig
18637 * statement.cs (Unckeched.Resolve): Also track the state of
18638 unchecked in the Resolve phase.
18640 2003-02-27 Martin Baulig <martin@ximian.com>
18642 * ecore.cs (Expression.MemberLookup): Don't create a
18643 MethodGroupExpr for something which is not a method. Fixes #38291.
18645 2003-02-25 Miguel de Icaza <miguel@ximian.com>
18647 * class.cs (MemberBase.CheckParameters): Also check that the type
18648 is unmanaged if it is a pointer.
18650 * expression.cs (SizeOf.Resolve): Add location information.
18652 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
18653 a managed type is declared.
18655 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
18656 parameter modifiers as well. Fixes bug 38606
18658 * class.cs: Very sad. Am backing out the speed up changes
18659 introduced by the ArrayList -> Array in the TypeContainer, as they
18660 were not actually that much faster, and introduced a bug (no error
18661 reports on duplicated methods).
18663 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
18664 source first, this will guarantee that we have a valid expression
18665 before calling in lower levels functions that will require a
18666 resolved object. Then use this original_source in the
18667 target.ResolveLValue instead of the original source that was
18670 Another change. Use target.Resolve instead of LValueResolve.
18671 Although we are resolving for LValues, we will let the Assign code
18672 take care of that (it will be called again from Resolve). This
18673 basically allows code like this:
18675 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
18676 class Y { void A (X x) { x [0] += o; }
18678 The problem was that the indexer was trying to resolve for
18679 set_Item (idx, object o) and never finding one. The real set_Item
18680 was set_Item (idx, X). By delaying the process we get the right
18685 2003-02-23 Martin Baulig <martin@ximian.com>
18687 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
18688 while calling DoEmit ().
18690 * codegen.cs (EmitContext.Mark): Don't mark locations in other
18691 source files; if you use the #line directive inside a method, the
18692 compiler stops emitting line numbers for the debugger until it
18693 reaches the end of the method or another #line directive which
18694 restores the original file.
18696 2003-02-23 Martin Baulig <martin@ximian.com>
18698 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
18700 2003-02-23 Martin Baulig <martin@ximian.com>
18702 * statement.cs (Block.AddChildVariableNames): We need to call this
18703 recursively, not just for our immediate children.
18705 2003-02-23 Martin Baulig <martin@ximian.com>
18707 * class.cs (Event.Define): Always make the field private, like csc does.
18709 * typemanager.cs (TypeManager.RealMemberLookup): Make events
18710 actually work, fixes bug #37521.
18712 2003-02-23 Miguel de Icaza <miguel@ximian.com>
18714 * delegate.cs: When creating the various temporary "Parameters"
18715 classes, make sure that we call the ComputeAndDefineParameterTypes
18716 on those new parameters (just like we do with the formal ones), to
18717 allow them to be resolved in the context of the DeclSpace.
18719 This fixes the bug that Dick observed in Bugzilla #38530.
18721 2003-02-22 Miguel de Icaza <miguel@ximian.com>
18723 * expression.cs (ResolveMemberAccess): When resolving a constant,
18724 do not attempt to pull a constant if the value was not able to
18725 generate a valid constant.
18727 * const.cs (LookupConstantValue): Do not report more errors than required.
18729 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18731 * expression.cs: fixes bug #38328.
18733 2003-02-18 Miguel de Icaza <miguel@ximian.com>
18735 * class.cs: Changed all the various members that can be part of a
18736 class from being an ArrayList to be an Array of the right type.
18737 During the DefineType type_list, interface_list, delegate_list and
18738 enum_list are turned into types, interfaces, delegates and enums
18741 And during the member population, indexer_list, event_list,
18742 constant_list, field_list, instance_constructor_list, method_list,
18743 operator_list and property_list are turned into their real arrays.
18745 Although we could probably perform this operation earlier, for
18746 good error reporting we need to keep the lists and remove the
18747 lists for longer than required.
18749 This optimization was triggered by Paolo profiling the compiler
18750 speed on the output of `gen-sample-program.pl' perl script.
18752 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
18753 not crash in methods like MemberLookupFailed that use this field.
18755 This problem arises when the compiler fails to resolve a type
18756 during interface type definition for example.
18758 2003-02-18 Miguel de Icaza <miguel@ximian.com>
18760 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
18761 inherit from System.Object, so we have to stop at null, not only
18762 when reaching System.Object.
18764 2003-02-17 Miguel de Icaza <miguel@ximian.com>
18766 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
18767 DeclaredOnly because the parent indexer might have had a different
18768 name, but did not loop until the top of the hierarchy was reached.
18770 The problem this one fixes is 35492: when a class implemented an
18771 indexer from an interface, we were getting the interface method
18772 (which was abstract) and we were flagging an error (can not invoke
18775 This also keeps bug 33089 functioning, and test-148 functioning.
18777 * typemanager.cs (IsSpecialMethod): The correct way of figuring
18778 out if a method is special is to see if it is declared in a
18779 property or event, or whether it is one of the predefined operator
18780 names. This should fix correctly #36804.
18782 2003-02-15 Miguel de Icaza <miguel@ximian.com>
18784 The goal here is to remove the dependency on EmptyCast.Peel ().
18785 Killing it completely.
18787 The problem is that currently in a number of places where
18788 constants are expected, we have to "probe" for an EmptyCast, and
18789 Peel, which is not the correct thing to do, as this will be
18790 repetitive and will likely lead to errors.
18792 The idea is to remove any EmptyCasts that are used in casts that
18793 can be reduced to constants, so we only have to cope with
18796 This bug hunt was triggered by Bug 37363 and the desire to remove
18797 the duplicate pattern where we were "peeling" emptycasts to check
18798 whether they were constants. Now constants will always be
18801 * ecore.cs: Use an enumconstant here instead of wrapping with
18804 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
18805 throwing me off. By handling this we can get rid of a few hacks.
18807 * statement.cs (Switch): Removed Peel() code.
18809 2003-02-14 Miguel de Icaza <miguel@ximian.com>
18811 * class.cs: Location information for error 508
18813 * expression.cs (New.DoResolve): Add a guard against double
18814 resolution of an expression.
18816 The New DoResolve might be called twice when initializing field
18817 expressions (see EmitFieldInitializers, the call to
18818 GetInitializerExpression will perform a resolve on the expression,
18819 and later the assign will trigger another resolution
18821 This leads to bugs (#37014)
18823 * delegate.cs: The signature for EndInvoke should contain any ref
18824 or out parameters as well. We were not doing this in the past.
18826 * class.cs (Field.Define): Do not overwrite the type definition
18827 inside the `volatile' group. Turns out that volatile enumerations
18828 were changing the type here to perform a validity test, which
18831 2003-02-12 Miguel de Icaza <miguel@ximian.com>
18833 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
18834 and structs, we do not want to load the instance variable
18836 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
18837 enum_type has to be handled like an object reference (implicit
18838 conversions exists from this to object), but the regular IsClass
18839 and IsValueType tests will never return true for this one.
18841 Also we use TypeManager.IsValueType instead of type.IsValueType,
18842 just for consistency with the rest of the code (this is only
18843 needed if we ever use the construct exposed by test-180.cs inside
18844 corlib, which we dont today).
18846 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
18848 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
18851 2003-02-09 Martin Baulig <martin@ximian.com>
18853 * namespace.cs (Namespace..ctor): Added SourceFile argument.
18854 (Namespace.DefineNamespaces): New static public method; this is
18855 called when we're compiling with debugging to add all namespaces
18856 to the symbol file.
18858 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
18859 pass it to the Namespace's .ctor.
18861 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
18862 and MethodBase arguments; pass the namespace ID to the symwriter;
18863 pass the MethodBase instead of the token to the symwriter.
18864 (SymbolWriter.DefineNamespace): New method to add a namespace to
18867 2003-02-09 Martin Baulig <martin@ximian.com>
18869 * symbolwriter.cs: New file. This is a wrapper around
18870 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
18871 methods here in near future.
18873 2003-02-09 Martin Baulig <martin@ximian.com>
18875 * codegen.cs (EmitContext.Mark): Just pass the arguments to
18876 ILGenerator.MarkSequencePoint() which are actually used by the
18879 2003-02-09 Martin Baulig <martin@ximian.com>
18881 * location.cs (SourceFile): New public sealed class. This
18882 contains the name and an index which is used in the location's token.
18883 (Location): Reserve an appropriate number of bits in the token for
18884 the source file instead of walking over that list, this gives us a
18885 really huge performance improvement when compiling with debugging.
18887 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
18888 `SourceFile' argument instead of a string.
18889 (Driver.ProcessFile): Add all the files via Location.AddFile(),
18890 but don't parse/tokenize here, we need to generate the list of all
18891 source files before we do that.
18892 (Driver.ProcessFiles): New static function. Parses/tokenizes all
18895 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
18896 instead of a string.
18898 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
18901 2003-02-09 Martin Baulig <martin@ximian.com>
18903 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
18904 filename on `#line default'.
18906 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
18908 * statement.cs: don't clear the pinned var when the fixed statement
18909 returns from the method (fixes bug#37752).
18911 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
18913 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
18916 2003-02-07 Martin Baulig <martin@ximian.com>
18918 * driver.cs: Removed the `--debug-args' command line argument.
18920 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
18921 automatically by the AsssemblyBuilder.
18922 (CodeGen.InitializeSymbolWriter): We don't need to call any
18923 initialization function on the symbol writer anymore. This method
18924 doesn't take any arguments.
18926 2003-02-03 Miguel de Icaza <miguel@ximian.com>
18928 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
18929 from referenced assemblies as well.
18931 2003-02-02 Martin Baulig <martin@ximian.com>
18933 * class.cs (MethodData.Emit): Generate debugging info for external methods.
18935 2003-02-02 Martin Baulig <martin@ximian.com>
18937 * class.cs (Constructor.Emit): Open the symbol writer before
18938 emitting the constructor initializer.
18939 (ConstructorInitializer.Emit): Call ec.Mark() to allow
18940 single-stepping through constructor initializers.
18942 2003-01-30 Miguel de Icaza <miguel@ximian.com>
18944 * class.cs: Handle error 549: do not allow virtual methods in
18947 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
18949 * decl.cs: Check access levels when resolving types
18951 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
18953 * statement.cs: Add parameters and locals set in catch blocks that might
18954 return to set vector
18956 2003-01-29 Miguel de Icaza <miguel@ximian.com>
18958 * class.cs (Operator): Set the SpecialName flags for operators.
18960 * expression.cs (Invocation.DoResolve): Only block calls to
18961 accessors and operators on SpecialName methods.
18963 (Cast.TryReduce): Handle conversions from char constants.
18966 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
18968 * statement.cs: small memory and time optimization in FlowBranching.
18970 2003-01-28 Pedro Mart <yoros@wanadoo.es>
18972 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
18973 problem that the last fix but in the other sid (Set).
18975 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
18976 access when there is no indexer in the hierarchy.
18978 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
18980 * class.cs: Combine some if statements.
18982 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18984 * driver.cs: fixed bug #37187.
18986 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
18988 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
18989 any indexer, it's needed to build a list with all the indexers in the
18990 hierarchy (AllGetters), else we have problems. Fixes #35653.
18992 2003-01-23 Miguel de Icaza <miguel@ximian.com>
18994 * class.cs (MethodData.Define): It is wrong for an interface
18995 implementation to be static in both cases: explicit and implicit.
18996 We were only handling this in one case.
18998 Improve the if situation there to not have negations.
19000 * class.cs (Field.Define): Turns out that we do not need to check
19001 the unsafe bit on field definition, only on usage. Remove the test.
19003 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19005 * driver.cs: use assembly.Location instead of Codebase (the latest
19006 patch made mcs fail when using MS assemblies).
19008 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
19010 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
19011 get the path to *corlib.dll.
19013 2003-01-21 Nick Drochak <ndrochak@gol.com>
19017 * typemanager.cs: Remove compiler warnings
19019 2003-01-20 Duncan Mak <duncan@ximian.com>
19021 * AssemblyInfo.cs: Bump the version number to 0.19.
19023 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19025 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
19027 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
19029 * class.cs (Constructor::Emit): Emit debugging info for constructors.
19031 2003-01-17 Miguel de Icaza <miguel@ximian.com>
19033 * cs-parser.jay: Small fix: we were not comparing the constructor
19034 name correctly. Thanks to Zoltan for the initial pointer.
19036 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
19038 * cs-tokenizer.cs: Set file name when specified with #line
19040 2003-01-15 Miguel de Icaza <miguel@ximian.com>
19042 * cs-parser.jay: Only perform the constructor checks here if we
19043 are named like the class; This will help provider a better
19044 error. The constructor path is taken when a type definition is
19045 not found, but most likely the user forgot to add the type, so
19046 report that rather than the constructor error.
19048 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
19050 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
19053 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
19055 * cs-parser.jay: Add cleanup call.
19057 2003-01-13 Duncan Mak <duncan@ximian.com>
19059 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
19060 consistent with other methods.
19062 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
19064 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
19066 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
19068 * attribute.cs: only set GuidAttr to true when we have a
19071 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19075 * typemanager.cs: fixes to allow mcs compile corlib with the new
19076 Type.IsSubclassOf fix.
19078 2003-01-08 Miguel de Icaza <miguel@ximian.com>
19080 * expression.cs (LocalVariableReference.DoResolve): Classify a
19081 constant as a value, not as a variable. Also, set the type for
19084 * cs-parser.jay (fixed_statement): take a type instead of a
19085 pointer_type, so we can produce a better error message later.
19087 * statement.cs (Fixed.Resolve): Flag types that are not pointers
19090 (For.DoEmit): Make inifinite loops have a
19091 non-conditional branch back.
19093 (Fixed.DoEmit): First populate the pinned variables, then emit the
19094 statement, then clear the variables. Before I was emitting the
19095 code once for each fixed piece.
19098 2003-01-08 Martin Baulig <martin@ximian.com>
19100 * statement.cs (FlowBranching.MergeChild): A break in a
19101 SWITCH_SECTION does not leave a loop. Fixes #36155.
19103 2003-01-08 Martin Baulig <martin@ximian.com>
19105 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
19106 lives in the same number space than `param_map'. Fixes #36154.
19108 2003-01-07 Miguel de Icaza <miguel@ximian.com>
19110 * cs-parser.jay (constructor_declaration): Set the
19111 Constructor.ModFlags before probing for it. This makes the
19112 compiler report 514, 515 and 132 (the code was there, but got
19115 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
19116 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
19117 (GotoCase.Resolve): Set `Returns' to ALWAYS.
19119 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
19121 * enum.cs: create the enum static fields using the enum type.
19123 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
19125 * class.cs: don't try to create the ParamBuilder for the return
19126 type if it's not needed (and handle it breaking for the ms runtime
19129 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
19131 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
19133 2002-12-29 Miguel de Icaza <miguel@ximian.com>
19135 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
19136 the command. This showed up while compiling the JANET source
19137 code, which used \r as its only newline separator.
19139 2002-12-28 Miguel de Icaza <miguel@ximian.com>
19141 * class.cs (Method.Define): If we are an operator (because it
19142 reuses our code), then set the SpecialName and HideBySig. #36128
19144 2002-12-22 Miguel de Icaza <miguel@ximian.com>
19146 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
19147 exception, report error 120 `object reference required'.
19149 * driver.cs: Add --pause option, used during to measure the size
19150 of the process as it goes with --timestamp.
19152 * expression.cs (Invocation.DoResolve): Do not allow methods with
19153 SpecialName to be invoked.
19155 2002-12-21 Miguel de Icaza <miguel@ximian.com>
19157 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
19158 number before adding it.
19160 2002-12-21 Ravi Pratap <ravi@ximian.com>
19162 * ecore.cs (StandardImplicitConversion): When in an unsafe
19163 context, we allow conversion between void * to any other pointer
19164 type. This fixes bug #35973.
19166 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
19168 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
19169 is not thrown when extensionless outputs are used
19171 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19173 * rootcontext.cs: fixed compilation of corlib.
19175 2002-12-19 Miguel de Icaza <miguel@ximian.com>
19177 * attribute.cs (Attributes.Contains): Add new method.
19179 * class.cs (MethodCore.LabelParameters): if the parameter is an
19180 `out' parameter, check that no attribute `[In]' has been passed.
19182 * enum.cs: Handle the `value__' name in an enumeration.
19184 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
19186 * decl.cs: Added special case to allow overrides on "protected
19189 2002-12-18 Ravi Pratap <ravi@ximian.com>
19191 * attribute.cs (Attributes.AddAttributeSection): Rename to this
19192 since it makes much more sense.
19194 (Attributes.ctor): Don't require a Location parameter.
19196 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
19198 * attribute.cs (ApplyAttributes): Remove extra Location parameters
19199 since we already have that information per attribute.
19201 * everywhere : make appropriate changes.
19203 * class.cs (LabelParameters): Write the code which actually
19204 applies attributes to the return type. We can't do this on the MS
19205 .NET runtime so we flag a warning in the case an exception is
19208 2002-12-18 Miguel de Icaza <miguel@ximian.com>
19210 * const.cs: Handle implicit null conversions here too.
19212 2002-12-17 Ravi Pratap <ravi@ximian.com>
19214 * class.cs (MethodCore.LabelParameters): Remove the extra
19215 Type [] parameter since it is completely unnecessary. Instead
19216 pass in the method's attributes so that we can extract
19217 the "return" attribute.
19219 2002-12-17 Miguel de Icaza <miguel@ximian.com>
19221 * cs-parser.jay (parse): Use Report.Error to flag errors instead
19222 of ignoring it and letting the compile continue.
19224 * typemanager.cs (ChangeType): use an extra argument to return an
19225 error condition instead of throwing an exception.
19227 2002-12-15 Miguel de Icaza <miguel@ximian.com>
19229 * expression.cs (Unary.TryReduce): mimic the code for the regular
19230 code path. Perform an implicit cast in the cases where we can
19231 implicitly convert to one of the integral types, and then reduce
19232 based on that constant. This fixes bug #35483.
19234 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19236 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
19238 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19240 * namespace.cs: fixed bug #35489.
19242 2002-12-12 Miguel de Icaza <miguel@ximian.com>
19244 * class.cs: Remove some dead code.
19246 * cs-parser.jay: Estimate the number of methods needed
19247 (RootContext.MethodCount);
19249 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
19250 numbers instead of StringBuilders.
19252 * support.cs (PtrHashtable): Add constructor with initial size;
19253 We can now reduce reallocations of the method table.
19255 2002-12-10 Ravi Pratap <ravi@ximian.com>
19257 * attribute.cs (ApplyAttributes): Keep track of the emitted
19258 attributes on a per-target basis. This fixes bug #35413.
19260 2002-12-10 Miguel de Icaza <miguel@ximian.com>
19262 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
19263 default to the Windows 1252 encoding.
19265 (UnixParseOption): Support version, thanks to Alp for the missing
19268 * AssemblyInfo.cs: Add nice assembly information.
19270 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
19273 * cs-parser.jay: Allow a trailing comma before the close bracked
19274 in the attribute_section production.
19276 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
19277 address of the instance was being taken, I will take this out,
19278 because we take the address of the object immediately here.
19280 2002-12-09 Ravi Pratap <ravi@ximian.com>
19282 * typemanager.cs (AreMultipleAllowed): Take care of the most
19283 obvious case where attribute type is not in the current assembly -
19286 2002-12-08 Miguel de Icaza <miguel@ximian.com>
19288 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
19289 definitions, instead of doing that afterwards.
19291 Also we use a nice little hack, depending on the constructor, we
19292 know if we are a "composed" name or a simple name. Hence, we
19293 avoid the IndexOf test, and we avoid
19295 * codegen.cs: Add code to assist in a bug reporter to track down
19296 the source of a compiler crash.
19298 2002-12-07 Ravi Pratap <ravi@ximian.com>
19300 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
19301 types have been emitted for a given element and flag an error
19302 if something which does not have AllowMultiple set is used more
19305 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
19306 attribute types and their corresponding AllowMultiple properties
19308 (AreMultipleAllowed): Check the property for a given type.
19310 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
19311 property in the case we have a TypeContainer.
19313 (Attributes.AddAttribute): Detect duplicates and just skip on
19314 adding them. This trivial fix catches a pretty gross error in our
19315 attribute emission - global attributes were being emitted twice!
19317 Bugzilla bug #33187 is now fixed.
19319 2002-12-06 Miguel de Icaza <miguel@ximian.com>
19321 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
19322 instead of pp_and).
19324 * expression.cs (Binary.ResolveOperator): I can only use the
19325 Concat (string, string, string) and Concat (string, string,
19326 string, string) if the child is actually a concatenation of
19329 2002-12-04 Miguel de Icaza <miguel@ximian.com>
19331 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
19332 context where we need a 2-character lookahead.
19334 * pending.cs (PendingImplementation): Rework so we can keep track
19335 of interface types all the time, and flag those which were
19336 implemented by parents as optional.
19338 2002-12-03 Miguel de Icaza <miguel@ximian.com>
19340 * expression.cs (Binary.ResolveOperator): Use
19341 String.Concat(string,string,string) or
19342 String.Concat(string,string,string,string) when possible.
19344 * typemanager: More helper methods.
19347 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
19349 * pending.cs: remove the bogus return from GetMissingInterfaces()
19350 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
19352 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19354 * namespace.cs: avoid duplicated 'using xxx' being added to
19355 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
19356 when we get more than one 'using' statement for the same namespace.
19357 Report a CS0105 warning for it.
19359 2002-11-30 Miguel de Icaza <miguel@ximian.com>
19361 * cs-tokenizer.cs (consume_identifier): use read directly, instead
19362 of calling getChar/putback, uses internal knowledge of it.
19364 (xtoken): Reorder tokenizer so most common patterns are checked
19365 first. This reduces the compilation time in another 5% (from 8.11s
19366 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
19368 The parsing time is 22% of the compilation in mcs, and from that
19369 64% is spent on the tokenization process.
19371 I tried using a binary search for keywords, but this is slower
19372 than the hashtable. Another option would be to do a couple of
19375 * Not use a StringBuilder, instead use an array of chars,
19376 with a set value. Notice that this way we could catch
19377 the 645 error without having to do it *afterwards*.
19379 * We could write a hand-parser to avoid the hashtable
19380 compares altogether.
19382 The identifier consumption process takes 37% of the tokenization
19383 time. Another 15% is spent on is_number. 56% of the time spent
19384 on is_number is spent on Int64.Parse:
19386 * We could probably choose based on the string length to
19387 use Int32.Parse or Int64.Parse and avoid all the 64-bit
19390 Another 3% is spend on wrapping `xtoken' in the `token' function.
19392 Handle 0xa0 as whitespace (#34752)
19394 2002-11-26 Miguel de Icaza <miguel@ximian.com>
19396 * typemanager.cs (IsCLRType): New routine to tell whether a type
19397 is one of the builtin types.
19399 Maybe it needs to use TypeCodes to be faster. Maybe we could use
19400 typecode in more places instead of doing pointer comparissions.
19401 We could leverage some knowledge about the way the typecodes are
19404 New code to cache namespaces in assemblies, it is currently not
19405 invoked, to be used soon.
19407 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
19409 * expression.cs (Binary.ResolveOperator): specially handle
19410 strings, and do not perform user-defined operator overloading for
19413 2002-11-24 Miguel de Icaza <miguel@ximian.com>
19415 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
19416 internalcall as it is a pretty simple operation; Avoid whenever
19417 possible to call Char.IsLetter.
19419 (consume_identifier): Cut by half the number of
19420 hashtable calls by merging the is_keyword and GetKeyword behavior.
19422 Do not short-circuit, because if we do, we
19423 report errors (ie, #if false && true would produce an invalid
19427 2002-11-24 Martin Baulig <martin@ximian.com>
19429 * expression.cs (Cast.TryReduce): If we're in checked syntax,
19430 check constant ranges and report a CS0221. Fixes #33186.
19432 2002-11-24 Martin Baulig <martin@ximian.com>
19434 * cs-parser.jay: Make this work for uninitialized variable
19435 declarations in the `for' initializer. Fixes #32416.
19437 2002-11-24 Martin Baulig <martin@ximian.com>
19439 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
19440 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
19442 2002-11-24 Martin Baulig <martin@ximian.com>
19444 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
19445 argument; if true, we also check for user-defined conversions.
19446 This is only needed if both arguments are of a user-defined type.
19447 Fixes #30443, added test-175.cs.
19448 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
19450 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
19452 2002-11-24 Martin Baulig <martin@ximian.com>
19454 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
19455 function to get the store opcode.
19456 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
19457 only emit the Ldelema if the store opcode is Stobj. You must run
19458 both test-34 and test-167 to test this. Fixes #34529.
19460 2002-11-23 Martin Baulig <martin@ximian.com>
19462 * ecore.cs (Expression.MemberLookup): Added additional
19463 `qualifier_type' argument which is used when we're being called
19464 from MemberAccess.DoResolve() and null if we're called from a
19466 (Expression.MemberLookupFailed): New method to report errors; this
19467 does the CS1540 check and reports the correct error message.
19469 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
19470 argument for the CS1540 check and redone the way how we're dealing
19471 with private members. See the comment in the source code for details.
19472 (FilterWithClosure): Reverted this back to revision 1.197; renamed
19473 `closure_start_type' to `closure_qualifier_type' and check whether
19474 it's not null. It was not this filter being broken, it was just
19475 being called with the wrong arguments.
19477 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
19478 and pass it the correct `qualifier_type'; this also does the error
19481 2002-11-22 Miguel de Icaza <miguel@ximian.com>
19483 * expression.cs (Invocation.EmitParams): If the we are dealing
19484 with a non-built-in value type, load its address as well.
19486 (ArrayCreation): Use a a pretty constant instead
19487 of the hardcoded value 2. Use 6 instead of 2 for the number of
19488 static initializers.
19490 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
19491 because they are not really value types, just glorified integers.
19493 * driver.cs: Do not append .exe, the CSC compiler does not do it.
19495 * ecore.cs: Remove redundant code for enumerations, make them use
19496 the same code path as everything else, fixes the casting issue
19497 with enumerations in Windows.Forms.
19499 * attribute.cs: Do only cast to string if it is a string, the
19500 validation happens later.
19502 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
19503 people upgrade their corlibs.
19505 * ecore.cs: Oops, enumerations were not following the entire code path
19507 2002-11-21 Miguel de Icaza <miguel@ximian.com>
19509 * typemanager.cs (FilterWithClosure): Commented out the test for
19510 1540 in typemanager.cs, as it has problems when accessing
19511 protected methods from a parent class (see test-174.cs).
19513 * attribute.cs (Attribute.ValidateGuid): new method.
19514 (Attribute.Resolve): Use above.
19516 2002-11-19 Miguel de Icaza <miguel@ximian.com>
19518 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
19520 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
19521 handling for enumerations, as we only needed the TypeContainer
19522 functionality to begin with (this is required for the fix below to
19523 work for enums that reference constants in a container class for
19526 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
19528 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
19529 a valid TypeBuilder to perform lookups on.o
19531 * class.cs (InheritableMemberSignatureCompare): Use true in the
19532 call to GetGetMethod and GetSetMethod, because we are comparing
19533 the signature, and we need to get the methods *even* if they are
19536 (PropertyBase.CheckBase): ditto.
19538 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
19539 GotoCase.Resolve): Use Peel on EmpytCasts.
19541 * ecore.cs (EmptyCast): drop child, add Peel method.
19543 2002-11-17 Martin Baulig <martin@ximian.com>
19545 * ecore.cs (EmptyCast.Child): New public property.
19547 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
19548 label resolved to an EmptyCast. Fixes #34162.
19549 (GotoCase.Resolve): Likewise.
19550 (Block.EmitMeta): Likewise.
19552 2002-11-17 Martin Baulig <martin@ximian.com>
19554 * expression.cs (Invocation.BetterConversion): Prefer int over
19555 uint; short over ushort; long over ulong for integer literals.
19556 Use ImplicitConversionExists instead of StandardConversionExists
19557 since we also need to check for user-defined implicit conversions.
19558 Fixes #34165. Added test-173.cs.
19560 2002-11-16 Martin Baulig <martin@ximian.com>
19562 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
19563 with the `true' and `false' literals. Fixes #33151.
19565 2002-11-16 Martin Baulig <martin@ximian.com>
19567 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
19568 October 22nd; don't do the cs1540 check for static members.
19570 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
19571 now using our own filter here and doing the cs1540 check again.
19573 2002-11-16 Martin Baulig <martin@ximian.com>
19575 * support.cs (InternalParameters): Don't crash if we don't have
19576 any fixed parameters. Fixes #33532.
19578 2002-11-16 Martin Baulig <martin@ximian.com>
19580 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
19581 when looking up static methods to make this work on Windows.
19584 2002-11-16 Martin Baulig <martin@ximian.com>
19586 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
19587 a setter rather than using PropertyInfo.CanWrite.
19589 2002-11-15 Nick Drochak <ndrochak@gol.com>
19591 * class.cs: Allow acces to block member by subclasses. Fixes build
19594 2002-11-14 Martin Baulig <martin@ximian.com>
19596 * class.cs (Constructor.Emit): Added the extern/block check.
19599 2002-11-14 Martin Baulig <martin@ximian.com>
19601 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
19602 iteration while looking for indexers, this is needed because the
19603 indexer may have a different name in our base classes. Fixed the
19604 error reporting (no indexers at all, not get accessor, no
19605 overloaded match). Fixes bug #33089.
19606 (IndexerAccess.DoResolveLValue): Likewise.
19608 2002-11-14 Martin Baulig <martin@ximian.com>
19610 * class.cs (PropertyBase.CheckBase): Make this work for multiple
19611 indexers. Fixes the first part of bug #33089.
19612 (MethodSignature.InheritableMemberSignatureCompare): Added support
19615 2002-11-13 Ravi Pratap <ravi@ximian.com>
19617 * attribute.cs (Attribute.Resolve): Catch the
19618 NullReferenceException and report it since it isn't supposed to
19621 2002-11-12 Miguel de Icaza <miguel@ximian.com>
19623 * expression.cs (Binary.EmitBranchable): Also handle the cases for
19624 LogicalOr and LogicalAnd that can benefit from recursively
19625 handling EmitBranchable. The code now should be nice for Paolo.
19627 2002-11-08 Miguel de Icaza <miguel@ximian.com>
19629 * typemanager.cs (LookupType): Added a negative-hit hashtable for
19630 the Type lookups, as we perform quite a number of lookups on
19631 non-Types. This can be removed once we can deterministically tell
19632 whether we have a type or a namespace in advance.
19634 But this might require special hacks from our corlib.
19638 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
19639 and double which avoids a conversion from an integer to a double.
19641 * expression.cs: tiny optimization, avoid calling IsConstant,
19642 because it effectively performs the lookup twice.
19644 2002-11-06 Miguel de Icaza <miguel@ximian.com>
19646 But a bogus return here to keep the semantics of the old code
19647 until the Mono runtime is fixed.
19649 * pending.cs (GetMissingInterfaces): New method used to remove all
19650 the interfaces that are already implemented by our parent
19651 classes from the list of pending methods.
19653 * interface.cs: Add checks for calls after ResolveTypeExpr.
19655 2002-11-05 Miguel de Icaza <miguel@ximian.com>
19657 * class.cs (Class.Emit): Report warning 67: event not used if the
19658 warning level is beyond 3.
19660 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
19661 being a NullLiteral.
19663 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
19666 * class.cs (TypeContainer.GetClassBases): Cover a missing code
19667 path that might fail if a type can not be resolved.
19669 * expression.cs (Binary.Emit): Emit unsigned versions of the
19672 * driver.cs: use error 5.
19674 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
19676 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
19678 2002-11-01 Miguel de Icaza <miguel@ximian.com>
19680 * cs-parser.jay (switch_section): A beautiful patch from Martin
19681 Baulig that fixed 33094.
19683 2002-10-31 Miguel de Icaza <miguel@ximian.com>
19685 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
19686 Check whether the base is abstract and report an error if so.
19688 * expression.cs (IndexerAccess.DoResolveLValue,
19689 IndexerAccess.DoResolve): ditto.
19691 (Invocation.DoResolve): ditto.
19693 (Invocation.FullMethodDesc): Improve the report string.
19695 * statement.cs (Block): Eliminate IsVariableDefined as it is
19696 basically just a wrapper for GetVariableInfo.
19698 * ecore.cs (SimpleName): Use new
19700 * support.cs (ReflectionParamter.ParameterType): We unwrap the
19701 type, as we return the actual parameter ref/unref state on a
19704 2002-10-30 Miguel de Icaza <miguel@ximian.com>
19706 * support.cs: Return proper flags REF/OUT fixing the previous
19709 * expression.cs: Reverted last patch, that was wrong. Is_ref is
19710 not used to mean `ref' but `ref or out' in ParameterReference
19712 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
19713 full type signature instead of calling TypeManger.CSharpName
19716 * support.cs (InternalParameters.ParameterDesc): Do not compare
19717 directly to the modflags, because REF/OUT will actually be bitsets
19720 * delegate.cs (VerifyMethod): Check also the modifiers.
19722 * cs-tokenizer.cs: Fix bug where floating point values with an
19723 exponent where a sign was missing was ignored.
19725 * driver.cs: Allow multiple assemblies to be specified in a single
19728 2002-10-28 Miguel de Icaza <miguel@ximian.com>
19730 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
19731 because identifiers after a parenthesis would end up in this kind
19732 of production, and we needed to desamiguate it for having casts
19735 (UserDefinedType *) xxx
19737 2002-10-24 Miguel de Icaza <miguel@ximian.com>
19739 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
19740 we should set on the Bindingflags.NonPublic, but not turn on
19741 private_ok. private_ok controls whether a Private member is
19742 returned (this is chekced on the filter routine), while the
19743 BindingFlags.NonPublic just controls whether private/protected
19744 will be allowed. This fixes the problem part of the problem of
19745 private properties being allowed to be used in derived classes.
19747 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
19748 so we can call the children DoResolveLValue method (this will
19749 properly signal errors on lvalue assignments to base properties)
19751 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
19752 getter are null, and we have a property info, we know that this
19753 happened because the lookup failed, so we report an error 122 for
19754 protection level violation.
19756 We also silently return if setter and getter are null in the
19757 resolve functions, this condition only happens if we have flagged
19758 the error before. This is the other half of the problem.
19760 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
19761 not have accessibility information, that is why we were returning
19762 true in the filter function in typemanager.cs.
19764 To properly report 122 (property is inaccessible because of its
19765 protection level) correctly, we report this error in ResolveAccess
19766 by failing if both the setter and the getter are lacking (ie, the
19769 DoResolve and DoLResolve have been modified to check for both
19770 setter/getter being null and returning silently, the reason being
19771 that I did not want to put the knowledge about this error in upper
19774 int old = Report.Errors;
19775 x = new PropertyExpr (...);
19776 if (old != Report.Errors)
19781 So the property expr is returned, but it is invalid, so the error
19782 will be flagged during the resolve process.
19784 * class.cs: Remove InheritablePropertySignatureCompare from the
19785 class, as we no longer depend on the property signature to compute
19786 whether it is possible to implement a method or not.
19788 The reason is that calling PropertyInfo.GetGetMethod will return
19789 null (in .NET, in Mono it works, and we should change this), in
19790 cases where the Get Method does not exist in that particular
19795 class X { public virtual int A { get { return 1; } } }
19797 class Z : Y { public override int A { get { return 2; } } }
19799 Would fail in Z because the parent (Y) would not have the property
19800 defined. So we avoid this completely now (because the alternative
19801 fix was ugly and slow), and we now depend exclusively on the
19804 (PropertyBase.CheckBase): Use a method-base mechanism to find our
19805 reference method, instead of using the property.
19807 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
19808 routines are gone now.
19810 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
19811 names, they were incorrectly named.
19813 * cs-tokenizer.cs: Return are more gentle token on failure.
19815 * pending.cs (PendingImplementation.InterfaceMethod): This routine
19816 had an out-of-sync index variable, which caused it to remove from
19817 the list of pending methods the wrong method sometimes.
19819 2002-10-22 Miguel de Icaza <miguel@ximian.com>
19821 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
19822 CanWrite, because those refer to this particular instance of the
19823 property, and do not take into account the fact that we can
19824 override single members of a property.
19826 Constructor requires an EmitContext. The resolution process does
19827 not happen here, but we need to compute the accessors before,
19828 because the resolution does not always happen for properties.
19830 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
19831 subclass, before we did not update this flag, but we did update
19834 (GetAccessors): Drop this routine, as it did not work in the
19835 presence of partially overwritten set/get methods.
19837 Notice that this broke the cs1540 detection, but that will require
19840 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19844 * driver.cs: issue a warning instead of an error if we don't support
19845 debugging for the platform. Also ignore a couple of errors that may
19846 arise when trying to write the symbols. Undo my previous patch.
19848 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19850 * driver.cs: ignore /debug switch except for Unix platforms.
19852 2002-10-23 Nick Drochak <ndrochak@gol.com>
19854 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
19856 2002-10-21 Miguel de Icaza <miguel@ximian.com>
19858 * driver.cs: Do not make mcs-debug conditional, so we do not break
19859 builds that use it.
19861 * statement.cs (UsageVector.MergeChildren): I would like Martin to
19862 review this patch. But basically after all the children variables
19863 have been merged, the value of "Breaks" was not being set to
19864 new_breaks for Switch blocks. I think that it should be set after
19865 it has executed. Currently I set this to the value of new_breaks,
19866 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
19867 conservative, but I do not understand this code very well.
19869 I did not break anything in the build, so that is good ;-)
19871 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
19873 2002-10-20 Mark Crichton <crichton@gimp.org>
19875 * cfold.cs: Fixed compile blocker. Really fixed it this time.
19877 2002-10-20 Nick Drochak <ndrochak@gol.com>
19879 * cfold.cs: Fixed compile blocker.
19881 2002-10-20 Miguel de Icaza <miguel@ximian.com>
19883 * driver.cs: I was chekcing the key, not the file.
19885 2002-10-19 Ravi Pratap <ravi@ximian.com>
19887 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
19888 message that we were generating - we just need to silently return
19891 2002-10-19 Miguel de Icaza <miguel@ximian.com>
19893 * class.cs (Event.Define): Change my previous commit, as this
19894 breaks the debugger. This is a temporary hack, as it seems like
19895 the compiler is generating events incorrectly to begin with.
19897 * expression.cs (Binary.ResolveOperator): Added support for
19898 "U operator - (E x, E y)"
19900 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
19903 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
19904 init-only variables, but this path did not take into account that
19905 there might be also instance readonly variables. Correct this
19908 This fixes bug 32253
19910 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
19913 * driver.cs: Change the extension for modules to `netmodule'
19915 * cs-parser.jay: Improved slightly the location tracking for
19916 the debugger symbols.
19918 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
19919 modifiers that were specified instead of the hardcoded value
19920 (FamAndAssem). This was basically ignoring the static modifier,
19921 and others. Fixes 32429.
19923 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
19924 fixed a bug in the process (32476)
19926 * expression.cs (ArrayAccess.EmitAssign): Patch from
19927 hwang_rob@yahoo.ca that fixes bug 31834.3
19929 2002-10-18 Miguel de Icaza <miguel@ximian.com>
19931 * driver.cs: Make the module extension .netmodule.
19933 2002-10-16 Miguel de Icaza <miguel@ximian.com>
19935 * driver.cs: Report an error if the resource file is not found
19936 instead of crashing.
19938 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
19939 false, like Emit does.
19941 2002-10-16 Nick Drochak <ndrochak@gol.com>
19943 * typemanager.cs: Remove unused private member. Also reported mcs
19944 bug to report this as a warning like csc.
19946 2002-10-15 Martin Baulig <martin@gnome.org>
19948 * statement.cs (Statement.Emit): Made this a virtual method; emits
19949 the line number info and calls DoEmit().
19950 (Statement.DoEmit): New protected abstract method, formerly knows
19951 as Statement.Emit().
19953 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
19955 2002-10-11 Miguel de Icaza <miguel@ximian.com>
19957 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
19958 have fixed a remaining problem: not every AddXXXX was adding a
19959 fully qualified name.
19961 Now everyone registers a fully qualified name in the DeclSpace as
19962 being defined instead of the partial name.
19964 Downsides: we are slower than we need to be due to the excess
19965 copies and the names being registered this way.
19967 The reason for this is that we currently depend (on the corlib
19968 bootstrap for instance) that types are fully qualified, because
19969 we dump all the types in the namespace, and we should really have
19970 types inserted into the proper namespace, so we can only store the
19971 basenames in the defined_names array.
19973 2002-10-10 Martin Baulig <martin@gnome.org>
19975 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
19976 from bug #31834, see the bug report for a testcase which is
19979 2002-10-10 Martin Baulig <martin@gnome.org>
19981 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
19982 flow analysis code for this.
19984 * statement.cs (Do, While, For): Tell the flow analysis code about
19986 (FlowBranching.UsageVector): Added support for infinite loops.
19987 (Block.Resolve): Moved the dead code elimination here and use flow
19990 2002-10-09 Miguel de Icaza <miguel@ximian.com>
19992 * class.cs (Field.Define): Catch cycles on struct type
19995 * typemanager.cs (IsUnmanagedtype): Do not recursively check
19996 fields if the fields are static. We only need to check instance
19999 * expression.cs (As.DoResolve): Test for reference type.
20001 * statement.cs (Using.ResolveExpression): Use
20002 ConvertImplicitRequired, not ConvertImplicit which reports an
20004 (Using.ResolveLocalVariableDecls): ditto.
20006 * expression.cs (Binary.ResolveOperator): Report errors in a few
20007 places where we had to.
20009 * typemanager.cs (IsUnmanagedtype): Finish implementation.
20011 2002-10-08 Miguel de Icaza <miguel@ximian.com>
20013 * expression.cs: Use StoreFromPtr instead of extracting the type
20014 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
20016 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
20017 an enumeration value to a System.Enum, but System.Enum is not a
20018 value type, but an class type, so we need to box.
20020 (Expression.ConvertExplicit): One codepath could return
20021 errors but not flag them. Fix this. Fixes #31853
20023 * parameter.cs (Resolve): Do not allow void as a parameter type.
20025 2002-10-06 Martin Baulig <martin@gnome.org>
20027 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
20028 if it's a class type and not a struct. Fixes #31815.
20030 2002-10-06 Martin Baulig <martin@gnome.org>
20032 * statement.cs: Reworked the flow analysis code a bit to make it
20033 usable for dead code elimination.
20035 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20037 * cs-parser.jay: allow empty source files. Fixes bug #31781.
20039 2002-10-04 Miguel de Icaza <miguel@ximian.com>
20041 * expression.cs (ComposedCast.DoResolveType): A quick workaround
20042 to fix the test 165, will investigate deeper.
20044 2002-10-04 Martin Baulig <martin@gnome.org>
20046 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
20047 finally blocks actually work.
20048 (Try.Resolve): We don't need to create a sibling for `finally' if
20049 there is no finally block.
20051 2002-10-04 Martin Baulig <martin@gnome.org>
20053 * class.cs (Constructor.Define): The default accessibility for a
20054 non-default constructor is private, not public.
20056 2002-10-04 Miguel de Icaza <miguel@ximian.com>
20058 * class.cs (Constructor): Make AllowedModifiers public, add
20061 * cs-parser.jay: Perform the modifiers test here, as the
20062 constructor for the Constructor class usually receives a zero
20063 because of the way we create it (first we create, later we
20064 customize, and we were never checking the modifiers).
20066 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
20067 is a version of LookupTypeReflection that includes the type-name
20068 cache. This can be used as a fast path for functions that know
20069 the fully qualified name and are only calling into *.GetType() to
20070 obtain a composed type.
20072 This is also used by TypeManager.LookupType during its type
20075 (LookupType): We now also track the real type name, as sometimes
20076 we can get a quey for the real type name from things like
20077 ComposedCast. This fixes bug 31422.
20079 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
20080 complete type fullname, it does not have to go through the type
20081 resolution system to obtain the composed version of the type (for
20082 obtaining arrays or pointers).
20084 (Conditional.Emit): Use the EmitBoolExpression to
20085 generate nicer code, as requested by Paolo.
20087 (ArrayCreation.CheckIndices): Use the patch from
20088 hwang_rob@yahoo.ca to validate the array initializers.
20090 2002-10-03 Miguel de Icaza <miguel@ximian.com>
20092 * class.cs (ConstructorInitializer.Emit): simplify code by using
20093 Invocation.EmitCall, and at the same time, fix the bugs in calling
20094 parent constructors that took variable arguments.
20096 * ecore.cs (Expression.ConvertNumericExplicit,
20097 Expression.ImplicitNumericConversion): Remove the code that
20098 manually wrapped decimal (InternalTypeConstructor call is now gone
20101 * expression.cs (Cast.TryReduce): Also handle decimal types when
20102 trying to perform a constant fold on the type.
20104 * typemanager.cs (IsUnmanagedtype): Partially implemented.
20106 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
20107 that only turned off an error report, and did nothing else.
20109 2002-10-02 Miguel de Icaza <miguel@ximian.com>
20111 * driver.cs: Handle and ignore /fullpaths
20113 2002-10-01 Miguel de Icaza <miguel@ximian.com>
20115 * expression.cs (Binary.ResolveOperator): Catch the case where
20116 DoNumericPromotions returns true,
20118 (Binary.DoNumericPromotions): Simplify the code, and the tests.
20120 2002-09-27 Miguel de Icaza <miguel@ximian.com>
20122 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
20125 2002-09-26 Miguel de Icaza <miguel@ximian.com>
20127 * ecore.cs (ConvertNumericExplicit): It is not enough that the
20128 conversion exists, but it is also required that the conversion be
20129 performed. This manifested in "(Type64Enum) 2".
20131 * class.cs (TypeManager.AddMethod): The fix is not to change
20132 AddEnum, because that one was using a fully qualified name (every
20133 DeclSpace derivative does), but to change the AddMethod routine
20134 that was using an un-namespaced name. This now correctly reports
20135 the duplicated name.
20137 Revert patch until I can properly fix it. The issue
20138 is that we have a shared Type space across all namespaces
20139 currently, which is wrong.
20141 Options include making the Namespace a DeclSpace, and merge
20142 current_namespace/current_container in the parser.
20144 2002-09-25 Miguel de Icaza <miguel@ximian.com>
20146 * cs-parser.jay: Improve error reporting when we get a different
20147 kind of expression in local_variable_type and
20148 local_variable_pointer_type.
20150 Propagate this to avoid missleading errors being reported.
20152 * ecore.cs (ImplicitReferenceConversion): treat
20153 TypeManager.value_type as a target just like object_type. As
20158 Is valid, and needs to result in the int 1 being boxed before it
20159 is assigned to the value type v.
20161 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
20162 to validate the enumeration name.
20164 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
20165 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
20166 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
20168 * ecore.cs (TryImplicitIntConversion): When doing an
20169 implicit-enumeration-conversion, check if the type is 64-bits and
20170 perform a conversion before passing to EnumConstant.
20172 2002-09-23 Miguel de Icaza <miguel@ximian.com>
20174 * decl.cs (Error_AmbiguousTypeReference); New routine used to
20175 report ambiguous type references. Unlike the MS version, we
20176 report what the ambiguity is. Innovation at work ;-)
20178 (DeclSpace.FindType): Require a location argument to
20179 display when we display an ambiguous error.
20181 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
20183 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
20185 * expression.cs (EmitDynamicInitializers): Apply patch from
20186 hwang_rob@yahoo.ca that fixes the order in which we emit our
20189 2002-09-21 Martin Baulig <martin@gnome.org>
20191 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
20192 delegate takes no arguments.
20194 2002-09-20 Miguel de Icaza <miguel@ximian.com>
20196 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
20199 * expression.cs: Extract the underlying type.
20201 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
20203 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
20205 2002-09-19 Miguel de Icaza <miguel@ximian.com>
20207 * class.cs (TypeContainer.DefineType): We can not use the nice
20208 PackingSize with the size set to 1 DefineType method, because it
20209 will not allow us to define the interfaces that the struct
20212 This completes the fixing of bug 27287
20214 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
20215 means also structs. This fixes part of the problem.
20216 (Expresion.ImplicitReferenceConversionExists): ditto.
20218 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
20219 error if there were no errors reported during the type lookup
20220 process, to avoid duplicates or redundant errors. Without this
20221 you would get an ambiguous errors plus a type not found. We have
20222 beaten the user enough with the first error.
20224 (DeclSparce.FindType): Emit a warning if we have an ambiguous
20227 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
20228 during the resolution process, stop the lookup, this avoids
20229 repeated error reports (same error twice).
20231 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
20233 * typemanager.cs (LookupType): Redo the type lookup code to match
20234 the needs of System.Reflection.
20236 The issue is that System.Reflection requires references to nested
20237 types to begin with a "+" sign instead of a dot. So toplevel
20238 types look like: "NameSpace.TopLevelClass", and nested ones look
20239 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
20242 2002-09-19 Martin Baulig <martin@gnome.org>
20244 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
20245 says that a method always returns or always throws an exception,
20246 don't report the CS0161.
20248 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
20249 set `Returns = new_returns'.
20251 2002-09-19 Martin Baulig <martin@gnome.org>
20253 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
20254 to an enum constant, check for a CS0176.
20256 2002-09-18 Miguel de Icaza <miguel@ximian.com>
20258 * class.cs (TypeContainer.CheckPairedOperators): Now we check
20259 for operators that must be in pairs and report errors.
20261 * ecore.cs (SimpleName.DoResolveType): During the initial type
20262 resolution process, when we define types recursively, we must
20263 check first for types in our current scope before we perform
20264 lookups in the enclosing scopes.
20266 * expression.cs (MakeByteBlob): Handle Decimal blobs.
20268 (Invocation.VerifyArgumentsCompat): Call
20269 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
20270 I thought we were supposed to always call this, but there are a
20271 few places in the code where we dont do it.
20273 2002-09-17 Miguel de Icaza <miguel@ximian.com>
20275 * driver.cs: Add support in -linkres and -resource to specify the
20276 name of the identifier.
20278 2002-09-16 Miguel de Icaza <miguel@ximian.com>
20280 * ecore.cs (StandardConversionExists): Sync with the conversion
20281 code: allow anything-* to void* conversions.
20283 (FindMostSpecificSource): Use an Expression argument
20284 instead of a Type, because we might be handed over a Literal which
20285 gets a few more implicit conversions that plain types do not. So
20286 this information was being lost.
20288 Also, we drop the temporary type-holder expression when not
20291 2002-09-17 Martin Baulig <martin@gnome.org>
20293 * class.cs (PropertyBase.CheckBase): Don't check the base class if
20294 this is an explicit interface implementation.
20296 2002-09-17 Martin Baulig <martin@gnome.org>
20298 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
20299 different `IndexerName' attributes.
20301 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
20302 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
20303 virtual CommonResolve().
20305 2002-09-16 Miguel de Icaza <miguel@ximian.com>
20307 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
20308 and convert that to the UnderlyingType.
20310 * statement.cs (Foreach.Resolve): Indexers are just like variables
20311 or PropertyAccesses.
20313 * cs-tokenizer.cs (consume_string): Track line numbers and columns
20314 inside quoted strings, we were not doing this before.
20316 2002-09-16 Martin Baulig <martin@gnome.org>
20318 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
20319 resolve it. This is needed for the definite assignment check of the
20320 instance expression, fixes bug #29846.
20321 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
20323 2002-09-16 Nick Drochak <ndrochak@gol.com>
20325 * parameter.cs: Fix compile error. Cannot reference static member
20326 from an instance object. Is this an mcs bug?
20328 2002-09-14 Martin Baulig <martin@gnome.org>
20330 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
20331 multiple times. Fixes bug #30295, added test-166.cs.
20333 2002-09-14 Martin Baulig <martin@gnome.org>
20335 * statement.cs (Block.Emit): Don't emit unreachable code.
20336 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
20337 `break' statements.
20338 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
20340 2002-09-14 Martin Baulig <martin@gnome.org>
20342 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
20345 2002-09-14 Martin Baulig <martin@gnome.org>
20347 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
20348 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
20349 be false on the ms runtime.
20351 2002-09-13 Martin Baulig <martin@gnome.org>
20353 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
20354 the CS0038 error message.
20356 2002-09-12 Miguel de Icaza <miguel@ximian.com>
20358 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
20359 constant inside, return it.
20361 2002-09-12 Martin Baulig <martin@gnome.org>
20363 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
20364 implicit conversion can be done between enum types.
20366 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
20367 check whether an implicit conversion to the current enum's UnderlyingType
20368 exists and report an error if not.
20370 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
20371 without debugging support.
20373 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
20374 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
20376 2002-09-12 Martin Baulig <martin@gnome.org>
20378 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
20380 * ecore.cs (IMemberExpr.DeclaringType): New property.
20381 (SimpleName.SimpleNameResolve): Check whether we're accessing a
20382 nonstatic member of an outer type (CS0038).
20384 2002-09-11 Miguel de Icaza <miguel@ximian.com>
20386 * driver.cs: Activate the using-error detector at warning level
20387 4 (at least for MS-compatible APIs).
20389 * namespace.cs (VerifyUsing): Small buglett fix.
20391 * pending.cs (PendingImplementation): pass the container pointer.
20393 * interface.cs (GetMethods): Allow for recursive definition. Long
20394 term, I would like to move every type to support recursive
20395 definitions, not the current ordering mechanism that we have right
20398 The situation is this: Attributes are handled before interfaces,
20399 so we can apply attributes to interfaces. But some attributes
20400 implement interfaces, we will now handle the simple cases
20401 (recursive definitions will just get an error).
20403 * parameter.cs: Only invalidate types at the end if we fail to
20406 2002-09-09 Martin Baulig <martin@gnome.org>
20408 * ecore.cs (PropertyExpr.Emit): Also check for
20409 TypeManager.system_int_array_get_length so this'll also work when
20410 compiling corlib. Fixes #30003.
20412 2002-09-09 Martin Baulig <martin@gnome.org>
20414 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
20415 and throw an exception if we can't get the type's size. Fixed #30040,
20418 2002-09-09 Martin Baulig <martin@gnome.org>
20420 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
20422 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
20423 context. Fixes bug #30027.
20425 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
20426 virtual functions. Fixes bug #30043, added test-164.cs.
20428 2002-09-08 Ravi Pratap <ravi@ximian.com>
20430 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
20432 2002-09-08 Nick Drochak <ndrochak@gol.com>
20434 * driver.cs: Use an object to get the windows codepage since it's not a
20437 2002-09-08 Miguel de Icaza <miguel@ximian.com>
20439 * statement.cs (For.Emit): for infinite loops (test == null)
20440 return whether there is a break inside, not always "true".
20442 * namespace.cs (UsingEntry): New struct to hold the name of the
20443 using definition, the location where it is defined, and whether it
20444 has been used in a successful type lookup.
20446 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
20451 2002-09-06 Ravi Pratap <ravi@ximian.com>
20453 * attribute.cs : Fix incorrect code which relied on catching
20454 a NullReferenceException to detect a null being passed in
20455 where an object was expected.
20457 2002-09-06 Miguel de Icaza <miguel@ximian.com>
20459 * statement.cs (Try): flag the catch variable as assigned
20461 * expression.cs (Cast): Simplified by using ResolveType instead of
20462 manually resolving.
20464 * statement.cs (Catch): Fix bug by using ResolveType.
20466 2002-09-06 Ravi Pratap <ravi@ximian.com>
20468 * expression.cs (BetterConversion): Special case for when we have
20469 a NullLiteral as the argument and we have to choose between string
20470 and object types - we choose string the way csc does.
20472 * attribute.cs (Attribute.Resolve): Catch the
20473 NullReferenceException and report error #182 since the Mono
20474 runtime no more has the bug and having this exception raised means
20475 we tried to select a constructor which takes an object and is
20478 2002-09-05 Ravi Pratap <ravi@ximian.com>
20480 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
20481 message (1502, 1503) when we can't locate a method after overload
20482 resolution. This is much more informative and closes the bug
20485 * interface.cs (PopulateMethod): Return if there are no argument
20486 types. Fixes a NullReferenceException bug.
20488 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
20489 expressions too. Previously we were checking only in one place for
20490 positional arguments leaving out named arguments.
20492 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
20493 type to the enum type is not allowed. Remove code corresponding to
20496 (ConvertNumericExplicit): Allow explicit conversions from
20497 the underlying type to enum type. This precisely follows the spec
20498 and closes a bug filed by Gonzalo.
20500 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20503 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
20505 2002-09-03 Miguel de Icaza <miguel@ximian.com>
20507 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
20508 it was important that we stored the right value after the
20509 reduction in `converted'.
20511 2002-09-04 Martin Baulig <martin@gnome.org>
20513 * location.cs (Location.SymbolDocument): Use full pathnames for the
20516 2002-08-30 Miguel de Icaza <miguel@ximian.com>
20518 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
20519 of the expression resolve mechanism, because that will catch the
20520 SimpleName error failures.
20522 (Conditional): If we can not resolve the
20523 expression, return, do not crash.
20525 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20528 (location): display token name instead of its number.
20530 2002-08-28 Martin Baulig <martin@gnome.org>
20532 * expression.cs (Binary.ResolveOperator): Don't silently return
20533 but return an error if an operator cannot be applied between two
20536 2002-08-28 Martin Baulig <martin@gnome.org>
20538 * class.cs (Constructor.Define): Set the permission attributes
20539 correctly instead of making all constructors public.
20541 2002-08-28 Martin Baulig <martin@gnome.org>
20543 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
20544 for private members before reporting a CS0103; if we find anything,
20547 2002-08-28 Martin Baulig <martin@gnome.org>
20549 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
20550 to check whether `closure_start_type == closure_invocation_type',
20551 we also need to check whether `m.DeclaringType == closure_invocation_type'
20552 before bypassing the permission checks. We might be accessing
20553 protected/private members from the base class.
20554 (TypeManager.RealMemberLookup): Only set private_ok if private
20555 members were requested via BindingFlags.NonPublic.
20557 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
20559 * expression.cs (MemberAccess.ResolveMemberAccess): Set
20560 MethodGroupExpr.IsExplicitImpl if appropriate.
20561 (Invocation.DoResolve): Don't report the CS0120 for explicit
20562 interface implementations.
20564 2002-08-27 Martin Baulig <martin@gnome.org>
20566 * expression.cs (Invocation.DoResolve): If this is a static
20567 method and we don't have an InstanceExpression, we must report
20570 2002-08-25 Martin Baulig <martin@gnome.org>
20572 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
20573 `==' between a valuetype and an object.
20575 2002-08-25 Miguel de Icaza <miguel@ximian.com>
20577 * ecore.cs (TypeExpr): Provide a ToString method.
20579 2002-08-24 Martin Baulig <martin@gnome.org>
20581 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
20582 now called proggie.dbg and it's a binary file.
20584 2002-08-23 Martin Baulig <martin@gnome.org>
20586 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
20588 2002-08-23 Martin Baulig <martin@gnome.org>
20590 * struct.cs (MyStructInfo.ctor): Make this work with empty
20591 structs; it's not allowed to use foreach() on null.
20593 2002-08-23 Martin Baulig <martin@gnome.org>
20595 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
20596 writer the full pathname of the generated assembly.
20598 2002-08-23 Martin Baulig <martin@gnome.org>
20600 * statements.cs (FlowBranching.UsageVector.MergeChildren):
20601 A `finally' block never returns or breaks; improved handling of
20604 2002-08-23 Martin Baulig <martin@gnome.org>
20606 * statement.cs (Throw.Resolve): Allow `throw null'.
20608 2002-08-23 Martin Baulig <martin@gnome.org>
20610 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
20611 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
20612 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
20613 MemberLookup would return a wrong event if this is an explicit
20614 interface implementation and the class has an event with the same
20617 2002-08-23 Martin Baulig <martin@gnome.org>
20619 * statement.cs (Block.AddChildVariableNames): New public method.
20620 (Block.AddChildVariableName): Likewise.
20621 (Block.IsVariableNameUsedInChildBlock): Likewise.
20622 (Block.AddVariable): Check whether a variable name has already
20623 been used in a child block.
20625 * cs-parser.jay (declare_local_variables): Mark all variable names
20626 from the current block as being used in a child block in the
20629 2002-08-23 Martin Baulig <martin@gnome.org>
20631 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
20632 find the symbol writer.
20634 * driver.cs: csc also allows the arguments to /define being
20635 separated by commas, not only by semicolons.
20637 2002-08-23 Martin Baulig <martin@gnome.org>
20639 * interface.cs (Interface.GetMembers): Added static check for events.
20641 2002-08-15 Martin Baulig <martin@gnome.org>
20643 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
20644 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
20646 * ecore.cs (Expression.MemberLookup): Added documentation and explained
20647 why the MethodData.EmitDestructor() change was necessary.
20649 2002-08-20 Martin Baulig <martin@gnome.org>
20651 * class.cs (TypeContainer.FindMembers): Added static check for events.
20653 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
20655 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
20656 use Type.GetEvents(), not Type.FindMembers().
20658 2002-08-20 Martin Baulig <martin@gnome.org>
20660 * decl.cs (MemberCache): Added a special method cache which will
20661 be used for method-only searched. This ensures that a method
20662 search will return a MethodInfo with the correct ReflectedType for
20665 2002-08-20 Martin Baulig <martin@gnome.org>
20667 * decl.cs (DeclSpace.FindMembers): Made this public.
20669 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20671 * delegate.cs: fixed build on windows.
20672 [FIXME: Filed as bug #29150: MCS must report these errors.]
20674 2002-08-19 Ravi Pratap <ravi@ximian.com>
20676 * ecore.cs (StandardConversionExists): Return a false
20677 if we are trying to convert the void type to anything else
20678 since that is not allowed.
20680 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
20681 we flag error 70 in the event an event is trying to be accessed
20682 directly from outside the declaring type.
20684 2002-08-20 Martin Baulig <martin@gnome.org>
20686 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
20687 MemberCache from typemanager.cs to decl.cs.
20689 2002-08-19 Martin Baulig <martin@gnome.org>
20691 * class.cs (TypeContainer): Implement IMemberContainer.
20692 (TypeContainer.DefineMembers): Create the MemberCache.
20693 (TypeContainer.FindMembers): Do better BindingFlags checking; only
20694 return public members if BindingFlags.Public was given, check
20695 whether members are static.
20697 2002-08-16 Martin Baulig <martin@gnome.org>
20699 * decl.cs (DeclSpace.Define): Splitted this in Define and
20700 DefineMembers. DefineMembers is called first and initializes the
20703 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
20704 DefineMembers() on all our DeclSpaces.
20706 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
20707 but call DefineMembers() on all nested interfaces. We call their
20708 Define() in our new Define() function.
20710 * interface.cs (Interface): Implement IMemberContainer.
20711 (Interface.Define): Moved all code except the attribute stuf to
20713 (Interface.DefineMembers): Initialize the member cache.
20715 * typemanager.cs (IMemberFinder): Removed this interface, we don't
20716 need this anymore since we can use MemberCache.FindMembers directly.
20718 2002-08-19 Martin Baulig <martin@gnome.org>
20720 * typemanager.cs (MemberCache): When creating the cache for an
20721 interface type, add all inherited members.
20722 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
20723 to `out bool used_cache' and documented it.
20724 (TypeManager.MemberLookup): If we already used the cache in the first
20725 iteration, we don't need to do the interfaces check.
20727 2002-08-19 Martin Baulig <martin@gnome.org>
20729 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
20730 here from IMemberFinder and don't implement this interface anymore.
20731 (DeclSpace.MemberCache): Moved here from IMemberFinder.
20733 * typemanager.cs (IMemberFinder): This interface is now only used by
20734 classes which actually support the member cache.
20735 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
20736 since we only put DeclSpaces into this Hashtable.
20737 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
20738 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
20740 2002-08-16 Martin Baulig <martin@gnome.org>
20742 * typemanager.cs (ICachingMemberFinder): Removed.
20743 (IMemberFinder.MemberCache): New property.
20744 (TypeManager.FindMembers): Merged this with RealFindMembers().
20745 This function will never be called from TypeManager.MemberLookup()
20746 so we can't use the cache here, just the IMemberFinder.
20747 (TypeManager.MemberLookup_FindMembers): Check whether the
20748 IMemberFinder has a MemberCache and call the cache's FindMembers
20750 (MemberCache): Rewrote larger parts of this yet another time and
20751 cleaned it up a bit.
20753 2002-08-15 Miguel de Icaza <miguel@ximian.com>
20755 * driver.cs (LoadArgs): Support quoting.
20757 (Usage): Show the CSC-like command line arguments.
20759 Improved a few error messages.
20761 2002-08-15 Martin Baulig <martin@gnome.org>
20763 * typemanager.cs (IMemberContainer.Type): New property.
20764 (IMemberContainer.IsInterface): New property.
20766 The following changes are conditional to BROKEN_RUNTIME, which is
20767 defined at the top of the file.
20769 * typemanager.cs (MemberCache.MemberCache): Don't add the base
20770 class'es members, but add all members from TypeHandle.ObjectType
20771 if we're an interface.
20772 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
20773 is the current type.
20774 (MemberCache.CacheEntry.Container): Removed this field.
20775 (TypeHandle.GetMembers): Include inherited members.
20777 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20779 * typemanager.cs: fixed compilation and added a comment on a field that
20782 2002-08-15 Martin Baulig <martin@gnome.org>
20784 * class.cs (ConstructorInitializer.Resolve): In the
20785 Expression.MemberLookup call, use the queried_type as
20788 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
20789 declared' attribute, it's always true.
20790 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
20791 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
20792 temporary wrapper for FindMembers which tells MemberLookup whether
20793 members from the base classes are included in the return value.
20794 This will go away soon.
20795 (TypeManager.MemberLookup): Use this temporary hack here; once the
20796 new MemberCache is completed, we don't need to do the DeclaredOnly
20797 looping here anymore since the MemberCache will take care of this.
20798 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
20799 (MemberCache): When creating the MemberCache for a class, get
20800 members from the current class and all its base classes.
20801 (MemberCache.CacheEntry.Container): New field. This is a
20802 temporary hack until the Mono runtime is fixed to distinguish
20803 between ReflectedType and DeclaringType. It allows us to use MCS
20804 with both the MS runtime and the unfixed Mono runtime without
20805 problems and without accecting performance.
20806 (MemberCache.SearchMembers): The DeclaredOnly looping from
20807 TypeManager.MemberLookup is now done here.
20809 2002-08-14 Martin Baulig <martin@gnome.org>
20811 * statement.cs (MyStructInfo.MyStructInfo): Don't call
20812 Type.GetFields on dynamic types but get the fields from the
20813 corresponding TypeContainer.
20814 (MyStructInfo.GetStructInfo): Added check for enum types.
20816 * typemanager.cs (MemberList.IsSynchronized): Implemented.
20817 (MemberList.SyncRoot): Implemented.
20818 (TypeManager.FilterWithClosure): No need to check permissions if
20819 closure_start_type == closure_invocation_type, don't crash if
20820 closure_invocation_type is null.
20822 2002-08-13 Martin Baulig <martin@gnome.org>
20824 Rewrote TypeContainer.FindMembers to use a member cache. This
20825 gives us a speed increase of about 35% for the self-hosting MCS
20826 build and of about 15-20% for the class libs (both on GNU/Linux).
20828 * report.cs (Timer): New class to get enhanced profiling. This
20829 whole class is "TIMER" conditional since it remarkably slows down
20832 * class.cs (MemberList): New class. This is an IList wrapper
20833 which we're now using instead of passing MemberInfo[]'s around to
20834 avoid copying this array unnecessarily.
20835 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
20836 (ICachingMemberFinder, IMemberContainer): New interface.
20837 (TypeManager.FilterWithClosure): If `criteria' is null, the name
20838 has already been checked, otherwise use it for the name comparision.
20839 (TypeManager.FindMembers): Renamed to RealMemberFinder and
20840 provided wrapper which tries to use ICachingMemberFinder.FindMembers
20841 if possible. Returns a MemberList, not a MemberInfo [].
20842 (TypeHandle): New class, implements IMemberContainer. We create
20843 one instance of this class per type, it contains a MemberCache
20844 which is used to do the member lookups.
20845 (MemberCache): New class. Each instance of this class contains
20846 all members of a type and a name-based hash table.
20847 (MemberCache.FindMembers): This is our new member lookup
20848 function. First, it looks up all members of the requested name in
20849 the hash table. Then, it walks this list and sorts out all
20850 applicable members and returns them.
20852 2002-08-13 Martin Baulig <martin@gnome.org>
20854 In addition to a nice code cleanup, this gives us a performance
20855 increase of about 1.4% on GNU/Linux - not much, but it's already
20856 half a second for the self-hosting MCS compilation.
20858 * typemanager.cs (IMemberFinder): New interface. It is used by
20859 TypeManager.FindMembers to call FindMembers on a TypeContainer,
20860 Enum, Delegate or Interface.
20861 (TypeManager.finder_to_member_finder): New PtrHashtable.
20862 (TypeManager.finder_to_container): Removed.
20863 (TypeManager.finder_to_delegate): Removed.
20864 (TypeManager.finder_to_interface): Removed.
20865 (TypeManager.finder_to_enum): Removed.
20867 * interface.cs (Interface): Implement IMemberFinder.
20869 * delegate.cs (Delegate): Implement IMemberFinder.
20871 * enum.cs (Enum): Implement IMemberFinder.
20873 * class.cs (TypeContainer): Implement IMemberFinder.
20875 2002-08-12 Martin Baulig <martin@gnome.org>
20877 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
20879 2002-08-12 Martin Baulig <martin@gnome.org>
20881 * ecore.cs (ITypeExpression): New interface for expressions which
20883 (TypeExpression): Renamed to TypeLookupExpression.
20884 (Expression.DoResolve): If we're doing a types-only lookup, the
20885 expression must implement the ITypeExpression interface and we
20886 call DoResolveType() on it.
20887 (SimpleName): Implement the new ITypeExpression interface.
20888 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
20889 hack, the situation that we're only looking up types can't happen
20890 anymore when this method is called. Moved the type lookup code to
20891 DoResolveType() and call it.
20892 (SimpleName.DoResolveType): This ITypeExpression interface method
20893 is now doing the types-only lookup.
20894 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
20895 (ResolveFlags): Added MaskExprClass.
20897 * expression.cs (MemberAccess): Implement the ITypeExpression
20899 (MemberAccess.DoResolve): Added support for a types-only lookup
20900 when we're called via ITypeExpression.DoResolveType().
20901 (ComposedCast): Implement the ITypeExpression interface.
20903 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
20904 Expression.Resolve() with ResolveFlags.Type instead.
20906 2002-08-12 Martin Baulig <martin@gnome.org>
20908 * interface.cs (Interface.Define): Apply attributes.
20910 * attribute.cs (Attribute.ApplyAttributes): Added support for
20911 interface attributes.
20913 2002-08-11 Martin Baulig <martin@gnome.org>
20915 * statement.cs (Block.Emit): Only check the "this" variable if we
20916 do not always throw an exception.
20918 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
20919 whether the property has a set accessor.
20921 2002-08-11 Martin Baulig <martin@gnome.org>
20923 Added control flow analysis support for structs.
20925 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
20926 with control flow analysis turned off.
20927 (IVariable): New interface.
20928 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
20929 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
20930 (FieldExpr.DoResolve): Resolve the instance expression with flow
20931 analysis turned off and do the definite assignment check after the
20932 resolving when we know what the expression will resolve to.
20934 * expression.cs (LocalVariableReference, ParameterReference):
20935 Implement the new IVariable interface, only call the flow analysis
20936 code if ec.DoFlowAnalysis is true.
20937 (This): Added constructor which takes a Block argument. Implement
20938 the new IVariable interface.
20939 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
20940 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
20941 This does the definite assignment checks for struct members.
20943 * class.cs (Constructor.Emit): If this is a non-static `struct'
20944 constructor which doesn't have any initializer, call
20945 Block.AddThisVariable() to tell the flow analysis code that all
20946 struct elements must be initialized before control returns from
20949 * statement.cs (MyStructInfo): New public class.
20950 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
20951 argument to this indexer. If non-zero, check an individual struct
20952 member, not the whole struct.
20953 (FlowBranching.CheckOutParameters): Check struct members.
20954 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
20955 overloaded versions of these methods which take an additional
20956 `int field_idx' argument to check struct members.
20957 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
20958 overloaded versions of these methods which take an additional
20959 `string field_name' argument to check struct member.s
20960 (VariableInfo): Implement the IVariable interface.
20961 (VariableInfo.StructInfo): New public property. Returns the
20962 MyStructInfo instance of the variable if it's a struct or null.
20963 (Block.AddThisVariable): New public method. This is called from
20964 Constructor.Emit() for non-static `struct' constructor which do
20965 not have any initializer. It creates a special variable for the
20966 "this" instance variable which will be checked by the flow
20967 analysis code to ensure that all of the struct's fields are
20968 initialized before control returns from the constructor.
20969 (UsageVector): Added support for struct members. If a
20970 variable/parameter is a struct with N members, we reserve a slot
20971 in the usage vector for each member. A struct is considered fully
20972 initialized if either the struct itself (slot 0) or all its
20973 members are initialized.
20975 2002-08-08 Martin Baulig <martin@gnome.org>
20977 * driver.cs (Driver.MainDriver): Only report an error CS5001
20978 if there were no compilation errors.
20980 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
20981 `UnsafeContext' property to determine whether the parent is in
20982 unsafe context rather than checking the parent's ModFlags:
20983 classes nested in an unsafe class are unsafe as well.
20985 2002-08-08 Martin Baulig <martin@gnome.org>
20987 * statement.cs (UsageVector.MergeChildren): Distinguish between
20988 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
20989 we return. Added test17() and test18() to test-154.cs.
20991 2002-08-08 Martin Baulig <martin@gnome.org>
20993 * typemanager.cs (TypeManager.FilterWithClosure): If we have
20994 Family access, make sure the invoking type isn't a subclass of the
20995 queried type (that'd be a CS1540).
20997 * ecore.cs (Expression.MemberLookup): Added overloaded version of
20998 this method which takes an additional `Type invocation_type'.
21000 * expression.cs (BaseAccess.DoResolve): Use the base type as
21001 invocation and query type.
21002 (MemberAccess.DoResolve): If the lookup failed and we're about to
21003 report a CS0122, try a lookup with the ec.ContainerType - if this
21004 succeeds, we must report a CS1540.
21006 2002-08-08 Martin Baulig <martin@gnome.org>
21008 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
21009 (MethodGroupExpr): Implement the IMemberExpr interface.
21011 * expression (MemberAccess.ResolveMemberAccess): No need to have
21012 any special code for MethodGroupExprs anymore, they're now
21015 2002-08-08 Martin Baulig <martin@gnome.org>
21017 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
21018 Family, FamANDAssem and FamORAssem permissions.
21019 (TypeManager.IsSubclassOrNestedChildOf): New public method.
21021 2002-08-08 Martin Baulig <martin@gnome.org>
21023 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
21024 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
21027 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
21029 * driver.cs: implemented /resource option to embed managed resources.
21031 2002-08-07 Martin Baulig <martin@gnome.org>
21033 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
21034 (FieldBase.HasFieldInitializer): New public property.
21035 (FieldBase.GetInitializerExpression): New public method. Resolves and
21036 returns the field initializer and makes sure it is only resolved once.
21037 (TypeContainer.EmitFieldInitializers): Call
21038 FieldBase.GetInitializerExpression to get the initializer, this ensures
21039 that it isn't resolved multiple times.
21041 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
21042 the resolving process (SimpleName/MemberLookup) that we're currently
21043 emitting a field initializer (which must not access any instance members,
21044 this is an error CS0236).
21046 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
21047 argument, if the `IsFieldInitializer' flag is set, we must report and
21048 error CS0236 and not an error CS0120.
21050 2002-08-07 Martin Baulig <martin@gnome.org>
21052 * ecore.cs (IMemberExpr): New public interface.
21053 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
21054 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
21055 if the expression is an IMemberExpr.
21057 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
21058 to be null, implicitly default to `this' if we're non-static in
21059 this case. Simplified the code a lot by using the new IMemberExpr
21060 interface. Also fixed bug #28176 here.
21062 2002-08-06 Martin Baulig <martin@gnome.org>
21064 * cs-parser.jay (SimpleLookup): Removed. We need to create
21065 ParameterReferences during semantic analysis so that we can do a
21066 type-only search when resolving Cast, TypeOf and SizeOf.
21067 (block): Pass the `current_local_parameters' to the Block's
21070 * class.cs (ConstructorInitializer): Added `Parameters parameters'
21071 argument to the constructor.
21072 (ConstructorInitializer.Resolve): Create a temporary implicit
21073 block with the parameters.
21075 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
21076 references here if we aren't doing a type-only search.
21078 * statement.cs (Block): Added constructor which takes a
21079 `Parameters parameters' argument.
21080 (Block.Parameters): New public property.
21082 * support.cs (InternalParameters.Parameters): Renamed `parameters'
21083 to `Parameters' and made it public readonly.
21085 2002-08-06 Martin Baulig <martin@gnome.org>
21087 * ecore.cs (Expression.Warning): Made this public as well.
21089 * report.cs (Report.Debug): Print the contents of collections.
21091 2002-08-06 Martin Baulig <martin@gnome.org>
21093 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
21094 used to tell Resolve() which kinds of expressions it may return.
21095 (Expression.Resolve): Added overloaded version of this method which
21096 takes a `ResolveFlags flags' argument. This can be used to tell
21097 Resolve() which kinds of expressions it may return. Reports a
21099 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
21100 ResolveFlags.SimpleName.
21101 (Expression.Error118): Added overloaded version of this method which
21102 takes a `ResolveFlags flags' argument. It uses the flags to determine
21103 which kinds of expressions are allowed.
21105 * expression.cs (Argument.ResolveMethodGroup): New public method.
21106 Resolves an argument, but allows a MethodGroup to be returned.
21107 This is used when invoking a delegate.
21109 * TODO: Updated a bit.
21111 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21113 Fixed compilation with csc.
21115 * ecore.cs: Expression.Error made public. Is this correct? Should
21116 Warning be made public too?
21118 * expression.cs: use ea.Location instead of ea.loc.
21119 [FIXME: Filed as bug #28607: MCS must report these errors.]
21121 2002-08-06 Martin Baulig <martin@gnome.org>
21123 * ecore.cs (Expression.loc): Moved the location here instead of
21124 duplicating it in all derived classes.
21125 (Expression.Location): New public property.
21126 (Expression.Error, Expression.Warning): Made them non-static and
21127 removed the location argument.
21128 (Expression.Warning): Added overloaded version which takes an
21129 `int level' argument.
21130 (Expression.Error118): Make this non-static and removed the
21131 expression and location arguments.
21132 (TypeExpr): Added location argument to the constructor.
21134 * expression.cs (StaticCallExpr): Added location argument to
21136 (Indirection, PointerArithmetic): Likewise.
21137 (CheckedExpr, UnCheckedExpr): Likewise.
21138 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
21139 (StringPtr): Likewise.
21142 2002-08-05 Martin Baulig <martin@gnome.org>
21144 * expression.cs (BaseAccess.DoResolve): Actually report errors.
21146 * assign.cs (Assign.DoResolve): Check whether the source
21147 expression is a value or variable.
21149 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
21150 while resolving the corresponding blocks.
21152 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
21153 an error, don't silently return null.
21155 * statement.cs (Block.AddVariable): Do the error reporting here
21156 and distinguish between CS0128 and CS0136.
21157 (Block.DoResolve): Report all unused labels (warning CS0164).
21158 (LabeledStatement): Pass the location to the constructor.
21159 (LabeledStatement.HasBeenReferenced): New property.
21160 (LabeledStatement.Resolve): Set it to true here.
21162 * statement.cs (Return.Emit): Return success even after reporting
21163 a type mismatch error (CS0126 or CS0127), this is what csc does and
21164 it avoids confusing the users with any consecutive errors.
21166 2002-08-05 Martin Baulig <martin@gnome.org>
21168 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
21170 * const.cs (Const.LookupConstantValue): Catch circular definitions.
21172 * expression.cs (MemberAccess.DoResolve): Silently return if an
21173 error has already been reported.
21175 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
21176 error has already been reported.
21178 2002-08-05 Martin Baulig <martin@gnome.org>
21180 * statement.cs (UsageVector): Only initialize the `parameters'
21181 vector if we actually have any "out" parameters.
21183 2002-08-05 Martin Baulig <martin@gnome.org>
21185 * expression.cs (Binary.ResolveOperator): When combining delegates,
21186 they must have the same type.
21188 2002-08-05 Martin Baulig <martin@gnome.org>
21190 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
21191 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
21192 work with the ms runtime and we also don't need it: if we're a
21193 PropertyBuilder and not in the `indexer_arguments' hash, then we
21194 are a property and not an indexer.
21196 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
21197 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
21198 since the latter one doesn't work with the ms runtime.
21200 2002-08-03 Martin Baulig <martin@gnome.org>
21202 Fixed bugs #27998 and #22735.
21204 * class.cs (Method.IsOperator): New public field.
21205 (Method.CheckBase): Report CS0111 if there's already a method
21206 with the same parameters in the current class. Report CS0508 when
21207 attempting to change the return type of an inherited method.
21208 (MethodData.Emit): Report CS0179 if a method doesn't have a body
21209 and it's not marked abstract or extern.
21210 (PropertyBase): New abstract base class for Property and Indexer.
21211 (PropertyBase.CheckBase): Moved here from Property and made it work
21213 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
21214 the same so we can reuse it there.
21215 (Property, Indexer): Derive from PropertyBase.
21216 (MethodSignature.inheritable_property_signature_filter): New delegate
21217 to find properties and indexers.
21219 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
21220 argument and improved error reporting.
21222 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
21223 EmptyReadOnlyParameters and made it a property.
21225 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
21226 version of this method which takes a `PropertyInfo indexer'.
21227 (TypeManager.RegisterIndexer): New method.
21229 * class.cs: Added myself as author of this file :-)
21231 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21233 * class.cs: fixed compilation on windoze.
21235 2002-08-03 Martin Baulig <martin@gnome.org>
21237 * interface.cs (Interface.GetInterfaceBases): Check whether all
21238 base interfaces are at least as accessible than the current one.
21240 * class.cs (TypeContainer.GetClassBases): Check whether base types
21241 are at least as accessible than the current type.
21242 (TypeContainer.AsAccessible): Implemented and made non-static.
21243 (MemberBase.CheckParameters): Report errors if the accessibility
21246 * delegate.cs (Delegate.Delegate): The default visibility is
21247 internal for top-level types and private for nested types.
21248 (Delegate.Define): Report errors if the accessibility checks fail.
21250 * enum.cs (Enum.Enum): The default visibility is internal for
21251 top-level types and private for nested types.
21252 (Enum.DefineType): Compute the correct visibility.
21254 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
21255 function which takes a `bool is_toplevel' instead of a TypeContainer.
21257 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
21260 2002-08-02 Martin Baulig <martin@gnome.org>
21262 * expression.cs (LocalVariableReferenc): Added constructor which
21263 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
21264 (LocalVariableReference.IsReadOnly): New property.
21265 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
21266 variable is readonly, use our own readonly flag to do this; you can
21267 use the new constructor to get a writable reference to a read-only
21270 * cs-parser.jay (foreach_statement, using_statement): Get a writable
21271 reference to the local variable.
21273 2002-08-01 Miguel de Icaza <miguel@ximian.com>
21275 * rootcontext.cs (ResolveCore): Also include System.Exception
21277 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
21278 we reach an EmptyStatement.
21280 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
21283 * expression.cs (Binary.ResolveOperator): Check error result in
21286 use brtrue/brfalse directly and avoid compares to null.
21288 2002-08-02 Martin Baulig <martin@gnome.org>
21290 * class.cs (TypeContainer.Define): Define all nested interfaces here.
21291 Fixes bug #28407, added test-155.cs.
21293 2002-08-01 Martin Baulig <martin@gnome.org>
21295 * class.cs (Event.EmitDefaultMethod): Make this work with static
21296 events. Fixes #28311, added verify-3.cs.
21298 2002-08-01 Martin Baulig <martin@gnome.org>
21300 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
21301 `is_disposable' fields.
21302 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
21303 `hm.is_disposable' if we're using the collection pattern.
21304 (Foreach.EmitCollectionForeach): Use the correct type for the
21305 enumerator's local variable, only emit the try/finally block if
21306 necessary (fixes #27713).
21308 2002-08-01 Martin Baulig <martin@gnome.org>
21310 * ecore.cs (Expression.report118): Renamed to Error118 and made
21313 * statement.cs (Throw.Resolve): Check whether the expression is of
21314 the correct type (CS0118) and whether the type derives from
21315 System.Exception (CS0155).
21316 (Catch.Resolve): New method. Do the type lookup here and check
21317 whether it derives from System.Exception (CS0155).
21318 (Catch.CatchType, Catch.IsGeneral): New public properties.
21320 * typemanager.cs (TypeManager.exception_type): Added.
21322 2002-07-31 Miguel de Icaza <miguel@ximian.com>
21324 * driver.cs: Updated About function.
21326 2002-07-31 Martin Baulig <martin@gnome.org>
21328 Implemented Control Flow Analysis.
21330 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
21331 (EmitContext.CurrentBranching): Added.
21332 (EmitContext.StartFlowBranching): Added.
21333 (EmitContext.EndFlowBranching): Added.
21334 (EmitContext.KillFlowBranching): Added.
21335 (EmitContext.IsVariableAssigned): Added.
21336 (EmitContext.SetVariableAssigned): Added.
21337 (EmitContext.IsParameterAssigned): Added.
21338 (EmitContext.SetParameterAssigned): Added.
21339 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
21340 Added control flow analysis stuff here.
21342 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
21343 resolve the expression as lvalue.
21344 (LocalVariableReference.DoResolve): Check whether the variable has
21345 already been assigned.
21346 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
21347 the parameter as assigned here.
21348 (ParameterReference.DoResolve): Check whether the parameter has already
21350 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
21351 expression as lvalue.
21353 * statement.cs (FlowBranching): New class for the flow analysis code.
21354 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
21355 (LabeledStatement.IsDefined): New public property.
21356 (LabeledStatement.AddUsageVector): New public method to tell flow
21357 analyis that the label may be reached via a forward jump.
21358 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
21360 (VariableInfo.Number): New public field. This is used by flow analysis
21361 to number all locals of a block.
21362 (Block.CountVariables): New public property. This is the number of
21363 local variables in this block (including the locals from all parent
21365 (Block.EmitMeta): Number all the variables.
21367 * statement.cs: Added flow analysis support to all classes.
21369 2002-07-31 Martin Baulig <martin@gnome.org>
21371 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
21372 To get debugging messages, compile mcs with /define:MCS_DEBUG and
21373 then use this argument.
21375 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
21377 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
21378 use this to specify /define options.
21380 2002-07-29 Martin Baulig <martin@gnome.org>
21382 * statement.cs (Fixed): Moved all code that does variable lookups
21383 and resolvings from Emit to Resolve.
21385 * statement.cs (For): Moved all code that does variable lookups
21386 and resolvings from Emit to Resolve.
21388 * statement.cs (Using): Moved all code that does variable lookups
21389 and resolvings from Emit to Resolve.
21391 2002-07-29 Martin Baulig <martin@gnome.org>
21393 * attribute.cs (Attribute.Resolve): Explicitly catch a
21394 System.NullReferenceException when creating the
21395 CustromAttributeBuilder and report a different warning message.
21397 2002-07-29 Martin Baulig <martin@gnome.org>
21399 * support.cs (ParameterData.ParameterName): Added method to
21400 get the name of a parameter.
21402 * typemanager.cs (TypeManager.IsValueType): New public method.
21404 2002-07-29 Martin Baulig <martin@gnome.org>
21406 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
21407 is a flag which specifies that it's either ref or out.
21408 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
21409 the out parameter to `out Parameter.Modifier mod', also set the
21410 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
21412 * support.cs (InternalParameters.ParameterModifier): Distinguish
21413 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
21414 Parameter.Modifier.ISBYREF flag if it's either ref or out.
21416 * expression.cs (Argument.GetParameterModifier): Distinguish
21417 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
21418 Parameter.Modifier.ISBYREF flag if it's either ref or out.
21420 2002-07-29 Martin Baulig <martin@gnome.org>
21422 * expression.cs (ParameterReference.ParameterReference): Added
21423 `Location loc' argument to the constructor.
21425 * cs-parser.jay: Pass location to ParameterReference.
21427 2002-07-28 Miguel de Icaza <miguel@ximian.com>
21429 * statement.cs (Try): Initialize the location.
21431 * cs-parser.jay: pass location to Try.
21433 * expression.cs (Unary.Reduce): Change the prototype to return
21434 whether a constant fold could be performed or not. The result is
21435 returned in an out parameters. In the case of Indirection and
21436 AddressOf, we want to perform the full tests.
21438 2002-07-26 Miguel de Icaza <miguel@ximian.com>
21440 * statement.cs (Statement.Emit): Flag dead code.
21442 2002-07-27 Andrew Birkett <andy@nobugs.org>
21444 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
21446 2002-07-27 Martin Baulig <martin@gnome.org>
21448 * class.cs (MethodData.Define): Put back call to
21449 TypeManager.AddMethod(), accidentally commented this out.
21451 * report.cs (Debug): New public method to print debugging information,
21452 this is `[Conditional ("DEBUG")]'.
21454 2002-07-26 Martin Baulig <martin@gnome.org>
21456 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
21457 (switch_statement): Push the current_block to the switch_stack and
21458 pop it again when we're done with the switch.
21459 (switch_section): The new block is a child of the current_block.
21460 Fixes bug #24007, added test-152.cs.
21462 2002-07-27 Martin Baulig <martin@gnome.org>
21464 * expression.cs (Invocation.EmitArguments): When calling a varargs
21465 function with only its fixed arguments, we need to pass an empty
21468 2002-07-27 Martin Baulig <martin@gnome.org>
21470 Mono 0.13 has been released.
21472 2002-07-25 Miguel de Icaza <miguel@ximian.com>
21474 * driver.cs: Rename --resource to --linkres, because that is what
21475 we do currently, we dont support --resource yet.
21477 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
21479 2002-07-25 Martin Baulig <martin@gnome.org>
21481 * class.cs (MethodData): New public class. This is a `method builder'
21482 class for a method or one accessor of a Property/Indexer/Event.
21483 (MethodData.GetMethodFlags): Moved here from MemberBase.
21484 (MethodData.ApplyAttributes): Likewise.
21485 (MethodData.ApplyObsoleteAttribute): Likewise.
21486 (MethodData.ApplyConditionalAttribute): Likewise.
21487 (MethodData.ApplyDllImportAttribute): Likewise.
21488 (MethodData.CheckAbstractAndExternal): Likewise.
21489 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
21490 (MethodData.Emit): Formerly known as Method.Emit().
21491 (MemberBase): Moved everything which was specific to a single
21492 accessor/method to MethodData.
21493 (Method): Create a new MethodData and call Define() and Emit() on it.
21494 (Property, Indexer, Event): Create a new MethodData objects for each
21495 accessor and call Define() and Emit() on them.
21497 2002-07-25 Martin Baulig <martin@gnome.org>
21499 Made MethodCore derive from MemberBase to reuse the code from there.
21500 MemberBase now also checks for attributes.
21502 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
21503 (MemberBase.GetMethodFlags): Moved here from class Method and marked
21505 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
21506 `CallingConventions cc' and `Attributes opt_attrs' arguments.
21507 (MemberBase.ApplyAttributes): New virtual method; applies the
21508 attributes to a method or accessor.
21509 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
21510 (MemberBase.ApplyConditionalAttribute): Likewise.
21511 (MemberBase.ApplyDllImportAttribute): Likewise.
21512 (MemberBase.CheckAbstractAndExternal): Likewise.
21513 (MethodCore.ParameterTypes): This is now a property instead of a
21514 method, it's initialized from DoDefineParameters().
21515 (MethodCore.ParameterInfo): Removed the set accessor.
21516 (MethodCore.DoDefineParameters): New protected virtual method to
21517 initialize ParameterTypes and ParameterInfo.
21518 (Method.GetReturnType): We can now simply return the MemberType.
21519 (Method.GetMethodFlags): Override the MemberBase version and add
21520 the conditional flags.
21521 (Method.CheckBase): Moved some code from Define() here, call
21522 DoDefineParameters() here.
21523 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
21524 here to avoid some larger code duplication.
21525 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
21526 ensure that abstract and external accessors don't declare a body.
21528 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
21529 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
21530 lookup in the attribute's parent classes, so we need to abort as soon
21531 as we found the first match.
21532 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
21533 the attribute has no arguments.
21535 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
21538 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21540 * cs-parser.jay: reverted previous patch.
21542 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21544 * cs-parser.jay: fixed bug #22119.
21546 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21548 * attribute.cs: fixed compilation. The error was:
21549 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
21550 be assigned to before control leaves the current method."
21551 [FIXME: Filed as bug #28186: MCS must report this error.]
21553 2002-07-25 Martin Baulig <martin@gnome.org>
21555 * attribute.cs (Attribute.Conditional_GetConditionName): New static
21556 method to pull the condition name ouf of a Conditional attribute.
21557 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
21558 the obsolete message and error flag out of an Obsolete attribute.
21560 * class.cs (Method.GetMethodFlags): New public method to get the
21561 TypeManager.MethodFlags for this method.
21562 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
21564 (Method.Define): Get and apply the Obsolete and Conditional attributes;
21565 if we're overriding a virtual function, set the new private variable
21566 `parent_method'; call the new TypeManager.AddMethod().
21568 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
21569 the MethodBuilder and the Method in a PtrHashtable.
21570 (TypeManager.builder_to_method): Added for this purpose.
21571 (TypeManager.MethodFlags): Added IsObsoleteError.
21572 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
21573 Obsolete and Conditional arguments in MethodBuilders. If we discover
21574 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
21575 the message from the attribute.
21577 2002-07-24 Martin Baulig <martin@gnome.org>
21579 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
21580 preprocessor directives, ensure that the argument to #define/#undef is
21581 exactly one identifier and that it's actually an identifier.
21583 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
21586 2002-07-24 Martin Baulig <martin@gnome.org>
21588 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
21589 initialize it to TypeManager.object_type in the constructor.
21590 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
21591 of the `hm.get_current' method if we're using the collection pattern.
21592 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
21593 for the explicit conversion to make it work when we're using the collection
21594 pattern and the `Current' property has a different return type than `object'.
21597 2002-07-24 Martin Baulig <martin@gnome.org>
21599 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
21600 does not match, but don't report any errors. This method is called in
21601 order for all methods in a MethodGroupExpr until a matching method is
21602 found, so we don't want to bail out if the first method doesn't match.
21603 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
21604 matches, report the 123. Fixes #28070.
21606 2002-07-24 Martin Baulig <martin@gnome.org>
21608 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
21609 TypeManager.TypeToCoreType() to the top of the method so the
21610 following equality checks will work. Fixes #28107.
21612 2002-07-24 Martin Baulig <martin@gnome.org>
21614 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
21615 operand is of type uint, and the other operand is of type sbyte,
21616 short or int, the operands are converted to type long." -
21617 Actually do what this comment already told us. Fixes bug #28106,
21620 2002-07-24 Martin Baulig <martin@gnome.org>
21622 * class.cs (MethodBase): New abstract class. This is now a base
21623 class for Property, Indexer and Event to avoid some code duplication
21624 in their Define() and DefineMethods() methods.
21625 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
21626 generic methods for Define() and DefineMethods().
21627 (FieldBase): Derive from MemberBase, not MemberCore.
21628 (Property): Derive from MemberBase, not MemberCore.
21629 (Property.DefineMethod): Moved all the code from this method to the
21630 new MethodBase.DefineAccessor(), just call it with appropriate
21632 (Property.Define): Call the new Property.DoDefine(), this does some
21633 sanity checks and we don't need to duplicate the code everywhere.
21634 (Event): Derive from MemberBase, not MemberCore.
21635 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
21636 accessors, this will also make them work with interface events.
21637 (Indexer): Derive from MemberBase, not MemberCore.
21638 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
21639 (Indexer.Define): Use the new MethodBase functions.
21641 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
21642 argument to the constructor.
21643 (Interface.FindMembers): Added support for interface events.
21644 (Interface.PopluateEvent): Implemented.
21646 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
21648 2002-07-22 Miguel de Icaza <miguel@ximian.com>
21650 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
21651 but this is required to check for a method name being the same as
21652 the containing class.
21656 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21658 * interface.cs: initialize variable.
21660 2002-07-23 Martin Baulig <martin@gnome.org>
21662 Implemented the IndexerName attribute in interfaces.
21664 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
21665 name if this is an explicit interface implementation.
21666 (Indexer.InterfaceIndexerName): New public variable. If we're
21667 implementing an interface indexer, this is the IndexerName in that
21668 interface. Otherwise, it's the IndexerName.
21669 (Indexer.DefineMethod): If we're implementing interface indexer,
21670 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
21671 and Pending.ImplementIndexer methods.
21672 (Indexer.Define): Also define the PropertyBuilder if we're
21673 implementing an interface indexer and this is neither an explicit
21674 interface implementation nor do the IndexerName match the one in
21677 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
21678 If a method is defined here, then we always need to create a proxy
21679 for it. This is used when implementing interface indexers.
21680 (Pending.IsInterfaceIndexer): New public method.
21681 (Pending.ImplementIndexer): New public method.
21682 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
21683 This is used when implementing interface indexers to define a proxy
21685 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
21686 define a proxy if necessary.
21688 * interface.cs (Interface.IndexerName): New public variable.
21689 (Interface.PopulateIndexer): Set the IndexerName.
21690 (Interface.DefineIndexers): New private method. Populate all the
21691 indexers and make sure their IndexerNames match.
21693 * typemanager.cs (IndexerPropertyName): Added support for interface
21696 2002-07-22 Martin Baulig <martin@gnome.org>
21698 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
21699 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
21700 ret if HasReturnLabel.
21701 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
21704 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
21705 and set the ec.LoopBeginTryCatchLevel.
21706 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
21707 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
21708 the current ec.TryCatchLevel, the branch goes out of an exception
21709 block. In this case, we need to use Leave and not Br.
21711 2002-07-22 Martin Baulig <martin@gnome.org>
21713 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
21714 block unless the block does not always return or it is contained in
21715 another try { ... } catch { ... } block. Fixes bug #26506.
21716 Added verify-1.cs to the test suite.
21718 2002-07-22 Martin Baulig <martin@gnome.org>
21720 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
21721 then we do not always return. Fixes bug #24985.
21723 2002-07-22 Martin Baulig <martin@gnome.org>
21725 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
21726 lookup on a per-class level; ie. walk up the class hierarchy until we
21727 found at least one applicable method, then choose the best among them.
21728 Fixes bug #24463 and test-29.cs.
21730 2002-07-22 Martin Baulig <martin@gnome.org>
21732 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
21733 return types of the methods. The return type is not part of the
21734 signature and we must not check it to make the `new' modifier work.
21735 Fixes bug #27999, also added test-147.cs.
21736 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
21738 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
21739 on the method's return type.
21741 2002-07-21 Martin Baulig <martin@gnome.org>
21743 * assign.cs: Make this work if the rightmost source is a constant and
21744 we need to do an implicit type conversion. Also adding a few more tests
21745 to test-38.cs which should have caught this.
21747 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
21748 target in the makefile for this. The makefile.gnu is primarily intended
21749 for end-users who don't want to debug the compiler.
21751 2002-07-21 Martin Baulig <martin@gnome.org>
21753 * assign.cs: Improved the Assign class so it can now handle embedded
21754 assignments (X = Y = Z = something). As a side-effect this'll now also
21755 consume less local variables. test-38.cs now passes with MCS, added
21756 a few new test cases to that test.
21758 2002-07-20 Martin Baulig <martin@gnome.org>
21760 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
21761 instructions. Fixes bug #27977, also added test-146.cs.
21763 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21765 * cs-tokenizer.cs: fixed getHex ().
21767 2002-07-19 Martin Baulig <martin@gnome.org>
21769 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
21770 not Type.GetType() to lookup the array type. This is needed when
21771 we're constructing an array of a user-defined type.
21772 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
21773 single-dimensional arrays, but also for single-dimensial arrays of
21776 2002-07-19 Martin Baulig <martin@gnome.org>
21778 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
21779 this function is called, it's not allowed to share LocalBuilders
21780 among ILGenerators.
21782 2002-07-19 Martin Baulig <martin@gnome.org>
21784 * expression.cs (Argument.Resolve): Report an error 118 when trying
21785 to pass a type as argument.
21787 2002-07-18 Martin Baulig <martin@gnome.org>
21789 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
21790 Conv_R_Un for the signed `long' type.
21792 2002-07-15 Miguel de Icaza <miguel@ximian.com>
21794 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
21795 `expr' for the temporary result, as that will fail if we do
21796 multiple resolves on the same expression.
21798 2002-07-05 Miguel de Icaza <miguel@ximian.com>
21800 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
21801 ec.TypeContainer for looking up aliases.
21803 * class.cs (TypeContainer): Remove LookupAlias from here.
21805 * decl.cs (DeclSpace); Move here.
21807 2002-07-01 Miguel de Icaza <miguel@ximian.com>
21809 * class.cs (FindMembers): Only call filter if the constructor
21810 bulider is not null.
21812 Also handle delegates in `NestedTypes' now. Now we will perform
21813 type lookups using the standard resolution process. This also
21816 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
21817 This uses Expressions (the limited kind that can be parsed by the
21818 tree) instead of strings.
21820 * expression.cs (ComposedCast.ToString): Implement, used to flag
21821 errors since now we have to render expressions.
21823 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
21826 * ecore.cs (SimpleName.ToString): ditto.
21828 * cs-parser.jay: Instead of using strings to assemble types, use
21829 Expressions to assemble the type (using SimpleName, ComposedCast,
21830 MemberAccess). This should fix the type lookups in declarations,
21831 because we were using a different code path for this.
21833 * statement.cs (Block.Resolve): Continue processing statements
21834 even when there is an error.
21836 2002-07-17 Miguel de Icaza <miguel@ximian.com>
21838 * class.cs (Event.Define): Also remove the `remove' method from
21839 the list of pending items.
21841 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
21842 generate more compact code.
21844 2002-07-17 Martin Baulig <martin@gnome.org>
21846 * const.cs (Const.LookupConstantValue): Add support for constant
21847 `unchecked' and `checked' expressions.
21848 Also adding test case test-140.cs for this.
21850 2002-07-17 Martin Baulig <martin@gnome.org>
21852 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
21853 check whether mi.ReturnType implements the IEnumerator interface; the
21854 `==' and the IsAssignableFrom() will fail in this situation.
21856 2002-07-16 Ravi Pratap <ravi@ximian.com>
21858 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
21861 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21863 * expression.cs: fixed bug #27811.
21865 2002-07-14 Miguel de Icaza <miguel@ximian.com>
21867 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
21868 Molaro: when we are a ref, the value already contains a pointer
21869 value, do not take the address of it.
21871 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
21872 * removed mb-parser.jay and mb-tokenizer.cs
21874 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
21876 * expression.cs: check against the building corlib void type.
21878 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
21880 * ecore.cs: fix for valuetype static readonly fields: when
21881 initializing them, we need their address, not the address of a copy.
21883 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
21885 * typemanager.cs: register also enum_type in corlib.
21887 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
21889 * class.cs: allow calling this (but not base) initializers in structs.
21891 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
21893 * ecore.cs: make sure we compare against the building base types
21896 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
21898 * typemanager.cs: fix TypeToCoreType() to handle void and object
21899 (corlib gets no more typerefs after this change).
21901 2002-07-12 Miguel de Icaza <miguel@ximian.com>
21903 * expression.cs (ArrayCreation.EmitArrayArguments): use
21904 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
21906 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
21907 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
21908 array indexes, the runtime actually forbids them.
21910 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
21911 for array arguments here.
21913 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
21914 instead of the default for ValueTypes.
21916 (New.DoEmit): Use IsValueType instead of
21917 IsSubclassOf (value_type)
21918 (New.DoResolve): ditto.
21919 (Invocation.EmitCall): ditto.
21921 * assign.cs (Assign): ditto.
21923 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
21924 Statements *are* currently doing part of their resolution during
21927 Expressions do always resolve during resolve, but statements are
21928 only required to propagate resolution to their children.
21930 2002-07-11 Miguel de Icaza <miguel@ximian.com>
21932 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
21934 (LoadAssembly): Do not add the dll if it is already specified
21936 (MainDriver): Add the System directory to the link path at the end,
21937 after all the other -L arguments.
21939 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
21940 wrong opcode for loading bytes and bools (ldelem.i1 instead of
21941 ldelem.u1) and using the opposite for sbytes.
21943 This fixes Digger, and we can finally run it.
21945 * driver.cs (UnixParseOption): Move the option parsing here.
21946 (CSCParseOption): Implement CSC-like parsing of options.
21948 We now support both modes of operation, the old Unix way, and the
21949 new CSC-like way. This should help those who wanted to make cross
21950 platform makefiles.
21952 The only thing broken is that /r:, /reference: and /lib: are not
21953 implemented, because I want to make those have the same semantics
21954 as the CSC compiler has, and kill once and for all the confussion
21955 around this. Will be doing this tomorrow.
21957 * statement.cs (Unsafe.Resolve): The state is checked during
21958 resolve, not emit, so we have to set the flags for IsUnsfe here.
21960 2002-07-10 Miguel de Icaza <miguel@ximian.com>
21962 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
21963 not catch the Error_ObjectRefRequired in SimpleName (as it is
21964 possible to have a class/instance variable name that later gets
21965 deambiguated), we have to check this here.
21967 2002-07-10 Ravi Pratap <ravi@ximian.com>
21969 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
21970 make static and put into Expression.
21972 (Event.Define): Register the private field of the event with the
21973 TypeManager so that GetFieldFromEvent can get at it.
21975 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
21976 keep track of the private field associated with an event which
21979 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
21982 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
21984 2002-07-10 Miguel de Icaza <miguel@ximian.com>
21986 * expression.cs (Binary.EmitBranchable): this routine emits the
21987 Binary expression in a branchable context. This basically means:
21988 we need to branch somewhere, not just get the value on the stack.
21990 This works together with Statement.EmitBoolExpression.
21992 * statement.cs (Statement.EmitBoolExpression): Use
21995 2002-07-09 Miguel de Icaza <miguel@ximian.com>
21997 * statement.cs (For): Reduce the number of jumps in loops.
21999 (For): Implement loop inversion for the For statement.
22001 (Break): We can be breaking out of a Try/Catch controlled section
22002 (foreach might have an implicit try/catch clause), so we need to
22003 use Leave instead of Br.
22005 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
22006 now). If the instace expression supports IMemoryLocation, we use
22007 the AddressOf method from the IMemoryLocation to extract the
22008 address instead of emitting the instance.
22010 This showed up with `This', as we were emitting the instance
22011 always (Emit) instead of the Address of This. Particularly
22012 interesting when This is a value type, as we dont want the Emit
22013 effect (which was to load the object).
22015 2002-07-08 Miguel de Icaza <miguel@ximian.com>
22017 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
22019 * statement.cs (Checked): Set the CheckedState during the resolve
22020 process too, as the ConvCast operations track the checked state on
22021 the resolve process, and not emit.
22023 * cs-parser.jay (namespace_member_declaration): Flag that we have
22024 found a declaration when we do. This is used to flag error 1529
22026 * driver.cs: Report ok when we display the help only.
22028 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
22030 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
22032 2002-07-04 Miguel de Icaza <miguel@ximian.com>
22034 * cs-tokenizer.cs (define): We also have to track locally the
22035 defines. AllDefines is just used for the Conditional Attribute,
22036 but we also need the local defines for the current source code.
22038 2002-07-03 Miguel de Icaza <miguel@ximian.com>
22040 * statement.cs (While, For, Do): These loops can exit through a
22041 Break statement, use this information to tell whether the
22042 statement is the last piece of code.
22044 (Break): Flag that we break.
22046 * codegen.cs (EmitContexts): New `Breaks' state variable.
22048 2002-07-03 Martin Baulig <martin@gnome.org>
22050 * class.cs (TypeContainer.MethodModifiersValid): Allow override
22051 modifiers in method declarations in structs. Otherwise, you won't
22052 be able to override things like Object.Equals().
22054 2002-07-02 Miguel de Icaza <miguel@ximian.com>
22056 * class.cs (Method, Property, Indexer): Do not allow the public
22057 modifier to be used in explicit interface implementations.
22059 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
22060 override modifiers in method declarations in structs
22062 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
22064 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
22065 integer or real overflow, report an error
22067 2002-07-02 Martin Baulig <martin@gnome.org>
22069 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
22070 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
22071 to tell the runtime about our newly created System.Object and
22072 System.ValueType types.
22074 2002-07-02 Miguel de Icaza <miguel@ximian.com>
22076 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
22077 struct instead of Ldarg/Starg.
22079 2002-07-02 Martin Baulig <martin@gnome.org>
22081 * expression.cs (Indirection.Indirection): Call
22082 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
22084 2002-07-02 Martin Baulig <martin@gnome.org>
22086 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
22087 ValueType, call TypeManager.TypeToCoreType() on it.
22088 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
22089 the OpCodes.Newarr argument.
22091 2002-07-02 Martin Baulig <martin@gnome.org>
22093 * expression.cs (Invocation.EmitCall): When compiling corlib,
22094 replace all calls to the system's System.Array type to calls to
22095 the newly created one.
22097 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
22098 System.Array methods.
22099 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
22100 from the system's System.Array type which must be replaced.
22102 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
22104 * typemanager.cs: load unverifiable_code_ctor so we can build
22105 corlib using the correct type. Avoid using GetTypeCode() with
22107 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
22108 TypeManager.object_type to allow building corlib.
22110 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
22112 * ecore.cs: handle System.Enum separately in LoadFromPtr().
22114 2002-07-01 Martin Baulig <martin@gnome.org>
22116 * class.cs: Make the last change actually work, we need to check
22117 whether `ifaces != null' to avoid a crash.
22119 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
22121 * class.cs: when we build structs without fields that implement
22122 interfaces, we need to add the interfaces separately, since there is
22123 no API to both set the size and add the interfaces at type creation
22126 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
22128 * expression.cs: the dimension arguments to the array constructors
22129 need to be converted if they are a long.
22131 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
22133 * class.cs: don't emit ldarg.0 if there is no parent constructor
22134 (fixes showstopper for corlib).
22136 2002-06-29 Martin Baulig <martin@gnome.org>
22138 MCS now compiles corlib on GNU/Linux :-)
22140 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
22141 ie. check for MethodImplOptions.InternalCall.
22143 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
22144 and TypeManager.attribute_type are null, so we must explicitly check
22145 whether parent is not null to find out whether it's an attribute type.
22146 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
22147 and SetBuilder, not only if the property is neither abstract nor external.
22148 This is necessary to set the MethodImplOptions on the accessor methods.
22149 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
22150 SetBuilder, see Property.Emit().
22152 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
22153 populate "System.Object", "System.ValueType" and "System.Attribute" since
22154 they've already been populated from BootCorlib_PopulateCoreTypes().
22156 2002-06-29 Martin Baulig <martin@gnome.org>
22158 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
22159 is the NullLiteral, we also need to make sure that target_type is not
22162 2002-06-29 Martin Baulig <martin@gnome.org>
22164 * rootcontext.cs (RootContext.ResolveCore): We must initialize
22165 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
22166 before calling BootstrapCorlib_ResolveDelegate ().
22168 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22170 * statement.cs: fixed build-breaker. All tests passed ok.
22172 2002-06-27 Martin Baulig <martin@gnome.org>
22174 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
22175 for System.Decimal when compiling corlib.
22177 2002-06-27 Martin Baulig <martin@gnome.org>
22179 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
22180 switch blocks which contain nothing but a default clause.
22182 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
22184 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
22186 2002-06-27 Martin Baulig <martin@gnome.org>
22188 * ecore.cs (PropertyExpr.PropertyExpr): Call
22189 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
22191 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
22192 is already a TypeBuilder.
22194 2002-06-27 Martin Baulig <martin@gnome.org>
22196 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
22197 `target_type == TypeManager.array_type', not IsAssignableFrom() in
22198 the "from an array-type to System.Array" case. This makes it work
22199 when compiling corlib.
22201 2002-06-27 Martin Baulig <martin@gnome.org>
22203 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
22204 non-static PropertyExpr, set its InstanceExpression. This makes
22205 the `ICollection.Count' property work in System/Array.cs.
22207 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
22209 * driver.cs: Made error handling more consistent. Errors now
22210 tracked by Report class, so many methods which used to return int
22211 now return void. Main() now prints success/failure and
22212 errors/warnings message.
22214 Renamed '--probe' compiler argument to '--expect-error'. Removed
22215 the magic number return values (123 and 124). Now, if the
22216 expected error occurs, the compiler exits with success (exit value
22217 0). If the compilation completes without seeing that particular
22218 error, the compiler exits with failure (exit value 1). The
22219 makefile in mcs/errors has been changed to handle the new behaviour.
22221 * report.cs: Made 'expected error' number a property and renamed
22222 it from 'Probe' to 'ExpectedError'.
22224 * genericparser.cs: Removed error handling support, since it is
22225 now all done by Report class.
22227 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
22228 class, so parse() no longer returns an int.
22230 * namespace.cs: Use Report.Error instead of GenericParser.error
22232 2002-06-22 Miguel de Icaza <miguel@ximian.com>
22234 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
22235 TypeContainer.AddOperator): At the front of the list put the
22236 explicit implementations, so they get resolved/defined first.
22238 2002-06-21 Miguel de Icaza <miguel@ximian.com>
22240 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
22241 interface type is implemented by this TypeContainer. Used during
22242 explicit interface implementation.
22244 (Property.Define, Indexer.Define, Method.Define): Validate that
22245 the given interface in the explicit implementation is one of the
22246 base classes for the containing type.
22248 Also if we are explicitly implementing an interface, but there is
22249 no match in the pending implementation table, report an error.
22251 (Property.Define): Only define the property if we are
22252 not explicitly implementing a property from an interface. Use the
22253 correct name also for those properties (the same CSC uses,
22254 although that is really not needed).
22256 (Property.Emit): Do not emit attributes for explicitly implemented
22257 properties, as there is no TypeBuilder.
22259 (Indexer.Emit): ditto.
22261 Hiding then means that we do not really *implement* a pending
22262 implementation, which makes code fail.
22264 2002-06-22 Martin Baulig <martin@gnome.org>
22266 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
22267 the return value of Object.GetType(). [FIXME: we need to do this whenever
22268 we get a type back from the reflection library].
22270 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
22272 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
22274 2002-06-20 Miguel de Icaza <miguel@ximian.com>
22276 * attribute.cs: Return null if we can not look up the type.
22278 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
22279 the interface types found.
22281 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
22282 interface types found.
22284 * typemanager.cs (GetInterfaces): Make this routine returns alll
22285 the interfaces and work around the lame differences between
22286 System.Type and System.Reflection.Emit.TypeBuilder in the results
22287 result for GetInterfaces.
22289 (ExpandInterfaces): Given an array of interface types, expand and
22290 eliminate repeated ocurrences of an interface. This expands in
22291 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
22294 2002-06-21 Martin Baulig <martin@gnome.org>
22296 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
22299 2002-06-21 Martin Baulig <martin@gnome.org>
22301 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
22302 and called with one of the core types, return the corresponding typebuilder for
22305 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
22308 2002-06-21 Martin Baulig <martin@gnome.org>
22310 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
22311 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
22312 (Expression.ConvertReferenceExplicit): Likewise.
22314 * expression.cs (ElementAccess.DoResolve): Likewise.
22315 (ElementAccess.DoResolveLValue): Likewise.
22317 2002-06-10 Martin Baulig <martin@gnome.org>
22319 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
22320 add the "value" parameter to the parameter list.
22322 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
22325 2002-06-19 Miguel de Icaza <miguel@ximian.com>
22327 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
22328 the argument to an int, uint, long or ulong, per the spec. Also
22329 catch negative constants in array creation.
22331 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
22333 * class.cs: do not allow the same interface to appear twice in
22334 the definition list.
22336 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
22338 * ecore.cs: don't use ldlen with System.Array.
22340 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
22342 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
22344 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
22346 * modifiers.cs: produce correct field attributes for protected
22347 internal. Easy fix so miguel can work on ther harder stuff:-)
22349 2002-06-18 Miguel de Icaza <miguel@ximian.com>
22351 * pending.cs: New file. Move the code from class.cs here.
22352 Support clearning the pending flag for all methods (when not doing
22353 explicit interface implementation).
22355 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
22357 * rootcontext.cs: added a couple more types needed to bootstrap.
22359 2002-06-17 Miguel de Icaza <miguel@ximian.com>
22361 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
22362 constructor in the type, instead of any constructor in the type
22363 hierarchy. Thanks to Paolo for finding this bug (it showed up as
22364 a bug in the Mono runtime when applying the params attribute).
22366 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
22367 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
22369 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
22371 * expression.cs (Unary.ResolveOperator): Use TypeManager
22372 to resolve the type.
22374 2002-06-13 Ravi Pratap <ravi@ximian.com>
22376 * cs-parser.jay (enum_member_declaration): Pass in the attributes
22379 * enum.cs (AddEnumMember): Add support to store the attributes associated
22380 with each member too.
22382 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
22383 field builders too - this takes care of the enum member case.
22385 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
22387 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
22388 address-of operator on both value types and pointers.
22390 2002-06-10 Martin Baulig <martin@gnome.org>
22392 * interface.cs (Interface.PopulateIndexer): Add the indexer's
22393 PropertyBuilder to the `property_builders' list.
22395 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
22396 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
22397 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
22398 find any indexers which are inherited from an interface.
22400 2002-06-09 Martin Baulig <martin@gnome.org>
22402 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
22403 the same type as the constant if necessary. There's also a test-130.cs
22406 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
22408 * typemanager.cs (TypeManager.ChangeType): Previously known as
22409 Enum.ChangeEnumType().
22411 2002-06-09 Martin Baulig <martin@gnome.org>
22413 * expression.cs (Cast.TryReduce): Added support for consts.
22415 2002-06-08 Ravi Pratap <ravi@ximian.com>
22417 * class.cs (Accessor): Hold attributes information so we can pass
22420 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
22421 Modify to pass in attributes attached to the methods.
22423 (add_accessor_declaration, remove_accessor_declaration): Ditto.
22425 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
22426 to handle the Accessor kind :-)
22428 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
22430 2002-06-08 Martin Baulig <martin@gnome.org>
22432 * expression.cs (Unary.TryReduceNegative): Added support for
22435 2002-06-08 Martin Baulig <martin@gnome.org>
22437 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
22438 name can't be found in the `defined_names' - the caller will do a
22439 MemberLookup in this case and thus find methods in System.Enum
22440 such as Enum.IsDefined().
22442 2002-06-08 Martin Baulig <martin@gnome.org>
22444 * enum.cs (Enum.ChangeEnumType): This is a custom version of
22445 Convert.ChangeType() which works with TypeBuilder created types.
22446 (Enum.LookupEnumValue, Enum.Define): Use it here.
22448 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
22449 `TypeBuilder.BaseType != null' check.
22450 (TypeContainer.FindMembers): Only lookup parent members if we
22451 actually have a parent.
22452 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
22453 (ConstructorInitializer.Resolve): Likewise.
22455 * interface.cs (Interface.FindMembers): Added
22456 `TypeBuilder.BaseType != null' check.
22458 * rootcontext.cs (RootContext.ResolveCore): Added
22459 "System.Runtime.CompilerServices.IndexerNameAttribute" to
22460 classes_second_stage.
22462 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
22463 debug_type and trace_type when compiling with --nostdlib.
22465 2002-06-07 Martin Baulig <martin@gnome.org>
22467 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
22468 (AddField): Set it to true when adding a non-static field.
22469 (DefineType): Use `have_nonstatic_fields' to find out whether we
22470 have non-static fields, not `Fields != null'.
22472 2002-06-02 Miguel de Icaza <miguel@ximian.com>
22474 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
22475 dereferencing a null on the static-field code path)
22477 2002-05-30 Martin Baulig <martin@gnome.org>
22479 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
22480 to take command line arguments. Use reflection to call the new
22481 custom `Initialize' function on the symbol writer and pass it the
22482 command line arguments.
22484 * driver.cs (--debug-args): New command line argument to pass command
22485 line arguments to the symbol writer.
22487 2002-05-28 Miguel de Icaza <miguel@ximian.com>
22489 * assign.cs (DoResolve): Forgot to do the implicit conversion to
22490 the target type for indexers and properties. Thanks to Joe for
22493 2002-05-27 Miguel de Icaza <miguel@ximian.com>
22495 * typemanager.cs (MethodFlags): returns the method flags
22496 (Obsolete/ShouldIgnore) that control warning emission and whether
22497 the invocation should be made, or ignored.
22499 * expression.cs (Invocation.Emit): Remove previous hack, we should
22500 not do this on matching a base type, we should do this based on an attribute
22502 Only emit calls to System.Diagnostics.Debug and
22503 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
22504 on the command line.
22506 * rootcontext.cs: Global settings for tracing and debugging.
22508 * cs-tokenizer.cs (define): New utility function to track
22509 defines. Set the global settings for TRACE and DEBUG if found.
22511 2002-05-25 Ravi Pratap <ravi@ximian.com>
22513 * interface.cs (Populate*): Pass in the TypeContainer as well as
22514 the DeclSpace as parameters so that we can create EmitContexts and
22515 then use that to apply attributes etc.
22517 (PopulateMethod, PopulateEvent, PopulateProperty)
22518 (PopulateIndexer): Apply attributes everywhere.
22520 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
22523 (ApplyAttributes): Update accordingly.
22525 We now apply interface attributes for all members too.
22527 2002-05-26 Miguel de Icaza <miguel@ximian.com>
22529 * class.cs (Indexer.Define); Correctly check if we are explicit
22530 implementation (instead of checking the Name for a ".", we
22531 directly look up if the InterfaceType was specified).
22533 Delay the creation of the PropertyBuilder.
22535 Only create the PropertyBuilder if we are not an explicit
22536 interface implementation. This means that explicit interface
22537 implementation members do not participate in regular function
22538 lookups, and hence fixes another major ambiguity problem in
22539 overload resolution (that was the visible effect).
22541 (DefineMethod): Return whether we are doing an interface
22544 * typemanager.cs: Temporary hack until we get attributes in
22545 interfaces (Ravi is working on that) and we get IndexerName
22546 support in interfaces.
22548 * interface.cs: Register the indexers as properties.
22550 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
22551 warning, I have verified that this is a bug in the .NET runtime
22552 (JavaScript suffers of the same problem).
22554 * typemanager.cs (MemberLookup): When looking up members for
22555 interfaces, the parent of an interface is the implicit
22556 System.Object (so we succeed in searches of Object methods in an
22557 interface method invocation. Example: IEnumerable x; x.ToString
22560 2002-05-25 Miguel de Icaza <miguel@ximian.com>
22562 * class.cs (Event): Events should also register if they do
22563 implement the methods that an interface requires.
22565 * typemanager.cs (MemberLookup); use the new GetInterfaces
22568 (GetInterfaces): The code used to lookup interfaces for a type is
22569 used in more than one place, factor it here.
22571 * driver.cs: Track the errors at the bottom of the file, we kept
22574 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
22575 instance if the method we are calling is static!
22577 2002-05-24 Miguel de Icaza <miguel@ximian.com>
22579 * attribute.cs (ApplyAttributes): Make this function filter out
22580 the IndexerName attribute (as that attribute in reality is never
22581 applied) and return the string constant for the IndexerName
22584 * class.cs (TypeContainer.Emit): Validate that all the indexers
22585 have the same IndexerName attribute, and if so, set the
22586 DefaultName attribute on the class.
22588 * typemanager.cs: The return value might contain other stuff (not
22589 only methods). For instance, consider a method with an "Item"
22590 property and an Item method.
22592 * class.cs: If there is a problem with the parameter types,
22595 2002-05-24 Ravi Pratap <ravi@ximian.com>
22597 * ecore.cs (ImplicitConversionExists): Wrapper function which also
22598 looks at user defined conversion after making a call to
22599 StandardConversionExists - we need this for overload resolution.
22601 * expression.cs : Update accordingly the various method calls.
22603 This fixes 2 bugs filed against implicit user defined conversions
22605 2002-05-22 Miguel de Icaza <miguel@ximian.com>
22607 * statement.cs: Track the result of the assignment.
22609 2002-05-21 Miguel de Icaza <miguel@ximian.com>
22611 * expression.cs (MemberAccess): Improved error reporting for
22612 inaccessible members.
22614 2002-05-22 Martin Baulig <martin@gnome.org>
22616 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
22617 itself with debugging support.
22619 2002-05-22 Martin Baulig <martin@gnome.org>
22621 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
22622 Removed, this isn't needed anymore.
22624 2002-05-20 Martin Baulig <martin@gnome.org>
22626 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
22627 be underlying type for an enum.
22629 2002-05-20 Miguel de Icaza <miguel@ximian.com>
22631 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
22632 that splits out the loading of just the core types.
22634 * rootcontext.cs (ResolveCore): Split the struct resolution in
22635 two, so we can load the enumeration underlying types before any
22638 * expression.cs (Is): Bandaid until we fix properly Switch (see
22639 bug #24985 for details).
22641 * typemanager.cs (ImplementsInterface): The hashtable will contain
22642 a null if there are no interfaces implemented.
22644 2002-05-18 Miguel de Icaza <miguel@ximian.com>
22646 * cs-parser.jay (indexer_declarator): It is fine to have array
22649 2002-05-17 Miguel de Icaza <miguel@ximian.com>
22651 * typemanager.cs: (RegisterBuilder): New function used to register
22652 TypeBuilders that implement interfaces. Since
22653 TypeBuilder.GetInterfaces (as usual) does not work with lame
22655 (AddUserType): register interfaces.
22657 (ImplementsInterface): Use the builder_to_ifaces hash if we are
22658 dealing with TypeBuilder. Also, arrays are showing up as
22659 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
22660 methods can not be invoked on them!
22662 * ecore.cs (ExplicitReferenceConversionExists): Made public.
22663 (ImplicitReferenceConversionExists): Split out from
22664 StandardConversionExists.
22666 * expression.cs (As): We were only implementing one of the three
22667 cases for the as operator. We now implement them all.
22668 (Is): Implement the various other cases for Is as well.
22670 * typemanager.cs (CACHE): New define used to control if we want or
22671 not the FindMembers cache. Seems to have a negative impact on
22672 performance currently
22674 (MemberLookup): Nested types have full acess to
22675 enclosing type members
22677 Remove code that coped with instance/static returns for events, we
22678 now catch this in RealFindMembers.
22680 (RealFindMembers): only perform static lookup if the instance
22681 lookup did not return a type or an event.
22683 2002-05-17 Miguel de Icaza <miguel@ximian.com>
22685 * assign.cs (CompoundAssign): We pass more semantic information
22686 now to Compound Assignments than we did before: now we have all
22687 the information at hand, and now we resolve the target *before* we
22688 do the expression expansion, which allows the "CacheValue" method
22689 to have the effect we intended (before, a [x] += 1 would generate
22690 two differen ArrayAccess expressions from the ElementAccess,
22691 during the resolution process).
22693 (CompoundAssign.DoResolve): Resolve target and original_source here.
22695 2002-05-16 Miguel de Icaza <miguel@ximian.com>
22697 * expression.cs (ArrayAccess): dropped debugging information.
22699 * typemanager.cs: Small bug fix: I was always returning i_members,
22700 instead of one of i_members or s_members (depending on which had
22703 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
22704 method is invoked before any code generation takes place, and it
22705 is a mechanism to inform that the expression will be invoked more
22706 than once, and that the method should use temporary values to
22707 avoid having side effects
22709 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
22711 * ecore.cs (Expression.CacheTemporaries): Provide empty default
22714 * expression.cs (Indirection, ArrayAccess): Add support for
22715 CacheTemporaries in these two bad boys.
22717 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
22718 ldobj or ldind_ref.
22719 (StoreFromPtr): Handle stobj as well.
22721 * expression.cs (UnaryMutator): Share more code.
22723 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
22724 down: I was not tracking the Filter function as well, which
22725 was affecting the results of the cache.
22727 2002-05-15 Miguel de Icaza <miguel@ximian.com>
22729 * attribute.cs: Remove the hack to handle the CharSet property on
22732 2002-05-14 Miguel de Icaza <miguel@ximian.com>
22734 * attribute.cs (DoResolve): More uglyness, we now only try to
22735 resolve the attribute partially, to extract the CharSet
22736 information (only if we are a StructLayout attribute). Otherwise
22738 (GetExtraTypeInfo): Add some code to conditionally kill in the
22739 future this. I am more and more convinced that the .NET
22740 framework has special code to handle the attribute setting on
22743 * expression.cs (IsParamsMethodApplicable): Revert my previous
22744 foreach change here, it was wrong.
22746 2002-05-13 Miguel de Icaza <miguel@ximian.com>
22748 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
22749 (pp_expr): do not abort on unknown input, just return.
22750 (eval): abort if there are pending chars.
22752 * attribute.cs (Attribute.Resolve): Positional parameters are
22753 optional. Deal with that case.
22755 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
22756 the Ansi/Unicode/Auto information for the type.
22758 (TypeContainer.DefineType): instantiate the EmitContext here, as
22759 we will be using it during the type definition (to resolve
22760 attributes) and during the emit phase.
22762 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
22763 to pull type information out of the attributes
22765 (Attribute.Resolve): track the constructor builder, and allow for
22766 multiple invocations (structs and classes will use this).
22768 * ecore.cs (MemberLookupFinal): new version with all the
22769 parameters customizable.
22771 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
22772 constructors. Return if the result value is null (as the error
22773 would have been flagged already by MemberLookupFinal)
22775 Do not allow instances of abstract classes or interfaces to be
22778 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
22779 We have to compare the assembly property here when dealing with
22780 FamANDAssem and Assembly access modifiers, because we might be
22781 creating an assembly from *modules* (that means that we are not
22782 getting TypeBuilders for types defined in other modules that are
22783 part of this assembly).
22785 (Method.Emit): If the method is marked abstract and has a body,
22788 (TypeContainer.DefineMembers): If both the defined member and the
22789 parent name match are methods, then do not emit any warnings: let
22790 the Method.Define routine take care of flagging warnings. But if
22791 there is a mismatch (method overrides something else, or method is
22792 overriwritten by something, then emit warning).
22794 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
22795 set to null, this means `do not check for the return type on the
22798 (Method.Define): set the return type for the method signature to
22799 null, so that we get methods with the same name and parameters and
22800 different return types. This is used to flag warning 114 (you are
22801 hiding a method, and you probably want to use the new/override
22804 * typemanager.cs (MemberLookup): Implemented proper access
22805 control, closing a long standing set of bug reports. The problem
22806 was that the Framework only has two bits: Public and NonPublic,
22807 and NonPublic includes private and protected methods, but we need
22808 to enforce the FamANDAssem, FamOrAssem and Family.
22810 2002-05-11 Miguel de Icaza <miguel@ximian.com>
22812 * statement.cs (GotoCase): Return true: Ammounts to giving up
22813 knowledge on whether we return or not, and letting the other case
22814 be responsible for it.
22816 2002-05-10 Miguel de Icaza <miguel@ximian.com>
22818 * driver.cs: Do not load directories for each file processed, only
22819 do it if there is a pattern.
22821 * ecore.cs: Report readonly assigns here as well, as we might have
22822 been resolved only by MemberAccess.
22824 (SimpleName.SimpleNameResolve): Also be useful for LValue
22825 resolution. We need this to propagate assign to local readonly variables
22827 * typemanager.cs: Use a ptrhashtable for the criteria, because we
22828 do not want to reuse potential criteria memory.
22830 * class.cs (MyEventBuilder): Set reflected_type;
22832 * ecore.cs (Constantify): Added support for constifying bools.
22834 (RootContext.LookupType): Added a cache for values looked up in
22835 the declaration space.
22837 * typemanager.cs (FindMembers): Now is a front-end to
22838 RealFindMembers, and provides a two-level hashtable-based cache to
22841 15% performance improvement: from 22.5 to 19.2 seconds.
22843 * expression.cs (IsParamsMethodApplicable): use foreach.
22844 (Invocation.DoResolve): ditto.
22845 (New.DoResolve): ditto.
22846 (ArrayCreation.DoResolve): ditto.
22848 * ecore.cs (FindMostEncompassingType): use foreach.
22850 * delegate.cs (NewDelegate.DoResolve): Use foreach
22852 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
22853 (RemoveMethods): use foreach.
22855 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
22856 nested foreach statements instead of for, and also break out of
22857 the inner loop once a match is found.
22859 (Invocation.OverloadResolve): Use foreach, simplify the code.
22861 2002-05-08 Miguel de Icaza <miguel@ximian.com>
22863 * cfold.cs (BinaryFold): During an enumeration evaluation context,
22864 we actually unwrap the expression to allow for extra information
22867 * expression.cs: Use Shr_Un on unsigned operations.
22869 2002-05-08 Ravi Pratap <ravi@ximian.com>
22871 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
22872 applicable operators was not being considered correctly. This closes
22873 the bug Miguel reported.
22875 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
22877 * attribute.cs: check that the type derives from System.Attribute
22878 and report the correct error in that case (moved the duplicate code to
22879 its own method, too).
22881 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
22883 * attribute.cs: lookup attribute type name as the spec says: first the
22884 bare attribute name and then name + "Attribute" (nant compiles with
22885 mcs after this fix).
22887 2002-05-07 Miguel de Icaza <miguel@ximian.com>
22889 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
22890 Because of the way we parse things, we should try to see if a
22891 UIntConstant can fit in an integer.
22893 2002-05-07 Ravi Pratap <ravi@ximian.com>
22895 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
22896 when we are in an explicit context.
22898 (ConvertReferenceExplicit): When converting from Iface type S to Class
22899 T make sure the rules are implemented as an OR.
22901 * parameter.cs (ParameterType): Make it a property for now although the
22902 purpose really isn't anything immediate.
22904 * expression.cs (Is*Applicable): Do better checking on the parameter type
22905 of a ref/out parameter. The ones from the system assemblies are already
22906 marked with the correct type so we don't need to do any correction.
22908 * ecore.cs (StandardConversionExists): Conversion from Interface types to
22909 the object type is standard too so include that.
22911 2002-05-06 Miguel de Icaza <miguel@ximian.com>
22913 * ecore.cs (StandardConversionExists): Augment with missing code:
22914 deal with IntConstant, LongConstants and Enumerations.
22916 * assign.cs: Report the error, instead of failing silently
22918 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
22919 typecontainer that they are declared, because the
22920 typecontainer/namespace will have the list of using clauses that
22921 need to be applied.
22923 Assembly Attributes were escaping the normal registration
22926 (EmitCode): Apply attributes within an EmitContext that represents
22927 the container they were declared on.
22929 * cs-parser.jay: Track bases for structs. How did I get this wrong?
22931 2002-05-06 Ravi Pratap <ravi@ximian.com>
22933 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
22934 Revamp completely - make much cleaner as we now operate only
22937 (FindMostSpecificSource, FindMostSpecificTarget): New methods
22938 to implement the logic detailed in the spec more correctly.
22940 (UserDefinedConversion): Update accordingly.
22942 2002-05-06 Miguel de Icaza <miguel@ximian.com>
22944 * statement.cs: Return flow analysis information up.
22946 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
22949 (token): Do not consume an extra character before calling
22952 2002-05-06 Piers Haken <piersh@friskit.com>
22954 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
22956 2002-05-06 Miguel de Icaza <miguel@ximian.com>
22958 * class.cs (Constructor.Emit): Set the IsStatic flag in the
22959 EmitContext during the instance constructor initializer
22960 resolution, to stop access to instance variables.
22962 This is mandated by the spec, last paragraph of the `constructor
22963 initializers' section.
22965 2002-05-05 Miguel de Icaza <miguel@ximian.com>
22967 * cs-parser.jay, class.cs (Accessor): new class used to represent
22968 an accessor (get or set). In the past we used `null' to represent
22969 a missing accessor. But this is ambiguous because there was no
22970 way to tell in abstract indexers/properties if one of them was
22973 Now there is a way of addressing that.
22975 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
22976 instead of FindMembers.
22978 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
22979 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
22981 * attribute.cs: Treat indexers and properties as the same in terms
22982 of applying attributes
22984 * ecore.cs (FindMostEncompassedType): Use statically initialized
22985 EmptyExpressions()s like we do elsewhere to avoid creating useless
22986 objects (and we take this out of the tight loop).
22988 (GetConversionOperators): Move the code to extract the actual
22989 operators to a separate routine to clean things up.
22991 2002-05-04 Miguel de Icaza <miguel@ximian.com>
22993 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
22994 events are always registered FieldBuilders.
22996 * class.cs (FieldBase): New class shared by Fields
22998 * delegate.cs: If we are a toplevel delegate, use our full name.
22999 If we are a nested delegate, then only use our tail name.
23001 2002-05-02 Ravi Pratap <ravi@ximian.com>
23003 * expression.cs (IsApplicable): Ensure that we add the "&" to
23004 ref/out types before comparing it with the type of the argument.
23006 (IsParamsMethodApplicable): Ditto.
23008 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
23011 * delegate.cs : Handle the case when we have more than one applicable
23012 method. Flag an error only when we finish checking all.
23014 2002-05-02 Miguel de Icaza <miguel@ximian.com>
23016 * expression.cs: Add support for boolean static initializers.
23018 2002-05-01 Miguel de Icaza <miguel@ximian.com>
23020 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
23022 * parameter.cs (ComputeParameterTypes,
23023 ComputeAndDefineParameterTypes): Better error handling: now we
23024 clear the `types' cache if we fail during any of the type lookups.
23025 We also return the status code correctly to our caller
23027 * delegate.cs: If we fail to define a delegate, abort the extra
23030 * expression.cs (Binary.ResolveOperator): for
23031 operator==(object,object) and operator !=(object, object) we also
23032 have to verify that there is an implicit conversion from one to
23035 (ArrayAccess.DoResolve): Array Access can operate on
23038 2002-04-30 Miguel de Icaza <miguel@ximian.com>
23040 * assign.cs (CompoundAssign): A new class used as a "flag" that
23041 the assignment actually is happening as part of a compound
23042 assignment operator.
23044 During compound assignment, a few new rules exist to enable things
23051 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
23052 to the type of x) if y is implicitly convertible to the type of x,
23053 and the operator is a builtin operator and the return type of the
23054 operator is explicitly convertible to the type of x.
23056 * rootcontext.cs: Reset warning level to 2. 4 catches various
23057 "interesting" features in mcs, we must clean this up at some
23058 point, but currently am trying to kill other bugs ;-)
23060 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
23061 in container classes as well.
23063 * expression.cs (Binary.ResolveOperator): Handle string case
23064 before anything else (as operator overloading does emit an error
23065 before doing anything else).
23067 This code could go away when we move to a table driven model, but
23068 i could not come up with a good plan last night.
23070 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
23072 * typemanager.cs (CSharpName): reimplementation using regex.
23073 * class.cs: added null check for fields in Emit
23074 * rootcontext.cs: set warninglevel to 4
23076 2002-04-29 Miguel de Icaza <miguel@ximian.com>
23078 * typemanager.cs (CSharpName): reimplemented with Lupus
23081 2002-04-28 Miguel de Icaza <miguel@ximian.com>
23083 * statement.cs (If): correclty implement Resolve, because we were
23084 not catching sem errors in there. The same process is needed
23086 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
23089 (Statement.Warning_DeadCodeFound): Factorize code.
23090 (While): Report dead code here too.
23092 (Statement): Added Resolve virtual method to allow
23093 for resolution split from the emit code.
23095 2002-04-26 Miguel de Icaza <miguel@ximian.com>
23097 * statement.cs (EmitBoolExpression): No longer try to resolve the
23099 (MakeBoolean): New utility function that resolve, implicitly
23100 converts to boolean and tags the expression.
23103 (If, Do): Implement dead code elimination.
23104 (While): Implement loop inversion
23106 (Do, While, For, If): Resolve the expression prior to calling our
23109 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
23112 - added method Report28 (warning: program has more than one entry point)
23113 - added method IsEntryPoint, implements paragraph 10.1 of the spec
23114 - modified method Method.Define, the part at the end of the method
23116 * rootcontext.cs: added static public Location EntryPointLocation;
23118 * ../errors/cs0028.cs : Add test case for the above warning.
23121 - modified method CSharpName to allow arrays of primitive type to
23122 be printed nicely (e.g. instead of System.Int32[][] it now prints
23124 - added method CSharpSignature: returns the signature of a method
23125 in string format to be used in reporting errors, warnings, etc.
23127 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
23130 2002-04-26 Ravi Pratap <ravi@ximian.com>
23132 * delegate.cs (Define): Fix extremely silly bug where I was
23133 setting the type of the 'object' parameter of the BeginInvoke
23134 method to System.IAsyncResult instead of System.Object ;-)
23136 2002-04-26 Miguel de Icaza <miguel@ximian.com>
23138 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
23141 (Constructor.Emit): return if we fail to initialize the
23142 constructor. Another door closed!
23144 * expression.cs (New.DoResolve): Improve error message (from -6 to
23145 1501). Use DeclaredOnly lookup to find the exact constructor.
23147 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
23148 loop. This is useful.
23150 * cs-parser.jay: Adjust the default parameters so that destructors
23151 have the proper signature.
23153 2002-04-26 Martin Baulig <martin@gnome.org>
23155 * driver.cs (LoadAssembly): If `assembly' contains any characters
23156 which are only valid in path names and not in assembly names
23157 (currently slash, backslash and point), use Assembly.LoadFrom ()
23158 instead of Assembly.Load () on the `assembly' (before iteration
23159 over the link_paths).
23161 2002-04-26 Martin Baulig <martin@gnome.org>
23163 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
23165 2002-04-25 Miguel de Icaza <miguel@ximian.com>
23167 * class.cs (Property): use the new typemanager.MemberLookup
23169 (TypeContainer.MemberLookup): Implement using the
23170 TypeManager.MemberLookup now.
23172 * typemanager.cs: Make MemberLookup a function of the TypeManager,
23173 and return MemberInfos, so that these can be used without an
23174 EmitContext (what we had before).
23176 2002-04-24 Miguel de Icaza <miguel@ximian.com>
23178 * expression.cs: Fix the case where the argument to params if the
23179 type of the params. I omitted handling this before. Fixed
23181 2002-04-22 Miguel de Icaza <miguel@ximian.com>
23183 * driver.cs: Call BootCorlib_PopulateCoreType
23185 * class.cs (Property.CheckBase): Check for properties only, not
23188 * interface.cs: Temporary hack: try/catch around the
23189 CustomAttributeBuilder, because I am getting an exception that I
23192 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
23193 types whose definitions are required to be there (attributes are
23194 defined before standard types).
23196 Compute definitions as we boot the various types, as they are used
23197 immediately (value_type class will need object_type, but if we do
23198 not initialize object_type, we will pass a null, which will let
23199 the runtime pick the System.Object from the existing corlib, which
23200 is not what we want).
23202 2002-04-22 Patrik Torstensson <totte@labs2.com>
23204 * cs-tokenizer.cs: fixed a number of trim() issues.
23206 2002-04-22 Ravi Pratap <ravi@ximian.com>
23208 * expression.cs (Argument.Type): Ensure that we return the correct
23209 type when we have out or ref parameters [in which case we
23212 2002-04-22 Miguel de Icaza <miguel@ximian.com>
23214 * class.cs (Property, Indexer): Allow extern modifier in there.
23216 * typemanager.cs (InitBaseTypes): Initializes object_type and
23217 value_type, since those will be used early on during the bootstrap
23218 process to compile corlib.
23220 (InitCoreTypes): Move code from here to InitBaseTypes.
23222 2002-04-21 Miguel de Icaza <miguel@ximian.com>
23224 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
23225 single-dimension arrays as using the ldlen opcode.
23227 Daniel Lewis discovered this optimization.
23229 * typemanager.cs: Add signature for System.Array::get_Length
23231 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23233 * statement.cs: report the error when the foreach does not apply to an
23234 array nor a collection.
23236 2002-04-19 Miguel de Icaza <miguel@ximian.com>
23238 * expression.cs: Add implicit conversions to the operator ~.
23240 * constant.cs (DecimalConstant.Emit): Emit decimal value.
23242 * typemanager.cs: Locate the decimal constructor.
23244 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23246 * attribute.cs: use the new property of TypeOf.
23247 * expression.cs: added 'get' property around typearg.
23249 These changes fix a build breaker reported by NickD. Is this the
23250 correct way to fix? If not, please, revert my changes and make it
23253 2002-04-17 Miguel de Icaza <miguel@ximian.com>
23255 * attribute.cs: Add support for typeof in attribute invocations.
23256 I am not sure that this is right though.
23258 2002-04-14 Duncan Mak <duncan@ximian.com>
23260 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
23261 Binary.Operator.Division case.
23263 2002-04-13 Ravi Pratap <ravi@ximian.com>
23265 * class.cs (DefineType): Ensure that we do a proper check on
23266 attribute types and also register it with the TypeManager.
23268 (TypeContainer.Targets): The default for attribute types is
23269 AttributeTargets.All.
23271 * attribute.cs (ApplyAttributes): Registering the attribute type
23272 is done elsewhere, not when we discover we have a Usage attribute.
23274 2002-04-12 Ravi Pratap <ravi@ximian.com>
23276 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
23277 and get rid of is_delegate parameter.
23279 * everywhere : update.
23281 2002-04-12 Ravi Pratap <ravi@ximian.com>
23283 * cs-parser.jay (compilation_unit): Revamp completely to use
23284 some new ideas that I got from Rhys' grammar to solve the problems
23285 with assembly level attributes.
23287 (outer_declaration): New grammar production.
23289 (attribute_sections): Add.
23291 (opt_attributes): Base on attribute_sections
23293 (namespace_declaration): Allow opt_attributes to tackle the case
23294 when we have assembly level attributes - we are clever in this
23297 * attribute.cs (ApplyAttributes): Do not worry about assembly
23298 attributes in the non-global context.
23300 * rootcontext.cs (AddGlobalAttributes): Go back to using this
23301 instead of SetGlobalAttributes.
23303 * class.cs, rootcontext.cs : Ensure we define and generate
23304 attribute types before anything else.
23306 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
23307 and flag the new error -20 for the case when the attribute type
23308 does not have valid targets specified. csc does not catch this.
23310 * ../errors/errors.txt : update for error # -20
23312 2002-04-11 Ravi Pratap <ravi@ximian.com>
23314 * support.cs (InternalParameters.ParameterModifier): Do some null
23315 checking and return sane values.
23317 * class.cs (Method.Define): If we are a PInvoke method, ensure
23318 that we are static and extern. Report error # 601
23320 * ../errors/cs0601.cs : Add test case for the above error.
23322 2002-04-07 Ravi Pratap <ravi@ximian.com>
23324 * rootcontext.cs (attribute_types): We need to keep type of
23325 all attribute types separately and emit code for them first.
23327 (RegisterAttribute) : Implement.
23329 * class.cs (DefineType): Check if the current Type is a custom
23330 attribute type and register it accordingly.
23332 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
23333 adding the first attribute twice and rename to
23335 (SetGlobalAttributes): this.
23337 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
23340 * attribute.cs (ApplyAttributes): Take an additional argument telling us
23341 if we are processing global arguments. Hmm, I am unsure of this.
23343 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23345 * expression.cs: added static array of strings to avoid calling
23346 Enum.ToString () for Operator in Binary. Significant recover of
23349 2002-04-10 Miguel de Icaza <miguel@ximian.com>
23351 * class.cs (FindMembers): Allow the Builders of the various
23352 members to be null. If they are skip them. This only happens
23353 during the PInvoke declaration.
23355 2002-04-09 Miguel de Icaza <miguel@ximian.com>
23357 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
23358 failure, so we do not keep going afterwards.
23360 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
23361 wanted to pass `false' as the `is_delegate' argument. If this is
23362 the case, why not use delegate_type == null to mean `is_delegate =
23363 false' and anything else as is_delegate = true.
23365 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
23367 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
23368 code for the section, not the beginning of the tests.
23370 2002-04-08 Miguel de Icaza <miguel@ximian.com>
23372 * cfold.cs: Handle operator + (Enum x, Underlying x)
23374 * expression.cs (Binary): same. Warn about errors where we have
23375 Enum/Enum in operator + as well.
23377 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
23380 - added support for switch(bool)
23381 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
23382 - add TableSwitchEmit() to handle table-based switch statements
23384 2002-04-05 Ravi Pratap <ravi@ximian.com>
23386 * expression.cs (Invocation.OverloadResolve): Factor out code which
23387 does parameter compatibility checking with arguments so that we can
23388 re-use the code even from Delegate.VerifyApplicability
23390 (VerifyArgumentsCompat): Move above code here.
23392 * delegate.cs (VerifyApplicability): Get rid of duplicate code
23393 and instead make a call to the above method.
23395 2002-03-31 Ravi Pratap <ravi@ximian.com>
23397 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
23398 We use it to keep track of classes which are attribute types.
23400 2002-04-02 Miguel de Icaza <miguel@ximian.com>
23402 * delegate.cs (Delegate.Define): Correctly define the types in the
23403 presence of fixed and array parameters.
23405 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
23408 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
23409 include NonPublic after the first iteration.
23411 * class.cs (Indexer.CheckBase): Only check if both parents are
23414 * cs-parser.jay (accessor_body): If empty, set to null.
23416 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
23417 same code path here to resolve constants names that we did have in
23418 MemberAccess.DoResolve. There is too much code duplicated here.
23420 2002-04-01 Miguel de Icaza <miguel@ximian.com>
23422 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
23424 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
23427 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
23428 tokens, numbers and strings.
23430 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
23433 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
23434 asyncronous parameters and the regular parameters.
23436 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
23437 specify the target directory.
23439 * expression.cs: (This.DoResolve): Simplify
23440 (As.Emit): Optimize, do not generate IsInst if the expression is
23441 always of the given type.
23443 (Is.DoResolve): Bug fix, we were reporting both always/never for
23446 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
23447 creating too many unnecessary arrays.
23449 2002-03-31 Miguel de Icaza <miguel@ximian.com>
23451 * class.cs (EmitFieldInitializer): Use Assign expression to assign
23452 fields instead of rolling our own initializer. Takes care of all
23453 implicit conversions, and drops unnecessary static checks/argument.
23455 2002-03-31 Dick Porter <dick@ximian.com>
23457 * driver.cs: use the GetDirectories() return values properly, and
23458 use "/" as path separator.
23460 2002-03-30 Miguel de Icaza <miguel@ximian.com>
23462 * expression.cs (Unary): Optimize - - expr into expr.
23463 (Binary): Optimize a + (-b) into a -b.
23465 * codegen.cs (CodeGen): Made all methods static.
23467 2002-03-29 Miguel de Icaza <miguel@ximian.com>
23471 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
23472 TypeBuilder property.
23474 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
23477 * tree.cs: Removed the various RecordXXXX, and replaced with a
23478 single RecordDecl. Removed all the accessor methods, and just
23479 left a single access point Type
23481 * enum.cs: Rename DefineEnum to DefineType.
23483 * decl.cs: New abstract method `DefineType' used to unify the
23484 Defines for Enumerations, Interfaces, TypeContainers and
23487 (FindType): Moved LookupInterfaceOrClass here. Moved the
23488 LookupBaseClasses method that used to live in class.cs and
23489 interface.cs here, and renamed to FindType.
23491 * delegate.cs: Implement DefineType. Take advantage of the
23492 refactored pattern for locating the parent builder without taking
23493 the parent_builder argument (which we know does not work if we are
23494 nested, and triggering a toplevel definition).
23496 2002-03-28 Miguel de Icaza <miguel@ximian.com>
23498 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
23499 accessibility of a member has changed during override and report
23502 * class.cs (Method.Define, Property.Define): Only complain on
23503 overrides if the method is private, any other accessibility is
23504 fine (and since we just checked the permission is the same, we are
23507 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
23508 and elif are processed always. The other pre-processing
23509 directives are only processed if we are "taking" the path
23511 2002-03-29 Martin Baulig <martin@gnome.org>
23513 * class.cs (Method.Emit): Only emit symbolic debugging info if the
23514 current location is not Null.
23516 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
23517 a separate method so we can profile it.
23519 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
23520 `span.Seconds' are just seconds, but no minutes or hours.
23521 (MainDriver): Profile the CodeGen.SaveSymbols calls.
23523 2002-03-28 Miguel de Icaza <miguel@ximian.com>
23525 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
23526 Remove the gratuitous set of Final:
23528 // If an interface implementation, then we can set Final.
23529 if (((flags & MethodAttributes.Abstract) == 0) &&
23530 implementing.DeclaringType.IsInterface)
23531 flags |= MethodAttributes.Final;
23533 I do not know what I was smoking when I used that.
23536 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
23537 step into fixing the name resolution issues for delegates and
23538 unifying the toplevel name resolution.
23540 2002-03-28 Martin Baulig <martin@gnome.org>
23542 * class.cs (Method.Emit): If we have a symbol writer, call its
23543 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
23544 tell it about the current method.
23546 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
23547 writer that we're going to emit the first byte of IL code for a new
23548 statement (a new source line).
23549 (EmitContext.EmitTopBlock): If we have a symbol writer, call
23550 EmitContext.Mark() before emitting any code.
23552 * location.cs (SymbolDocument): Return null when we're Null.
23554 * statement.cs (Statement): Moved the `Location loc' variable here.
23555 (Statement.EmitBoolExpression): If we have a symbol writer, call
23556 ec.Mark() before emitting any code to tell it that we're at the
23557 beginning of a new statement.
23558 (StatementExpression): Added `Location' argument to the constructor.
23559 (Block): Added public readonly variable `StartLocation' and public
23560 variable `EndLocation'. The latter is to be set using SetEndLocation().
23561 (Block): Added constructor which takes a start and end location.
23562 (Block.SetEndLocation): New method. This sets the end location.
23563 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
23564 local variables we create.
23565 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
23566 each statement and do also mark the begin and end of the block.
23568 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
23569 tell it the current lexer.Location, use Location.Null for the end of the
23571 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
23572 current block, set its end location using SetEndLocation().
23573 (statement_expression): StatementExpression constructor now takes the
23574 lexer.Location as additional argument.
23575 (for_statement, declare_local_variables): Likewise.
23576 (declare_local_variables): When creating a new implicit block, use the
23577 new Block constructor and pass it the lexer.Location.
23579 2002-03-28 Miguel de Icaza <miguel@ximian.com>
23581 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
23582 members also on the parent interfaces recursively.
23584 2002-03-27 Miguel de Icaza <miguel@ximian.com>
23586 * report.cs: Use new formats, since Gonzalo finished the missing
23589 * expression.cs (Binary.ResolveOperator): added missing operator|
23590 operator& and operator^ for bool/bool.
23592 * cs-parser.jay: CheckDef now takes a Location argument that is
23593 used to report errors more precisly (instead of reporting the end
23594 of a definition, we try to track something which is a lot closer
23595 to the source of the problem).
23597 * cs-tokenizer.cs: Track global token use, so we can properly flag
23598 the use of #define/#undef after the first token has been seen.
23600 Also, rename the reportXXXX to Error_DescriptiveName
23602 * decl.cs (DeclSpace.IsTopLevel): Move property here from
23603 TypeContainer, so that Enum and Interface can use this too.
23605 * class.cs (TypeContainer.LookupInterfaceOrClass,
23606 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
23607 `builder' argument. Typically this was used to pass the parent
23608 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
23611 The problem is that a nested class could trigger the definition of
23612 a toplevel class, and the builder would be obviously wrong in that
23615 So we drop this argument, and we compute dynamically the
23616 TypeBuilder/ModuleBuilder (the correct information was available
23617 to us anyways from DeclSpace.Parent)
23619 * interface.cs (Interface.DefineInterface): Drop builder
23620 parameter cleanup like class.cs
23622 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
23625 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
23628 (Try.Emit): Propagate the returns value from the statement.
23630 (Return.Emit): Even if we are leavning
23632 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
23634 * modifiers.cs: Fix the computation of MethodAttributes flags.
23636 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
23638 * driver.cs: allow compilation of files that start with '/'.
23639 Add a default case when checking the argument of --target.
23641 2002-03-25 Miguel de Icaza <miguel@ximian.com>
23643 * interface.cs: Implement the same search algorithm for types in
23644 the interface code.
23646 * delegate.cs: Do not allow multiple definition.
23648 * Recovered ChangeLog that got accidentally amputated
23650 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
23652 * rootcontext.cs: Load manually enum to allow core classes to
23653 contain enumerations.
23655 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
23656 Update to new static methods in TypeManager.
23658 * typemanager.cs (GetMethod, GetConstructor): Use our
23659 implementation of FindMembers to find the members, since during
23660 corlib compilation, the types are TypeBuilders and GetMethod and
23661 GetConstructor do not work.
23663 Make all methods in TypeManager static.
23665 (InitCodeHelpers): Split the functionality from
23666 the InitCodeTypes function.
23668 * driver.cs: Call InitCodeHelpers after we have populated the
23671 * cs-parser.jay (delegate_declaration): we did not used to compute
23672 the delegate name correctly for void delegates.
23674 2002-03-24 Miguel de Icaza <miguel@ximian.com>
23676 * rootcontext.cs (RootContext): Init the interface_resolve_order
23677 and type_container_resolve_order always.
23679 (ResolveCore, BootstrapCorlib_ResolveClass,
23680 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
23681 compiler when compiling with --nostdlib
23683 * class.cs (TypeContainer.DefineType): Check that our parent is
23684 not null. This test is most important when we are bootstraping
23687 * codegen.cs: Split out the symbol writing code.
23689 2002-03-25 Martin Baulig <martin@gnome.org>
23691 * driver.cs (-g): Made -g an alias for --debug.
23693 2002-03-24 Martin Baulig <martin@gnome.org>
23695 * codegen.cs (SymbolWriter): New public variable. Returns the
23696 current symbol writer.
23697 (CodeGen): Added `bool want_debugging_support' argument to the
23698 constructor. If true, tell the ModuleBuild that we want debugging
23699 support and ask it for the ISymbolWriter.
23700 (Save): If we have a symbol writer, call it's Close() method after
23701 saving the assembly.
23703 * driver.c (--debug): New command line argument to create a
23704 debugger information file.
23706 * location.cs (SymbolDocument): New public property. Returns an
23707 ISymbolDocumentWriter object for the current source file or null
23708 if we don't have a symbol writer.
23710 2002-03-21 Miguel de Icaza <miguel@ximian.com>
23712 * driver.cs (LoadAssembly): Correctly return when all the paths
23713 have been tried and not before.
23715 * statement.cs (Switch.Emit): return the actual coverage for this
23716 statement (returns/not-returns)
23718 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
23719 switch of the statement if we are the last switch section. That
23720 kills two problems: try/catch problems (we used to emit an empty
23721 nop at the end) and switch statements where all branches would
23724 2002-03-19 Miguel de Icaza <miguel@ximian.com>
23726 * driver.cs: Add default assemblies (the equivalent to the
23727 Microsoft CSC.RSP file)
23729 * cs-tokenizer.cs: When updating `cols and setting it to zero,
23730 also update tokens_seen and set it to false.
23732 * driver.cs: Implement --recurse for Mike.
23734 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
23735 correctly splitting out the paths.
23737 2002-03-18 Miguel de Icaza <miguel@ximian.com>
23739 * interface.cs (Interface.PopulateProperty): Instead of using
23740 `parent' as the declaration space for the set parameters, use
23743 * support.cs (InternalParameters): InternalParameters constructor
23744 takes a DeclSpace instead of a TypeContainer.
23746 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
23747 types are being initialized, load the address of it before calling
23750 (New): Provide a mechanism to disable the generation of local
23751 value type temporaries when the caller will be providing us with
23752 an address to store it.
23754 (ArrayCreation.EmitDynamicInitializers): Use it.
23756 2002-03-17 Miguel de Icaza <miguel@ximian.com>
23758 * expression.cs (Invocation.EmitArguments): Only probe for array
23759 property if there is more than one argument. Sorry about that.
23761 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
23762 empty param arrays.
23764 * class.cs (Method.LabelParameters): Fix incorrect code path that
23765 prevented the `ParamArrayAttribute' from being applied to the
23768 2002-03-16 Miguel de Icaza <miguel@ximian.com>
23770 * support.cs (ReflectionParameters): Correctly compute whether the
23771 last argument is a params array. Fixes the problem with
23774 * typemanager.cs: Make the assemblies array always be non-null
23775 (empty, but non-null)
23777 * tree.cs (RecordDecl): New function that abstracts the recording
23778 of names. This reports error 101, and provides a pointer to the
23779 previous declaration. Fixes a crash in the compiler.
23781 * cs-parser.jay (constructor_declaration): Update to new grammar,
23782 and provide a constructor_body that can be empty.
23784 2002-03-15 Miguel de Icaza <miguel@ximian.com>
23786 * driver.cs: Add support for --resources.
23788 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
23789 Make all types for the various array helper methods be integer.
23791 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
23792 CheckState to ConvCast.
23794 (ConvCast): Now it takes a `checked' state argument, to avoid
23795 depending on the emit context for the conversion, and just using
23796 the resolve time setting.
23798 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
23799 instead of Invocation.EmitArguments. We do not emit the original
23800 arguments, instead we emit those which have been converted to
23801 unsigned int expressions.
23803 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
23805 * codegen.cs: ditto.
23807 * expression.cs (LocalVariableReference): Drop the use of the
23808 Store function that depended on the variable index.
23810 * statement.cs (VariableInfo): Drop the `Idx' property from this
23811 class, as this is not taking into account the indexes for
23812 temporaries tat we generate during the execution, getting the
23815 * class.cs: First emit class initializers, then call the parent
23818 * expression.cs (Binary): Fix opcode emision.
23819 (UnaryMutator.EmitCode): Support checked code generation
23821 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
23822 matches for events for both the Static and Instance scans,
23823 pointing to the same element. Fix that.
23825 2002-03-14 Miguel de Icaza <miguel@ximian.com>
23827 * rootcontext.cs (ResolveTree): Always set the
23828 interface_resolve_order, because nested interfaces will be calling
23831 * class.cs (GetInterfaceOrClass): Track the same resolution
23832 process used by TypeManager.LookupType. This fixes the nested
23833 type lookups in class declarations (separate path from
23836 (TypeContainer.DefineType): Also define nested interfaces.
23837 (TypeContainer.RegisterOrder): New public function used to
23838 register the order in which child interfaces need to be closed.
23840 Nested interfaces need to be closed after their parents have been
23843 * interface.cs (InterfaceAttr): Put all the logic for computing
23844 the interface attribute here.
23846 (DefineInterface): Register our interface order with the
23847 RootContext or with the TypeContainer depending on the case.
23849 2002-03-12 Miguel de Icaza <miguel@ximian.com>
23851 * cs-parser.jay: rework foreach statement to work with the new
23852 changes to the policy on SimpleNames.
23854 * report.cs: support Stacktrace on warnings as well.
23856 * makefile: drop --unsafe and /unsafe from the compile.
23858 2002-03-13 Ravi Pratap <ravi@ximian.com>
23860 * ecore.cs (StandardConversionExists): Modify to take an Expression
23861 as the first parameter. Ensure we do null -> reference type conversion
23864 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
23865 temporary Expression objects.
23867 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
23869 * interface.cs: workaround bug in method overloading resolution
23870 (there is already a bugzilla bug for it).
23872 2002-03-12 Miguel de Icaza <miguel@ximian.com>
23874 We could also solve this problem by having a separate path for
23875 performing type lookups, instead of DoResolve, we could have a
23876 ResolveType entry point, and only participating pieces of the
23877 production (simplename, deref, array) would implement this.
23879 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
23880 signal SimpleName to only resolve type names and not attempt to
23881 resolve anything else.
23883 * expression.cs (Cast): Set the flag.
23885 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
23887 * class.cs: Only report 108 if there is no `new' modifier.
23889 * cs-parser.jay: rework foreach statement to work with the new
23890 changes to the policy on SimpleNames.
23892 * report.cs: support Stacktrace on warnings as well.
23894 * makefile: drop --unsafe and /unsafe from the compile.
23896 2002-03-11 Miguel de Icaza <miguel@ximian.com>
23898 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
23899 lookups here, instead of doing that at parse time. This means
23900 that our grammar will not introduce `LocalVariableReferences' as
23901 expressions at this point. That solves the problem of code like
23905 static void Main ()
23909 This is only half the fix. The full fix requires parameters to
23910 also be handled in this way.
23912 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
23913 makes the use more obvious of the DeclSpace. The
23914 ec.TypeContainer.TypeBuilder is now only used to pull the
23915 TypeBuilder for it.
23917 My theory is that I can get rid of the TypeBuilder completely from
23918 the EmitContext, and have typecasts where it is used (from
23919 DeclSpace to where it matters).
23921 The only pending problem is that the code that implements Aliases
23922 is on TypeContainer, and probably should go in DeclSpace.
23924 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
23925 lookups here, instead of doing that at parse time. This means
23926 that our grammar will not introduce `LocalVariableReferences' as
23927 expressions at this point. That solves the problem of code like
23931 static void Main ()
23935 This is only half the fix. The full fix requires parameters to
23936 also be handled in this way.
23938 * class.cs (Property.DefineMethod): When implementing an interface
23939 method, set newslot, when implementing an abstract method, do not
23940 set the flag (before we tried never setting it, or always setting
23941 it, which is the difference).
23942 (Indexer.DefineMethod): same.
23943 (Method.DefineMethod): same.
23945 * ecore.cs: Only set the status used flag if we get back a Field.
23947 * attribute.cs: Temporary hack, so Paolo can keep working.
23949 2002-03-08 Ravi Pratap <ravi@ximian.com>
23951 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
23952 the unmanaged type in the case we have a MarshalAs attribute.
23954 (Resolve): Handle the case when we are parsing the special MarshalAs
23955 attribute [we need to store the unmanaged type to use later]
23957 * typemanager.cs (marshal_as_attr_type): Built in type for the
23958 MarshalAs Attribute.
23960 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
23961 on parameters and accordingly set the marshalling info.
23963 2002-03-09 Miguel de Icaza <miguel@ximian.com>
23965 * class.cs: Optimizing slightly by removing redundant code after
23966 we switched to the `NoTypes' return value.
23967 (Property.DefineMethod): use NoTypes here too.
23969 This fixes the bug I introduced in my last batch of changes.
23971 2002-03-05 Ravi Pratap <ravi@ximian.com>
23973 * tree.cs (RecordEnum): Add. We now keep track of enums too.
23975 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
23976 Enums since those are types too.
23978 * cs-parser.jay (enum_declaration): Record enums as we parse them.
23980 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
23981 thanks to a call during the lookup process.
23983 2002-03-07 Miguel de Icaza <miguel@ximian.com>
23985 * statement.cs (Foreach): Lots of work to accomodate a particular
23986 kind of foreach statement that I had not kept in mind. It is
23987 possible to have foreachs on classes that provide a GetEnumerator
23988 method that return objects that implement the "pattern" for using
23989 a foreach, there is no need to support GetEnumerator
23992 This is needed to compile nant.
23994 * decl.cs: Only report 114 if the member is not `Finalize' and if
23995 the warning level is at least 2.
23997 * class.cs: Moved the compare function from Method to
24000 (MethodSignature.InheritableMemberSignatureCompare): Add new
24001 filter function that is used to extract inheritable methods from a
24004 (Method.Define): Use the new `inheritable_method_signature_filter'
24007 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
24010 2002-03-06 Miguel de Icaza <miguel@ximian.com>
24012 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
24014 * cs-parser.jay: Add opt_semicolon to the interface declaration.
24016 * expression.cs: Pass location information to
24017 ConvertImplicitStandard.
24019 * class.cs: Added debugging code to track return values from
24022 2002-03-05 Miguel de Icaza <miguel@ximian.com>
24024 * expression.cs (Is.DoResolve): If either side of the `is' is an
24025 interface, do not flag the warning.
24027 * ecore.cs (ImplicitReferenceConversion): We need a separate test
24030 * report.cs: Allow for --fatal to be used with --probe.
24032 * typemanager.cs (NoTypes): Move the definition for the empty Type
24035 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
24037 (TypeContainer.DefineProxy): New function used to proxy to parent
24038 implementations when implementing interfaces.
24039 (TypeContainer.ParentImplements): used to lookup if our parent
24040 implements a public function that is required by an interface.
24041 (TypeContainer.VerifyPendingMethods): Hook this up.
24043 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
24044 `modules' and `assemblies' arraylists into arrays. We only grow
24045 these are the very early start up of the program, so this improves
24046 the speedof LookupType (nicely measured).
24048 * expression.cs (MakeByteBlob): Replaced unsafe code with
24049 BitConverter, as suggested by Paolo.
24051 * cfold.cs (ConstantFold.Binary): Special case: perform constant
24052 folding of string concatenation, but if either side is a string,
24053 and the other is not, then return null, and let the runtime use
24054 the concatenation on the string plus the object (using
24055 `Object.ToString').
24057 2002-03-04 Miguel de Icaza <miguel@ximian.com>
24059 Constant Folding has been implemented now.
24061 * expression.cs (Unary.Reduce): Do not throw an exception, catch
24062 the error instead on types that are not supported in one's
24065 * constant.cs (Constant and all children): New set of functions to
24066 perform implict and explicit conversions.
24068 * ecore.cs (EnumConstant): Implement the new functions to perform
24069 conversion by proxying to the child expression.
24071 * codegen.cs: (ConstantCheckState): Constant evaluation has its
24072 own separate setting that can not be turned off from the command
24073 line using --unchecked or --checked and is only controlled using
24074 the checked/unchecked statements and expressions. This setting is
24075 used by the constant folder to flag errors.
24077 * expression.cs (CheckedExpr, UncheckedExpr): Set the
24078 ConstantCheckState as well.
24080 During Resolve, they also have to flag the state, because the
24081 constant folder runs completely in the Resolve phase.
24083 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
24086 2002-03-01 Miguel de Icaza <miguel@ximian.com>
24088 * cfold.cs: New file, this file contains the constant folder.
24090 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
24091 argument to track whether we are using the resulting address to
24092 load or store a value and provide better error messages.
24094 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
24095 new AddressOf arguments.
24097 * statement.cs (Foreach.EmitCollectionForeach): Update
24099 * expression.cs (Argument.Emit): Call AddressOf with proper
24100 arguments to track usage.
24102 (New.DoEmit): Call AddressOf with new arguments.
24104 (Unary.Emit): Adjust AddressOf call.
24106 2002-03-01 Ravi Pratap <ravi@ximian.com>
24108 * cs-parser.jay (member_access): Change the case for pre-defined types
24109 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
24112 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
24115 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
24116 essentially like methods and apply attributes like MethodImplOptions to them too.
24118 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
24121 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
24122 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
24125 * Update code everywhere accordingly.
24127 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
24129 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
24131 2002-02-28 Ravi Pratap <ravi@ximian.com>
24133 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
24134 try performing lookups against those instead of jumping straight into using
24135 the 'using' clauses.
24137 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
24139 (LookupType): Perform lookups in implicit parents too.
24141 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
24142 sequence as RootContext.LookupType.
24144 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
24145 the various cases of namespace lookups into this method.
24147 2002-03-01 Miguel de Icaza <miguel@ximian.com>
24149 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
24150 in positional arguments)
24152 * class.cs (Operator): Update the AllowedModifiers to contain
24155 * cs-parser.jay: Update operator declaration to allow for the
24156 operator body to be empty.
24158 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
24161 2002-02-27 Miguel de Icaza <miguel@ximian.com>
24163 * class.cs (Method.Emit): Label parameters.
24165 * driver.cs: Return 1 or 0 as the program exit code.
24167 2002-02-26 Miguel de Icaza <miguel@ximian.com>
24169 * expression.cs: Special case the `null' object when trying to
24170 auto-compute the type, as anything can be explicitly converted to
24173 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
24174 spotting this Paolo.
24176 (Expression.ImplicitNumericConversion): Perform comparissions of
24177 the type using the underlying type in the case of an enumeration
24178 rather than using the enumeration type for the compare.
24180 Cope with the underlying == type case, which is not possible to
24183 (Expression.ConvertNumericExplicit): Perform comparissions of
24184 the type using the underlying type in the case of an enumeration
24185 rather than using the enumeration type for the compare.
24187 * driver.cs: If the user does not supply an extension, assume .exe
24189 * cs-parser.jay (if_statement): Rewrote so that we can track the
24190 location for the if statement.
24192 * expression.cs (Binary.ConstantFold): Only concat strings when
24193 the operation is "+", not everything ;-)
24195 * statement.cs (Statement.EmitBoolExpression): Take a location
24197 (If, While, Do): Track location.
24199 * expression.cs (Binary.ResolveOperator): In the object + string
24200 case, I was missing a call to ConvertImplicit
24202 2002-02-25 Ravi Pratap <ravi@ximian.com>
24204 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
24205 Location arguments. Ensure we use RootContext.LookupType to do our work
24206 and not try to do a direct Type.GetType and ModuleBuilder.GetType
24208 * interface.cs (PopulateMethod): Handle the type of the parameter being
24211 * expression.cs (Invocation.BetterFunction): Handle the case when we
24212 have a params method with no fixed arguments and a call is made with no
24215 2002-02-25 Miguel de Icaza <miguel@ximian.com>
24217 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
24218 the verbatim-string-literal
24220 * support.cs (InternalParameters.ParameterModifier): handle null
24222 (InternalParameters.ParameterType): ditto.
24224 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
24225 duplicating the name of the variable parameter.
24226 (GetParameterByName): Fix bug where we were not looking up array
24227 paramters if they were the only present (thanks Paolo!).
24228 (GetParameterInfo): We only have an empty set of types if both
24229 fixed and array are set to null.
24230 (GetParameterInfo-idx): Handle FixedParameter == null
24232 * cs-parser.jay: Handle the case where there is no catch
24233 statements (missing null test).
24235 2002-02-22 Miguel de Icaza <miguel@ximian.com>
24237 * driver.cs (MainDriver): Be conservative on our command line
24240 Catch DirectoryNotFoundException when calling GetFiles.
24242 (SplitPathAndPattern): Used to split the input specification into
24243 a path and a pattern that we can feed to Directory.GetFiles.
24245 2002-02-21 Miguel de Icaza <miguel@ximian.com>
24247 * statement.cs (Fixed): Implement the last case of the Fixed
24248 statement (string handling).
24250 * expression.cs (StringPtr): New class used to return a char * to
24251 a string; Used by the Fixed statement.
24253 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
24255 * expression.cs (Binary.ResolveOperator): Remove redundant
24256 MemberLookup pn parent type.
24257 Optimize union call, we do not need a union if the types are the same.
24258 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
24261 Specialize the use of MemberLookup everywhere, instead of using
24262 the default settings.
24264 (StackAlloc): Implement stackalloc keyword.
24266 * cs-parser.jay: Add rule to parse stackalloc.
24268 * driver.cs: Handle /h, /help, /?
24270 * expression.cs (MakeByteBlob): Removed the hacks we had in place
24271 before we supported unsafe code.
24273 * makefile: add --unsafe to the self compilation of mcs.
24275 2002-02-20 Miguel de Icaza <miguel@ximian.com>
24277 * expression.cs (PointerArithmetic): New class that is used to
24278 perform pointer arithmetic.
24279 (Binary.Resolve): Handle pointer arithmetic
24280 Handle pointer comparission.
24281 (ArrayPtr): Utility expression class that is used to take the
24282 address of an array.
24284 (ElementAccess): Implement array access for pointers
24286 * statement.cs (Fixed): Implement fixed statement for arrays, we
24287 are missing one more case before we are done.
24289 * expression.cs (Indirection): Implement EmitAssign and set the
24290 ExprClass to Variable. This allows pointer dereferences to be
24291 treated as variables, and to have values assigned to them.
24293 * ecore.cs (Expression.StoreFromPtr): New utility function to
24294 store values dereferencing.
24296 2002-02-20 Ravi Pratap <ravi@ximian.com>
24298 * expression.cs (Binary.ResolveOperator): Ensure that we are
24299 not trying to operate on a void type - this fixes the reported
24302 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
24303 the parent implementation is sealed.
24305 * ../errors/cs0239.cs : Add.
24307 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
24309 * typemanager.cs (unverifiable_code_type): Corresponds to
24310 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
24311 which have unsafe code in them.
24313 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
24316 2002-02-19 Miguel de Icaza <miguel@ximian.com>
24318 * cs-tokenizer.cs: Add support for @"litreal strings"
24320 Make tokenizer accept pre-processor directives
24321 on any column (remove the old C-like limitation).
24323 * rootcontext.cs (EmitCode): Emit any global attributes.
24324 (AddGlobalAttributes): Used to keep track of assembly attributes.
24326 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
24328 * cs-parser.jay: Add support for global attributes.
24330 2002-02-17 Miguel de Icaza <miguel@ximian.com>
24332 * expression.cs (Indirection): New helper class. Unary will
24333 create Indirection classes to be able to implement the
24334 IMemoryLocation interface on it.
24336 2002-02-16 Miguel de Icaza <miguel@ximian.com>
24338 * cs-parser.jay (fixed_statement): reference the right statement.
24340 * statement.cs (Fixed.Emit): Finish implementing the fixed
24341 statement for the &x case.
24343 2002-02-14 Miguel de Icaza <miguel@ximian.com>
24345 * class.cs (Property.Define, Method.Define): Remove newslot when
24348 * modifiers.cs: My use of NewSlot when `Abstract' was set was
24349 wrong. NewSlot should only be used if the `new' keyword is present.
24351 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
24352 locating our system dir. Sorry about this.
24354 2002-02-13 Miguel de Icaza <miguel@ximian.com>
24356 * driver.cs (GetSystemDir): Compute correctly the location of our
24357 system assemblies. I was using the compiler directory instead of
24358 the library directory.
24360 2002-02-13 Ravi Pratap <ravi@ximian.com>
24362 * expression.cs (BetterFunction): Put back in what Miguel commented out
24363 since it is the correct fix. The problem is elsewhere ;-)
24365 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
24366 parameters of the parms method are themselves compatible or not !
24368 (StandardConversionExists): Fix very dangerous bug where we were forgetting
24369 to check that a class implements an interface before saying that an implicit
24370 conversion was allowed. Use ImplementsInterface to do the checking.
24372 2002-02-13 Miguel de Icaza <miguel@ximian.com>
24374 * class.cs (Method.Define): Track whether we are an explicit
24375 implementation or not. And only call DefineMethodOverride if we
24376 are an explicit implementation.
24378 (Property.DefineMethod): Ditto.
24380 2002-02-11 Ravi Pratap <ravi@ximian.com>
24382 * expression.cs (BetterFunction): Catch hideous bug which was
24383 preventing us from detecting ambiguous calls due to implicit casts i.e
24386 2002-01-29 Miguel de Icaza <miguel@ximian.com>
24388 * support.cs (Pair): Remove un-needed method. I figured why I was
24389 getting the error in cs-parser.jay, the variable in a foreach loop
24390 is readonly, and the compiler does not really treat this as a variable.
24392 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
24393 instead of EQUALS in grammar.
24395 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
24397 * expression.cs (Unary.DoResolve): Check whether the argument is
24400 2002-01-28 Miguel de Icaza <miguel@ximian.com>
24402 * support.cs: Api for Pair to set a value. Despite the fact that
24403 the variables are public the MS C# compiler refuses to compile
24404 code that accesses the field if the variable is part of a foreach
24407 * statement.cs (Fixed): Begin implementation of the fixed
24410 (Block.AddVariable): Return the VariableInfo on success and null
24411 on failure instead of true/false.
24413 * cs-parser.jay (foreach): Catch errors on variables already
24414 defined (we were ignoring this value before) and properly unwind
24415 the block hierarchy
24417 (fixed_statement): grammar for the fixed statement.
24419 2002-01-25 Miguel de Icaza <miguel@ximian.com>
24421 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
24422 pointer types to be incretemented.
24424 (SizeOf): Implement.
24426 * cs-parser.jay (pointer_member_access): Implement
24427 expr->IDENTIFIER production.
24429 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
24430 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
24433 (Unary): Implement indirection.
24435 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
24436 use in non-unsafe context).
24438 (SimpleName.DoResolve): Check for pointers in field access on safe
24441 (Expression.LoadFromPtr): Factor the load-indirect code in this
24442 function. This was duplicated in UnboxCast and ParameterReference
24444 2002-01-24 Miguel de Icaza <miguel@ximian.com>
24446 * expression.cs (ComposedCast): report an error if a pointer cast
24447 is used in a safe region.
24449 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
24450 pointer type casts in unsafe context.
24452 * codegen.cs (EmitContext): Set up IsUnsafe.
24454 * cs-parser.jay (non_expression_type): Add productions for pointer
24457 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
24458 code. We should not use force into static mode if the method is
24459 not virtual. Fixes bug in MIS
24461 * statement.cs (Do.Emit, While.Emit, For.Emit,
24462 Statement.EmitBoolExpression): Add support to Do and While to
24463 propagate infinite loop as `I do return' semantics.
24465 Improve the For case to also test for boolean constants.
24467 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
24468 to the list of attributes we can add.
24470 Remove `EmitContext' argument.
24472 * class.cs (Method.Define): Apply parameter attributes.
24473 (Constructor.Define): Apply parameter attributes.
24474 (MethodCore.LabelParameters): Move here the core of labeling
24477 * support.cs (ReflectionParameters.ParameterModifier,
24478 InternalParameters.ParameterModifier): Use IsByRef on the type and
24479 only return the OUT bit for these parameters instead of in/out/ref
24482 This is because I miss-understood things. The ParameterInfo.IsIn
24483 and IsOut represent whether the parameter has the [In] and [Out]
24486 2002-01-22 Miguel de Icaza <miguel@ximian.com>
24488 * ecore.cs (FieldExpr.Emit): Release temporaries.
24490 * assign.cs (LocalTemporary.Release): new function.
24492 * codegen.cs (EmitContext.GetTemporaryStorage,
24493 EmitContext.FreeTemporaryStorage): Rework the way we deal with
24494 temporary storage. Now we can "put back" localbuilders when we
24497 2002-01-21 Miguel de Icaza <miguel@ximian.com>
24499 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
24500 need to make a copy of the variable to generate verifiable code.
24502 2002-01-19 Miguel de Icaza <miguel@ximian.com>
24504 * driver.cs: Compute dynamically the system directory.
24506 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
24507 Slower, but more generally useful. Used by the abstract
24508 registering implementation.
24510 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
24511 the rules for the special rule on Type/instances. First check if
24512 we have the same name, and if so, try that special static path
24513 rather than the instance path.
24515 2002-01-18 Miguel de Icaza <miguel@ximian.com>
24517 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
24520 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
24521 Enum, ValueType, Delegate or Array for non-corlib compiles.
24523 * cs-tokenizer.cs: Catch long identifiers (645)
24525 * typemanager.cs (IndexerPropetyName): Ravi never tested this
24528 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
24529 fix, we were returning too early, so we were not registering
24530 pending methods from abstract classes.
24532 Do not register pending methods if the class is abstract.
24534 * expression.cs (Conditional.DoResolve): Report circular implicit
24535 conversions when we neecd to compute it for conditional
24538 (Is.DoResolve): If the expression is always of the provided type,
24539 flag warning 183. If the expression can not ever be of the
24540 provided type flag warning 184.
24542 * class.cs: Catch 169 as well.
24544 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
24547 2002-01-18 Nick Drochak <ndrochak@gol.com>
24549 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
24551 2002-01-17 Miguel de Icaza <miguel@ximian.com>
24553 * interface.cs: (PopulateMethod): Check for pointers being defined
24554 only if the unsafe context is active.
24555 (PopulateProperty): ditto.
24556 (PopulateIndexer): ditto.
24558 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
24559 specified. If pointers are present, make sure that they are
24560 present in an unsafe context.
24561 (Constructor, Constructor.Define): ditto.
24562 (Field, Field.Define): ditto.
24563 (Property, Property.Define): ditto.
24564 (Event, Event.Define): ditto.
24566 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
24567 hashtable if there are classes or structs defined.
24569 * expression.cs (LocalVariableReference.DoResolve): Simplify this
24570 code, as the constant resolution moved.
24572 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
24573 the metadata, so we can flag error 133.
24575 * decl.cs (MemberCore.UnsafeOK): New function to test that a
24576 pointer is being declared in an unsafe context.
24578 2002-01-16 Miguel de Icaza <miguel@ximian.com>
24580 * modifiers.cs (Modifiers.Check): Require a Location argument.
24581 Report error 227 for Unsafe use.
24583 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
24585 * statement.cs (For.Emit): If the test is null, then report that
24586 we do `return', as we wont reach anything afterwards.
24588 (Switch.SwitchGoverningType): Track the expression that matched
24591 * driver.cs: Allow negative numbers as an error code to flag.
24593 * cs-parser.jay: Handle 1551.
24595 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
24597 2002-01-15 Miguel de Icaza <miguel@ximian.com>
24599 * cs-parser.jay: Report 1518 (type declaration can only contain
24600 class, struct, interface, enum or delegate)
24602 (switch_label): Report 1523 (keywords `case' or `default' must
24605 (opt_switch_sections): Report 1522 (empty switch)
24607 * driver.cs: Report 1515 (response file specified multiple times)
24608 Report 1516 (Source file specified multiple times).
24610 * expression.cs (Argument.Resolve): Signal 1510
24612 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
24613 access not allowed in static code)
24615 2002-01-11 Ravi Pratap <ravi@ximian.com>
24617 * typemanager.cs (IsPointerType): Utility method which we are going
24620 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
24621 the object type, so we take care of that.
24623 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
24625 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
24626 added to non-params parameters :-)
24628 * typemanager.cs (CSharpName): Include 'void' type too.
24630 (void_ptr_type): Include in the set of core types.
24632 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
24635 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
24638 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
24639 completely forgotten about it.
24641 2002-01-10 Ravi Pratap <ravi@ximian.com>
24643 * cs-parser.jay (pointer_type): Add. This begins our implementation
24644 of parsing rules for unsafe code.
24646 (unsafe_statement): Implement.
24648 (embedded_statement): Modify to include the above.
24650 * statement.cs (Unsafe): Implement new class for unsafe blocks.
24652 * codegen.cs (EmitContext.InUnsafe): Add. This determines
24653 if the current context is an unsafe one.
24655 * cs-parser.jay (local_variable_pointer_type): Since local variable types
24656 are handled differently, we need separate rules for them.
24658 (local_variable_declaration): Update to use local_variable_pointer_type
24659 to allow variable declarations of unmanaged pointer types.
24661 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
24662 in unsafe contexts.
24664 * ../errors/cs0214.cs : Add.
24666 2002-01-16 Nick Drochak <ndrochak@gol.com>
24668 * makefile: remove 'response' file when cleaning.
24670 2002-01-15 Miguel de Icaza <miguel@ximian.com>
24672 * cs-parser.jay: Report 1524.
24674 2002-01-14 Miguel de Icaza <miguel@ximian.com>
24676 * typemanager.cs (RegisterMethod): drop checking if we have
24677 registered this from here
24679 2002-01-12 Miguel de Icaza <miguel@ximian.com>
24681 * class.cs (Method.EmitDestructor): Implement calling our base
24684 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
24685 value of InFinally.
24687 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
24688 this routine and will wrap the call in a try/catch block. Deal
24691 2002-01-11 Miguel de Icaza <miguel@ximian.com>
24693 * ecore.cs (Expression.MemberLookup): instead of taking a
24694 parameter `same_type' that was used to tell whether we could
24695 access private members we compute our containing type from the
24698 (FieldExpr): Added partial support for volatile fields. This does
24699 not work for volatile fields exposed from assemblies, as I can not
24700 figure out how to extract the modreq from it.
24702 Updated all the source files to use this.
24704 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
24705 because it is referenced by MemberLookup very often.
24707 2002-01-09 Ravi Pratap <ravi@ximian.com>
24709 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
24710 TypeBuilder.GetCustomAttributes to retrieve what we need.
24712 Get rid of redundant default_member_attr_type as this is the same as
24713 default_member_type which already exists.
24715 * interface.cs, attribute.cs : Update accordingly.
24717 2002-01-08 Miguel de Icaza <miguel@ximian.com>
24719 * typemanager.cs: Enable IndexerPropertyName again. It does not
24720 work for TYpeBuilders though. Ravi, can you please fix this?
24722 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
24724 * expression.cs (Argument.Emit): Handle the case of ref objects
24725 being passed to ref functions;
24727 (ParameterReference.EmitLoad): Loads the content of the pointer
24728 without dereferencing.
24730 2002-01-07 Miguel de Icaza <miguel@ximian.com>
24732 * cs-tokenizer.cs: Implemented the pre-processing expressions.
24734 2002-01-08 Ravi Pratap <ravi@ximian.com>
24736 * class.cs (Indexer.DefineMethod): Incorporate the interface
24737 type in the name of the method if we are doing explicit interface
24740 * expression.cs (ConversionExists): Remove as it is completely obsolete.
24742 (BetterConversion): Fix extremely trivial bug where we were referring to
24743 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
24746 * ../errors/bug16.cs : Add although we have fixed it.
24748 2002-01-07 Miguel de Icaza <miguel@ximian.com>
24750 * expression.cs (BaseIndexer): Begin implementation.
24752 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
24754 * cs-parser.jay (indexer_declarator): Use qualified_identifier
24755 production directly to remove a shift/reduce, and implement
24756 explicit interface implementation.
24758 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
24759 after a floating point suffix.
24761 * expression.cs (DoNumericPromotions): Improved the conversion for
24762 uint/uint. If we have a constant, we avoid doing a typecast to a
24765 * class.cs (Indexer): Implement explicit interface implementation
24768 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
24770 * class.cs: make the default instance constructor public and hidebysig.
24772 2001-01-03 Ravi Pratap <ravi@ximian.com>
24774 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
24775 so we can call it from elsewhere.
24777 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
24778 we emit it internally if the class has a defined indexer; otherwise the user
24779 emits it by decorating the class definition with the DefaultMemberAttribute.
24781 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
24782 attribute is not used on a type which defines an indexer.
24784 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
24785 character when we skip whitespace.
24787 * ../errors/cs0646.cs : Add.
24789 2002-01-03 Miguel de Icaza <miguel@ximian.com>
24791 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
24794 * makefile: Add practical target `mcs3.exe' which builds the third
24795 generation compiler.
24797 * expression.cs (New): Fix structures constructor calling.
24799 * class.cs (Property, Method, Indexer): Emit Final flag on the
24800 method if we are an interface implementation and we are not
24803 * ecore.cs (PropertyExpr): New public field `IsBase', tells
24804 whether this property is referencing a `base' method.
24806 * expression.cs (Invocation.EmitCall): take an extra argument:
24807 is_base, this is used to determine whether the `call' or
24808 `callvirt' opcode should be used.
24811 * delegate.cs: update EmitCall.
24813 * class.cs (Method.Define): Set NewSlot for the cases where we are
24814 not implementing an interface method.
24816 (Property.Define): ditto.
24818 2002-01-02 Miguel de Icaza <miguel@ximian.com>
24820 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
24821 'r'. Allows mcs to parse itself fully.
24823 2002-01-02 Ravi Pratap <ravi@ximian.com>
24825 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
24826 of the number of initializers that require the InitializeArray method.
24828 (CheckIndices): Store the Expression in all cases - not the plain value. Also
24829 update the above field where necessary.
24831 (MakeByteBlob): Update accordingly.
24833 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
24836 (EmitDynamicInitializers): Update in accordance with the new optimization.
24838 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
24839 same OpCode applies.
24841 * cs-parser.jay : Fix some glaring errors I introduced.
24843 2002-01-01 Ravi Pratap <ravi@ximian.com>
24845 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
24846 so that we can check for name clashes there too.
24848 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
24849 for interface indexers.
24851 * interfaces.cs (Define): Emit the default member attribute.
24853 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
24854 variable was being referred to while setting the value ;-)
24856 2002-01-01 Miguel de Icaza <miguel@ximian.com>
24858 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
24859 byte-by-byte information when we know the data is zero.
24861 Make the block always a multiple of 4, because
24862 DefineInitializedData has a bug.
24864 * assign.cs: Fix, we should assign from the temporary, not from
24867 * expression.cs (MakeByteBlob): Fix my incorrect code.
24869 2001-12-31 Miguel de Icaza <miguel@ximian.com>
24871 * typemanager.cs (EnumToUnderlying): This function is used to get
24872 the underlying type from an enumeration, because it does not
24875 * constant.cs: Use the I4_S form for values between -128 and 127.
24877 * statement.cs (Block.LookupLabel): Looks up a label.
24878 (Block): Drop support for labeled blocks.
24880 (LabeledStatement): New kind of statement that represents a label
24883 (Goto): Finally implement this bad boy.
24885 * cs-parser.jay: Update to reflect new mechanism to implement
24888 2001-12-30 Miguel de Icaza <miguel@ximian.com>
24890 * codegen.cs (EmitContext.This): a codegen property that keeps the
24891 a single instance of this instead of creating many different this
24894 * delegate.cs (Delegate.DoResolve): Update to use the property;
24896 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
24898 * expression.cs (BaseAccess.DoResolve): Ditto.
24900 2001-12-29 Ravi Pratap <ravi@ximian.com>
24902 * typemanager.cs (methodimpl_attr_type): Add to hold the type
24903 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
24905 (InitCoreTypes): Update accordingly.
24907 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
24908 so we can quickly store the state.
24910 (ApplyAttributes): Set the correct implementation flags
24911 for InternalCall methods.
24913 2001-12-29 Miguel de Icaza <miguel@ximian.com>
24915 * expression.cs (EmitCall): if a method is not virtual, then do
24916 not use callvirt on it.
24918 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
24919 user defined stuff) requires the use of stobj, which takes an
24920 address on the stack instead of an array and an index. So emit
24921 the Ldelema operation for it.
24923 (EmitStoreOpcode): Use stobj for valuetypes.
24925 (UnaryMutator.EmitCode): Use the right 1 value depending on
24926 whether we are dealing with int64/uint64, float or doubles.
24928 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
24929 constructors that I implemented last night.
24931 (Constructor.IsDefault): Fix to work properly for static
24934 * cs-parser.jay (CheckDef): report method signature errors.
24935 Update error number 103 to be 132.
24937 * decl.cs: New AdditionResult enumeration value: MethodExists.
24938 Although we do this check for methods later on in the semantic
24939 analysis, catching repeated default constructors is so easy that
24940 we catch these here.
24942 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
24945 (ParameterReference.EmitAssign, Emit): handle
24948 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
24949 (ArrayAccess.EmitStoreOpcode): ditto.
24951 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
24953 * expression.cs (MakeByteBlob): Complete all the missing types
24954 (uint, short, ushort, byte, sbyte)
24956 * class.cs: Only init instance field initializers on instance
24959 Rename `constructors' to instance_constructors.
24961 (TypeContainer.AddConstructor): Only add constructors to the list
24962 if it is not static.
24964 Make sure that we handle default_static_constructor independently
24965 everywhere where we handle instance_constructors
24967 2001-12-28 Miguel de Icaza <miguel@ximian.com>
24969 * class.cs: Do not lookup or create a base initializer for a
24970 static constructor.
24972 (ConstructorInitializer.Resolve): use the proper type to lookup
24975 * cs-parser.jay: Report error 1585 (modifiers between type and name).
24977 * enum.cs, interface.cs: Remove CloseType, this is taken care by
24980 * decl.cs: CloseType is now an virtual method, the default
24981 implementation just closes this type.
24983 2001-12-28 Ravi Pratap <ravi@ximian.com>
24985 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
24986 to PreserveSig by default. Also emit HideBySig on such methods.
24988 Basically, set the defaults to standard values.
24990 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
24991 argument, if candidate is better, it can't be worse than the best !
24993 (Invocation): Re-write bits to differentiate between methods being
24994 applicable in their expanded form and their normal form - for params
24997 Get rid of use_standard everywhere as only standard conversions are allowed
24998 in overload resolution.
25000 More spec conformance.
25002 2001-12-27 Miguel de Icaza <miguel@ximian.com>
25004 * driver.cs: Add --timestamp, to see where the compiler spends
25007 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
25008 `this' in static code.
25010 (SimpleName.DoResolve): Implement in terms of a helper function
25011 that allows static-references to be passed upstream to
25014 (Expression.ResolveWithSimpleName): Resolve specially simple
25015 names when called by MemberAccess to implement the special
25018 (Expression.ImplicitReferenceConversion): Handle conversions from
25019 Null to reference types before others, as Null's type is
25022 * expression.cs (Invocation.EmitCall): Handle the special case of
25023 calling methods declared on a reference type from a ValueType
25024 (Base classes System.Object and System.Enum)
25026 (MemberAccess.Resolve): Only perform lookups on Enumerations if
25027 the left hand side is a TypeExpr, not on every enumeration.
25029 (Binary.Resolve): If types are reference types, then do a cast to
25030 object on operators != and == of both arguments.
25032 * typemanager.cs (FindMembers): Extract instance and static
25033 members if requested.
25035 * interface.cs (PopulateProperty): Use void_type instead of null
25036 as the return type for the setter method.
25038 (PopulateIndexer): ditto.
25040 2001-12-27 Ravi Pratap <ravi@ximian.com>
25042 * support.cs (ReflectionParameters): Fix minor bug where we
25043 were examining the wrong parameter for the ParamArray attribute.
25045 Cope with requests for the type of the parameter at position
25046 greater than the params parameter's. We now return the element
25047 type of the params array as that makes more sense.
25049 * expression.cs (Invocation.IsParamsMethodApplicable): Update
25050 accordingly as we no longer have to extract the element type
25053 (Invocation.OverloadResolve): Update.
25055 2001-12-27 Miguel de Icaza <miguel@ximian.com>
25057 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
25058 against IEnumerator, test whether the return value is a descendant
25059 of the IEnumerator interface.
25061 * class.cs (Indexer.Define): Use an auxiliary method to implement
25062 the other bits of the method definition. Begin support for
25063 explicit interface implementation.
25065 (Property.DefineMethod): Use TypeManager.void_type instead of null
25066 for an empty return value.
25068 2001-12-26 Miguel de Icaza <miguel@ximian.com>
25070 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
25071 dealing with a FieldExpr which is composed of a FieldBuilder, in
25072 the code path we did extract the constant, but we should have
25073 obtained the underlying value to be able to cast it (otherwise we
25074 end up in an infinite loop, this is what Ravi was running into).
25076 (ArrayCreation.UpdateIndices): Arrays might be empty.
25078 (MemberAccess.ResolveMemberAccess): Add support for section
25079 14.5.4.1 that deals with the special case of E.I when E is a type
25080 and something else, that I can be a reference to a static member.
25082 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
25083 handle a particular array type to create byte blobs, it is just
25084 something we dont generate byteblobs for.
25086 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
25089 * location.cs (Push): remove the key from the hashtable that we
25090 are about to add. This happens for empty files.
25092 * driver.cs: Dispose files after we have parsed them.
25094 (tokenize): new function that only runs the tokenizer on its
25095 input, for speed testing.
25097 2001-12-26 Ravi Pratap <ravi@ximian.com>
25099 * class.cs (Event.Define): Define the private field only if there
25100 are no accessors defined.
25102 * expression.cs (ResolveMemberAccess): If there is no associated
25103 field with the event, that means we have an event defined with its
25104 own accessors and we should flag error cs0070 since transforming
25105 ourselves into a field is not valid in that case.
25107 * ecore.cs (SimpleName.DoResolve): Same as above.
25109 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
25110 and charset to sane values.
25112 2001-12-25 Ravi Pratap <ravi@ximian.com>
25114 * assign.cs (DoResolve): Perform check on events only if they
25115 are being accessed outside the declaring type.
25117 * cs-parser.jay (event_declarations): Update rules to correctly
25118 set the type of the implicit parameter etc.
25120 (add_accessor, remove_accessor): Set current local parameters.
25122 * expression.cs (Binary): For delegate addition and subtraction,
25123 cast the return value from the method into the appropriate delegate
25126 2001-12-24 Ravi Pratap <ravi@ximian.com>
25128 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
25129 of these as the workaround is unnecessary.
25131 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
25132 delegate data - none of that is needed at all.
25134 Re-write bits to extract the instance expression and the delegate method
25137 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
25140 * attribute.cs (ApplyAttributes): New method to take care of common tasks
25141 of attaching attributes instead of duplicating code everywhere.
25143 * everywhere : Update code to do attribute emission using the above method.
25145 2001-12-23 Miguel de Icaza <miguel@ximian.com>
25147 * expression.cs (IsParamsMethodApplicable): if there are not
25148 parameters, return immediately.
25150 * ecore.cs: The 0 literal can be implicity converted to an enum
25153 (SimpleName.DoResolve): First lookup the type, then lookup the
25156 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
25157 want to get its address. If the InstanceExpression is not
25158 addressable, store the result in a temporary variable, then get
25161 * codegen.cs: Only display 219 errors on warning level or above.
25163 * expression.cs (ArrayAccess): Make it implement the
25164 IMemoryLocation interface.
25166 (Binary.DoResolve): handle the operator == (object a, object b)
25167 and operator != (object a, object b) without incurring into a
25168 BoxedCast (because 5 != o should never be performed).
25170 Handle binary enumerator operators.
25172 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
25173 value type, otherwise use Ldelem_ref.
25175 Use precomputed names;
25177 (AddressOf): Implement address of
25179 * cs-parser.jay (labeled_statement): Fix recursive block
25180 addition by reworking the production.
25182 * expression.cs (New.DoEmit): New has a special case:
25184 If we are dealing with a ValueType, we have a few
25185 situations to deal with:
25187 * The target of New is a ValueType variable, that is
25188 easy, we just pass this as the variable reference
25190 * The target of New is being passed as an argument,
25191 to a boxing operation or a function that takes a
25194 In this case, we need to create a temporary variable
25195 that is the argument of New.
25198 2001-12-23 Ravi Pratap <ravi@ximian.com>
25200 * rootcontext.cs (LookupType): Check that current_type is not null before
25201 going about looking at nested types.
25203 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
25204 not implement the IAssignMethod interface any more.
25206 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
25207 where we tranform them into FieldExprs if they are being resolved from within
25208 the declaring type.
25210 * ecore.cs (SimpleName.DoResolve): Do the same here.
25212 * assign.cs (DoResolve, Emit): Clean up code considerably.
25214 * ../errors/bug10.cs : Add.
25216 * ../errors/cs0070.cs : Add.
25218 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
25220 * assign.cs : Get rid of EventIsLocal everywhere.
25222 2001-12-23 Miguel de Icaza <miguel@ximian.com>
25224 * ecore.cs (ConvertIntLiteral): finished the implementation.
25226 * statement.cs (SwitchLabel): Convert the value we are using as a
25227 key before looking up the table.
25229 2001-12-22 Miguel de Icaza <miguel@ximian.com>
25231 * codegen.cs (EmitTopBlock): Require a Location argument now.
25233 * cs-parser.jay (constructor_declarator): We need to setup
25234 current_local_parameters before we parse the
25235 opt_constructor_initializer, to allow the variables to be bound
25236 to the constructor arguments.
25238 * rootcontext.cs (LookupType): First lookup nested classes in our
25239 class and our parents before we go looking outside our class.
25241 * expression.cs (ConstantFold): Extract/debox the values at the
25244 * rootcontext.cs (EmitCode): Resolve the constants first before we
25245 resolve the types. This is not really needed, but it helps debugging.
25247 * statement.cs: report location.
25249 * cs-parser.jay: pass location to throw statement.
25251 * driver.cs: Small bug fix.
25253 * report.cs: Updated format to be 4-zero filled digits.
25255 2001-12-22 Ravi Pratap <ravi@ximian.com>
25257 * expression.cs (CheckIndices): Fix minor bug where the wrong
25258 variable was being referred to ;-)
25260 (DoEmit): Do not call EmitStaticInitializers when the
25261 underlying type is System.Object.
25263 2001-12-21 Ravi Pratap <ravi@ximian.com>
25265 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
25266 and do the usual workaround for SRE.
25268 * class.cs (MyEventBuilder.EventType): New member to get at the type
25269 of the event, quickly.
25271 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
25273 * assign.cs (Assign.DoResolve): Handle the case when the target
25274 is an EventExpr and perform the necessary checks.
25276 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
25279 (SimpleName.MemberStaticCheck): Include check for EventExpr.
25281 (EventExpr): Set the type in the constructor itself since we
25282 are meant to be born fully resolved.
25284 (EventExpr.Define): Revert code I wrote earlier.
25286 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
25287 instance expression is null. The instance expression is a This in that case
25288 or a null, depending on whether it is a static method or not.
25290 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
25291 refers to more than one method.
25293 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
25294 and accordingly flag errors.
25296 2001-12-21 Miguel de Icaza <miguel@ximian.com>
25298 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
25300 2001-12-22 Miguel de Icaza <miguel@ximian.com>
25302 * location.cs (ToString): Provide useful rutine.
25304 2001-12-21 Miguel de Icaza <miguel@ximian.com>
25306 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
25307 objects, return the actual integral boxed.
25309 * statement.cs (SwitchLabel): define an ILLabel for each
25312 (Switch.CheckSwitch): If the value is a Literal, extract
25313 the underlying literal.
25315 Also in the unused hashtable we had, add the SwitchLabel so we can
25316 quickly look this value up.
25318 * constant.cs: Implement a bunch of new constants. Rewrite
25319 Literal based on this. Made changes everywhere to adapt to this.
25321 * expression.cs (Expression.MakeByteBlob): Optimize routine by
25322 dereferencing array only once, and also copes with enumrations.
25324 bytes are two bytes wide, not one.
25326 (Cast): Perform constant conversions.
25328 * ecore.cs (TryImplicitIntConversion): Return literals instead of
25329 wrappers to the literals here.
25331 * expression.cs (DoNumericPromotions): long literals can converted
25332 to ulong implicity (this is taken care of elsewhere, but I was
25333 missing this spot).
25335 * ecore.cs (Expression.Literalize): Make the return type Literal,
25336 to improve type checking.
25338 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
25340 2001-12-20 Miguel de Icaza <miguel@ximian.com>
25342 * literal.cs: Revert code from ravi that checked the bounds. The
25343 bounds are sane by the definition of the type itself.
25345 * typemanager.cs: Fix implementation of ImplementsInterface. We
25346 need to actually look up in our parent hierarchy for interfaces
25349 * const.cs: Use the underlying type for enumerations
25351 * delegate.cs: Compute the basename for the delegate creation,
25352 that should fix the delegate test case, and restore the correct
25353 Type Lookup semantics in rootcontext
25355 * rootcontext.cs: Revert Ravi's last patch. The correct way of
25356 referencing a nested type with the Reflection API is using the "+"
25359 * cs-parser.jay: Do not require EOF token at the end.
25361 2001-12-20 Ravi Pratap <ravi@ximian.com>
25363 * rootcontext.cs (LookupType): Concatenate type names with
25364 a '.' instead of a '+' The test suite passes again.
25366 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
25367 field of the enumeration.
25369 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
25370 the case when the member is an EventExpr.
25372 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
25373 static has an associated instance expression.
25375 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
25377 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
25379 * class.cs (Event.Define): Register event and perform appropriate checks
25382 We define the Add and Remove methods even if the use provides none because
25383 in that case, we provide default implementations ourselves.
25385 Define a private field of the type of the event. This is done by the CSC compiler
25386 and we should be doing it too ;-)
25388 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
25389 More methods we use in code we generate.
25391 (multicast_delegate_type, delegate_type): Two separate types since the distinction
25394 (InitCoreTypes): Update accordingly for the above.
25396 * class.cs (Event.Emit): Generate code for default accessors that we provide
25398 (EmitDefaultMethod): Do the job in the above.
25400 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
25403 2001-12-20 Miguel de Icaza <miguel@ximian.com>
25405 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
25406 builders even if we were missing one.
25408 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
25409 pass the Basename as our class name instead of the Name. The
25410 basename will be correctly composed for us.
25412 * parameter.cs (Paramters): Now takes a Location argument.
25414 * decl.cs (DeclSpace.LookupType): Removed convenience function and
25415 make all the code call directly LookupType in RootContext and take
25416 this chance to pass the Location information everywhere.
25418 * Everywhere: pass Location information.
25420 2001-12-19 Miguel de Icaza <miguel@ximian.com>
25422 * class.cs (Constructor.Define): Updated way of detecting the
25423 length of the parameters.
25425 (TypeContainer.DefineType): Use basename as the type name for
25428 (TypeContainer.Define): Do not recursively define types here, as
25429 definition is taken care in order by the RootContext.
25431 * tree.cs: Keep track of namespaces in a per-file basis.
25433 * parameter.cs (Parameter.ComputeSignature): Update to use
25436 (Parameters.GetSignature): ditto.
25438 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
25439 instead of a TypeContainer.
25441 (Interface.SemanticAnalysis): Use `this' instead of our parent to
25442 resolve names. Because we need to be resolve in our context, not
25445 * driver.cs: Implement response files.
25447 * class.cs (TypeContainer.DefineType): If we are defined, do not
25448 redefine ourselves.
25450 (Event.Emit): Emit the code for add/remove handlers.
25451 (Event.Define): Save the MethodBuilders for add/remove.
25453 * typemanager.cs: Use pair here too.
25455 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
25456 DictionaryEntry requires the first argument to be non-null.
25458 (enum_declaration): Compute full name for registering the
25461 (delegate_declaration): Instead of using
25462 formal_parameter_list, use opt_formal_parameter_list as the list
25465 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
25466 (EventParsing): New property that controls whether `add' and
25467 `remove' are returned as tokens or identifiers (for events);
25469 2001-12-19 Ravi Pratap <ravi@ximian.com>
25471 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
25472 use MyEventBuilder only and let it wrap the real builder for us.
25474 (MyEventBuilder): Revamp constructor etc.
25476 Implement all operations that we perform on EventBuilder in precisely the same
25479 (FindMembers): Update to use the EventBuilder member.
25481 (Event.Emit): Update accordingly.
25483 2001-12-18 Ravi Pratap <ravi@ximian.com>
25485 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
25486 by calling the appropriate methods.
25488 (GetCustomAttributes): Make stubs as they cannot possibly do anything
25491 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
25493 2001-12-17 Ravi Pratap <ravi@ximian.com>
25495 * delegate.cs (Delegate.Populate): Check that the return type
25496 and various parameters types are indeed accessible.
25498 * class.cs (Constructor.Define): Same here.
25500 (Field.Define): Ditto.
25502 (Event.Define): Ditto.
25504 (Operator.Define): Check that the underlying Method defined itself
25505 correctly - so it's MethodBuilder should not be null.
25507 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
25508 expression happens to be null.
25510 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
25511 members but as of now we don't seem to be able to do anything really useful with it.
25513 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
25514 not the EventBuilder.
25516 2001-12-18 Miguel de Icaza <miguel@ximian.com>
25518 * cs-tokenizer.cs: Add support for defines.
25519 Add support for #if, #elif, #else, #endif
25521 (eval_var): evaluates a variable.
25522 (eval): stubbed for evaluating functions.
25524 * cs-parser.jay: Pass the defines information
25526 * driver.cs: Add --define command line option.
25528 * decl.cs: Move MemberCore here.
25530 Make it the base class for DeclSpace. This allows us to catch and
25531 report 108 and 109 for everything now.
25533 * class.cs (TypeContainer.Define): Extract all the members
25534 before populating and emit the warning 108 (new keyword required
25535 to override) instead of having each member implement this.
25537 (MemberCore.Define): New abstract method, we will be using this in
25538 the warning reporting engine in Populate.
25540 (Operator.Define): Adjust to new MemberCore protocol.
25542 * const.cs (Const): This does not derive from Expression, it is a
25543 temporary object we use to create fields, it is a MemberCore.
25545 * class.cs (Method.Define): Allow the entry point to be in a
25548 * driver.cs: Rewrite the argument handler to clean it up a bit.
25550 * rootcontext.cs: Made it just an auxiliary namespace feature by
25551 making everything static.
25553 * driver.cs: Adapt code to use RootContext type name instead of
25556 * delegate.cs: Remove RootContext argument.
25558 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
25561 * class.cs (Event.Define): The lookup can fail.
25563 * cs-tokenizer.cs: Begin implementation of pre-procesor.
25565 * expression.cs: Resolve the this instance before invoking the code.
25567 2001-12-17 Miguel de Icaza <miguel@ximian.com>
25569 * cs-parser.jay: Add a production in element_access that allows
25570 the thing to become a "type" reference. This way we can parse
25571 things like "(string [])" as a type.
25573 Note that this still does not handle the more complex rules of
25577 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
25579 * ecore.cs: (CopyNewMethods): new utility function used to
25580 assemble the list of methods from running FindMembers.
25582 (MemberLookup): Rework FindMembers so that
25584 2001-12-16 Miguel de Icaza <miguel@ximian.com>
25586 * class.cs (TypeContainer): Remove Delegates who fail to be
25589 * delegate.cs (Populate): Verify that we dont get null return
25590 values. TODO: Check for AsAccessible.
25592 * cs-parser.jay: Use basename to emit error 574 (destructor should
25593 have the same name as container class), not the full name.
25595 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
25596 possible representation.
25598 Also implements integer type suffixes U and L.
25600 2001-12-15 Miguel de Icaza <miguel@ximian.com>
25602 * expression.cs (ArrayCreation.DoResolve): We need to do the
25603 argument resolution *always*.
25605 * decl.cs: Make this hold the namespace. Hold the root context as
25607 (LookupType): Move here.
25609 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
25611 * location.cs (Row, Name): Fixed the code, it was always returning
25612 references to the first file.
25614 * interface.cs: Register properties defined through interfaces.
25616 * driver.cs: Add support for globbing on the command line
25618 * class.cs (Field): Make it derive from MemberCore as well.
25621 2001-12-15 Ravi Pratap <ravi@ximian.com>
25623 * class.cs (Event::Define): Check that the type of the event is a delegate
25624 type else flag error #66.
25626 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
25629 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
25630 values of EntryPoint, CharSet etc etc.
25632 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
25634 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
25635 be null and we should ignore this. I am not sure if this is really clean. Apparently,
25636 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
25637 which needs this to do its work.
25639 * ../errors/cs0066.cs : Add.
25641 2001-12-14 Miguel de Icaza <miguel@ximian.com>
25643 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
25646 * class.cs: (MethodSignature.MethodSignature): Removed hack that
25647 clears out the parameters field.
25648 (MemberSignatureCompare): Cleanup
25650 (MemberCore): New base class used to share code between MethodCore
25653 (RegisterRequiredImplementations) BindingFlags.Public requires
25654 either BindingFlags.Instace or Static. Use instance here.
25656 (Property): Refactored code to cope better with the full spec.
25658 * parameter.cs (GetParameterInfo): Return an empty array instead
25661 * class.cs (Property): Abstract or extern properties have no bodies.
25663 * parameter.cs (GetParameterInfo): return a zero-sized array.
25665 * class.cs (TypeContainer.MethodModifiersValid): Move all the
25666 method modifier validation to the typecontainer so we can reuse
25667 this on properties.
25669 (MethodCore.ParameterTypes): return an empty sized array of types.
25671 (Property.Define): Test property modifier validity.
25673 Add tests for sealed/override too.
25675 (Method.Emit): abstract or extern methods have no bodies.
25677 2001-12-14 Ravi Pratap <ravi@ximian.com>
25679 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
25682 (Method::Define, ::Emit): Modify accordingly.
25684 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
25686 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
25688 * makefile: Pass in /unsafe.
25690 2001-12-13 Miguel de Icaza <miguel@ximian.com>
25692 * class.cs (MakeKey): Kill routine.
25694 * class.cs (TypeContainer.Define): Correctly define explicit
25695 method implementations (they require the full interface name plus
25698 * typemanager.cs: Deply the PtrHashtable here and stop using the
25699 lame keys. Things work so much better.
25701 This of course broke everyone who depended on `RegisterMethod' to
25702 do the `test for existance' test. This has to be done elsewhere.
25704 * support.cs (PtrHashtable): A hashtable that avoid comparing with
25705 the object stupid Equals method (because, that like fails all over
25706 the place). We still do not use it.
25708 * class.cs (TypeContainer.SetRequiredInterface,
25709 TypeContainer.RequireMethods): Killed these two routines and moved
25710 all the functionality to RegisterRequiredImplementations.
25712 (TypeContainer.RegisterRequiredImplementations): This routine now
25713 registers all the implementations required in an array for the
25714 interfaces and abstract methods. We use an array of structures
25715 which can be computed ahead of time to reduce memory usage and we
25716 also assume that lookups are cheap as most classes will not
25717 implement too many interfaces.
25719 We also avoid creating too many MethodSignatures.
25721 (TypeContainer.IsInterfaceMethod): Update and optionally does not
25722 clear the "pending" bit if we find that there are problems with
25725 (TypeContainer.VerifyPendingMethods): Update to report errors of
25726 methods that look like implementations but are not.
25728 (TypeContainer.Define): Add support for explicit interface method
25731 2001-12-12 Miguel de Icaza <miguel@ximian.com>
25733 * typemanager.cs: Keep track of the parameters here instead of
25734 being a feature of the TypeContainer.
25736 * class.cs: Drop the registration of parameters here, as
25737 InterfaceMethods are also interface declarations.
25739 * delegate.cs: Register methods with the TypeManager not only with
25740 the TypeContainer. This code was buggy.
25742 * interface.cs: Full registation here.
25744 2001-12-11 Miguel de Icaza <miguel@ximian.com>
25746 * expression.cs: Remove reducer for binary expressions, it can not
25749 * const.cs: Put here the code that used to go into constant.cs
25751 * constant.cs: Put here the code for constants, this is a new base
25752 class for Literals.
25754 * literal.cs: Make Literal derive from Constant.
25756 2001-12-09 Miguel de Icaza <miguel@ximian.com>
25758 * statement.cs (Return.Emit): Report error 157 if the user
25759 attempts to return from a finally block.
25761 (Return.Emit): Instead of emitting a return, jump to the end of
25764 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
25765 LocalBuilder to store the result of the function. ReturnLabel is
25766 the target where we jump.
25769 2001-12-09 Radek Doulik <rodo@ximian.com>
25771 * cs-parser.jay: remember alias in current namespace
25773 * ecore.cs (SimpleName::DoResolve): use aliases for types or
25776 * class.cs (LookupAlias): lookup alias in my_namespace
25778 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
25780 (LookupAlias): lookup alias in this and if needed in parent
25783 2001-12-08 Miguel de Icaza <miguel@ximian.com>
25787 * rootcontext.cs: (ModuleBuilder) Made static, first step into
25788 making things static. I need this to avoid passing the
25789 TypeContainer when calling ParameterType.
25791 * support.cs (InternalParameters.ParameterType): Remove ugly hack
25792 that did string manipulation to compute the type and then call
25793 GetType. Use Parameter.ParameterType instead.
25795 * cs-tokenizer.cs: Consume the suffix for floating values.
25797 * expression.cs (ParameterReference): figure out whether this is a
25798 reference parameter or not. Kill an extra variable by computing
25799 the arg_idx during emission.
25801 * parameter.cs (Parameters.GetParameterInfo): New overloaded
25802 function that returns whether a parameter is an out/ref value or not.
25804 (Parameter.ParameterType): The type of the parameter (base,
25805 without ref/out applied).
25807 (Parameter.Resolve): Perform resolution here.
25808 (Parameter.ExternalType): The full type (with ref/out applied).
25810 * statement.cs (Using.Emit, Using.EmitExpression): Implement
25811 support for expressions on the using statement.
25813 2001-12-07 Miguel de Icaza <miguel@ximian.com>
25815 * statement.cs (Using.EmitLocalVariableDecls): Split the
25816 localvariable handling of the using statement.
25818 (Block.EmitMeta): Keep track of variable count across blocks. We
25819 were reusing slots on separate branches of blocks.
25821 (Try.Emit): Emit the general code block, we were not emitting it.
25823 Check the type of the declaration to be an IDisposable or
25824 something that can be implicity converted to it.
25826 Emit conversions if required.
25828 * ecore.cs (EmptyExpression): New utility class.
25829 (Expression.ImplicitConversionExists): New utility function.
25831 2001-12-06 Miguel de Icaza <miguel@ximian.com>
25833 * statement.cs (Using): Implement.
25835 * expression.cs (LocalVariableReference): Support read only variables.
25837 * statement.cs: Remove the explicit emit for the Leave opcode.
25838 (VariableInfo): Add a readonly field.
25840 2001-12-05 Miguel de Icaza <miguel@ximian.com>
25842 * ecore.cs (ConvCast): new class used to encapsulate the various
25843 explicit integer conversions that works in both checked and
25844 unchecked contexts.
25846 (Expression.ConvertNumericExplicit): Use new ConvCast class to
25847 properly generate the overflow opcodes.
25849 2001-12-04 Miguel de Icaza <miguel@ximian.com>
25851 * statement.cs: The correct type for the EmptyExpression is the
25852 element_type, not the variable type. Ravi pointed this out.
25854 2001-12-04 Ravi Pratap <ravi@ximian.com>
25856 * class.cs (Method::Define): Handle PInvoke methods specially
25857 by using DefinePInvokeMethod instead of the usual one.
25859 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
25860 above to do the task of extracting information and defining the method.
25862 2001-12-04 Ravi Pratap <ravi@ximian.com>
25864 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
25865 of the condition for string type.
25867 (Emit): Move that here.
25869 (ArrayCreation::CheckIndices): Keep string literals in their expression
25872 (EmitDynamicInitializers): Handle strings appropriately.
25874 2001-12-04 Miguel de Icaza <miguel@ximian.com>
25876 * codegen.cs (EmitContext): Replace multiple variables with a
25877 single pointer to the current Switch statement.
25879 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
25882 2001-12-03 Miguel de Icaza <miguel@ximian.com>
25886 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
25889 (Foreach.Emit): Foreach on arrays was not setting
25890 up the loop variables (for break/continue).
25892 (GotoCase): Semi-implented.
25894 2001-12-03 Ravi Pratap <ravi@ximian.com>
25896 * attribute.cs (CheckAttribute): Handle system attributes by using
25897 Attribute.GetAttributes to examine information we need.
25899 (GetValidPlaces): Same here.
25901 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
25903 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
25905 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
25907 (Method::Define): Set appropriate flags if we have a DllImport attribute.
25909 (Method::Emit): Handle the case when we are a PInvoke method.
25911 2001-12-03 Miguel de Icaza <miguel@ximian.com>
25913 * expression.cs: Use ResolveWithSimpleName on compound names.
25915 2001-12-02 Ravi Pratap <ravi@ximian.com>
25917 * constant.cs (EmitConstant): Make sure we resolve the associated expression
25918 before trying to reduce it.
25920 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
25922 * constant.cs (LookupConstantValue): Implement.
25924 (EmitConstant): Use the above in emitting the constant.
25926 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
25927 that are user-defined by doing a LookupConstantValue on them.
25929 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
25932 2001-11-29 Miguel de Icaza <miguel@ximian.com>
25934 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
25936 (BaseAccess.DoResolve): Implement.
25938 (MemberAccess.DoResolve): Split this routine into a
25939 ResolveMemberAccess routine that can be used independently
25941 2001-11-28 Miguel de Icaza <miguel@ximian.com>
25943 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
25944 As that share bits of the implementation. Is returns a boolean,
25945 while As returns the Type that is being probed.
25947 2001-12-01 Ravi Pratap <ravi@ximian.com>
25949 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
25950 instead of a Literal - much easier.
25952 (EnumInTransit): Remove - utterly useless :-)
25954 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
25956 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
25958 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
25959 chain when we have no associated expression.
25961 2001-11-30 Ravi Pratap <ravi@ximian.com>
25963 * constant.cs (Define): Use Location while reporting the errror.
25965 Also emit a warning when 'new' is used and there is no inherited
25968 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
25971 (LookupEnumValue): Implement to lookup an enum member's value and define it
25974 (Populate): Re-write accordingly to use the above routine.
25976 2001-11-27 Miguel de Icaza <miguel@ximian.com>
25978 * expression.cs (This): Fix prototype for DoResolveLValue to
25979 override the base class DoResolveLValue.
25981 * cs-parser.cs: Report errors cs574 and cs575 (destructor
25984 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
25985 (we need to load the address of the field here). This fixes
25988 (FieldExpr.DoResolveLValue): Call the DoResolve
25989 function to initialize the Instance expression.
25991 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
25992 correctly the GetEnumerator operation on a value type.
25994 * cs-parser.jay: Add more simple parsing error catches.
25996 * statement.cs (Switch): Add support for string switches.
25997 Handle null specially.
25999 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
26001 2001-11-28 Ravi Pratap <ravi@ximian.com>
26003 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
26005 (declare_local_constant): New helper function.
26007 * statement.cs (AddConstant): Keep a separate record of constants
26009 (IsConstant): Implement to determine if a variable is a constant.
26011 (GetConstantExpression): Implement.
26013 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
26015 * statement.cs (IsVariableDefined): Re-write.
26017 2001-11-27 Ravi Pratap <ravi@ximian.com>
26019 * class.cs (TypeContainer::FindMembers): Look for constants
26020 in the case when we are looking for MemberTypes.Field
26022 * expression.cs (MemberAccess::DoResolve): Check that in the
26023 case we are a FieldExpr and a Literal, we are not being accessed
26024 by an instance reference.
26026 * cs-parser.jay (local_constant_declaration): Implement.
26028 (declaration_statement): Implement for constant declarations.
26030 2001-11-26 Miguel de Icaza <miguel@ximian.com>
26032 * statement.cs (Switch): Catch double defaults.
26034 (Switch): More work on the switch() statement
26035 implementation. It works for integral values now, need to finish
26039 2001-11-24 Miguel de Icaza <miguel@ximian.com>
26041 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
26042 integer literals into other integer literals. To be used by
26045 2001-11-24 Ravi Pratap <ravi@ximian.com>
26047 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
26050 (EmitDynamicInitializers): Cope with the above since we extract data
26051 directly from ArrayData now.
26053 (ExpectInitializers): Keep track of whether initializers are mandatory
26056 (Bounds): Make it a hashtable to prevent the same dimension being
26057 recorded for every element in that dimension.
26059 (EmitDynamicInitializers): Fix bug which prevented the Set array method
26062 Also fix bug which was causing the indices to be emitted in the reverse
26065 2001-11-24 Miguel de Icaza <miguel@ximian.com>
26067 * expression.cs (ArrayCreation): Implement the bits that Ravi left
26068 unfinished. They do not work, because the underlying code is
26071 2001-11-22 Miguel de Icaza <miguel@ximian.com>
26073 * cs-parser.jay: Remove bogus fixme.
26075 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
26076 on Switch statement.
26078 2001-11-23 Ravi Pratap <ravi@ximian.com>
26080 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
26083 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
26084 parameter. Apparently, any expression is allowed.
26086 (ValidateInitializers): Update accordingly.
26088 (CheckIndices): Fix some tricky bugs thanks to recursion.
26090 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
26091 I was being completely brain-dead.
26093 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
26094 and re-write acordingly.
26096 (DelegateInvocation): Re-write accordingly.
26098 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
26100 (MakeByteBlob): Handle types more correctly.
26102 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
26103 initialization from expressions but it is incomplete because I am a complete
26106 2001-11-22 Miguel de Icaza <miguel@ximian.com>
26108 * statement.cs (If.Emit): Fix a bug that generated incorrect code
26109 on If. Basically, we have to return `true' (ie, we do return to
26110 our caller) only if both branches of the if return.
26112 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
26113 short-circuit operators, handle them as short circuit operators.
26115 (Cast.DoResolve): Resolve type.
26116 (Cast.Cast): Take an expression as the target type.
26118 * cs-parser.jay (cast_expression): Remove old hack that only
26119 allowed a limited set of types to be handled. Now we take a
26120 unary_expression and we resolve to a type during semantic
26123 Use the grammar productions from Rhys to handle casts (this is
26124 not complete like Rhys syntax yet, we fail to handle that corner
26125 case that C# has regarding (-x), but we will get there.
26127 2001-11-22 Ravi Pratap <ravi@ximian.com>
26129 * class.cs (EmitFieldInitializer): Take care of the case when we have a
26130 field which is an array type.
26132 * cs-parser.jay (declare_local_variables): Support array initialization too.
26134 * typemanager.cs (MakeKey): Implement.
26136 (everywhere): Use the above appropriately.
26138 * cs-parser.jay (for_statement): Update for array initialization while
26139 declaring variables.
26141 * ecore.cs : The error message was correct, it's the variable's names that
26142 were misleading ;-) Make the code more readable.
26144 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
26145 the correct type etc.
26147 (ConvertExplicit): Handle Enum types by examining the underlying type.
26149 2001-11-21 Ravi Pratap <ravi@ximian.com>
26151 * parameter.cs (GetCallingConvention): Always return
26152 CallingConventions.Standard for now.
26154 2001-11-22 Miguel de Icaza <miguel@ximian.com>
26156 * expression.cs (Binary.ResolveOperator): Update the values of `l'
26157 and `r' after calling DoNumericPromotions.
26159 * ecore.cs: Fix error message (the types were in the wrong order).
26161 * statement.cs (Foreach.ProbeCollectionType): Need to pass
26162 BindingFlags.Instance as well
26164 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
26165 implicit int literal conversion in an empty cast so that we
26166 propagate the right type upstream.
26168 (UnboxCast): new class used to unbox value types.
26169 (Expression.ConvertExplicit): Add explicit type conversions done
26172 (Expression.ImplicitNumericConversion): Oops, forgot to test for
26173 the target type before applying the implicit LongLiterals to ULong
26176 2001-11-21 Miguel de Icaza <miguel@ximian.com>
26178 * cs-parser.jay (for_statement): Reworked the way For works: now
26179 we declare manually any variables that are introduced in
26180 for_initializer to solve the problem of having out-of-band code
26181 emition (that is what got for broken).
26183 (declaration_statement): Perform the actual variable declaration
26184 that used to be done in local_variable_declaration here.
26186 (local_variable_declaration): Do not declare anything, just pass
26187 the information on a DictionaryEntry
26189 2001-11-20 Ravi Pratap <ravi@ximian.com>
26191 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
26192 re-write of the logic to now make it recursive.
26194 (UpdateIndices): Re-write accordingly.
26196 Store element data in a separate ArrayData list in the above methods.
26198 (MakeByteBlob): Implement to dump the array data into a byte array.
26200 2001-11-19 Ravi Pratap <ravi@ximian.com>
26202 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
26205 * constant.cs (Define): Implement.
26207 (EmitConstant): Re-write fully.
26209 Pass in location info.
26211 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
26214 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
26215 DictionaryEntry since we need location info too.
26217 (constant_declaration): Update accordingly.
26219 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
26220 code into another method : UpdateIndices.
26222 2001-11-18 Ravi Pratap <ravi@ximian.com>
26224 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
26225 some type checking etc.
26227 2001-11-17 Ravi Pratap <ravi@ximian.com>
26229 * expression.cs (ArrayCreation::ValidateInitializers): Implement
26230 bits to provide dimension info if the user skips doing that.
26232 Update second constructor to store the rank correctly.
26234 2001-11-16 Ravi Pratap <ravi@ximian.com>
26236 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
26237 and try to implement.
26239 * ../errors/cs0150.cs : Add.
26241 * ../errors/cs0178.cs : Add.
26243 2001-11-16 Miguel de Icaza <miguel@ximian.com>
26245 * statement.cs: Implement foreach on multi-dimensional arrays.
26247 * parameter.cs (Parameters.GetParameterByName): Also lookup the
26248 name of the params argument.
26250 * expression.cs: Use EmitStoreOpcode to get the right opcode while
26251 initializing the array.
26253 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
26254 we can use this elsewhere.
26256 * statement.cs: Finish implementation of foreach for single
26259 * cs-parser.jay: Use an out-of-band stack to pass information
26260 around, I wonder why I need this.
26262 foreach_block: Make the new foreach_block the current_block.
26264 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
26265 function used to return a static Parameters structure. Used for
26266 empty parameters, as those are created very frequently.
26268 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
26270 2001-11-15 Ravi Pratap <ravi@ximian.com>
26272 * interface.cs : Default modifier is private, not public. The
26273 make verify test passes again.
26275 2001-11-15 Ravi Pratap <ravi@ximian.com>
26277 * support.cs (ReflectionParameters): Fix logic to determine
26278 whether the last parameter is a params one. Test 9 passes again.
26280 * delegate.cs (Populate): Register the builders we define with
26281 RegisterParameterForBuilder. Test 19 passes again.
26283 * cs-parser.jay (property_declaration): Reference $6 instead
26284 of $$ to get at the location.
26286 (indexer_declaration): Similar stuff.
26288 (attribute): Ditto.
26290 * class.cs (Property): Register parameters for the Get and Set methods
26291 if they exist. Test 23 passes again.
26293 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
26294 call to EmitArguments as we are sure there aren't any params arguments.
26295 Test 32 passes again.
26297 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
26298 IndexOutOfRangeException.
26300 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
26301 Test 33 now passes again.
26303 2001-11-15 Miguel de Icaza <miguel@ximian.com>
26305 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
26306 broke a bunch of things. Will have to come up with a better way
26307 of tracking locations.
26309 * statement.cs: Implemented foreach for single dimension arrays.
26311 2001-11-09 Miguel de Icaza <miguel@ximian.com>
26313 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
26314 an error. This removes the lookup from the critical path.
26316 * cs-parser.jay: Removed use of temporary_loc, which is completely
26319 2001-11-14 Miguel de Icaza <miguel@ximian.com>
26321 * support.cs (ReflectionParameters.ParameterModifier): Report
26322 whether the argument is a PARAMS argument or not.
26324 * class.cs: Set the attribute `ParamArrayAttribute' on the
26325 parameter argument.
26327 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
26328 and cons_param_array_attribute (ConstructorInfo for
26329 ParamArrayAttribute).,
26331 * codegen.cs: Emit the return using the `Return' statement, that
26332 way we can report the error correctly for missing return values.
26334 * class.cs (Method.Emit): Clean up.
26336 * expression.cs (Argument.Resolve): Take another argument: the
26337 location where this argument is used. Notice that this is not
26338 part of the "Argument" class as to reduce the size of the
26339 structure (we know the approximate location anyways).
26341 Test if the argument is a variable-reference, if not, then
26342 complain with a 206.
26344 (Argument.Emit): Emit addresses of variables.
26346 (Argument.FullDesc): Simplify.
26348 (Invocation.DoResolve): Update for Argument.Resolve.
26350 (ElementAccess.DoResolve): ditto.
26352 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
26353 method should be virtual, as this method is always virtual.
26355 (NewDelegate.DoResolve): Update for Argument.Resolve.
26357 * class.cs (ConstructorInitializer.DoResolve): ditto.
26359 * attribute.cs (Attribute.Resolve): ditto.
26361 2001-11-13 Miguel de Icaza <miguel@ximian.com>
26363 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
26365 * expression.cs (ParameterReference): Drop IStackStorage and implement
26366 IAssignMethod instead.
26368 (LocalVariableReference): ditto.
26370 * ecore.cs (FieldExpr): Drop IStackStorage and implement
26371 IAssignMethod instead.
26373 2001-11-13 Miguel de Icaza <miguel@ximian.com>
26375 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
26376 enumerations that are used in heavily used structures derive from
26377 byte in a laughable and pathetic attempt to reduce memory usage.
26378 This is the kind of pre-optimzations that you should not do at
26379 home without adult supervision.
26381 * expression.cs (UnaryMutator): New class, used to handle ++ and
26382 -- separatedly from the other unary operators. Cleans up the
26383 code, and kills the ExpressionStatement dependency in Unary.
26385 (Unary): Removed `method' and `Arguments' from this class, making
26386 it smaller, and moving it all to SimpleCall, so I can reuse this
26387 code in other locations and avoid creating a lot of transient data
26388 strucutres when not required.
26390 * cs-parser.jay: Adjust for new changes.
26392 2001-11-11 Miguel de Icaza <miguel@ximian.com>
26394 * enum.cs (Enum.Populate): If there is a failure during
26397 * cs-parser.jay (opt_enum_base): we used to catch type errors
26398 here, but this is really incorrect. The type error should be
26399 catched during semantic analysis.
26401 2001-12-11 Ravi Pratap <ravi@ximian.com>
26403 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
26404 current_local_parameters as expected since I, in my stupidity, had forgotten
26407 * attribute.cs (GetValidPlaces): Fix stupid bug.
26409 * class.cs (Method::Emit): Perform check on applicability of attributes.
26411 (Constructor::Emit): Ditto.
26413 (Field::Emit): Ditto.
26415 (Field.Location): Store location information.
26417 (Property, Event, Indexer, Operator): Ditto.
26419 * cs-parser.jay (field_declaration): Pass in location for each field.
26421 * ../errors/cs0592.cs : Add.
26423 2001-11-12 Ravi Pratap <ravi@ximian.com>
26425 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
26427 (InitCoreTypes): Update accordingly.
26429 (RegisterAttrType, LookupAttr): Implement.
26431 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
26432 info about the same.
26434 (Resolve): Update to populate the above as necessary.
26436 (Error592): Helper.
26438 (GetValidPlaces): Helper to the above.
26440 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
26442 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
26444 2001-11-12 Ravi Pratap <ravi@ximian.com>
26446 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
26448 * ../errors/cs0617.cs : Add.
26450 2001-11-11 Ravi Pratap <ravi@ximian.com>
26452 * enum.cs (Emit): Rename to Populate to be more consistent with what
26453 we expect it to do and when exactly it is called.
26455 * class.cs, rootcontext.cs : Update accordingly.
26457 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
26458 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
26460 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
26462 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
26463 of a fieldinfo using the above, when dealing with a FieldBuilder.
26465 2001-11-10 Ravi Pratap <ravi@ximian.com>
26467 * ../errors/cs0031.cs : Add.
26469 * ../errors/cs1008.cs : Add.
26471 * ../errrors/cs0543.cs : Add.
26473 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
26476 (FindMembers): Implement.
26478 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
26479 enums and delegates too.
26481 (enum_types): Rename to builder_to_enum.
26483 (delegate_types): Rename to builder_to_delegate.
26485 * delegate.cs (FindMembers): Implement.
26487 2001-11-09 Ravi Pratap <ravi@ximian.com>
26489 * typemanager.cs (IsEnumType): Implement.
26491 * enum.cs (Emit): Re-write parts to account for the underlying type
26492 better and perform checking etc.
26494 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
26495 of the underlying type.
26497 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
26500 * enum.cs (error31): Helper to report error #31.
26502 * cs-parser.jay (enum_declaration): Store location of each member too.
26504 * enum.cs (member_to_location): New hashtable.
26506 (AddEnumMember): Update location hashtable.
26508 (Emit): Use the location of each member while reporting errors.
26510 2001-11-09 Miguel de Icaza <miguel@ximian.com>
26512 * cs-parser.jay: A for_initializer if is a
26513 local_variable_declaration really ammount to have an implicit
26514 block with the variable declaration and no initializer for for.
26516 * statement.cs (For.Emit): Cope with null initializers.
26518 This fixes the infinite loop on for initializers.
26520 2001-11-08 Miguel de Icaza <miguel@ximian.com>
26522 * enum.cs: More cleanup.
26524 * ecore.cs: Remove dead code.
26526 * class.cs (Property.Emit): More simplification.
26527 (Event.Emit): ditto.
26529 Reworked to have less levels of indentation.
26531 2001-11-08 Ravi Pratap <ravi@ximian.com>
26533 * class.cs (Property): Emit attributes.
26543 * enum.cs (Emit): Ditto.
26545 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
26548 * class.cs (Field, Event, etc.): Move attribute generation into the
26549 Emit method everywhere.
26551 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
26552 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
26553 as we had no way of defining nested enums !
26555 * rootcontext.cs : Adjust code accordingly.
26557 * typemanager.cs (AddEnumType): To keep track of enum types separately.
26559 2001-11-07 Ravi Pratap <ravi@ximian.com>
26561 * expression.cs (EvalConstantExpression): Move into ecore.cs
26563 * enum.cs (Enum): Rename some members and make them public and readonly
26564 according to our convention.
26566 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
26569 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
26571 (Enum::Emit): Write a simple version for now which doesn't try to compute
26572 expressions. I shall modify this to be more robust in just a while.
26574 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
26576 (TypeContainer::CloseType): Create the Enum types too.
26578 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
26580 * expression.cs (EvalConstantExpression): Get rid of completely.
26582 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
26583 user-defined values and other cases.
26585 (IsValidEnumLiteral): Helper function.
26587 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
26588 out there in the case we had a literal FieldExpr.
26590 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
26592 (Literalize): Revamp a bit to take two arguments.
26594 (EnumLiteral): New class which derives from Literal to wrap enum literals.
26596 2001-11-06 Ravi Pratap <ravi@ximian.com>
26598 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
26600 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
26602 (Resolve): Use the above to ensure we have proper initializers.
26604 2001-11-05 Ravi Pratap <ravi@ximian.com>
26606 * expression.cs (Expression::EvalConstantExpression): New method to
26607 evaluate constant expressions.
26609 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
26611 2001-11-07 Miguel de Icaza <miguel@ximian.com>
26613 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
26616 (Binary.ResolveOperator): Handle operator != (object a, object b)
26617 and operator == (object a, object b);
26619 (Binary.DoNumericPromotions): Indicate whether the numeric
26620 promotion was possible.
26622 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
26625 Made the ArrayAccess implement interface IAssignMethod instead of
26626 IStackStore as the order in which arguments are passed reflects
26629 * assign.cs: Instead of using expr.ExprClass to select the way of
26630 assinging, probe for the IStackStore/IAssignMethod interfaces.
26632 * typemanager.cs: Load InitializeArray definition.
26634 * rootcontext.cs (RootContext.MakeStaticData): Used to define
26635 static data that can be used to initialize arrays.
26637 2001-11-05 Miguel de Icaza <miguel@ximian.com>
26639 * expression.cs: Handle operator== and operator!= for booleans.
26641 (Conditioal.Reduce): Implement reducer for the ?: operator.
26643 (Conditional.Resolve): Implement dead code elimination.
26645 (Binary.Resolve): Catch string literals and return a new
26646 concatenated string.
26648 (Unary.Reduce): Implement reduction of unary expressions.
26650 * ecore.cs: Split out the expression core handling here.
26652 (Expression.Reduce): New method used to perform constant folding
26653 and CSE. This is needed to support constant-expressions.
26655 * statement.cs (Statement.EmitBoolExpression): Pass true and false
26656 targets, and optimize for !x.
26658 2001-11-04 Ravi Pratap <ravi@ximian.com>
26660 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
26661 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
26662 set custom atttributes.
26664 * literal.cs (Literal::GetValue): New abstract method to return the actual
26665 value of the literal, cast as an object.
26667 (*Literal): Implement GetValue method.
26669 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
26670 expressions to the arraylist but objects of type Argument.
26672 * class.cs (TypeContainer::Emit): Emit our attributes too.
26674 (Method::Emit, Constructor::Emit): Ditto.
26676 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
26677 to be ignoring earlier.
26679 2001-11-03 Ravi Pratap <ravi@ximian.com>
26681 * attribute.cs (AttributeSection::Define): Implement to do the business
26682 of constructing a CustomAttributeBuilder.
26684 (Attribute): New trivial class. Increases readability of code.
26686 * cs-parser.jay : Update accordingly.
26688 (positional_argument_list, named_argument_list, named_argument): New rules
26690 (attribute_arguments): Use the above so that we are more correct.
26692 2001-11-02 Ravi Pratap <ravi@ximian.com>
26694 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
26695 to perform all checks for a method with a params parameter.
26697 (Invocation::OverloadResolve): Update to use the above method and therefore
26698 cope correctly with params method invocations.
26700 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
26703 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
26704 constructors in our parent too because we can't afford to miss out on
26707 * attribute.cs (AttributeSection): New name for the class Attribute
26709 Other trivial changes to improve readability.
26711 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
26712 use the new class names.
26714 2001-11-01 Ravi Pratap <ravi@ximian.com>
26716 * class.cs (Method::Define): Complete definition for params types too
26718 (Indexer::Define): Ditto.
26720 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
26721 Cope everywhere with a request for info about the array parameter.
26723 2001-11-01 Ravi Pratap <ravi@ximian.com>
26725 * tree.cs (RecordNamespace): Fix up to check for the correct key.
26727 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
26728 local_variable_type to extract the string corresponding to the type.
26730 (local_variable_type): Fixup the action to use the new helper method.
26732 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
26735 * expression.cs : Clean out code which uses the above.
26737 2001-10-31 Ravi Pratap <ravi@ximian.com>
26739 * typemanager.cs (RegisterMethod): Check if we already have an existing key
26740 and bale out if necessary by returning a false.
26742 (RegisterProperty): Ditto.
26744 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
26745 and print out appropriate error messages.
26747 * interface.cs (everywhere): Ditto.
26749 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
26750 location to constructor.
26752 * class.cs (Property, Event, Indexer): Update accordingly.
26754 * ../errors/cs111.cs : Added.
26756 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
26757 of a method, as laid down by the spec.
26759 (Invocation::OverloadResolve): Use the above method.
26761 2001-10-31 Ravi Pratap <ravi@ximian.com>
26763 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
26764 now take a TypeContainer and a Parameters object.
26766 (ParameterData): Modify return type of ParameterModifier method to be
26767 Parameter.Modifier and not a string.
26769 (ReflectionParameters, InternalParameters): Update accordingly.
26771 * expression.cs (Argument::GetParameterModifier): Same here.
26773 * support.cs (InternalParameters::ParameterType): Find a better way of determining
26774 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
26775 symbol in it at all so maybe this is only for now.
26777 2001-10-30 Ravi Pratap <ravi@ximian.com>
26779 * support.cs (InternalParameters): Constructor now takes an extra argument
26780 which is the actual Parameters class.
26782 (ParameterDesc): Update to provide info on ref/out modifiers.
26784 * class.cs (everywhere): Update call to InternalParameters to pass in
26785 the second argument too.
26787 * support.cs (ParameterData): Add ParameterModifier, which is a method
26788 to return the modifier info [ref/out etc]
26790 (InternalParameters, ReflectionParameters): Implement the above.
26792 * expression.cs (Argument::ParameterModifier): Similar function to return
26793 info about the argument's modifiers.
26795 (Invocation::OverloadResolve): Update to take into account matching modifiers
26798 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
26799 a new SetFormalParameters object which we pass to InternalParameters.
26801 2001-10-30 Ravi Pratap <ravi@ximian.com>
26803 * expression.cs (NewArray): Merge into the ArrayCreation class.
26805 2001-10-29 Ravi Pratap <ravi@ximian.com>
26807 * expression.cs (NewArray): Merge classes NewBuiltinArray and
26808 NewUserdefinedArray into one as there wasn't much of a use in having
26811 * expression.cs (Argument): Change field's name to ArgType from Type.
26813 (Type): New readonly property which returns the proper type, taking into
26814 account ref/out modifiers.
26816 (everywhere): Adjust code accordingly for the above.
26818 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
26819 whether we are emitting for a ref or out parameter.
26821 * expression.cs (Argument::Emit): Use the above field to set the state.
26823 (LocalVariableReference::Emit): Update to honour the flag and emit the
26826 * parameter.cs (Attributes): Set the correct flags for ref parameters.
26828 * expression.cs (Argument::FullDesc): New function to provide a full desc.
26830 * support.cs (ParameterData): Add method ParameterDesc to the interface.
26832 (ReflectionParameters, InternalParameters): Implement the above method.
26834 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
26837 (Invocation::FullMethodDesc): Ditto.
26839 2001-10-29 Miguel de Icaza <miguel@ximian.com>
26841 * cs-parser.jay: Add extra production for the second form of array
26844 * expression.cs (ArrayCreation): Update to reflect the above
26847 * Small changes to prepare for Array initialization.
26849 2001-10-28 Miguel de Icaza <miguel@ximian.com>
26851 * typemanager.cs (ImplementsInterface): interface might be null;
26852 Deal with this problem;
26854 Also, we do store negative hits on the cache (null values), so use
26855 this instead of calling t.GetInterfaces on the type everytime.
26857 2001-10-28 Ravi Pratap <ravi@ximian.com>
26859 * typemanager.cs (IsBuiltinType): New method to help determine the same.
26861 * expression.cs (New::DoResolve): Get rid of array creation code and instead
26862 split functionality out into different classes.
26864 (New::FormArrayType): Move into NewBuiltinArray.
26866 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
26869 (NewBuiltinArray): New class to handle creation of built-in arrays.
26871 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
26872 account creation of one-dimensional arrays.
26874 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
26876 (NewUserdefinedArray::DoResolve): Implement.
26878 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
26880 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
26881 we maintain inside the TypeManager. This is necessary to perform lookups on the
26884 (LookupType): Update to perform GetType on the module builders too.
26886 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
26888 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
26890 2001-10-23 Ravi Pratap <ravi@ximian.com>
26892 * expression.cs (New::DoResolve): Implement guts of array creation.
26894 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
26896 2001-10-27 Miguel de Icaza <miguel@ximian.com>
26898 * expression.cs: Fix bug I introduced lsat night that broke
26901 (Expression.Resolve): Report a 246 error (can not resolve name)
26902 if we find a SimpleName in the stream.
26904 (Expression.ResolveLValue): Ditto.
26906 (Expression.ResolveWithSimpleName): This function is a variant of
26907 ResolveName, this one allows SimpleNames to be returned without a
26908 warning. The only consumer of SimpleNames is MemberAccess
26910 2001-10-26 Miguel de Icaza <miguel@ximian.com>
26912 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
26913 might arrive here. I have my doubts that this is correct.
26915 * statement.cs (Lock): Implement lock statement.
26917 * cs-parser.jay: Small fixes to support `lock' and `using'
26919 * cs-tokenizer.cs: Remove extra space
26921 * driver.cs: New flag --checked, allows to turn on integer math
26924 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
26925 Threading.Monitor.Exit
26927 2001-10-23 Miguel de Icaza <miguel@ximian.com>
26929 * expression.cs (IndexerAccess::DoResolveLValue): Set the
26930 Expression Class to be IndexerAccess.
26932 Notice that Indexer::DoResolve sets the eclass to Value.
26934 2001-10-22 Miguel de Icaza <miguel@ximian.com>
26936 * class.cs (TypeContainer::Emit): Emit code for indexers.
26938 * assign.cs (IAssignMethod): New interface implemented by Indexers
26939 and Properties for handling assignment.
26941 (Assign::Emit): Simplify and reuse code.
26943 * expression.cs (IndexerAccess, PropertyExpr): Implement
26944 IAssignMethod, clean up old code.
26946 2001-10-22 Ravi Pratap <ravi@ximian.com>
26948 * typemanager.cs (ImplementsInterface): New method to determine if a type
26949 implements a given interface. Provides a nice cache too.
26951 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
26954 (ConvertReferenceExplicit): Ditto.
26956 * delegate.cs (Delegate::Populate): Update to define the parameters on the
26957 various methods, with correct names etc.
26959 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
26960 Operator.UnaryNegation.
26962 * cs-parser.jay (operator_declarator): Be a little clever in the case where
26963 we have a unary plus or minus operator.
26965 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
26968 * everywhere : update accordingly.
26970 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
26973 * class.cs (Method::Define): For the case where we are implementing a method
26974 inherited from an interface, we need to set the MethodAttributes.Final flag too.
26975 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
26977 2001-10-21 Ravi Pratap <ravi@ximian.com>
26979 * interface.cs (FindMembers): Implement to work around S.R.E
26982 * typemanager.cs (IsInterfaceType): Implement.
26984 (FindMembers): Update to handle interface types too.
26986 * expression.cs (ImplicitReferenceConversion): Re-write bits which
26987 use IsAssignableFrom as that is not correct - it doesn't work.
26989 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
26990 and accordingly override EmitStatement.
26992 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
26993 using the correct logic :-)
26995 2001-10-19 Ravi Pratap <ravi@ximian.com>
26997 * ../errors/cs-11.cs : Add to demonstrate error -11
26999 2001-10-17 Miguel de Icaza <miguel@ximian.com>
27001 * assign.cs (Assign::Resolve): Resolve right hand side first, and
27002 then pass this as a hint to ResolveLValue.
27004 * expression.cs (FieldExpr): Add Location information
27006 (FieldExpr::LValueResolve): Report assignment to readonly
27009 (Expression::ExprClassFromMemberInfo): Pass location information.
27011 (Expression::ResolveLValue): Add new method that resolves an
27014 (Expression::DoResolveLValue): Default invocation calls
27017 (Indexers): New class used to keep track of indexers in a given
27020 (IStackStore): Renamed from LValue, as it did not really describe
27021 what this did. Also ResolveLValue is gone from this interface and
27022 now is part of Expression.
27024 (ElementAccess): Depending on the element access type
27026 * typemanager.cs: Add `indexer_name_type' as a Core type
27027 (System.Runtime.CompilerServices.IndexerNameAttribute)
27029 * statement.cs (Goto): Take a location.
27031 2001-10-18 Ravi Pratap <ravi@ximian.com>
27033 * delegate.cs (Delegate::VerifyDelegate): New method to verify
27034 if two delegates are compatible.
27036 (NewDelegate::DoResolve): Update to take care of the case when
27037 we instantiate a delegate from another delegate.
27039 * typemanager.cs (FindMembers): Don't even try to look up members
27040 of Delegate types for now.
27042 2001-10-18 Ravi Pratap <ravi@ximian.com>
27044 * delegate.cs (NewDelegate): New class to take care of delegate
27047 * expression.cs (New): Split the delegate related code out into
27048 the NewDelegate class.
27050 * delegate.cs (DelegateInvocation): New class to handle delegate
27053 * expression.cs (Invocation): Split out delegate related code into
27054 the DelegateInvocation class.
27056 2001-10-17 Ravi Pratap <ravi@ximian.com>
27058 * expression.cs (New::DoResolve): Implement delegate creation fully
27059 and according to the spec.
27061 (New::DoEmit): Update to handle delegates differently.
27063 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
27064 because of which we were printing out arguments in reverse order !
27066 * delegate.cs (VerifyMethod): Implement to check if the given method
27067 matches the delegate.
27069 (FullDelegateDesc): Implement.
27071 (VerifyApplicability): Implement.
27073 * expression.cs (Invocation::DoResolve): Update to accordingly handle
27074 delegate invocations too.
27076 (Invocation::Emit): Ditto.
27078 * ../errors/cs1593.cs : Added.
27080 * ../errors/cs1594.cs : Added.
27082 * delegate.cs (InstanceExpression, TargetMethod): New properties.
27084 2001-10-16 Ravi Pratap <ravi@ximian.com>
27086 * typemanager.cs (intptr_type): Core type for System.IntPtr
27088 (InitCoreTypes): Update for the same.
27090 (iasyncresult_type, asynccallback_type): Ditto.
27092 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
27095 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
27098 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
27099 the builders for the 4 members of a delegate type :-)
27101 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
27104 * expression.cs (New::DoResolve): Implement guts for delegate creation.
27106 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
27108 2001-10-15 Miguel de Icaza <miguel@ximian.com>
27110 * statement.cs (Break::Emit): Implement.
27111 (Continue::Emit): Implement.
27113 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
27114 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
27115 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
27116 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
27119 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
27120 properties that track the label for the current loop (begin of the
27121 loop and end of the loop).
27123 2001-10-15 Ravi Pratap <ravi@ximian.com>
27125 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
27126 use of emitting anything at all.
27128 * class.cs, rootcontext.cs : Get rid of calls to the same.
27130 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
27132 (Populate): Define the constructor correctly and set the implementation
27135 * typemanager.cs (delegate_types): New hashtable to hold delegates that
27138 (AddDelegateType): Implement.
27140 (IsDelegateType): Implement helper method.
27142 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
27144 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
27145 and accordingly handle it.
27147 * delegate.cs (Populate): Take TypeContainer argument.
27148 Implement bits to define the Invoke method. However, I still haven't figured out
27149 how to take care of the native int bit :-(
27151 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
27152 Qualify the name of the delegate, not its return type !
27154 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
27157 (StandardConversionExists): Checking for array types turns out to be recursive.
27159 (ConvertReferenceExplicit): Implement array conversion.
27161 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
27163 2001-10-12 Ravi Pratap <ravi@ximian.com>
27165 * cs-parser.jay (delegate_declaration): Store the fully qualified
27166 name as it is a type declaration.
27168 * delegate.cs (ReturnType, Name): Rename members to these. Make them
27171 (DefineDelegate): Renamed from Define. Does the same thing essentially,
27172 as TypeContainer::DefineType.
27174 (Populate): Method in which all the definition of the various methods (Invoke)
27177 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
27180 (CloseDelegate): Finally creates the delegate.
27182 * class.cs (TypeContainer::DefineType): Update to define delegates.
27183 (Populate, Emit and CloseType): Do the same thing here too.
27185 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
27186 delegates in all these operations.
27188 2001-10-14 Miguel de Icaza <miguel@ximian.com>
27190 * expression.cs: LocalTemporary: a new expression used to
27191 reference a temporary that has been created.
27193 * assign.cs: Handle PropertyAccess back here, so that we can
27194 provide the proper semantic access to properties.
27196 * expression.cs (Expression::ConvertReferenceExplicit): Implement
27197 a few more explicit conversions.
27199 * modifiers.cs: `NEW' modifier maps to HideBySig.
27201 * expression.cs (PropertyExpr): Make this into an
27202 ExpressionStatement, and support the EmitStatement code path.
27204 Perform get/set error checking, clean up the interface.
27206 * assign.cs: recognize PropertyExprs as targets, and if so, turn
27207 them into toplevel access objects.
27209 2001-10-12 Miguel de Icaza <miguel@ximian.com>
27211 * expression.cs: PropertyExpr::PropertyExpr: use work around the
27214 * typemanager.cs: Keep track here of our PropertyBuilders again to
27215 work around lameness in SRE.
27217 2001-10-11 Miguel de Icaza <miguel@ximian.com>
27219 * expression.cs (LValue::LValueResolve): New method in the
27220 interface, used to perform a second resolution pass for LValues.
27222 (This::DoResolve): Catch the use of this in static methods.
27224 (This::LValueResolve): Implement.
27226 (This::Store): Remove warning, assigning to `this' in structures
27229 (Invocation::Emit): Deal with invocation of
27230 methods on value types. We need to pass the address to structure
27231 methods rather than the object itself. (The equivalent code to
27232 emit "this" for structures leaves the entire structure on the
27233 stack instead of a pointer to it).
27235 (ParameterReference::DoResolve): Compute the real index for the
27236 argument based on whether the method takes or not a `this' pointer
27237 (ie, the method is static).
27239 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
27240 value types returned from functions when we need to invoke a
27241 method on the sturcture.
27244 2001-10-11 Ravi Pratap <ravi@ximian.com>
27246 * class.cs (TypeContainer::DefineType): Method to actually do the business of
27247 defining the type in the Modulebuilder or Typebuilder. This is to take
27248 care of nested types which need to be defined on the TypeBuilder using
27249 DefineNestedMethod.
27251 (TypeContainer::GetClassBases): Implement. Essentially the code from the
27252 methods in RootContext, only ported to be part of TypeContainer.
27254 (TypeContainer::GetInterfaceOrClass): Ditto.
27256 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
27258 * interface.cs (Interface::DefineInterface): New method. Does exactly
27259 what RootContext.CreateInterface did earlier, only it takes care of nested types
27262 (Interface::GetInterfaces): Move from RootContext here and port.
27264 (Interface::GetInterfaceByName): Same here.
27266 * rootcontext.cs (ResolveTree): Re-write.
27268 (PopulateTypes): Re-write.
27270 * class.cs (TypeContainer::Populate): Populate nested types too.
27271 (TypeContainer::Emit): Emit nested members too.
27273 * typemanager.cs (AddUserType): Do not make use of the FullName property,
27274 instead just use the name argument passed in as it is already fully
27277 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
27278 to TypeContainer mapping to see if a type is user-defined.
27280 * class.cs (TypeContainer::CloseType): Implement.
27282 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
27283 the default constructor.
27285 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
27288 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
27290 * interface.cs (CloseType): Create the type here.
27292 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
27295 Remove all the methods which are now in TypeContainer.
27297 2001-10-10 Ravi Pratap <ravi@ximian.com>
27299 * delegate.cs (Define): Re-write bits to define the delegate
27302 2001-10-10 Miguel de Icaza <miguel@ximian.com>
27304 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
27306 * expression.cs (ImplicitReferenceConversion): handle null as well
27307 as a source to convert to any reference type.
27309 * statement.cs (Return): Perform any implicit conversions to
27310 expected return type.
27312 Validate use of return statement.
27314 * codegen.cs (EmitContext): Pass the expected return type here.
27316 * class.cs (Method, Constructor, Property): Pass expected return
27317 type to EmitContext.
27319 2001-10-09 Miguel de Icaza <miguel@ximian.com>
27321 * expression.cs: Make DoResolve take an EmitContext instead of a
27324 Replaced `l' and `location' for `loc', for consistency.
27326 (Error, Warning): Remove unneeded Tc argument.
27328 * assign.cs, literal.cs, constant.cs: Update to new calling
27331 * codegen.cs: EmitContext now contains a flag indicating whether
27332 code is being generated in a static method or not.
27334 * cs-parser.jay: DecomposeQI, new function that replaces the old
27335 QualifiedIdentifier. Now we always decompose the assembled
27336 strings from qualified_identifier productions into a group of
27339 2001-10-08 Miguel de Icaza <miguel@ximian.com>
27341 * rootcontext.cs: Deal with field-less struct types correctly now
27342 by passing the size option to Define Type.
27344 * class.cs: Removed hack that created one static field.
27346 2001-10-07 Miguel de Icaza <miguel@ximian.com>
27348 * statement.cs: Moved most of the code generation here.
27350 2001-10-09 Ravi Pratap <ravi@ximian.com>
27352 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
27355 (ElementAccess): Remove useless bits for now - keep checks as the spec
27358 2001-10-08 Ravi Pratap <ravi@ximian.com>
27360 * expression.cs (ElementAccess::DoResolve): Remove my crap code
27361 and start performing checks according to the spec.
27363 2001-10-07 Ravi Pratap <ravi@ximian.com>
27365 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
27366 rank_specifiers instead.
27368 (rank_specifiers): Change the order in which the rank specifiers are stored
27370 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
27372 * expression.cs (ElementAccess): Implement the LValue interface too.
27374 2001-10-06 Ravi Pratap <ravi@ximian.com>
27376 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
27377 except that user defined conversions are not included.
27379 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
27380 perform the conversion of the return type, if necessary.
27382 (New::DoResolve): Check whether we are creating an array or an object
27383 and accordingly do the needful.
27385 (New::Emit): Same here.
27387 (New::DoResolve): Implement guts of array creation.
27389 (New::FormLookupType): Helper function.
27391 2001-10-07 Miguel de Icaza <miguel@ximian.com>
27393 * codegen.cs: Removed most of the code generation here, and move the
27394 corresponding code generation bits to the statement classes.
27396 Added support for try/catch/finalize and throw.
27398 * cs-parser.jay: Added support for try/catch/finalize.
27400 * class.cs: Catch static methods having the flags override,
27401 virtual or abstract.
27403 * expression.cs (UserCast): This user cast was not really doing
27404 what it was supposed to do. Which is to be born in fully resolved
27405 state. Parts of the resolution were being performed at Emit time!
27409 2001-10-05 Miguel de Icaza <miguel@ximian.com>
27411 * expression.cs: Implicity convert the result from UserCast.
27413 2001-10-05 Ravi Pratap <ravi@ximian.com>
27415 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
27416 prevented it from working correctly.
27418 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
27419 merely ConvertImplicit.
27421 2001-10-05 Miguel de Icaza <miguel@ximian.com>
27423 * typemanager.cs: Make the LookupTypeContainer function static,
27424 and not per-instance.
27426 * class.cs: Make static FindMembers (the one that takes a Type
27429 * codegen.cs: Add EmitForeach here.
27431 * cs-parser.jay: Make foreach a toplevel object instead of the
27432 inline expansion, as we need to perform semantic analysis on it.
27434 2001-10-05 Ravi Pratap <ravi@ximian.com>
27436 * expression.cs (Expression::ImplicitUserConversion): Rename to
27437 UserDefinedConversion.
27439 (Expression::UserDefinedConversion): Take an extra argument specifying
27440 whether we look for explicit user conversions too.
27442 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
27444 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
27446 (ExplicitUserConversion): Make it a call to UserDefinedConversion
27447 with the appropriate arguments.
27449 * cs-parser.jay (cast_expression): Record location too.
27451 * expression.cs (Cast): Record location info.
27453 (Expression::ConvertExplicit): Take location argument.
27455 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
27456 to determine if we are doing explicit conversions.
27458 (UserCast::Emit): Update accordingly.
27460 (Expression::ConvertExplicit): Report an error if everything fails.
27462 * ../errors/cs0030.cs : Add.
27464 2001-10-04 Miguel de Icaza <miguel@ximian.com>
27466 * modifiers.cs: If the ABSTRACT keyword is present, also set the
27467 virtual and newslot bits.
27469 * class.cs (TypeContainer::RegisterRequiredImplementations):
27470 Record methods we need.
27472 (TypeContainer::MakeKey): Helper function to make keys for
27473 MethodBases, since the Methodbase key is useless.
27475 (TypeContainer::Populate): Call RegisterRequiredImplementations
27476 before defining the methods.
27478 Create a mapping for method_builders_to_methods ahead of time
27479 instead of inside a tight loop.
27481 (::RequireMethods): Accept an object as the data to set into the
27482 hashtable so we can report interface vs abstract method mismatch.
27484 2001-10-03 Miguel de Icaza <miguel@ximian.com>
27486 * report.cs: Make all of it static.
27488 * rootcontext.cs: Drop object_type and value_type computations, as
27489 we have those in the TypeManager anyways.
27491 Drop report instance variable too, now it is a global.
27493 * driver.cs: Use try/catch on command line handling.
27495 Add --probe option to debug the error reporting system with a test
27498 * report.cs: Add support for exiting program when a probe
27499 condition is reached.
27501 2001-10-03 Ravi Pratap <ravi@ximian.com>
27503 * expression.cs (Binary::DoNumericPromotions): Fix the case when
27504 we do a forcible conversion regardless of type, to check if
27505 ForceConversion returns a null.
27507 (Binary::error19): Use location to report error.
27509 (Unary::error23): Use location here too.
27511 * ../errors/cs0019.cs : Check in.
27513 * ../errors/cs0023.cs : Check in.
27515 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
27516 case of a non-null MethodInfo object with a length of 0 !
27518 (Binary::ResolveOperator): Flag error if overload resolution fails to find
27519 an applicable member - according to the spec :-)
27520 Also fix logic to find members in base types.
27522 (Unary::ResolveOperator): Same here.
27524 (Unary::report23): Change name to error23 and make first argument a TypeContainer
27525 as I was getting thoroughly confused between this and error19 :-)
27527 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
27528 (::FindMostEncompassedType): Implement.
27529 (::FindMostEncompassingType): Implement.
27530 (::StandardConversionExists): Implement.
27532 (UserImplicitCast): Re-vamp. We now need info about most specific
27533 source and target types so that we can do the necessary conversions.
27535 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
27536 mathematical union with no duplicates.
27538 2001-10-03 Miguel de Icaza <miguel@ximian.com>
27540 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
27541 in order from base classes to child classes, so that we can in
27542 child classes look up in our parent for method names and
27543 attributes (required for handling abstract, virtual, new, override
27544 constructs: we need to instrospect our base class, and if we dont
27545 populate the classes in order, the introspection might be
27546 incorrect. For example, a method could query its parent before
27547 the parent has any methods and would determine that the parent has
27548 no abstract methods (while it could have had them)).
27550 (RootContext::CreateType): Record the order in which we define the
27553 2001-10-02 Miguel de Icaza <miguel@ximian.com>
27555 * class.cs (TypeContainer::Populate): Also method definitions can
27556 fail now, keep track of this.
27558 (TypeContainer::FindMembers): Implement support for
27559 DeclaredOnly/noDeclaredOnly flag.
27561 (Constructor::Emit) Return the ConstructorBuilder.
27563 (Method::Emit) Return the MethodBuilder.
27564 Check for abstract or virtual methods to be public.
27566 * rootcontext.cs (RootContext::CreateType): Register all the
27567 abstract methods required for the class to be complete and the
27568 interface methods that must be implemented.
27570 * cs-parser.jay: Report error 501 (method requires body if it is
27571 not marked abstract or extern).
27573 * expression.cs (TypeOf::Emit): Implement.
27575 * typemanager.cs: runtime_handle_type, new global type.
27577 * class.cs (Property::Emit): Generate code for properties.
27579 2001-10-02 Ravi Pratap <ravi@ximian.com>
27581 * expression.cs (Unary::ResolveOperator): Find operators on base type
27582 too - we now conform exactly to the spec.
27584 (Binary::ResolveOperator): Same here.
27586 * class.cs (Operator::Define): Fix minor quirk in the tests.
27588 * ../errors/cs0215.cs : Added.
27590 * ../errors/cs0556.cs : Added.
27592 * ../errors/cs0555.cs : Added.
27594 2001-10-01 Miguel de Icaza <miguel@ximian.com>
27596 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
27597 single integer which is really efficient
27599 2001-10-01 Ravi Pratap <ravi@ximian.com>
27601 * expression.cs (Expression::ImplicitUserConversion): Use location
27602 even in the case when we are examining True operators.
27604 * class.cs (Operator::Define): Perform extensive checks to conform
27605 with the rules for operator overloading in the spec.
27607 * expression.cs (Expression::ImplicitReferenceConversion): Implement
27608 some of the other conversions mentioned in the spec.
27610 * typemanager.cs (array_type): New static member for the System.Array built-in
27613 (cloneable_interface): For System.ICloneable interface.
27615 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
27616 we start resolving the tree and populating types.
27618 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
27620 2001-10-01 Miguel de Icaza <miguel@ximian.com>
27622 * expression.cs (Expression::ExprClassFromMemberInfo,
27623 Expression::Literalize): Create literal expressions from
27624 FieldInfos which are literals.
27626 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
27627 type casts, because they were wrong. The test suite in tests
27630 (ImplicitNumericConversion): ushort to ulong requires a widening
27633 Int32 constant to long requires widening cast as well.
27635 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
27636 for integers because the type on the stack is not i4.
27638 2001-09-30 Miguel de Icaza <miguel@ximian.com>
27640 * expression.cs (report118): require location argument.
27642 * parameter.cs: Do not dereference potential null value.
27644 * class.cs: Catch methods that lack the `new' keyword when
27645 overriding a name. Report warnings when `new' is used without
27646 anything being there to override.
27648 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
27650 * class.cs: Only add constructor to hashtable if it is non-null
27651 (as now constructors can fail on define).
27653 (TypeManager, Class, Struct): Take location arguments.
27655 Catch field instance initialization in structs as errors.
27657 accepting_filter: a new filter for FindMembers that is static so
27658 that we dont create an instance per invocation.
27660 (Constructor::Define): Catch errors where a struct constructor is
27663 * cs-parser.jay: Pass location information for various new
27666 * delegate.cs (Delegate): take a location argument.
27668 * driver.cs: Do not call EmitCode if there were problesm in the
27669 Definition of the types, as many Builders wont be there.
27671 * decl.cs (Decl::Decl): Require a location argument.
27673 * cs-tokenizer.cs: Handle properly hex constants that can not fit
27674 into integers, and find the most appropiate integer for it.
27676 * literal.cs: Implement ULongLiteral.
27678 * rootcontext.cs: Provide better information about the location of
27679 failure when CreateType fails.
27681 2001-09-29 Miguel de Icaza <miguel@ximian.com>
27683 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
27686 * expression.cs (Binary::CheckShiftArguments): Add missing type
27688 (Binary::ResolveOperator): Add type to the logical and and logical
27689 or, Bitwise And/Or and Exclusive Or code paths, it was missing
27692 (Binary::DoNumericPromotions): In the case where either argument
27693 is ulong (and most signed types combined with ulong cause an
27694 error) perform implicit integer constant conversions as well.
27696 2001-09-28 Miguel de Icaza <miguel@ximian.com>
27698 * expression.cs (UserImplicitCast): Method should always be
27700 (Invocation::BetterConversion): Simplified test for IntLiteral.
27702 (Expression::ImplicitNumericConversion): Split this routine out.
27703 Put the code that performs implicit constant integer conversions
27706 (Expression::Resolve): Become a wrapper around DoResolve so we can
27707 check eclass and type being set after resolve.
27709 (Invocation::Badness): Remove this dead function
27711 (Binary::ResolveOperator): Do not compute the expensive argumnets
27712 unless we have a union for it.
27714 (Probe::Emit): Is needs to do an isinst and then
27715 compare against null.
27717 (::CanConvert): Added Location argument. If the Location argument
27718 is null (Location.Null), then we do not report errors. This is
27719 used by the `probe' mechanism of the Explicit conversion. We do
27720 not want to generate an error for something that the user
27721 explicitly requested to be casted. But the pipeline for an
27722 explicit cast first tests for potential implicit casts.
27724 So for now, if the Location is null, it means `Probe only' to
27725 avoid adding another argument. Might have to revise this
27728 (ClassCast): New class used to type cast objects into arbitrary
27729 classes (used in Explicit Reference Conversions).
27731 Implement `as' as well.
27733 Reverted all the patches from Ravi below: they were broken:
27735 * The use of `level' as a mechanism to stop recursive
27736 invocations is wrong. That was there just to catch the
27737 bug with a strack trace but not as a way of addressing
27740 To fix the problem we have to *understand* what is going
27741 on and the interactions and come up with a plan, not
27742 just get things going.
27744 * The use of the type conversion cache that I proposed
27745 last night had an open topic: How does this work across
27746 protection domains. A user defined conversion might not
27747 be public in the location where we are applying the
27748 conversion, a different conversion might be selected
27749 (ie, private A->B (better) but public B->A (worse),
27750 inside A, A->B applies, but outside it, B->A will
27753 * On top of that (ie, even if the above is solved),
27754 conversions in a cache need to be abstract. Ie, `To
27755 convert from an Int to a Short use an OpcodeCast', not
27756 `To convert from an Int to a Short use the OpcodeCast on
27757 the variable 5' (which is what this patch was doing).
27759 2001-09-28 Ravi Pratap <ravi@ximian.com>
27761 * expression.cs (Invocation::ConversionExists): Re-write to use
27762 the conversion cache
27764 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
27765 cache all conversions done, not just user-defined ones.
27767 (Invocation::BetterConversion): The real culprit. Use ConversionExists
27768 to determine if a conversion exists instead of acutually trying to
27769 perform the conversion. It's faster too.
27771 (Expression::ConvertExplicit): Modify to use ConversionExists to check
27772 and only then attempt the implicit conversion.
27774 2001-09-28 Ravi Pratap <ravi@ximian.com>
27776 * expression.cs (ConvertImplicit): Use a cache for conversions
27777 already found. Check level of recursion and bail out if necessary.
27779 2001-09-28 Miguel de Icaza <miguel@ximian.com>
27781 * typemanager.cs (string_concat_string_string, string_concat_object_object):
27782 Export standard methods that we expect for string operations.
27784 * statement.cs (Block::UsageWarning): Track usage of variables and
27785 report the errors for not used variables.
27787 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
27790 2001-09-27 Miguel de Icaza <miguel@ximian.com>
27792 * codegen.cs: remove unnneded code
27794 * expression.cs: Removed BuiltinTypeAccess class
27796 Fix the order in which implicit conversions are
27799 The previous fixed dropped support for boxed conversions (adding a
27800 test to the test suite now)
27802 (UserImplicitCast::CanConvert): Remove test for source being null,
27803 that code is broken. We should not feed a null to begin with, if
27804 we do, then we should track the bug where the problem originates
27805 and not try to cover it up here.
27807 Return a resolved expression of type UserImplicitCast on success
27808 rather than true/false. Ravi: this is what I was talking about,
27809 the pattern is to use a static method as a "constructor" for
27812 Also, do not create arguments until the very last minute,
27813 otherwise we always create the arguments even for lookups that
27814 will never be performed.
27816 (UserImplicitCast::Resolve): Eliminate, objects of type
27817 UserImplicitCast are born in a fully resolved state.
27819 * typemanager.cs (InitCoreTypes): Init also value_type
27820 (System.ValueType).
27822 * expression.cs (Cast::Resolve): First resolve the child expression.
27824 (LValue): Add new method AddressOf to be used by
27827 Change the argument of Store to take an EmitContext instead of an
27828 ILGenerator, because things like FieldExpr need to be able to call
27829 their children expression to generate the instance code.
27831 (Expression::Error, Expression::Warning): Sugar functions for
27834 (Expression::MemberLookup): Accept a TypeContainer instead of a
27835 Report as the first argument.
27837 (Expression::ResolvePrimary): Killed. I still want to improve
27838 this as currently the code is just not right.
27840 (Expression::ResolveMemberAccess): Simplify, but it is still
27843 (Unary::Resolve): Catch errors in AddressOf operators.
27845 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
27846 index to a byte for the short-version, or the compiler will choose
27847 the wrong Emit call, which generates the wrong data.
27849 (ParameterReference::Emit, ::Store): same.
27851 (FieldExpr::AddressOf): Implement.
27853 * typemanager.cs: TypeManager: made public variable instead of
27856 * driver.cs: document --fatal.
27858 * report.cs (ErrorMessage, WarningMessage): new names for the old
27859 Error and Warning classes.
27861 * cs-parser.jay (member_access): Turn built-in access to types
27862 into a normal simplename
27864 2001-09-27 Ravi Pratap <ravi@ximian.com>
27866 * expression.cs (Invocation::BetterConversion): Fix to cope
27867 with q being null, since this was introducing a bug.
27869 * expression.cs (ConvertImplicit): Do built-in conversions first.
27871 2001-09-27 Ravi Pratap <ravi@ximian.com>
27873 * expression.cs (UserImplicitCast::Resolve): Fix bug.
27875 2001-09-27 Ravi Pratap <ravi@ximian.com>
27877 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
27878 I had introduced long ago (what's new ?).
27880 * expression.cs (UserImplicitCast::CanConvert): Static method to do
27881 the work of all the checking.
27882 (ConvertImplicit): Call CanConvert and only then create object if necessary.
27883 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
27885 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
27886 that is the right way.
27888 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
27889 overloading resolution. Use everywhere instead of cutting and pasting code.
27891 (Binary::ResolveOperator): Use MakeUnionSet.
27893 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
27894 we have to convert to bool types. Not complete yet.
27896 2001-09-27 Miguel de Icaza <miguel@ximian.com>
27898 * typemanager.cs (TypeManager::CSharpName): support ushort.
27900 * expression.cs (Expression::TryImplicitIntConversion): Attempts
27901 to provide an expression that performsn an implicit constant int
27902 conversion (section 6.1.6).
27903 (Expression::ConvertImplicitRequired): Reworked to include
27904 implicit constant expression conversions.
27906 (Expression::ConvertNumericExplicit): Finished.
27908 (Invocation::Emit): If InstanceExpression is null, then it means
27909 that we perform a call on this.
27911 2001-09-26 Miguel de Icaza <miguel@ximian.com>
27913 * expression.cs (Unary::Emit): Remove some dead code.
27914 (Probe): Implement Resolve and Emit for `is'.
27915 (Expression::ConvertImplicitRequired): Attempt to do constant
27916 expression conversions here. Maybe should be moved to
27917 ConvertImplicit, but I am not sure.
27918 (Expression::ImplicitLongConstantConversionPossible,
27919 Expression::ImplicitIntConstantConversionPossible): New functions
27920 that tell whether is it possible to apply an implicit constant
27921 expression conversion.
27923 (ConvertNumericExplicit): Started work on explicit numeric
27926 * cs-parser.jay: Update operator constants.
27928 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
27929 (Parameters::GetSignature): Hook up VerifyArgs here.
27930 (Parameters::VerifyArgs): Verifies that no two arguments have the
27933 * class.cs (Operator): Update the operator names to reflect the
27934 ones that the spec expects (as we are just stringizing the
27937 * expression.cs (Unary::ResolveOperator): Fix bug: Use
27938 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
27939 previous usage did only work for our methods.
27940 (Expression::ConvertImplicit): Handle decimal implicit numeric
27941 conversions as well.
27942 (Expression::InternalTypeConstructor): Used to invoke constructors
27943 on internal types for default promotions.
27945 (Unary::Emit): Implement special handling for the pre/post
27946 increment/decrement for overloaded operators, as they need to have
27947 the same semantics as the other operators.
27949 (Binary::ResolveOperator): ditto.
27950 (Invocation::ConversionExists): ditto.
27951 (UserImplicitCast::Resolve): ditto.
27953 2001-09-26 Ravi Pratap <ravi@ximian.com>
27955 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
27956 operator, return after emitting body. Regression tests pass again !
27958 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
27959 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
27960 (Invocation::OverloadResolve): Ditto.
27961 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
27963 * everywhere : update calls to the above methods accordingly.
27965 2001-09-26 Miguel de Icaza <miguel@ximian.com>
27967 * assign.cs (Assign): Make it inherit from ExpressionStatement.
27969 * expression.cs (ExpressionStatement): New base class used for
27970 expressions that can appear in statements, so that we can provide
27971 an alternate path to generate expression that do not leave a value
27974 (Expression::Emit, and all the derivatives): We no longer return
27975 whether a value is left on the stack or not. Every expression
27976 after being emitted leaves a single value on the stack.
27978 * codegen.cs (EmitContext::EmitStatementExpression): Use the
27979 facilties of ExpressionStatement if possible.
27981 * cs-parser.jay: Update statement_expression.
27983 2001-09-25 Miguel de Icaza <miguel@ximian.com>
27985 * driver.cs: Change the wording of message
27987 2001-09-25 Ravi Pratap <ravi@ximian.com>
27989 * expression.cs (Binary::ResolveOperator): Had forgottten to set
27990 the type of the expression to the return type of the method if
27991 we have an overloaded operator match ! The regression tests pass again !
27992 (Unary::ResolveOperator): Ditto.
27994 * expression.cs (Invocation::ConversionExists): Correct the member lookup
27995 to find "op_Implicit", not "implicit" ;-)
27996 (UserImplicitCast): New class to take care of user-defined implicit conversions.
27997 (ConvertImplicit, ForceConversion): Take TypeContainer argument
27999 * everywhere : Correct calls to the above accordingly.
28001 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
28002 (ConvertImplicit): Do user-defined conversion if it exists.
28004 2001-09-24 Miguel de Icaza <miguel@ximian.com>
28006 * assign.cs: track location.
28007 (Resolve): Use implicit conversions on assignment.
28009 * literal.cs: Oops. Not good, Emit of short access values should
28010 pass (Bytes) or the wrong argument will be selected.
28012 * expression.cs (Unary::Emit): Emit code for -expr.
28014 (Unary::ResolveOperator): Handle `Substract' for non-constants
28015 (substract from zero from the non-constants).
28016 Deal with Doubles as well.
28018 (Expression::ConvertImplicitRequired): New routine that reports an
28019 error if no implicit conversion exists.
28021 (Invocation::OverloadResolve): Store the converted implicit
28022 expressions if we make them
28024 2001-09-24 Ravi Pratap <ravi@ximian.com>
28026 * class.cs (ConstructorInitializer): Take a Location argument.
28027 (ConstructorBaseInitializer): Same here.
28028 (ConstructorThisInitializer): Same here.
28030 * cs-parser.jay : Update all calls accordingly.
28032 * expression.cs (Unary, Binary, New): Take location argument.
28033 Update accordingly everywhere.
28035 * cs-parser.jay : Update all calls to the above to take a location
28038 * class.cs : Ditto.
28040 2001-09-24 Ravi Pratap <ravi@ximian.com>
28042 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
28043 (Invocation::BetterConversion): Same here
28044 (Invocation::ConversionExists): Ditto.
28046 (Invocation::ConversionExists): Implement.
28048 2001-09-22 Ravi Pratap <ravi@ximian.com>
28050 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
28051 Also take an additional TypeContainer argument.
28053 * All over : Pass in TypeContainer as argument to OverloadResolve.
28055 * typemanager.cs (CSharpName): Update to check for the string type and return
28058 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
28061 2001-09-21 Ravi Pratap <ravi@ximian.com>
28063 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
28064 (Invocation::BetterFunction): Implement.
28065 (Invocation::BetterConversion): Implement.
28066 (Invocation::ConversionExists): Skeleton, no implementation yet.
28068 Okay, things work fine !
28070 2001-09-21 Miguel de Icaza <miguel@ximian.com>
28072 * typemanager.cs: declare and load enum_type, delegate_type and
28075 * expression.cs (Expression::Emit): Now emit returns a value that
28076 tells whether a value is left on the stack or not. This strategy
28077 might be reveted tomorrow with a mechanism that would address
28078 multiple assignments.
28079 (Expression::report118): Utility routine to report mismatches on
28082 (Unary::Report23): Report impossible type/operator combination
28085 (Unary::IsIncrementableNumber): Whether the type can be
28086 incremented or decremented with add.
28087 (Unary::ResolveOperator): Also allow enumerations to be bitwise
28089 (Unary::ResolveOperator): Implement ++, !, ~,
28091 (Invocation::Emit): Deal with new Emit convetion.
28093 * All Expression derivatives: Updated their Emit method to return
28094 whether they leave values on the stack or not.
28096 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
28097 stack for expressions that are statements.
28099 2001-09-20 Miguel de Icaza <miguel@ximian.com>
28101 * expression.cs (LValue): New interface. Must be implemented by
28103 (LocalVariableReference, ParameterReference, FieldExpr): Implement
28106 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
28107 interface for generating code, simplifies the code.
28109 2001-09-20 Ravi Pratap <ravi@ximian.com>
28111 * expression.cs (everywhere): Comment out return statements in ::Resolve
28112 methods to avoid the warnings.
28114 2001-09-20 Miguel de Icaza <miguel@ximian.com>
28116 * driver.cs (parse): Report error 2001 if we can not open the
28119 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
28122 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
28125 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
28126 otherwise nested blocks end up with the same index.
28128 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
28130 * expression.cs: Instead of having FIXMEs in the Resolve
28131 functions, throw exceptions so it is obvious that we are facing a
28134 * cs-parser.jay (invocation_expression): Pass Location information.
28136 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
28137 Use a basename for those routines because .NET does not like paths
28140 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
28143 2001-09-19 Miguel de Icaza <miguel@ximian.com>
28145 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
28146 are loading the correct data types (throws an exception if not).
28147 (TypeManager::InitCoreTypes): Use CoreLookupType
28149 * expression.cs (Unary::ResolveOperator): return the child
28150 expression for expressions which are just +expr.
28151 (Unary::ResolveOperator): Return negative literals for -LITERAL
28152 expressions (otherwise they are Unary {Literal}).
28153 (Invocation::Badness): Take into account `Implicit constant
28154 expression conversions'.
28156 * literal.cs (LongLiteral): Implement long literal class.
28157 (IntLiteral): export the `Value' of the intliteral.
28159 2001-09-19 Ravi Pratap <ravi@ximian.com>
28161 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
28163 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
28164 instead of 'Operator'
28166 * expression.cs (Binary::ResolveOperator): Update accordingly.
28167 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
28170 * cs-parser.jay (unary_expression): Update to use the new names.
28172 * gen-treedump.cs (GetUnary): Same here.
28174 * expression.cs (Unary::Resolve): Implement.
28175 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
28176 operators are found instead of making noise ;-)
28177 (Unary::ResolveOperator): New method to do precisely the same thing which
28178 Binary::ResolveOperator does for Binary expressions.
28179 (Unary.method, .Arguments): Add.
28180 (Unary::OperName): Implement.
28181 (Unary::ForceConversion): Copy and Paste !
28183 * class.cs (Operator::Define): Fix a small bug for the case when we have
28186 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
28187 for the inbuilt operators. Only overloading works for now ;-)
28189 2001-09-18 Miguel de Icaza <miguel@ximian.com>
28191 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
28192 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
28194 * expression.cs (This::Emit): Implement.
28195 (This::Resolve): Implement.
28196 (TypeOf:Resolve): Implement.
28197 (Expression::ResolveSimpleName): Add an implicit this to instance
28199 (MemberAccess::Resolve): Deal with Parameters and Fields.
28200 Bind instance variable to Field expressions.
28201 (FieldExpr::Instance): New field used to track the expression that
28202 represents the object instance.
28203 (FieldExpr::Resolve): Track potential errors from MemberLookup not
28205 (FieldExpr::Emit): Implement.
28207 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
28208 the last instruction contains a return opcode to avoid generating
28209 the last `ret' instruction (this generates correct code, and it is
28210 nice to pass the peverify output).
28212 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
28213 initializer for static and instance variables.
28214 (Constructor::Emit): Allow initializer to be null in the case of
28215 static constructors. Only emit initializer for instance
28218 (TypeContainer::FindMembers): Return a null array if there are no
28221 Also fix the code for the MemberTypes.Method branch, as it was not
28222 scanning that for operators (or tried to access null variables before).
28224 * assign.cs (Assign::Emit): Handle instance and static fields.
28228 * driver.cs: Stop compilation if there are parse errors.
28230 * cs-parser.jay (constructor_declaration): Provide default base
28231 initializer for non-static constructors.
28232 (constructor_declarator): Do not provide a default base
28233 initializers if none was specified.
28234 Catch the fact that constructors should not have parameters.
28236 * class.cs: Do not emit parent class initializers for static
28237 constructors, that should be flagged as an error.
28239 2001-09-18 Ravi Pratap <ravi@ximian.com>
28241 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
28242 Move back code into TypeContainer::Populate.
28244 2001-09-18 Ravi Pratap <ravi@ximian.com>
28246 * class.cs (TypeContainer::AddConstructor): Fix the check to
28247 compare against Name, not Basename.
28248 (Operator::OpType): Change Plus and Minus to Add and Subtract.
28250 * cs-parser.jay : Update accordingly.
28252 * class.cs (TypeContainer::FindMembers): For the case where we are searching
28253 for methods, don't forget to look into the operators too.
28254 (RegisterMethodBuilder): Helper method to take care of this for
28255 methods, constructors and operators.
28256 (Operator::Define): Completely revamp.
28257 (Operator.OperatorMethod, MethodName): New fields.
28258 (TypeContainer::Populate): Move the registering of builders into
28259 RegisterMethodBuilder.
28260 (Operator::Emit): Re-write.
28262 * expression.cs (Binary::Emit): Comment out code path to emit method
28263 invocation stuff for the case when we have a user defined operator. I am
28264 just not able to get it right !
28266 2001-09-17 Miguel de Icaza <miguel@ximian.com>
28268 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
28271 (Expression::MemberLookup): Provide a version that allows to
28272 specify the MemberTypes and BindingFlags.
28274 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
28275 so it was not fetching variable information from outer blocks.
28277 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
28278 Beforefieldinit as it was buggy.
28280 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
28281 that Ravi put here.
28283 * class.cs (Constructor::Emit): Only emit if block is not null.
28284 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
28285 deal with this by semantically definining it as if the user had
28288 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
28289 constructors as we now "emit" them at a higher level.
28291 (TypeContainer::DefineDefaultConstructor): Used to define the
28292 default constructors if none was provided.
28294 (ConstructorInitializer): Add methods Resolve and Emit.
28296 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
28298 2001-09-17 Ravi Pratap <ravi@ximian.com>
28300 * class.cs (TypeContainer::EmitDefaultConstructor): Register
28301 the default constructor builder with our hashtable for methodbuilders
28304 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
28305 and argument_count is 0 in which case we have a match.
28306 (Binary::ResolveOperator): More null checking and miscellaneous coding
28309 2001-09-17 Ravi Pratap <ravi@ximian.com>
28311 * rootcontext.cs (IsNameSpace): Compare against null.
28313 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
28315 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
28316 and Unary::Operator.
28318 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
28321 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
28322 we have overloaded operators.
28323 (Binary::ResolveOperator): Implement the part which does the operator overload
28326 * class.cs (Operator::Emit): Implement.
28327 (TypeContainer::Emit): Emit the operators we have too.
28329 * expression.cs (Binary::Emit): Update to emit the appropriate code for
28330 the case when we have a user-defined operator.
28332 2001-09-17 Miguel de Icaza <miguel@ximian.com>
28334 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
28336 2001-09-16 Ravi Pratap <ravi@ximian.com>
28338 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
28339 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
28340 (Constructor::Emit): Implement.
28341 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
28342 if we have no work to do.
28343 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
28346 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
28347 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
28349 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
28352 2001-09-15 Ravi Pratap <ravi@ximian.com>
28354 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
28356 (Tree::RecordNamespace): Method to do what the name says ;-)
28357 (Tree::Namespaces): Property to get at the namespaces hashtable.
28359 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
28362 * rootcontext.cs (IsNamespace): Fixed it :-)
28364 2001-09-14 Miguel de Icaza <miguel@ximian.com>
28366 * class.cs (TypeContainer::FindMembers): Add support for
28368 (MethodCore): New class that encapsulates both the shared aspects
28369 of a Constructor and a Method.
28370 (Method, Constructor): Factored pieces into MethodCore.
28372 * driver.cs: Added --fatal which makes errors throw exceptions.
28373 Load System assembly as well as part of the standard library.
28375 * report.cs: Allow throwing exceptions on errors for debugging.
28377 * modifiers.cs: Do not use `parent', instead use the real type
28378 container to evaluate permission settings.
28380 * class.cs: Put Ravi's patch back in. He is right, and we will
28381 have to cope with the
28383 2001-09-14 Ravi Pratap <ravi@ximian.com>
28385 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
28386 FamORAssem, not FamANDAssem.
28388 2001-09-14 Miguel de Icaza <miguel@ximian.com>
28390 * driver.cs: Added --parse option that only parses its input files
28393 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
28394 incorrect. IsTopLevel is not used to tell whether an object is
28395 root_types or not (that can be achieved by testing this ==
28396 root_types). But to see if this is a top-level *class* (not
28397 necessarly our "toplevel" container).
28399 2001-09-14 Ravi Pratap <ravi@ximian.com>
28401 * enum.cs (Enum::Define): Modify to call the Lookup method on the
28402 parent instead of a direct call to GetType.
28404 2001-09-14 Ravi Pratap <ravi@ximian.com>
28406 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
28407 Modifiers.TypeAttr. This should just be a call to that method.
28409 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
28410 object so that we can determine if we are top-level or not.
28412 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
28415 * enum.cs (Enum::Define): Ditto.
28417 * modifiers.cs (FieldAttr): Re-write.
28419 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
28420 (TypeContainer::HaveStaticConstructor): New property to provide access
28421 to precisely that info.
28423 * modifiers.cs (MethodAttr): Re-write.
28424 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
28426 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
28427 of top-level types as claimed.
28429 2001-09-13 Miguel de Icaza <miguel@ximian.com>
28431 * expression.cs (MemberLookup): Fruitless attempt to lookup
28432 constructors. Maybe I need to emit default constructors? That
28433 might be it (currently .NET emits this for me automatically).
28434 (Invocation::OverloadResolve): Cope with Arguments == null.
28435 (Invocation::EmitArguments): new function, shared by the new
28436 constructor and us.
28437 (Invocation::Emit): Handle static and instance methods. Emit
28438 proper call instruction for virtual or non-virtual invocations.
28439 (New::Emit): Implement.
28440 (New::Resolve): Implement.
28441 (MemberAccess:Resolve): Implement.
28442 (MethodGroupExpr::InstanceExpression): used conforming to the spec
28443 to track instances.
28444 (FieldExpr::Resolve): Set type.
28446 * support.cs: Handle empty arguments.
28448 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
28449 SimpleLookup): Auxiliary routines to help parse a qualifier
28452 Update qualifier_identifier rule.
28454 * codegen.cs: Removed debugging messages.
28456 * class.cs: Make this a global thing, this acts just as a "key" to
28457 objects that we might have around.
28459 (Populate): Only initialize method_builders_to_methods once.
28461 * expression.cs (PropertyExpr): Initialize type from the
28464 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
28465 Resolve pattern. Attempt to implicitly convert value to boolean.
28468 * expression.cs: Set the type for the int32/int32 argument case.
28469 (Binary::ResolveOperator): Set the return type to boolean for
28470 comparission operators
28472 * typemanager.cs: Remove debugging print code.
28474 (Invocation::Resolve): resolve type.
28476 * class.cs: Allocate a MemberInfo of the correct size, as the code
28477 elsewhere depends on the test to reflect the correct contents.
28479 (Method::) Keep track of parameters, due to System.Reflection holes
28481 (TypeContainer::Populate): Keep track of MethodBuilders to Method
28484 (TypeContainer::FindMembers): Use ArrayList and then copy an array
28485 of the exact size and return that.
28487 (Class::LookupMethodByBuilder): New function that maps
28488 MethodBuilders to its methods. Required to locate the information
28489 on methods because System.Reflection bit us again.
28491 * support.cs: New file, contains an interface ParameterData and
28492 two implementations: ReflectionParameters and InternalParameters
28493 used to access Parameter information. We will need to grow this
28496 * expression.cs (Invocation::GetParameterData): implement a cache
28497 and a wrapper around the ParameterData creation for methods.
28498 (Invocation::OverloadResolve): Use new code.
28500 2001-09-13 Ravi Pratap <ravi@ximian.com>
28502 * class.cs (TypeContainer::EmitField): Remove and move into
28503 (Field::Define): here and modify accordingly.
28504 (Field.FieldBuilder): New member.
28505 (TypeContainer::Populate): Update accordingly.
28506 (TypeContainer::FindMembers): Implement.
28508 2001-09-13 Miguel de Icaza <miguel@ximian.com>
28510 * statement.cs: (VariableInfo::VariableType): New field to be
28511 initialized with the full type once it is resolved.
28513 2001-09-12 Miguel de Icaza <miguel@ximian.com>
28515 * parameter.cs (GetParameterInfo): Use a type cache to compute
28516 things only once, and to reuse this information
28518 * expression.cs (LocalVariableReference::Emit): Implement.
28519 (OpcodeCast::Emit): fix.
28521 (ParameterReference::Resolve): Implement.
28522 (ParameterReference::Emit): Implement.
28524 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
28525 that are expressions need to stay as Expressions.
28527 * typemanager.cs (CSharpName): Returns the C# name of a type if
28530 * expression.cs (Expression::ConvertImplicit): New function that
28531 implements implicit type conversions.
28533 (Expression::ImplicitReferenceConversion): Implements implicit
28534 reference conversions.
28536 (EmptyCast): New type for transparent casts.
28538 (OpcodeCast): New type for casts of types that are performed with
28539 a sequence of bytecodes.
28541 (BoxedCast): New type used for casting value types into reference
28542 types. Emits a box opcode.
28544 (Binary::DoNumericPromotions): Implements numeric promotions of
28545 and computation of the Binary::Type.
28547 (Binary::EmitBranchable): Optimization.
28549 (Binary::Emit): Implement code emission for expressions.
28551 * typemanager.cs (TypeManager): Added two new core types: sbyte
28554 2001-09-12 Ravi Pratap <ravi@ximian.com>
28556 * class.cs (TypeContainer::FindMembers): Method which does exactly
28557 what Type.FindMembers does, only we don't have to use reflection. No
28558 implementation yet.
28560 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
28561 typecontainer objects as we need to get at them.
28562 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
28564 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
28565 typecontainer object.
28567 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
28568 of just a Report object.
28570 2001-09-11 Ravi Pratap <ravi@ximian.com>
28572 * class.cs (Event::Define): Go back to using the prefixes "add_" and
28574 (TypeContainer::Populate): Now define the delegates of the type too.
28575 (TypeContainer.Delegates): Property to access the list of delegates defined
28578 * delegates.cs (Delegate::Define): Implement partially.
28580 * modifiers.cs (TypeAttr): Handle more flags.
28582 2001-09-11 Ravi Pratap <ravi@ximian.com>
28584 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
28586 (Operator::Define): Re-write logic to get types by using the LookupType method
28587 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
28588 (Indexer::Define): Ditto.
28589 (Event::Define): Ditto.
28590 (Property::Define): Ditto.
28592 2001-09-10 Ravi Pratap <ravi@ximian.com>
28594 * class.cs (TypeContainer::Populate): Now define operators too.
28595 (TypeContainer.Operators): New property to access the list of operators
28597 (Operator.OperatorMethodBuilder): New member to hold the method builder
28598 for the operator we are defining.
28599 (Operator::Define): Implement.
28601 2001-09-10 Ravi Pratap <ravi@ximian.com>
28603 * class.cs (Event::Define): Make the prefixes of the accessor methods
28604 addOn_ and removeOn_
28606 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
28607 of the location being passed in too. Ideally, this should go later since all
28608 error reporting should be done through the Report object.
28610 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
28611 (Populate): Iterate thru the indexers we have and define them too.
28612 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
28613 for the get and set accessors.
28614 (Indexer::Define): Implement.
28616 2001-09-09 Miguel de Icaza <miguel@ximian.com>
28618 * expression.cs (Binary::Resolve): Beginning of it. I scratched
28619 my previous implementation, did not work.
28621 * typemanager.cs: Add a couple of missing types (the longs).
28623 * literal.cs: Use TypeManager.bool_type instead of getting it.
28625 * expression.cs (EventExpr): New kind of expressions.
28626 (Expressio::ExprClassFromMemberInfo): finish
28628 2001-09-08 Miguel de Icaza <miguel@ximian.com>
28630 * assign.cs: Emit stores to static fields differently.
28632 2001-09-08 Ravi Pratap <ravi@ximian.com>
28634 * Merge in changes and adjust code to tackle conflicts. Backed out my
28635 code in Assign::Resolve ;-)
28637 2001-09-08 Ravi Pratap <ravi@ximian.com>
28639 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
28640 instead Report.Error and also pass in the location.
28641 (CSharpParser::Lexer): New readonly property to return the reference
28642 to the Tokenizer object.
28643 (declare_local_variables): Use Report.Error with location instead of plain
28647 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
28648 (Operator.CheckBinaryOperator): Ditto.
28650 * cs-parser.jay (operator_declarator): Update accordingly.
28652 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
28653 (CheckBinaryOperator): Same here.
28655 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
28656 on the name without any prefixes of namespace names etc. This is because we
28657 already might have something already fully qualified like
28658 'System.Console.WriteLine'
28660 * assign.cs (Resolve): Begin implementation. Stuck ;-)
28662 2001-09-07 Ravi Pratap <ravi@ximian.com>
28664 * cs-tokenizer.cs (location): Return a string which also contains
28667 * expression.cs (ElementAccess): New class for expressions of the
28668 type 'element access.'
28669 (BaseAccess): New class for expressions of the type 'base access.'
28670 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
28673 * cs-parser.jay (element_access): Implement action.
28674 (base_access): Implement actions.
28675 (checked_expression, unchecked_expression): Implement.
28677 * cs-parser.jay (local_variable_type): Correct and implement.
28678 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
28680 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
28682 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
28683 name and the specifiers.
28685 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
28687 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
28688 making them all public ;-)
28690 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
28693 2001-09-07 Miguel de Icaza <miguel@ximian.com>
28695 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
28697 (FieldExpr, PropertyExprs): New resolved expressions.
28698 (SimpleName::MemberStaticCheck): Perform static checks for access
28699 to non-static fields on static methods. Maybe this should be
28700 generalized for MemberAccesses.
28701 (SimpleName::ResolveSimpleName): More work on simple name
28704 * cs-parser.jay (primary_expression/qualified_identifier): track
28705 the parameter index.
28707 * codegen.cs (CodeGen::Save): Catch save exception, report error.
28708 (EmitContext::EmitBoolExpression): Chain to expression generation
28709 instead of temporary hack.
28710 (::EmitStatementExpression): Put generic expression code generation.
28712 * assign.cs (Assign::Emit): Implement variable assignments to
28713 local variables, parameters and fields.
28715 2001-09-06 Miguel de Icaza <miguel@ximian.com>
28717 * statement.cs (Block::GetVariableInfo): New method, returns the
28718 VariableInfo for a variable name in a block.
28719 (Block::GetVariableType): Implement in terms of GetVariableInfo
28721 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
28722 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
28724 2001-09-06 Ravi Pratap <ravi@ximian.com>
28726 * cs-parser.jay (operator_declaration): Continue on my quest : update
28727 to take attributes argument.
28728 (event_declaration): Ditto.
28729 (enum_declaration): Ditto.
28730 (indexer_declaration): Ditto.
28732 * class.cs (Operator::Operator): Update constructor accordingly.
28733 (Event::Event): Ditto.
28735 * delegate.cs (Delegate::Delegate): Same here.
28737 * enum.cs (Enum::Enum): Same here.
28739 2001-09-05 Ravi Pratap <ravi@ximian.com>
28741 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
28743 * ../tests/cs0658.cs : New file to demonstrate error 0658.
28745 * attribute.cs (Attributes): New class to encapsulate all attributes which were
28746 being passed around as an arraylist.
28747 (Attributes::AddAttribute): Method to add attribute sections.
28749 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
28750 (struct_declaration): Update accordingly.
28751 (constant_declaration): Update.
28752 (field_declaration): Update.
28753 (method_header): Update.
28754 (fixed_parameter): Update.
28755 (parameter_array): Ditto.
28756 (property_declaration): Ditto.
28757 (destructor_declaration): Ditto.
28759 * class.cs (Struct::Struct): Update constructors accordingly.
28760 (Class::Class): Ditto.
28761 (Field::Field): Ditto.
28762 (Method::Method): Ditto.
28763 (Property::Property): Ditto.
28764 (TypeContainer::OptAttribute): update property's return type.
28766 * interface.cs (Interface.opt_attributes): New member.
28767 (Interface::Interface): Update to take the extra Attributes argument.
28769 * parameter.cs (Parameter::Parameter): Ditto.
28771 * constant.cs (Constant::Constant): Ditto.
28773 * interface.cs (InterfaceMemberBase): New OptAttributes field.
28774 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
28775 the attributes as a parameter.
28776 (InterfaceProperty): Update constructor call.
28777 (InterfaceEvent): Ditto.
28778 (InterfaceMethod): Ditto.
28779 (InterfaceIndexer): Ditto.
28781 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
28782 pass the attributes too.
28783 (interface_event_declaration): Ditto.
28784 (interface_property_declaration): Ditto.
28785 (interface_method_declaration): Ditto.
28786 (interface_declaration): Ditto.
28788 2001-09-05 Miguel de Icaza <miguel@ximian.com>
28790 * class.cs (Method::Define): Track the "static Main" definition to
28791 create an entry point.
28793 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
28794 EntryPoint if we find it.
28796 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
28797 (EmitContext::ig): Make this variable public.
28799 * driver.cs: Make the default output file be the first file name
28800 with the .exe extension.
28802 Detect empty compilations
28804 Handle various kinds of output targets. Handle --target and
28805 rename -t to --dumper.
28807 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
28808 methods inherited from Expression return now an Expression. This
28809 will is used during the tree rewriting as we resolve them during
28812 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
28813 the spec. Missing entirely is the information about
28814 accessability of elements of it.
28816 (Expression::ExprClassFromMemberInfo): New constructor for
28817 Expressions that creates a fully initialized Expression based on
28818 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
28821 (Invocation::Resolve): Begin implementing resolution of invocations.
28823 * literal.cs (StringLiteral): Implement Emit.
28825 2001-09-05 Ravi Pratap <ravi@ximian.com>
28827 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
28830 2001-09-04 Ravi Pratap <ravi@ximian.com>
28832 * cs-parser.jay (attribute_arguments): Implement actions.
28833 (attribute): Fix bug in production. Implement action.
28834 (attribute_list): Implement.
28835 (attribute_target): Implement.
28836 (attribute_target_specifier, opt_target_specifier): Implement
28837 (CheckAttributeTarget): New method to check if the attribute target
28839 (attribute_section): Implement.
28840 (opt_attributes): Implement.
28842 * attribute.cs : New file to handle attributes.
28843 (Attribute): Class to hold attribute info.
28845 * cs-parser.jay (opt_attribute_target_specifier): Remove production
28846 (attribute_section): Modify production to use 2 different rules to
28847 achieve the same thing. 1 s/r conflict down !
28848 Clean out commented, useless, non-reducing dimension_separator rules.
28850 * class.cs (TypeContainer.attributes): New member to hold list
28851 of attributes for a type.
28852 (Struct::Struct): Modify to take one more argument, the attribute list.
28853 (Class::Class): Ditto.
28854 (Field::Field): Ditto.
28855 (Method::Method): Ditto.
28856 (Property::Property): Ditto.
28858 * cs-parser.jay (struct_declaration): Update constructor call to
28859 pass in the attributes too.
28860 (class_declaration): Ditto.
28861 (constant_declaration): Ditto.
28862 (field_declaration): Ditto.
28863 (method_header): Ditto.
28864 (fixed_parameter): Ditto.
28865 (parameter_array): Ditto.
28866 (property_declaration): Ditto.
28868 * constant.cs (Constant::Constant): Update constructor similarly.
28869 Use System.Collections.
28871 * parameter.cs (Parameter::Parameter): Update as above.
28873 2001-09-02 Ravi Pratap <ravi@ximian.com>
28875 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
28876 (TypeContainer.delegates): New member to hold list of delegates.
28878 * cs-parser.jay (delegate_declaration): Implement the action correctly
28879 this time as I seem to be on crack ;-)
28881 2001-09-02 Miguel de Icaza <miguel@ximian.com>
28883 * rootcontext.cs (RootContext::IsNamespace): new function, used to
28884 tell whether an identifier represents a namespace.
28886 * expression.cs (NamespaceExpr): A namespace expression, used only
28887 temporarly during expression resolution.
28888 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
28889 utility functions to resolve names on expressions.
28891 2001-09-01 Miguel de Icaza <miguel@ximian.com>
28893 * codegen.cs: Add hook for StatementExpressions.
28895 * class.cs: Fix inverted test for static flag in methods.
28897 2001-09-02 Ravi Pratap <ravi@ximian.com>
28899 * class.cs (Operator::CheckUnaryOperator): Correct error number used
28900 to make it coincide with MS' number.
28901 (Operator::CheckBinaryOperator): Ditto.
28903 * ../errors/errors.txt : Remove error numbers added earlier.
28905 * ../errors/cs1019.cs : Test case for error # 1019
28907 * ../errros/cs1020.cs : Test case for error # 1020
28909 * cs-parser.jay : Clean out commented cruft.
28910 (dimension_separators, dimension_separator): Comment out. Ostensibly not
28911 used anywhere - non-reducing rule.
28912 (namespace_declarations): Non-reducing rule - comment out.
28914 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
28915 with TypeContainer::AddEnum.
28917 * delegate.cs : New file for delegate handling classes.
28918 (Delegate): Class for declaring delegates.
28920 * makefile : Update.
28922 * cs-parser.jay (delegate_declaration): Implement.
28924 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
28926 * class.cs (Event::Define): Implement.
28927 (Event.EventBuilder): New member.
28929 * class.cs (TypeContainer::Populate): Update to define all enums and events
28931 (Events): New property for the events arraylist we hold. Shouldn't we move to using
28932 readonly fields for all these cases ?
28934 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
28936 * class.cs (Property): Revamp to use the convention of making fields readonly.
28937 Accordingly modify code elsewhere.
28939 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
28940 the Define method of the Property class.
28942 * class.cs : Clean up applied patch and update references to variables etc. Fix
28944 (TypeContainer::Populate): Update to define all the properties we have. Also
28945 define all enumerations.
28947 * enum.cs (Define): Implement.
28949 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
28951 * cs-parser.jay (overloadable_operator): The semantic value is an
28952 enum of the Operator class.
28953 (operator_declarator): Implement actions.
28954 (operator_declaration): Implement.
28956 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
28957 validity of definitions.
28958 (Operator::CheckBinaryOperator): Static method to check for binary operators
28959 (TypeContainer::AddOperator): New method to add an operator to a type.
28961 * cs-parser.jay (indexer_declaration): Added line to actually call the
28962 AddIndexer method so it gets added ;-)
28964 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
28965 already taken care of by the MS compiler ?
28967 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
28969 * class.cs (Operator): New class for operator declarations.
28970 (Operator::OpType): Enum for the various operators.
28972 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
28974 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
28975 ostensibly handle this in semantic analysis.
28977 * cs-parser.jay (general_catch_clause): Comment out
28978 (specific_catch_clauses, specific_catch_clause): Ditto.
28979 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
28980 (catch_args, opt_catch_args): New productions.
28981 (catch_clause): Rewrite to use the new productions above
28982 (catch_clauses): Modify accordingly.
28983 (opt_catch_clauses): New production to use in try_statement
28984 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
28985 and re-write the code in the actions to extract the specific and
28986 general catch clauses by being a little smart ;-)
28988 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
28989 Hooray, try and catch statements parse fine !
28991 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
28993 * statement.cs (Block::GetVariableType): Fix logic to extract the type
28994 string from the hashtable of variables.
28996 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
28997 I end up making that mistake ;-)
28998 (catch_clauses): Fixed gross error which made Key and Value of the
28999 DictionaryEntry the same : $1 !!
29001 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
29003 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
29005 * cs-parser.jay (event_declaration): Correct to remove the semicolon
29006 when the add and remove accessors are specified.
29008 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
29010 * cs-parser.jay (IndexerDeclaration): New helper class to hold
29011 information about indexer_declarator.
29012 (indexer_declarator): Implement actions.
29013 (parsing_indexer): New local boolean used to keep track of whether
29014 we are parsing indexers or properties. This is necessary because
29015 implicit_parameters come into picture even for the get accessor in the
29016 case of an indexer.
29017 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
29019 * class.cs (Indexer): New class for indexer declarations.
29020 (TypeContainer::AddIndexer): New method to add an indexer to a type.
29021 (TypeContainer::indexers): New member to hold list of indexers for the
29024 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
29026 * cs-parser.jay (add_accessor_declaration): Implement action.
29027 (remove_accessor_declaration): Implement action.
29028 (event_accessors_declaration): Implement
29029 (variable_declarators): swap statements for first rule - trivial.
29031 * class.cs (Event): New class to hold information about event
29033 (TypeContainer::AddEvent): New method to add an event to a type
29034 (TypeContainer::events): New member to hold list of events.
29036 * cs-parser.jay (event_declaration): Implement actions.
29038 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
29040 * cs-parser.jay (dim_separators): Implement. Make it a string
29041 concatenating all the commas together, just as they appear.
29042 (opt_dim_separators): Modify accordingly
29043 (rank_specifiers): Update accordingly. Basically do the same
29044 thing - instead, collect the brackets here.
29045 (opt_rank_sepcifiers): Modify accordingly.
29046 (array_type): Modify to actually return the complete type string
29047 instead of ignoring the rank_specifiers.
29048 (expression_list): Implement to collect the expressions
29049 (variable_initializer): Implement. We make it a list of expressions
29050 essentially so that we can handle the array_initializer case neatly too.
29051 (variable_initializer_list): Implement.
29052 (array_initializer): Make it a list of variable_initializers
29053 (opt_array_initializer): Modify accordingly.
29055 * expression.cs (New::NType): Add enumeration to help us
29056 keep track of whether we have an object/delegate creation
29057 or an array creation.
29058 (New:NewType, New::Rank, New::Indices, New::Initializers): New
29059 members to hold data about array creation.
29060 (New:New): Modify to update NewType
29061 (New:New): New Overloaded contructor for the array creation
29064 * cs-parser.jay (array_creation_expression): Implement to call
29065 the overloaded New constructor.
29067 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
29069 * class.cs (TypeContainer::Constructors): Return member
29070 constructors instead of returning null.
29072 2001-08-26 Miguel de Icaza <miguel@ximian.com>
29074 * typemanager.cs (InitCoreTypes): Initialize the various core
29075 types after we have populated the type manager with the user
29076 defined types (this distinction will be important later while
29077 compiling corlib.dll)
29079 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
29080 on Expression Classification. Now all expressions have a method
29081 `Resolve' and a method `Emit'.
29083 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
29084 generation from working. Also add some temporary debugging
29087 2001-08-24 Miguel de Icaza <miguel@ximian.com>
29089 * codegen.cs: Lots of code generation pieces. This is only the
29090 beginning, will continue tomorrow with more touches of polish. We
29091 handle the fundamentals of if, while, do, for, return. Others are
29092 trickier and I need to start working on invocations soon.
29094 * gen-treedump.cs: Bug fix, use s.Increment here instead of
29097 * codegen.cs (EmitContext): New struct, used during code
29098 emission to keep a context. Most of the code generation will be
29101 * cs-parser.jay: Add embedded blocks to the list of statements of
29102 this block. So code generation proceeds in a top down fashion.
29104 2001-08-23 Miguel de Icaza <miguel@ximian.com>
29106 * statement.cs: Add support for multiple child blocks.
29108 2001-08-22 Miguel de Icaza <miguel@ximian.com>
29110 * codegen.cs (EmitCode): New function, will emit the code for a
29111 Block of code given a TypeContainer and its ILGenerator.
29113 * statement.cs (Block): Standard public readonly optimization.
29114 (Block::Block constructors): Link children.
29115 (Block::Child): Child Linker.
29116 (Block::EmitVariables): Emits IL variable declarations.
29118 * class.cs: Drop support for MethodGroups here, delay until
29120 (Method::): Applied the same simplification that I did before, and
29121 move from Properties to public readonly fields.
29122 (Method::ParameterTypes): Returns the parameter types for the
29123 function, and implements a cache that will be useful later when I
29124 do error checking and the semantic analysis on the methods is
29126 (Constructor::GetCallingConvention): Renamed from CallingConvetion
29127 and made a method, optional argument tells whether this is a class
29128 or a structure to apply the `has-this' bit.
29129 (Method::GetCallingConvention): Implement, returns the calling
29131 (Method::Define): Defines the type, a second pass is performed
29132 later to populate the methods.
29134 (Constructor::ParameterTypes): implement a cache similar to the
29135 one on Method::ParameterTypes, useful later when we do semantic
29138 (TypeContainer::EmitMethod): New method. Emits methods.
29140 * expression.cs: Removed MethodGroup class from here.
29142 * parameter.cs (Parameters::GetCallingConvention): new method.
29144 2001-08-21 Miguel de Icaza <miguel@ximian.com>
29146 * class.cs (TypeContainer::Populate): Drop RootContext from the
29149 (Constructor::CallingConvention): Returns the calling convention.
29150 (Constructor::ParameterTypes): Returns the constructor parameter
29153 (TypeContainer::AddConstructor): Keep track of default constructor
29154 and the default static constructor.
29156 (Constructor::) Another class that starts using `public readonly'
29157 instead of properties.
29159 (Constructor::IsDefault): Whether this is a default constructor.
29161 (Field::) use readonly public fields instead of properties also.
29163 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
29164 track of static constructors; If none is used, turn on
29165 BeforeFieldInit in the TypeAttributes.
29167 * cs-parser.jay (opt_argument_list): now the return can be null
29168 for the cases where there are no arguments.
29170 (constructor_declarator): If there is no implicit `base' or
29171 `this', then invoke the default parent constructor.
29173 * modifiers.cs (MethodAttr): New static function maps a set of
29174 modifiers flags into a MethodAttributes enum
29175 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
29176 MethodAttr, TypeAttr to represent the various mappings where the
29177 modifiers are used.
29178 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
29180 2001-08-19 Miguel de Icaza <miguel@ximian.com>
29182 * parameter.cs (GetParameterInfo): Fix bug where there would be no
29185 * interface.cs (PopulateIndexer): Implemented the code generator
29186 for interface indexers.
29188 2001-08-17 Miguel de Icaza <miguel@ximian.com>
29190 * interface.cs (InterfaceMemberBase): Now we track the new status
29193 (PopulateProperty): Implement property population. Woohoo! Got
29194 Methods and Properties going today.
29196 Removed all the properties for interfaces, and replaced them with
29197 `public readonly' fields.
29199 2001-08-16 Miguel de Icaza <miguel@ximian.com>
29201 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
29202 initialize their hashtables/arraylists only when they are needed
29203 instead of doing this always.
29205 * parameter.cs: Handle refs and out parameters.
29207 * cs-parser.jay: Use an ArrayList to construct the arguments
29208 instead of the ParameterCollection, and then cast that to a
29211 * parameter.cs: Drop the use of ParameterCollection and use
29212 instead arrays of Parameters.
29214 (GetParameterInfo): Use the Type, not the Name when resolving
29217 2001-08-13 Miguel de Icaza <miguel@ximian.com>
29219 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
29220 and instead use public readonly fields.
29222 * class.cs: Put back walking code for type containers.
29224 2001-08-11 Miguel de Icaza <miguel@ximian.com>
29226 * class.cs (MakeConstant): Code to define constants.
29228 * rootcontext.cs (LookupType): New function. Used to locate types
29231 2001-08-08 Miguel de Icaza <miguel@ximian.com>
29233 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
29234 this System.Reflection code is. Kudos to Microsoft
29236 * typemanager.cs: Implement a type cache and avoid loading all
29237 types at boot time. Wrap in LookupType the internals. This made
29238 the compiler so much faster. Wow. I rule!
29240 * driver.cs: Make sure we always load mscorlib first (for
29241 debugging purposes, nothing really important).
29243 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
29244 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
29246 * rootcontext.cs: Lookup types on their namespace; Lookup types
29247 on namespaces that have been imported using the `using' keyword.
29249 * class.cs (TypeContainer::TypeAttr): Virtualize.
29250 (Class::TypeAttr): Return attributes suitable for this bad boy.
29251 (Struct::TypeAttr): ditto.
29252 Handle nested classes.
29253 (TypeContainer::) Remove all the type visiting code, it is now
29254 replaced with the rootcontext.cs code
29256 * rootcontext.cs (GetClassBases): Added support for structs.
29258 2001-08-06 Miguel de Icaza <miguel@ximian.com>
29260 * interface.cs, statement.cs, class.cs, parameter.cs,
29261 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
29262 Drop use of TypeRefs, and use strings instead.
29264 2001-08-04 Miguel de Icaza <miguel@ximian.com>
29268 * class.cs (Struct::Struct): set the SEALED flags after
29269 checking the modifiers.
29270 (TypeContainer::TypeAttr): new property, returns the
29271 TypeAttributes for a class.
29273 * cs-parser.jay (type_list): Oops, list production was creating a
29274 new list of base types.
29276 * rootcontext.cs (StdLib): New property.
29277 (GetInterfaceTypeByName): returns an interface by type name, and
29278 encapsulates error handling here.
29279 (GetInterfaces): simplified.
29280 (ResolveTree): Encapsulated all the tree resolution here.
29281 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
29284 * driver.cs: Add support for --nostdlib, to avoid loading the
29285 default assemblies.
29286 (Main): Do not put tree resolution here.
29288 * rootcontext.cs: Beginning of the class resolution.
29290 2001-08-03 Miguel de Icaza <miguel@ximian.com>
29292 * rootcontext.cs: Provide better error reporting.
29294 * cs-parser.jay (interface_base): set our $$ to be interfaces.
29296 * rootcontext.cs (CreateInterface): Handle the case where there
29297 are no parent interfaces.
29299 (CloseTypes): Routine to flush types at the end.
29300 (CreateInterface): Track types.
29301 (GetInterfaces): Returns an array of Types from the list of
29302 defined interfaces.
29304 * typemanager.c (AddUserType): Mechanism to track user types (puts
29305 the type on the global type hash, and allows us to close it at the
29308 2001-08-02 Miguel de Icaza <miguel@ximian.com>
29310 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
29311 RecordInterface instead.
29313 * cs-parser.jay: Updated to reflect changes above.
29315 * decl.cs (Definition): Keep track of the TypeBuilder type that
29316 represents this type here. Not sure we will use it in the long
29317 run, but wont hurt for now.
29319 * driver.cs: Smaller changes to accomodate the new code.
29321 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
29324 * rootcontext.cs (CreateInterface): New method, used to create
29325 the System.TypeBuilder type for interfaces.
29326 (ResolveInterfaces): new entry point to resolve the interface
29328 (CodeGen): Property, used to keep track of the code generator.
29330 2001-07-26 Miguel de Icaza <miguel@ximian.com>
29332 * cs-parser.jay: Add a second production for delegate_declaration
29335 (enum_body): Put an opt_comma here instead of putting it on
29336 enum_body or enum_member_declarations so we can handle trailing
29337 commas on enumeration members. Gets rid of a shift/reduce.
29339 (type_list): Need a COMMA in the middle.
29341 (indexer_declaration): Tell tokenizer to recognize get/set
29343 * Remove old targets.
29345 * Re-add the parser target.
29347 2001-07-13 Simon Cozens <simon@simon-cozens.org>
29349 * cs-parser.jay: Add precendence rules for a number of operators
29350 ot reduce the number of shift/reduce conflicts in the grammar.
29352 2001-07-17 Miguel de Icaza <miguel@ximian.com>
29354 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
29357 Get rid of old crufty code.
29359 * rootcontext.cs: Use this to keep track of the parsed
29360 representation and the defined types available to the program.
29362 * gen-treedump.cs: adjust for new convention.
29364 * type.cs: Split out the type manager, and the assembly builder
29367 * typemanager.cs: the type manager will live here now.
29369 * cil-codegen.cs: And the code generator here.
29371 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
29373 * makefile: Fixed up for easy making.
29375 2001-07-13 Simon Cozens <simon@simon-cozens.org>
29377 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
29380 (unary_expression): Expand pre_increment_expression and
29381 post_decrement_expression to reduce a shift/reduce.
29383 2001-07-11 Simon Cozens
29385 * cs-tokenizer.cs: Hex numbers should begin with a 0.
29387 Improve allow_keyword_as_indent name.
29389 2001-06-19 Miguel de Icaza <miguel@ximian.com>
29391 * Adjustments for Beta2.
29393 2001-06-13 Miguel de Icaza <miguel@ximian.com>
29395 * decl.cs: Added `Define' abstract method.
29396 (InTransit): new property, used to catch recursive definitions.
29398 * interface.cs: Implement `Define'.
29400 * modifiers.cs: Map Modifiers.constants to
29401 System.Reflection.TypeAttribute flags.
29403 * class.cs: Keep track of types and user-defined types.
29404 (BuilderInit): New method for creating an assembly
29405 (ResolveType): New function to launch the resolution process, only
29406 used by interfaces for now.
29408 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
29409 that are inserted into the name space.
29411 2001-06-08 Miguel de Icaza <miguel@ximian.com>
29413 * ARGH. I have screwed up my tree so many times due to the use of
29414 rsync rather than using CVS. Going to fix this at once.
29416 * driver.cs: Objetify driver. Load assemblies, use assemblies to
29419 2001-06-07 Miguel de Icaza <miguel@ximian.com>
29421 * Experiment successful: Use System.Type rather that our own
29424 2001-05-25 Miguel de Icaza <miguel@ximian.com>
29426 * cs-parser.jay: Removed nsAliases from here.
29428 Use new namespaces, handle `using XXX;'
29430 * namespace.cs: Reimplemented namespace handling, use a recursive
29431 definition of the class. Now we can keep track of using clauses
29432 and catch invalid using clauses.
29434 2001-05-24 Miguel de Icaza <miguel@ximian.com>
29436 * gen-treedump.cs: Adapted for all the renaming.
29438 * expression.cs (Expression): this class now has a Type property
29439 which returns an expression Type.
29441 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
29442 `Type', as this has a different meaning now in the base
29444 2001-05-22 Miguel de Icaza <miguel@ximian.com>
29446 * interface.cs, class.cs: Removed from all the sources the
29447 references to signature computation, as we can not do method
29448 signature computation during the parsing time, as we are not
29449 trying to solve at that point distinguishing:
29453 void a (NS.Blah x) {}
29456 Which depending on the context might be valid or not, as we do not
29457 know if Blah is the same thing as NS.Blah at that point.
29459 * Redid everything so the code uses TypeRefs now instead of
29460 Types. TypeRefs are just temporary type placeholders, that need
29461 to be resolved. They initially have a pointer to a string and the
29462 current scope in which they are used. This is used later by the
29463 compiler to resolve the reference to an actual Type.
29465 * DeclSpace is no longer a CIR.Type, and neither are
29466 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
29467 are all DeclSpaces, but no Types.
29469 * type.cs (TypeRefManager): This implements the TypeRef manager,
29470 which keeps track of all the types that need to be resolved after
29471 the parsing has finished.
29473 2001-05-13 Miguel de Icaza <miguel@ximian.com>
29475 * ARGH. We are going to have to store `foreach' as a class rather
29476 than resolving it, as we need to verify error 1579 after name
29477 resolution. *OR* we could keep a flag that says `This request to
29478 IEnumerator comes from a foreach statement' which we can then use
29479 to generate the error.
29481 2001-05-10 Miguel de Icaza <miguel@ximian.com>
29483 * class.cs (TypeContainer.AddMethod): we now add methods to the
29484 MethodGroup instead of the method hashtable.
29486 * expression.cs: Add MethodGroup abstraction, which gets us one
29487 step closer to the specification in the way we handle method
29490 * cs-parser.jay (primary_expression): qualified_identifier now
29491 tried to match up an identifier to a local variable reference or
29492 to a parameter reference.
29494 current_local_parameters is now a parser global variable that
29495 points to the current parameters for the block, used during name
29498 (property_declaration): Now creates an implicit `value' argument to
29501 2001-05-09 Miguel de Icaza <miguel@ximian.com>
29503 * parameter.cs: Do not use `param' arguments as part of the
29504 signature, per the spec.
29506 2001-05-08 Miguel de Icaza <miguel@ximian.com>
29508 * decl.cs: Base class for classes, structs and interfaces. This
29509 is the "Declaration Space"
29511 * cs-parser.jay: Use CheckDef for checking declaration errors
29512 instead of having one on each function.
29514 * class.cs: Factor out some code for handling error handling in
29515 accordance to the "Declarations" section in the "Basic Concepts"
29516 chapter in the ECMA C# spec.
29518 * interface.cs: Make all interface member classes derive from
29519 InterfaceMemberBase.
29521 2001-05-07 Miguel de Icaza <miguel@ximian.com>
29523 * Many things: all interfaces are parsed and generated in
29524 gen-treedump. Support for member variables, constructors,
29525 destructors, properties, constants is there.
29527 Beginning of the IL backend, but very little done, just there for
29530 2001-04-29 Miguel de Icaza <miguel@ximian.com>
29532 * cs-parser.jay: Fix labeled statement.
29534 * cs-tokenizer.cs (escape): Escape " and ' always.
29535 ref_line, ref_name: keep track of the line/filename as instructed
29536 by #line by the compiler.
29539 2001-04-27 Miguel de Icaza <miguel@ximian.com>
29541 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
29542 to match the values in System.CodeDOM.
29544 Divid renamed to Divide.
29546 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
29548 (Statements.set): remove.
29550 * System.CodeDOM/CodeCatchClause.cs: always have a valid
29553 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
29554 falseStatements always have valid values.
29556 * cs-parser.jay: Use System.CodeDOM now.