1 2007-08-07 Miguel de Icaza <miguel@novell.com>
3 * driver.cs: When building SMCS, include a new different set of
4 default assemblies here. Do this here so we can control whether
5 to include the default assemblies with /noconfig.
7 2007-08-03 Marek Safar <marek.safar@gmail.com>
10 * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
13 2007-08-03 Marek Safar <marek.safar@gmail.com>
17 * anonymous.cs (AnonymousContainer.Define): Don't define anything when
18 we are in probing scope.
20 2007-08-03 Marek Safar <marek.safar@gmail.com>
24 * statement.cs (Catch.CloneTo): Clone blocks in the right order.
25 (Statement.CloneTo): Clone and not map children blocks.
27 2007-08-03 Marek Safar <marek.safar@gmail.com>
31 * expression.cs (LocalVariableReference.CloneTo): Remap local info
34 * statement.cs (Statement.CloneTo): Clone variables before statements
35 to allow remaping of local variables.
37 2007-08-03 Marek Safar <marek.safar@gmail.com>
42 * report.cs: Log crash details for future clone problems.
44 * statement.cs (Return.Clone): Don't clone non-existent expression.
46 2007-08-03 Raja R Harinath <harinath@gmail.com>
48 * class.cs (TypeContainer.AddBasesForPart): Make virtual.
49 (Class.AddBasesForPart): Move CS0537 check here from ...
50 * cs-parser.jay (class_declaration): ... here. Move calling of
51 'AddBasesForPart' to ...
52 (class_bases): ... here.
53 (struct_declaration, interface_declaration): Update to changes.
55 2007-08-02 Marek Safar <marek.safar@gmail.com>
59 * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
60 conversion is allowed.
62 2007-08-02 Marek Safar <marek.safar@gmail.com>
66 * ecore.cs (EventExpr): Add IsBase handling.
68 * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
71 2007-08-02 Raja R Harinath <harinath@gmail.com>
73 Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
74 * cs-parser.jay: Some whitespace cleanups.
75 (current_delegate): New.
77 (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
78 a dummy code block, and use 'type_name' instead of 'member_name'.
79 (interface_declaration, class_declaration): Likewise.
80 (delegate_declaration): Likewise. Rearrange slightly and use
82 * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
83 (GetKeyword): Update to change. Use '!foo' instead of 'foo == false'.
85 2007-08-02 Marek Safar <marek.safar@gmail.com>
89 * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
92 * typemanager.cs (CSharpName): Split to string overload.
94 2007-08-02 Marek Safar <marek.safar@gmail.com>
97 * report.cs: Updated warning CS0472.
99 2007-08-01 Marek Safar <marek.safar@gmail.com>
103 * cs-tokenizer.cs: Ignore partial keyword inside block expression.
105 2007-08-01 Marek Safar <marek.safar@gmail.com>
108 * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
110 2007-08-01 Marek Safar <marek.safar@gmail.com>
112 ** C# 3.0 Type Inference (major bits are working)
114 * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
115 (.ImplicitStandardConversionExists): Uses compatible.
116 (.ExplicitTypeInference): Infers type arguments based on explicit arguments
117 (.InferReturnType): New method.
118 (.Compatible): Refactored.
119 (.ResolveParameters): Uses factory to create resolved parameters.
120 (.CompatibleMethod): Add probing mode support.
121 (AnonymousContainer): Removed unused fields. Split Define and Resolve to
122 clearly distinguish between 2 different operations.
123 (LambdaMethod): Moved to lambda.cs.
124 (AnonymousMethod): Removed unused fields and methods.
125 (AnonymousDelegate): Simplified.
127 * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
129 * convert. cs (ImplicitConversionStandard): Compatible works differently.
131 * delegate.cs (Delegate): New mehods to reduce code duplication.
132 (.GetConstructor): New method.
133 (.GetInvokeMethod): New method.
134 (DelegateCreation): Updated.
136 * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
138 (OverloadResolve): Made probing little bit faster.
140 * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
143 * generic.cs (TypeInferenceContext): Dummy implementation.
145 * iterators.cs: Updated after Resolve/Define rename.
147 * lambda.cs (LambdaExpression)
148 (.ResolveParameters): Handles both type of arguments and type inference too.
150 * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
151 (InflateTypes): Updated.
153 * support.cs (InflateTypes): Changed signature and updated.
155 * typemanager.cs (LookupMemberCache): Better dynamic type check.
156 (MemberLookup_FindMembers): More MS tricks.
157 (GetParameterData): Ditto.
158 (GetDelegateParameters): Uses quick path for dynamic types.
160 2007-08-01 Marek Safar <marek.safar@gmail.com>
162 * class.cs (MethodData.Define): EmitContext is required for generic stuff
165 2007-07-31 Marek Safar <marek.safar@gmail.com>
167 * statement.cs (ProcessParameters): Don't crash when parameters have wrong
170 2007-07-26 Jb Evain <jbevain@novell.com>
172 * typemanager.cs (TypeManager.GetConstructor): Add a method overload
173 which takes a boolean 'report_errors', similar to the GetMethod.
174 (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
175 in .net 2.1, do not report errors here.
177 * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
178 System.Runtime.CompilerServices.RequiredAttributeAttribute and
179 System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
182 * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
183 of the type InternalsVisibleToAttribute before the first call
184 to CoreLookupType which is allowed to fail (third boolean parameter
185 to true). Because, during the resolution for a type that is not
186 immediately found, we try to check if the type is not defined in
187 a friend assembly, and to do so, we need the
188 InternalVisibleToAttribute.
190 2007-07-23 Miguel de Icaza <miguel@novell.com>
192 * expression.cs (Binary): Add support for the brain-dead CSC 2.x
193 feature that allows structs to be compared against null and inline
194 the result as true or false.
196 Notice that the same code is not permitted inside a generic block
197 of code that would do:
199 class Foo<T> where T : struct {
206 It is only allowed if the type of T is not bound (no where
207 clause). In my opinion, this CSC 2 behavior is broken but people
208 seem to be using it (IronRuby does, a few bug reports on bugzilla
209 have it and some people have complained about it).
211 All of the users that depend on this behavior have code that is
214 * report.cs (Warning, Error): make these take object arguments,
215 not strings, as that allows us to take advantage of Format.
217 2007-07-20 William Holmes <billholmes54@gmail.com>
219 * decl.cs: Changed MemberName.CountTypeArguments to also check the
220 Left member variable for the Count.
221 * doc.cs: Changed DocUtil.GetMethodDocCommentName to call
222 MemberName.CountTypeArguments to avoid a NRE.
224 This code is contributed under the MIT X11 license
226 2007-07-18 Marek Safar <marek.safar@gmail.com>
228 * cs-tokenizer.cs: Improved lambda parsing and removed old code.
230 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
232 * doc.cs : generic method arguments are written as ``x while generic
233 type arguments are `x. Combined with the previous change, fixed bug
236 2007-07-18 Raja R Harinath <rharinath@novell.com>
239 * expression.cs (Binary.ResolveOperator): When converting
240 'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
242 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
244 * doc.cs : when T: or whatever x: is specified, it does not really
245 check the doc comment's syntax correctness. Fixed bug #82006.
247 2007-07-18 Marek Safar <marek.safar@gmail.com>
249 * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
250 LambdaExpression better.
252 * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
254 * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
256 * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
257 as it can be generated.
259 * expression.cs (Invocation.Error_InvalidArguments): Show correct
262 * lambda.cs (LambdaExpression): Refactored to share same code with
263 AnonymousMethodExpression.
265 2007-07-17 Marek Safar <marek.safar@gmail.com>
267 * anonymous.cs (MakeName): Include host name for easier debugging.
268 (LambdaMethod): New class for lambda spcecific stuff.
270 * attribute.cs: Set EmitContext return type.
272 * class.cs: Set EmitContext return type.
274 * codegen.cs (EmitContext): Return type cannot be null to stop messing
275 with null/void meaning.
277 * iterators.cs (ContainerType): Implemented.
279 * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
281 * statement.cs (Return): Updated to lambda expressions.
282 (Block.CloneTo): Parent can be null.
284 2007-07-13 Marek Safar <marek.safar@gmail.com>
287 * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
289 * class.cs (FixedField): Check whether field is in unsafe scope.
291 * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
292 (FieldExpr.Emit): Fixed buffers cannot be volatile.
294 * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
297 * statement.cs (Fixed.Resolve): Simplified fixed buffers.
299 2007-07-13 Marek Safar <marek.safar@gmail.com>
301 * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
302 rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
305 2007-07-13 Marek Safar <marek.safar@gmail.com>
307 * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
309 2007-07-13 Marek Safar <marek.safar@gmail.com>
311 * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
312 (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
314 * codegen.cs(EmitContext): Add ProbingMode flag.
316 * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
318 * driver.cs: For now set both warning values.
320 * ecore.cs (SimpleName): Name is readonly.
321 (MethodGroup.OverloadResolve): One quick path for probing.
323 * expression.cs (Unary): Set Oper r/o.
324 (Binary): Set Oper r/o.
325 (ParameterReference): Set few instance variables as r/o.
326 (ParameterReference.DoResolveBase): Don't capture aruments when
328 (Invocation.CloneTo): Fixed typo, looks easy, yeah.
329 (Arglist): arguments are private.
330 (SizeOf): type is private and r/o.
331 (MemberAccess): arguments are private.
333 * report.cs: Enhanced reporting on/off capabilities.
335 * lambda.cs: Uses ec.IsInProbingMode.
336 (ContextualReturn): Derives from return.
338 * rootcontext.cs: For now set both warning values.
340 * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
342 (Return.Resolve): Don't die immediately.
343 (Block.Resolve): Speed-up probing.
344 (Block.CloneTo): Clone only child blocks.
346 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
348 * iterators.cs: reverted Miguel's latest change (r81925) as it
349 breaks the build in System.
351 2007-07-13 Miguel de Icaza <miguel@novell.com>
353 * iterators.cs (Yield.CheckContext): Check for the iterator type
354 also here as we can call into Yield even in codepaths that are not
356 (MethodOrOperator is the only path that was checked).
358 In addition to the standard check, use a more specific check for
359 constructors to report a more verbose error.
361 2007-07-12 Miguel de Icaza <miguel@novell.com>
363 * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
364 report the warning and continue
366 * statement.cs (Using.EmitLocalVariableDecls): We were leaving
367 values on the stack on the call to Emit. Use EmitStatement if
368 possible, or using Emit + Pop if not possible. Fixes #82064
370 2007-07-12 Raja R Harinath <rharinath@novell.com>
372 * expression.cs (Invocation.IsApplicable): Reorganize slightly to
373 avoid try...finally in some cases.
375 2007-07-10 Marek Safar <marek.safar@gmail.com>
377 * attribute.cs (Attribute.ResolveConstructor): Uses method group.
379 * class.cs (ConstructorInitializer.Resolve): Use and keep method group
380 instead of method. Re-use standard error handling.
381 (ConstructorInitializer.Emit): Simplified.
383 * delegate.cs: Updated after Invocation.EmitCall change.
385 * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
386 (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
387 (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
388 method and don't permanently changing input arguments.
389 (MethodGroupExpr): Introduced resolved best_candidate, when method group
390 is resolved it has one of the candidates is the best one which is later
391 used to emit. Removed a few unused method.
392 (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
394 * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
395 (Binary.ResolveOperator): Ditto.
396 (ConditionalLogicalOperator.DoResolve): Ditto.
397 (Invocation): Uses method group.
398 (Invocation.DoResolve): Simplified.
399 (Invocation.EmitCall): Removed useless is_static.
400 (Invocation.Emit): Delegate to method group.
401 (Invocation.EmitStatement): Simplified.
402 (New): Uses method group.
403 (MemberAccess.DoResolve): Don't destroy original expression.
405 * statement.cs (ForEach.Resolve): Use null for no method arguments.
407 2007-07-04 Marek Safar <marek.safar@gmail.com>
409 * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
412 * lambda.cs: Add custom error message type.
414 2007-07-03 Marek Safar <marek.safar@gmail.com>
416 * lambda.cs: Simplified little bit.
418 * parameter.cs: Introduced ImplicitLambdaParameter.
419 (Parameters.CreateFullyResolved): New factory instead of ctor.
423 * delegate.cs: Updated parameter creation.
425 2007-07-03 Marek Safar <marek.safar@gmail.com>
427 * ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
430 * generic.cs: Synchronized with gmcs.
432 2007-07-03 Marek Safar <marek.safar@gmail.com>
434 * class.cs (Indexer): Check return type as soon as possible.
436 * cs-parser.jay: Initialize implicit_value_parameter_type for interface
439 * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
441 * expression.cs (Invocation.Error_InvalidArguments): Show type only.
443 * parameter.cs (Parameter): Use expression type when it is available.
445 * support.cs (ReflectionParameters.ParameterDesc): Show an extension
446 method modifier for the first parameter only.
448 2007-06-24 Marek Safar <marek.safar@gmail.com>
451 * typemanager.cs (ChangeType): Fixed couple of char conversions.
453 * constant.cs: Tide up an exception message.
455 2007-06-22 Marek Safar <marek.safar@gmail.com>
457 * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
458 an uninitialized variable is used.
460 * expression.cs (LocalVariableReference.DoResolve): Ditto.
462 2007-06-22 Marek Safar <marek.safar@gmail.com>
464 * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
465 not found error handling.
467 * expression.cs (ArrayCreation): Removed redundant fields and little bit
469 (ArrayCreation.ResolveArrayElement): To be ready to customization.
470 (ArrayCreation.DoResolve): Simplified.
471 (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
472 its own resolve process.
473 (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
475 2007-06-20 Marek Safar <marek.safar@gmail.com>
477 * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
480 2007-06-20 Marek Safar <marek.safar@gmail.com>
482 * cs-tokenizer.cs: Removed var related stuff.
484 * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
485 (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
486 a type and a keyword at same time.
488 * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
491 * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
492 implicitly typed arrays, more changes will follow.
494 * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
496 2007-06-19 Marek Safar <marek.safar@gmail.com>
498 * ecore.cs (VarExpr): Removed Handled field.
500 * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
501 build-in assign functionality.
502 (ForEach.Resolve): Removed all implicitly typed local variable code and
504 (ArrayForeach.Resolve): Infer implicitly typed local variable here.
505 (CollectionForeach.Resolve): Infer implicitly typed local variable here.
507 2007-06-18 Marek Safar <marek.safar@gmail.com>
509 * assign.cs: Removed implicitly typed local variable check.
511 * expression.cs (LocalVariableReference.DoResolve): Add check for self
512 referencing implicitly typed local variable.
513 (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
516 * statement.cs (Fixed): Removed unsupported implicitly typed local
519 2007-06-15 Marek Safar <marek.safar@gmail.com>
521 * decl.cs (MemberName): Moved all Unbound stuff to parser.
523 2007-06-14 Marek Safar <marek.safar@gmail.com>
525 A fix for bugs #81855 and #76274
526 * attribute.cs (AttachTo): Always set owner for global attributes to
529 * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
532 * cs-parser.jay: Assembly and module attributes must precede all other
533 elements except using clauses and extern alias declarations.
535 2007-06-13 Marek Safar <marek.safar@gmail.com>
539 * expression.cs: More checks for non ISO-1 features.
541 2007-06-12 Marek Safar <marek.safar@gmail.com>
544 * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
545 present inside switch statement and it is required by nullable check.
547 2007-06-12 Marek Safar <marek.safar@gmail.com>
550 * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
551 when type matching fails.
553 * namespace.cs: Tiny error message change.
555 2007-06-12 Marek Safar <marek.safar@gmail.com>
557 * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
558 reporting. Added automatic property check.
560 * class.cs: Updated after CheckAbstractAndExtern relocation.
561 (AEventPropertyAccessor.GetSignatureForError): Customized.
563 2007-06-11 Marek Safar <marek.safar@gmail.com>
565 * class.cs (DefineBaseTypes): Base type can be undefined.
567 * ecore.cs (TypeLookup): Minor refactoring.
568 (DoResolveAsTypeStep): Removed redundant check.
570 * namespace.cs (Lookup): Removed redundant check.
572 * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal
573 ResolveAsTypeTerminal step.
574 (BootstrapCorlib_*): Simplified.
575 (PopulateCoreType): Core types can be now external.
577 2007-06-07 Marek Safar <marek.safar@gmail.com>
579 * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
581 (InferTypeArguments): Infers anonymous expression type arguments.
582 (Compatible): Split to Compatible and InferTypeArguments.
584 * lambda.cs: Updated.
586 2007-06-08 Marek Safar <marek.safar@gmail.com>
588 * anonymous.cs (AnonymousContainer): Marked as compiler generated.
590 2007-06-07 Raja R Harinath <harinath@gmail.com>
592 Fix #80477, cs0135-2.cs, cs0135-3.cs
593 * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
594 names to the "known" variables list.
595 (Block.CheckInvariantMeaningInBlock): Handle the fact the
596 parameter names are also "known".
597 (Block.CheckError136): Remove.
598 (ExplicitBlock.CloneTo): New. Set 'known_variables' in target to
601 2007-06-07 Marek Safar <marek.safar@gmail.com>
603 * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
605 2007-06-06 Marek Safar <marek.safar@gmail.com>
607 * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
608 internal error not an user error.
610 * expression.cs (IsApplicable): Refactored to make debugging easier.
612 * support.cs: More tricks for non-mono runtimes.
614 * typemanager.cs (CoreLookupType): Made public.
615 (InitSystemCore): All linq specific stuff moved to linq.cs
617 2007-06-05 Marek Safar <marek.safar@gmail.com>
619 * typemanager.cs (CSharpSignature): One more missing build-in types
621 More tricks for non-mono runtime.
623 2007-06-05 Raja R Harinath <harinath@gmail.com>
625 * statement.cs (Block.CheckError136_InParents): Remove.
626 (Block.AddVariable): Use GetParameterInfo instead.
627 (ToplevelBlock.ProcessArguments): Likewise.
629 2007-06-04 Raja R Harinath <rharinath@novell.com>
631 * statement.cs (ToplevelBlock.CloneTo): New. Copy over parameter
633 (ToplevelBlock.GetParameterInfo): Split out of ...
634 (ToplevelBlock.GetParameterRefernce): ... this.
635 (ToplevelBlock.ParameterMap): Remove.
636 * expression.cs (ParameterReference): Update to use
637 ToplevelParameterInfo.
639 * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
642 * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
643 * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
645 * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
646 (ToplevelBlock.ProcessParameters) ... here.
647 (ToplevelBlock..ctor): Invoke it.
649 * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
652 * statement.cs (IKnownVariable): New interface.
653 (LocalInfo): Implement it.
654 (ToplevelParameterInfo): New class.
655 (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
656 (ExplicitBlock.GetKnownVariable): Likewise. Rename from
657 GetKnownVariableInfo.
659 2007-06-03 Raja R Harinath <harinath@gmail.com>
661 Partly speed up CS0136 error checks.
662 * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
664 (Block.DoCheckError136): Only check errors in parameters. Move
665 local variable checks ...
666 (Block.AddVariable): ... here, and ...
667 (ToplevelBlock.ResolveMeta): ... here.
669 2007-06-02 Raja R Harinath <harinath@gmail.com>
671 * statement.cs (Block.IsChildOf): Remove.
673 * statement.cs (Statement.Clone): Move special case code ...
674 (Block.CloneTo): ... here.
676 2007-05-29 Raja R Harinath <rharinath@novell.com>
678 * statement.cs (ToplevelBlock.container): Remove field. It's
679 redundant with 'Parent'.
680 (ToplevelBlock.ContainerBlock): Remove accessor.
681 (ToplevelBlock..ctor): Update to changes. Register anonymous
682 child with parent here, ...
683 * cs-parser.jay (end_anonymous): ... not here. Don't modify
685 (start_anonymous): Don't save current_block.
686 (top_current_block): Remove.
688 * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
689 (Block.Resolve): Update to changes.
690 (Block..ctor): Move setting of "correct" 'Toplevel'
691 and 'Explicit' fields to ...
692 (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
694 2007-05-27 Raja R Harinath <harinath@gmail.com>
697 * statement.cs (Block.Implicit): Remove.
698 (Block): Update to changes.
699 * flowanalysis.cs: Likewise.
701 Mildly speed up CheckInvariantMeaningInBlock
702 * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
703 Recursively call AddKnownVariable to all enclosing blocks.
704 (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
705 Remove recursive calls.
706 (Block): Update to changes.
708 New ExplicitBlock invariants
709 * statement.cs (Block.Explicit): New field. It points to the
710 immediately enclosing non-implicit block.
711 (Block..ctor): Maintain the invariant.
712 * cs-parser.jay: Take advantage of invariant.
714 Introduce ExplicitBlock
715 * statement.cs (ExplicitBlock): New.
716 (ToplevelBlock): Derive from it.
717 (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
719 (Block.Implicit): Update to changes.
720 * cs-parser.jay: Update to changes.
723 * codegen.cs (EmitContext.IsLastStatement): Remove.
724 * statement.cs (Block.DoEmit): Update to changes.
726 2007-05-25 Raja R Harinath <rharinath@novell.com>
728 * cs-parser.jay: Use 'start_block' and 'end_block' rather than
729 modifying current_block directly.
731 2007-05-23 Scott Peterson <lunchtimemama@gmail.com>
733 * class.cs: Implemented automatic properties (C# 3.0)
734 Thanks to Marek for the help.
736 2007-05-23 Raja R Harinath <rharinath@novell.com>
738 * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
739 variable as assigned, note also that all its components are
741 (MyBitVector.SetRange): New. Function to set multiple bits to true.
743 2007-05-19 Marek Safar <marek.safar@gmail.com>
745 * anonymous.cs, class.cs: Emit Compiler generated attribute when
746 member is marked as compiler generated.
748 * decl.cs (MemberCore): Refactored ModFlags into property.
750 * modifiers.cs: Add new modifier (COMPILER_GENERATED).
751 (Check): Check only accessibility modifiers.
753 2007-05-18 Raja R Harinath <rharinath@novell.com>
755 Track all assignable slots in one bit array
756 * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
757 (ToplevelBlock.ResolveMeta): Don't create a VariableMap. Move
758 logic from VariableMap constructor here. Use the same 'offset'
759 variable that's later used for computing offsets of local
761 * flowanalysis.cs (UsageVector.parameters): Remove.
762 (UsageVector): Update to changes.
763 (VariableMap): Remove.
765 Avoid creating ParameterMap in every block
766 * statement.cs (Block.ParameterMap): Move ...
767 (ToplevelBlock.ParameterMap): ... here.
768 (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
770 * flowanalysis.cs (FlowBranching.param_map): Remove.
771 (FlowBranching.UsageVector): Update to changes.
772 (FlowBranchingToplevel.CheckOutParameters): Likewise.
774 * statement.cs (Block.CloneTo): Clone Toplevel field too.
776 * expression.cs (ParameterReference): Distinguish between block
777 where parameter was referenced and declared.
779 2007-05-18 Marek Safar <marek.safar@gmail.com>
781 * flowanalysis.cs, statement.cs: Put back improved error handling.
783 2007-05-15 Scott Peterson <lunchtimemama@gmail.com>
787 Imporved object and collection initialization (C# 3.0).
789 2007-05-15 Marek Safar <marek.safar@gmail.com>
792 * expression.cs (Is.DoResolve): Only value types have constant `is'
795 2007-05-15 Raja R Harinath <rharinath@novell.com>
797 * statement.cs (ToplevelBlock.child): Remove.
799 2007-05-15 Raja R Harinath <harinath@gmail.com>
801 Rationalize ResolveMeta: refactoring
802 (Block.ResolveMeta): Remove wrong or superfluous comments. Carve
803 out constant handling code into ...
804 (Block.DoResolveConstants): ... this.
806 Rationalize ResolveMeta: kill local_map
807 * statement.cs (Block.local_map, Block.LocalMap): Remove.
808 (Block.AssignableSlots): New.
809 (Block.ResolveMeta): Make protected. Don't create a VariableMap
810 for locals -- move code from VariableMap here. Avoid unnecessary
812 * flowanalysis.cs (FlowBranching.local_map): Remove.
813 (FlowBranching..ctor): Use Block.AssignableSlots.
814 (VariableMap): Remove unused constructors.
816 2007-05-11 Raja R Harinath <rharinath@novell.com>
818 * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
820 2007-05-11 Marek Safar <marek.safar@gmail.com>
822 * typemanager.cs (IsFriendAssembly): Should not be called for building
825 2007-05-09 Marek Safar <marek.safar@gmail.com>
827 * literal.cs (NullConstant): Print null in all cases.
829 * expression.cs (Binary.ResolveOperator): Implemented delegate
830 comparison based on C# 2.0 changes.
832 2007-04-28 Scott Peterson <lunchtimemama@gmail.com>
834 This code is contributed under the MIT X11 license
836 The following enables support for several C# 3.0 language features:
838 * cs-tokenizer.cs: Added support for the "var" keyword.
840 * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
841 Added VarExpr class to facilitate type inferencing.
843 * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
844 to support anonymous types.
846 * assign.cs: Added support for type inferencing and initialization.
848 * anonymous.cs: Added AnonymousClass class to enable anonymous types.
850 * expression.cs: Added implicit array support to ArrayCreation.
851 Added 5 types and 1 interface:
853 IInitializable Implementing classes can inject initializing
854 statements after object instantiation.
856 Initializer Stores data for object initialization.
858 AnonymousType An expression for anonymous types.
860 AnonymousTypeParameter Stores data about an anonymous type's field.
862 NewInitialize An expression for object initialization.
864 CollectionInitialize An expression for collection initialization.
866 * statement.cs: Added "var" keyword support to the foreach, using, and fixed
869 2007-05-06 Marek Safar <marek.safar@gmail.com>
872 * cs-tokenizer.cs: Add special handling for coalescing operator.
874 2007-05-06 Marek Safar <marek.safar@gmail.com>
877 * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
878 its value from base class until it is redefined.
880 2007-05-02 Raja R Harinath <rharinath@novell.com>
882 Fix regression in cs0631-3.cs
883 * cs-parser.jay (operator_declarator): Add opt_attributes to error
884 fallback. Make error fallback catch more cases.
886 2007-05-01 Miguel de Icaza <miguel@novell.com>
888 * cs-parser.jay: Allow parameters in operator declarations to have
891 2007-04-27 Miguel de Icaza <miguel@novell.com>
893 * statement.cs (If.CloneTo): Only clone the FalseStatement if it
896 * lambda.cs (ContextualReturn.Resolve): An expression is valid
897 inside the ContextualReturn, it does not have to be an
900 2007-04-24 Miguel de Icaza <miguel@novell.com>
902 * lambda.cs (ContextualReturn.Resolve): if the return type is not
905 2007-04-23 Miguel de Icaza <miguel@novell.com>
907 * anonymous.cs (AnonymousContainer): split the virtual Resolve
908 method in two methods: ResolveNoDefine and Resolve.
910 ResolveNoDefine will stop just after ResolveTopBlock has been
913 Resolve will then continue by creating a method and issuing the
914 call to method.Define ().
916 (AnonymousMethod): Split and implement the new Resolve and
917 ResolveNoDefine as well.
919 * lambda.cs (LambdaExpression): Split the anonymous method
920 resolution code into a separate routine (CoreCompatibilityTest)
921 from DoCompatibleTest.
923 (LambdaExpression.TryBuild): New method, this method tries to
924 build the LambdaExpression with the given set of types to be used
925 as the types for the various parameters of the lambda expression.
927 If the compilation succeed with the given types, the infered type
928 of the Anonymous method is returned, otherwise null is returned.
930 2007-04-23 Marek Safar <marek.safar@gmail.com>
933 * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
935 2007-04-22 Miguel de Icaza <miguel@novell.com>
937 * cs-tokenizer.cs: Change various identifiers here from the
938 camelCasing to the recommended Linux-like style for instance
939 variables from the Coding Guidelines.
941 2007-04-19 Martin Baulig <martin@ximian.com>
944 (Convert.ImplicitReferenceConversionCore): Allow conversions from
945 System.Enum to System.ValueType.
947 2007-04-13 Martin Baulig <martin@ximian.com>
949 Rewrote implicit reference conversions. We need to distinguish
950 between implicit reference conversions (13.1.4) and implicit
951 boxing conversions (13.1.5).
953 According to the spec, there's an an implicit conversion
954 "From a one-dimensional array-type S[] to IList<T> and base
955 interfaces of this interface, provided there is an implicit
956 reference conversion from S to T." Note that this does not
957 include boxing conversions.
960 (Convert.ImplicitTypeParameterBoxingConversion): New method.
961 (Convert.ImplicitReferenceConversion): Split into
962 ImplicitReferenceConversionCore() and
963 ImplicitBoxingConversionExist().
964 (Convert.ImplicitReferenceConversionExists): Use the new
965 ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
967 2007-04-12 Martin Baulig <martin@ximian.com>
969 * convert.cs (Convert.ImplicitReferenceConversion): Move the
970 `TypeManager.null_type' checks up to the top of the method.
972 2007-04-11 Marek Safar <marek.safar@gmail.com>
975 * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
978 2007-04-11 Martin Baulig <martin@ximian.com>
980 * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
981 Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
982 to make this work for generic classes; fixes #79561.
984 2007-04-11 Martin Baulig <martin@ximian.com>
986 * expression.cs (As): Add support for nullable types; fixes #79371.
988 2007-04-11 Martin Baulig <martin@ximian.com>
990 * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
991 `type.FullName' is null; fixes #80243.
993 2007-04-11 Martin Baulig <martin@ximian.com>
995 * expression.cs (Invocation.IsApplicable): Don't modify the method
996 if type inference succeeded, but the method was not applicable.
999 2007-04-10 Marek Safar <marek.safar@gmail.com>
1001 A fix for bug #81324
1002 * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
1003 internal and external namespaces containers.
1005 2007-04-10 Martin Baulig <martin@ximian.com>
1007 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
1008 TypeManager.DropGenericMethodArguments() so we also call
1009 IMethodData.SetMemberIsUsed() for generic methods. Fixes #80357.
1011 2007-04-10 Martin Baulig <martin@ximian.com>
1013 * iterators.cs (Iterator.CreateIterator): Don't crash if
1014 `method.ReturnType' is null. This happens if something went wrong
1015 while resolving that typ (we already reported an error in this case).
1017 2007-04-10 Martin Baulig <martin@ximian.com>
1019 * expression.cs (New.DoResolve): Don't call CheckComImport() on
1020 generic interfaces; report the CS0144 directly.
1022 2007-04-10 Martin Baulig <martin@ximian.com>
1024 * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
1025 `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
1027 2007-04-10 Martin Baulig <martin@ximian.com>
1029 * expression.cs (New.DoEmitTypeParameter): Fix #81109.
1031 2007-04-09 Raja R Harinath <rharinath@novell.com>
1034 * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
1035 * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
1038 * statement.cs (For.Resolve): If resolution fails, use
1041 2007-04-08 Marek Safar <marek.safar@gmail.com>
1043 * anonymous.cs (MakeName): Make faster and zero-based.
1044 (VerifyExplicitParameterCompatibility): Back to mode where generic
1045 parameter is ignored.
1046 (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
1048 * class.cs (EmitType): Method can emit another new method.
1050 * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
1052 * driver.cs: Updated.
1054 * lambda.cs: Reuse predefined empty parameters.
1056 * parameter.cs: Updated
1058 * support.cs: Implemented InflateTypes.
1060 * typemanager.cs (GetFullName): Don't use FullName as it can be null.
1061 (InitSystemCore): Introduced to isolate 3.0 dependencies.
1063 2007-04-03 Martin Baulig <martin@ximian.com>
1067 * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
1068 version of TypeManager.IsOverride() which also works with generic
1071 2007-04-03 Martin Baulig <martin@ximian.com>
1076 (Convert.ExplicitReferenceConversion): We need to cast when
1077 converting from IList<T> to S[].
1079 2007-04-01 Marek Safar <marek.safar@gmail.com>
1081 * decl.cs (FindExtensionMethods): Consider all candidates with same name
1084 * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
1086 2007-03-31 Marek Safar <marek.safar@gmail.com>
1088 * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
1089 argument and return type inferring.
1091 * codegen.cs (InferReturnType): Flag whether return can be inferred.
1092 (ReturnType): Turned to property.
1094 * statement.cs (Return): Implemented return type inferring.
1096 * support.cs (ReflectionParameters): Use local types if possible.
1098 2007-03-30 Raja R Harinath <rharinath@novell.com>
1100 * flowanalysis.cs (FlowBranching.Reachability): Remove.
1101 (FlowBranching.UsageVector): Update to changes.
1103 Prepare to kill 'Reachability'
1104 * flowanalysis.cs (UsageVector): Remove 'Reachability' from
1105 argument of constructor.
1107 2007-03-29 Raja R Harinath <rharinath@novell.com>
1109 Prepare to kill 'Reachability'
1110 * flowanalysis.cs (UsageVector.is_unreachable): New.
1111 (UsageVector): Update to maintain 'is_unreachable' in parallel to
1112 'reachability', and verify they're consistent.
1115 * expression.cs (New.EmitStatement): Handle type parameters here too.
1117 2007-03-29 Martin Baulig <martin@ximian.com>
1122 (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
1123 CompilerGeneratedClass.
1124 (ScopeInfo.EmitScopeInstance): Make this protected.
1125 (CapturedVariable.EmitInstance): Use `Ldarg_0' if
1126 `ec.CurrentAnonymousMethod.Scope == Scope'.
1128 * statement.cs (Block.ScopeInfo): Make this a property.
1130 2007-03-27 Raja R Harinath <harinath@gmail.com>
1132 Prepare to kill 'Reachability'
1133 * flowanalysis.cs (FlowBranching.Reachability): Make class private.
1134 (FlowBranching.UsageVector.Reachability): Remove property.
1135 (FlowBranching.UsageVector.IsUnreachable): New property.
1136 (FlowBranching.UsageVector.ResetBarrier): New.
1137 (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
1138 * codegen.cs, statement.cs: Update to changes.
1140 2007-03-27 Martin Baulig <martin@ximian.com>
1145 (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
1148 2007-03-26 Raja R Harinath <rharinath@novell.com>
1150 * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
1151 instead of TriState. Remove all mention of TriState.
1153 * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
1154 replaced by a boolean. Add boolean 'is_unreachable' field, check
1155 and maintain invariants.
1157 2007-03-25 Marek Safar <marek.safar@gmail.com>
1159 * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
1161 2007-03-25 Marek Safar <marek.safar@gmail.com>
1163 * expression.cs: Stop using obsolete 2.0 opcodes.
1165 2007-03-25 Marek Safar <marek.safar@gmail.com>
1167 * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
1168 one of the latests Martin's fixes.
1170 2007-03-23 Miguel de Icaza <miguel@novell.com>
1172 * expression.cs: On BigEndian systems, swap the bytes, temporary
1173 solution until we get a new bitconverter class.
1175 2007-03-23 Martin Baulig <martin@ximian.com>
1179 * decl.cs (MemberCache.AddMembers): Add generic methods both as
1180 "Method" and "Method`1". Normally, a cache lookup is done on the
1181 "Method" form (ie. without the generic arity), but this one makes
1182 lookups on the full form work as well.
1184 2007-03-22 Raja R Harinath <rharinath@novell.com>
1186 * flowanalysis.cs (Reachability): Reorganize slightly, and remove
1189 2007-03-20 Bill Holmes <billholmes54@gmail.com>
1191 Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
1192 ordered_member_list, to TypeBuilder to store members to be defined
1193 in the order they were parsed in.
1194 - ordered_explicit_member_list contains all properties indexers
1195 and methods that are defined as explicit implementation of an
1196 interface or base class.
1197 - ordered_member_list contains all properties indexers and methods
1198 that are not defined as explicit implementation of an interface
1201 Removed MethodArrayList and IndexerArrayList from TypeBuilder. The
1202 functionality in these removed classes has been replaced with
1203 ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and
1204 CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
1206 Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
1207 to CheckForDuplications inside GetMethod and SetMethod Define Method
1208 to handle method property and indexer name conflicts.
1212 All code is contributed under the MIT/X11 license.
1214 2007-03-20 Martin Baulig <martin@ximian.com>
1216 * class.cs (TypeContainer.Interfaces): Removed; they're now
1217 included in `TypeContainer.Types'.
1219 2007-03-20 Martin Baulig <martin@ximian.com>
1221 Fix #77963, #80314 and #81019. Added gtest-317, ..., gtest-320.
1223 * class.cs (TypeContainer.CreateType): New public method. This is
1224 now called before DefineType() to create the TypeBuilders.
1225 (TypeContainer.DefineType): Don't create the TypeBuilder here; it
1226 has already been created by CreateType().
1227 (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
1228 don't resolve our base classes here; this has been moved into
1229 DefineBaseTypes(). We're now called from CreateType().
1230 (TypeContainer.DefineBaseTypes): New private method; resolve our
1231 base classes here. We're now called from DefineType().
1234 (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
1235 our types first to create all the TypeBuilders. After that, call
1236 TypeContainer.DefineType() on all the types which'll resolve their
1237 base classes and setup the resolve order.
1239 2007-03-20 Martin Baulig <martin@ximian.com>
1241 * class.cs (TypeContainer.Enums): Removed; they're now included in
1242 `TypeContainer.Types'.
1244 2007-03-20 Martin Baulig <martin@ximian.com>
1247 (TypeContainer.DefineType): Don't call ResolveMembers() here.
1248 (TypeContainer.DoResolveMembers): Call DefineType() on our
1249 `compiler_generated' classes; moved here from DefineNestedTypes().
1252 (RootContext.ResolveTree): Call ResolveMembers() on all
1253 TypeContainer's in the `type_container_resolve_order'.
1255 2007-03-19 Marek Safar <marek.safar@gmail.com>
1257 * class.cs: Use corlib to handle InternalMethodImplAttribute.
1259 2007-03-17 Marek Safar <marek.safar@gmail.com>
1261 * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
1262 implementation flags.
1264 2007-03-17 Marek Safar <marek.safar@gmail.com>
1266 * class.cs: More optimizations for type parameters.
1268 2007-03-15 Marek Safar <marek.safar@gmail.com>
1270 * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
1272 * ecore.cs, parameter.cs: More common code for both corlibs.
1274 * typemanager.cs (IsGenericMethod): Simplified.
1276 2007-03-15 Raja R Harinath <rharinath@novell.com>
1278 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
1280 * statement.cs, iterators.cs, lambda.cs: Update to changes.
1282 * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
1283 unconditionally. Simplify explanation.
1284 (Try.Resolve, Using.Resolve): Likewise.
1286 2007-03-15 Martin Baulig <martin@ximian.com>
1290 * decl.cs (DeclSpace): If we're a partial class, use our
1291 `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
1293 2007-03-15 Raja R Harinath <rharinath@novell.com>
1295 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
1297 (FlowBranching.UsageVector): Update to changes.
1298 (FlowBranching.MergeSiblings): Likewise.
1299 * statement.cs: Likewise.
1301 2007-03-15 Martin Baulig <martin@ximian.com>
1306 (MemberCache): Added a special .ctor for type parameters.
1309 (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
1312 2007-03-09 Martin Baulig <martin@ximian.com>
1314 * enum.cs (Enum): Make this a TypeContainer.
1315 (EnumMember): Derive from `Const'.
1318 (Const.DoResolveValue): New protected virtual method; move most of
1319 the functionality of ResolveValue() here so we can override it in
1321 (Const.CreateConstantReference): Make this virtual.
1323 * class.cs (Kind): Add `Kind.Enum'.
1324 (TypeContainer.Emit): Don't emit the enums here; they're already
1325 in the `RootContext.typecontainer_resolve_order'.
1327 * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
1328 here; they're already in the `typecontainer_resolve_order'.
1330 * ecore.cs (EnumConstant.ConvertImplicitly): Add
1331 TypeManager.DropGenericTypeArguments().
1334 (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
1335 (TypeManager.IsEnumType): Likewise.
1336 (TypeManager.EnumToUnderlying): Likewise.
1337 (TypeManager.IsEqual): Add support for enums.
1339 2007-03-12 Raja R Harinath <rharinath@novell.com>
1341 * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
1342 DefaultParameterValueAttribute to be undefined, say if System.dll
1345 2007-03-11 Marek Safar <marek.safar@gmail.com>
1347 * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
1350 2007-03-10 Marek Safar <marek.safar@gmail.com>
1352 * class.cs, parameter.cs: Unified parameters verification.
1354 2007-03-08 Martin Baulig <martin@ximian.com>
1356 * cs-parser.jay (constructor_header): Pass the location to the
1357 newly created TopLevelBlock.
1359 2007-03-07 Martin Baulig <martin@ximian.com>
1361 * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
1363 2007-03-06 Miguel de Icaza <miguel@novell.com>
1365 * convert.cs (ExplicitReferenceConversionExists): Sync this method
1366 with the changes from David, fixes the build.
1368 2007-03-05 David Mitchell <dmitchell@logos.com>
1370 * convert.cs: Implement From System.Collecitons.Generic.IList<T>
1371 and its base interfaces to a one-dimensional array type S[],
1372 provided there is an implicit or explicit reference conversion
1375 2007-03-03 Marek Safar <marek.safar@gmail.com>
1377 * cs-tokenizer.cs: Implemented basic linq grammar.
1379 * driver.cs: Set linq lang version on demand.
1381 2007-02-26 Marek Safar <marek.safar@gmail.com>
1383 * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
1385 2007-02-25 Marek Safar <marek.safar@gmail.com>
1387 * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
1390 * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
1392 Check property and event extern attributes.
1394 * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
1397 2007-02-24 Marek Safar <marek.safar@gmail.com>
1399 A fix for bug #80407
1400 * ecore.cs: Don't report ambiguity error when methods have same parent.
1402 2007-02-23 Marek Safar <marek.safar@gmail.com>
1404 A fix for bug #80878
1405 * class.cs, cs-parser.jay: Event property can host anonymous methods.
1407 2007-02-22 Marek Safar <marek.safar@gmail.com>
1409 * attribute.cs: Enable ExtensionAttribute presence test.
1411 2007-02-22 Marek Safar <marek.safar@gmail.com>
1413 * class.cs: Warn about missing GetHashCode only when Equals is override.
1415 * decl.cs: Check accessibility of type arguments.
1417 * typemanager.cs: Correctly report nullable array.
1419 2007-02-20 Marek Safar <marek.safar@gmail.com>
1421 * class.cs, report.cs: Capture more details when things go wrong.
1423 2007-02-20 Marek Safar <marek.safar@gmail.com>
1425 A fix for bug #80650
1426 * cs-parser.jay: Anonymous container starts at constructor declaration
1427 and not at block beginning because it has to be usable in constructor
1430 * statement.cs: Use context location and not block one for error reporting.
1432 2007-02-18 Marek Safar <marek.safar@gmail.com>
1434 A fix for bug #78712
1435 * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
1438 2007-02-18 Marek Safar <marek.safar@gmail.com>
1440 A fix for bug #80493 by Atsushi Enomoto
1441 * cs-parser.jay: Ignore invalid attribute target.
1443 2007-02-18 Marek Safar <marek.safar@gmail.com>
1445 * cs-tokenizer.cs: Ignore '\0' as white space character.
1447 2007-02-17 Miguel de Icaza <miguel@novell.com>
1449 * cs-parser.jay: Add support for lambda expressions to the mcs
1452 * lambda.cs: Only clone when we are probing, not on the final call
1453 (Compatible is the final call).
1455 * statement.cs (CloneContext): Introduce class to provide block
1456 remapping during clone.
1458 All statements Clone themselves now.
1460 (Clone): special handling for blocks, when we clone a block, we
1461 register the block inside this routine, as children of the block
1462 might trigger a lookup.
1464 * expression.cs: Add support for CloneContext in all expressions.
1466 2007-02-17 Marek Safar <marek.safar@gmail.com>
1468 A fix for bug #80493
1469 * statement.cs: Report ambiguous warning when interfaces are not related.
1471 2007-02-15 Marek Safar <marek.safar@gmail.com>
1473 C# 3.0 extension methods.
1475 * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
1476 cannot be used directly.
1478 * class.cs (Class.Emit): Emit extension attribute if any class method
1479 is extension method.
1480 (Method.Define): Add basic extension method validation conditions.
1481 (Method.Emit): Emit extension attribute for method.
1483 * codegen.cs (AssemblyClass): Emit extension attribute if at least one
1484 extension method exists. Currently we follow same approach as Microsoft
1485 does, emit even if a method or a class are private but this can change
1488 * cs-parser.jay: Add handling of `this' keyword in method parameters
1491 * decl.cs (DeclSpace.IsStaticClass): New property.
1492 (MemberCache.FindExtensionMethods): Looks for extension methods with
1493 defined name and extension type.
1495 * doc.cs: Updated after OverloadResolve changes.
1497 * driver.cs: Add new soft reference to System.Core.dll.
1499 * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
1500 (ExtensionMethodGroupExpr): Represents group of extension methods.
1502 * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
1503 BetterFunction, IsOverride, IsAncestralType, OverloadResolve
1504 to MethodGroupExpr and made non-static for easier customization.
1505 (Invocation.DoResolve): Add extension method lookup when no standard
1507 (MemberAccess.DoResolve): Try extension methods if no member exists.
1509 * modifiers.cs: Add METHOD_EXTENSION modifier.
1511 * namespace.cs (RegisterExtensionMethodClass): Register class namespace
1512 as well as candidate extension type.
1513 (ComputeNamespaces): When assembly constains extension methods registers
1515 (Namespace.RegisterExternalExtensionMethodClass): Register type for later
1516 extension method lookup.
1517 (Namespace.LookupExtensionMethod): Looks for extension method in this
1519 (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
1520 find a method which matches name and extensionType.
1522 * parameter.cs (Parameter): Add This modifer.
1523 (HasExtensionMethodModifier): New property.
1524 (Resolve): Add extension parameter check.
1525 (ModFlags): turned to property to exclude this modifier as it is not real
1527 (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
1529 * support.cs (ParameterData): Add ExtensionMethodType.
1530 (ReflectionParameters): Implemented ExtensionMethodType interface property.
1532 * typemanager.cs: Add type and ctor extension attribute type.
1534 2007-02-15 Miguel de Icaza <miguel@novell.com>
1536 * report.cs (DisableErrors, EnableErrors): used to prevent error
1537 output when we are "trying" to compile various methods with
1540 * ecore.cs (Expression): Add Clone method that calls the virtual
1541 CloneTo method. The current CloneTo method in Expression throws
1542 an exception so we can track down all the places where this must
1543 be implemented (not using abstract, because that would be a lot of
1544 up-front-work before we can start testing the implementation
1547 Important: we only need Clone capabilities for expressions created
1548 by the parser, as the expressions we will be cloning are
1549 expressions in the pre-resolved state. This vastly simplifies
1552 (SimpleName): Add CloneTo that does nothing.
1553 (EmptyCast): Add CloneTo.
1555 * expression.cs (Binary): Implement CloneTo.
1556 (Invocation.IsApplicable): Store the current ec in
1557 EmitContext.TempEc and restore it on return. This is used so we
1558 do not have to sprinkle hundres of methods with an extra
1559 EmitContext, we know that the only user is the lambda expression
1560 ImplicitConversionExists code.
1562 (Argument): Add Cloning capabilities.
1563 (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
1564 Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
1565 ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
1566 UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
1567 IndexerAccess): Add Clone capability.
1569 (LocalVariableReference, This): TODO: needs cloned Block mapping.
1571 (Argument): Add cloning capability.
1573 * assign.cs (Assign): Implement CloneTo.
1575 * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
1577 * lambda.cs (ImplicitStandardConversionExists): Implement lambda
1578 version by calling Convert with the EmitContext (that we are
1579 currently storing in ec, this is not great, but will do for now,
1580 to avoid passing EmitContext parameters to hundreds of functions
1581 that do not need them now).
1583 (SetExpression): Remove, it is not needed.
1585 (ContextualReturn): Implement CloneTo.
1587 * statement.cs (Statement): Implement cloning infrastructure,
1588 similar to expressions.
1590 (Block): Partial implementation of Clone for statements.
1592 (Return): Implement clone.
1594 * constant.cs (Constant.CloneTo): New method, does nothing.
1596 * codegen.cs (TempEc): Add a static EmitContext as a temporary
1597 solution, until we decide how to exactly do this.
1599 2007-02-14 Marek Safar <marek.safar@gmail.com>
1601 A fix for bug #80493
1602 * class.cs (FindOutBaseMethod): When the base accessor does not exist and
1603 a property is override we need to use second accessor.
1605 2007-02-13 Marek Safar <marek.safar@gmail.com>
1607 A fix for bug #80418
1608 * attribute.cs, class.cs: Use correct calling conventions for pinvoke
1611 2007-02-13 Marek Safar <marek.safar@gmail.com>
1613 Another fix for bug #80749
1614 * pending.cs: Abstract class has priority over interfaces.
1616 2007-02-13 Marek Safar <marek.safar@gmail.com>
1618 Another fix for bug #80749
1619 * pending.cs: Abstract class has priority over interfaces.
1621 2007-02-13 Marek Safar <marek.safar@gmail.com>
1623 Another fix for bug #80749
1624 * pending.cs: Abstract class has priority over interfaces.
1626 2007-02-13 Marek Safar <marek.safar@gmail.com>
1628 Another fix for bug #80749
1629 * pending.cs: Abstract class has priority over interfaces.
1631 2007-02-13 Marek Safar <marek.safar@gmail.com>
1633 * class.cs Better error message.
1635 * driver.cs: Add shorter versions of -optimize option.
1637 2007-02-13 Martin Baulig <martin@ximian.com>
1639 * class.cs (Constructor.Emit): Check the return value of
1640 ec.ResolveTopBlock() and return on error.
1642 2007-02-13 Raja R Harinath <rharinath@novell.com>
1644 * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
1645 message to fix error message regression.
1647 2007-02-12 Marek Safar <marek.safar@gmail.com>
1649 * delegate.cs: Delegate creation expression cannot be of Nullable type.
1651 2007-02-12 Marek Safar <marek.safar@gmail.com>
1653 A fix for bug #80749
1654 * assign.cs (FieldInitializer): FieldInitializer has to keep track of
1655 its parent container.
1657 * class.cs (DefineFieldInitializers): Each initializer can has different
1660 * const.cs: Updated.
1662 2007-02-11 Miguel de Icaza <miguel@novell.com>
1664 * lambda.cs (LambdaExpression.Compatible): Remove some early code,
1665 now all the heavy lifting to check that embedded statements or
1666 expressions have the right form is done in the ContextualReturn.
1668 (ContextualReturn): New class.
1670 * ecore.cs (Error_InvalidExpressionStatement): Make a helper
1671 method that can be invoked to report 201, so we do not replicate
1674 * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
1676 * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
1677 treating tabs as spaces.
1679 2007-02-09 Marek Safar <marek.safar@gmail.com>
1681 A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
1682 * assign.cs: Use full implicit conversion for right side check.
1684 2007-02-09 Marek Safar <marek.safar@gmail.com>
1686 * statement.cs (Switch): Switch over boolean type is not standardized.
1688 2007-02-08 Marek Safar <marek.safar@gmail.com>
1690 A fix for bug #80755
1691 * decl.cs (FindBaseEvent): Don't use method cache for events.
1693 2007-02-07 Marek Safar <marek.safar@gmail.com>
1695 * cs-parser.jay: Better syntax error handling.
1697 * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
1698 instead of underlying type value.
1700 2007-02-06 Marek Safar <marek.safar@gmail.com>
1702 * driver.cs: Check define identifier before is registered.
1704 * namespace.cs: Use existing error message.
1706 * report.cs: New warning.
1708 2007-02-06 Marek Safar <marek.safar@gmail.com>
1710 A fix for bug #80742
1711 * expression.cs: Delegate Invoke method can be called directly.
1713 2007-02-06 Marek Safar <marek.safar@gmail.com>
1715 A fix for bug #80676
1716 * class.cs (IsEntryPoint): The Main method can have params modifier.
1718 2007-02-04 Miguel de Icaza <miguel@novell.com>
1720 * parameter.cs (Parameter, Parameters): Add Clone method.
1722 * anonymous.cs (Compatible): Turn method into virtual method, so
1723 LambdaExpression can implement a different behavior.
1725 (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
1726 out the basic checking here, so it can be used by
1729 * lambda.cs: Introduce "Compatible" function that will do the
1732 2007-02-02 Marek Safar <marek.safar@gmail.com>
1734 * attribute.cs: Unified one error message.
1736 * class.cs (Class): Use type attributes and not properties to test static
1738 (IsEntryPoint): Don's pass local variable.
1740 * convert.cs: Removed duplicate check.
1742 * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
1744 * driver.cs: Don't crash when soft reference does not exist.
1746 * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
1747 (UsingEntry): Removed redundant allocation.
1749 * parameter.cs: Add fast path for type parameters.
1751 * support.cs: Don't allocate attribute when it's not used.
1753 2007-01-30 Miguel de Icaza <miguel@novell.com>
1756 (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
1757 this into a virtual method, so we can override it in LambdaExpression.
1759 * driver.cs: Improve diagnostics in case of failure.
1761 * cs-tokenizer.cs: Instead of trying to parse a type and a name,
1762 write a function that is slightly more complex and that parses:
1764 type identifier [, type identifier]* )
1766 The old function would return incorrectly a OPEN_PARENS_LAMBDA for
1769 (canEmpty ? i >= 0 : i > 0)
1771 2007-01-30 Raja R Harinath <rharinath@novell.com>
1773 * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
1774 exception on possibly valid code.
1776 2007-01-29 Raja R Harinath <rharinath@novell.com>
1778 * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
1780 (parse_opt_type_arguments): Remove. It's almost the same as
1782 (parse_namespace_or_typename): Use parse_less_than.
1784 2007-01-28 Miguel de Icaza <miguel@novell.com>
1786 * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
1787 this bug took a few hours to find, because the state saved and
1788 restored by PushPosition and PopPosition was ignoring the state of
1789 parse_generic_less_than.
1791 I can also now remove the handling of OP_LT and OP_GT, this solves
1794 * cs-tokenizer.cs: store the location for the ARROW token, we use
1797 (PushPosition, PopPosition): save/restore also `current_token',
1798 restore `parse_generic_less_than' (was missing).
1800 (parse_opt_type_arguments): use parse_type, not
1801 parse_namespace_or_typename to parse types.
1803 * lambda.cs: Empty new file, will eventually have the lambda
1804 expression implementation.
1806 * lambda.test: used to test the internal tokenizer.
1808 * report.cs (FeatureIsNotISO1): Rename from
1809 FeatureIsNotStandardized, because it was about the language level
1810 (1 vs 2) it was not about standarization.
1812 (FeatureRequiresLINQ): New.
1814 * support.cs (SeekableStreamReader): Only require that the reader
1815 is a TextReader, not a StreamReader, so we can plug StringReader.
1817 * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
1818 given position in the input stream the following tokens can be
1819 parsed as a type followed by an identifier.
1821 (is_punct): after a '(' if parse_type_and_parameter returns true,
1822 then return a special token OPEN_PARENS_LAMBDA which is used to
1823 avoid reduce/reduce errors in the grammar for the
1824 lambda_expression rules.
1826 (parse_type): implement a type parser inside the
1827 tokenizer, the parser only returns true or false depending on
1828 whether the input at a given position can be parsed as a type.
1830 (peek_token): new method used during type parsing.
1832 2007-01-28 Raja R Harinath <rharinath@novell.com>
1835 * anonymous.cs (ScopeInfo.InflateParameters): New.
1836 (AnonymousContainer.Resolve): Use it to redirect types of
1837 delegate parameters.
1839 2007-01-27 Raja R Harinath <rharinath@novell.com>
1842 * expression.cs (Error_InvalidArguments): Don't use two different
1843 messages for CS1503. Use ExtraInformation and
1844 SymbolRelatedToPreviousError instead.
1847 * decl.cs (DeclSpace.initialize_type_params): Don't access
1848 'type_params' of a partial class directly.
1850 2007-01-26 Miguel de Icaza <miguel@novell.com>
1852 * constant.cs: Removed a handful of out-of-range checks that were
1855 2007-01-25 Marek Safar <marek.safar@gmail.com>
1857 * expression.cs (CheckUselessComparison): Add additional check for char
1860 * namespace.cs: Fixed typo.
1862 2007-01-23 Miguel de Icaza <miguel@novell.com>
1864 * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
1865 gone, instead we inline the test, preventing the needless casts to
1866 longs, ulongs and doubles for the parameters, avoiding calls to
1867 methods that overchecked stuff, and instead inlined things
1870 2007-01-20 Marek Safar <marek.safar@gmail.com>
1872 * cs-parser.jay: Better parameter error handling.
1874 2007-01-17 Marek Safar <marek.safar@gmail.com>
1876 A fix for bug #80368, #80522
1877 * expression.cs (ArrayCreation.only_constant_initializers): Indicates
1878 whether array initializer contains constants only.
1879 (ArrayCreation.Emit): Use better formula to decide when
1880 are array initializers for static initialization.
1881 (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
1882 have to emit even constants otherwise they are pre-initialized.
1884 2007-01-17 Bill Holmes <bill.holmes@ansys.com>
1885 Raja R Harinath <rharinath@novell.com>
1887 Fix emit order of 'get' vs. 'set'.
1888 * support.cs (Accessors): New.
1889 * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
1890 Note the order in which accessors are declared in the source.
1891 * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
1892 Refactored from Property.Define and Indexer.Define.
1893 (PropertyBase.DefineAccessors): New helper that calls the above in
1894 appropriate order as noted by the parser.
1895 (Property.Define, Indexer.Define): Update to changes.
1896 (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
1898 2007-01-17 Raja R Harinath <rharinath@novell.com>
1900 Fix cs0029-6.cs and gcs0029-2.cs (regression)
1901 * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
1902 there's an implicit conversion from the current type to the target
1903 type before converting the underlying constant.
1905 2007-01-16 Marek Safar <marek.safar@gmail.com>
1907 * const.cs (ResolveValue): Updated after constant conversion was made more
1910 * constant.cs (GetAttributableValue): constant to object conversion is
1911 used for attributes only.
1912 (IntConstant.ConvertImplicitly): Moved from convert to be used in all
1913 constant conversions.
1914 (LongConstant.ConvertImplicitly): Ditto.
1916 * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
1917 (ImplicitConversionStandard): Handle constant conversion as extra step.
1918 It solves the issue when constant conversion was called indirectly like
1919 inside array initializer and constant folding was skipped.
1921 * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
1924 * statement.cs(ImplicitConversionStandard): Updated after constant
1925 conversion was made more generic.
1927 2007-01-16 Sergey P. Kondratyev <se@unicom.tomica.ru>
1929 * expression.cs (As.DoResolve): Use GenericConstraints instead of
1930 Constraints, solves the problem where the compiler incorrectly
1931 reported that a type parameter was not constrained to a class (Bug
1934 2007-01-14 Marek Habersack <grendello@gmail.com>
1936 * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
1938 2007-01-14 Marek Safar <marek.safar@gmail.com>
1940 A fix for bug #80368
1941 * assign.cs (FieldInitializer): New class implements field
1942 initializer statement.
1944 * attribute.cs: Update after FieldMember rename.
1946 * class.cs (PropertyBasedMember): New common class for property based
1948 (InterfaceMemberBase): New base class for all members which can be used as
1949 an interface members.
1950 (MethodCore): Moved really common code to InterfaceMemberBase.
1951 (Method.Define): Equal and GetHasCode detection is relevant for methods
1953 (MethodData.Define): Don't assume that public event implements an
1954 interface automatically.
1955 (MethodData.DefineMethodBuilder): Issue an error even if only extern
1957 (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
1958 (FieldMember): Merged with FieldBase.
1959 (EventProperty.AEventPropertyAccessor): New specialization to check whether
1960 event extern modifier can be used.
1961 (EventField.EventFieldAccessor): Moved event field specific code here.
1962 (Event.AllowedModifiers): Even event can be extern.
1963 (Event.FindOutBaseMethod): New override specific to events.
1964 (Indexer.parameters): Reintroduce parameters because base class holds
1965 only properties common data.
1966 (Indexer.CheckForDuplications): Indexers are threated as methods so we
1967 need do extra parameters check.
1969 * const.cs: Update after FieldMember rename.
1971 * decl.cs (MemberCache.FindBaseEvent): New method.
1973 * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
1974 to reflect that indexer is now derived from PropertyBased.
1976 * ecore.cs (GetMemberType): Made public.
1977 (EventExpr.ResolveMemberAccess): Use right event cache and checks for
1980 * flowanalysis.cs, statement.cs: Update after FieldMember rename.
1982 * typemanager.cs (CSharpSignature): Correctly print event accessors.
1983 (RegisterEvent): Removed.
1984 (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
1985 (GetPrivateFieldOfEvent): Renamed to GetEventField.
1987 2007-01-11 Raja R Harinath <rharinath@novell.com>
1990 * statement.cs (CollectionForeach.TryType): Prefer generic
1991 GetEnumerator over non-generic variant. Fix code to follow comments.
1993 2007-01-09 Raja R Harinath <rharinath@novell.com>
1996 * support.cs (ReflectionParameter): Don't use an invalid index on
1997 the generic parameter data.
1999 2007-01-08 Miguel de Icaza <miguel@novell.com>
2001 * driver.cs: Just add a tiny bit of infrastructure.
2003 2007-01-02 Marek Safar <marek.safar@gmail.com>
2005 * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
2006 where field type is struct from current assembly.
2008 * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
2011 2007-01-02 Marek Safar <marek.safar@gmail.com>
2013 A fix for bug #80381
2014 * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
2017 * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
2019 (Namespace.LookupType): Always use core types from corlib when speficied.
2021 * report.cs: A new warning.
2023 * rootcontext.cs (BootstrapCorlib_ResolveInterface,
2024 BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
2025 (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
2027 * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
2028 (InitCoreTypes): Set expression type of object_type and value_type
2029 immediately after lookup.
2031 2007-01-01 Miguel de Icaza <miguel@novell.com>
2033 * cs-tokenizer.cs: Accept Pc class characters (Connector
2034 Punctuation) as valid identifiers. Fixes #78259
2036 * expression.cs (Invocation.DoResolve): Moved the check for the
2037 use of `this' for doing method calls to the Invocation resolution
2038 step, after overload resolution has taken place instead of doing
2039 the check at the low-level `This.DoResolve' level.
2041 The `This.DoResolve'(appens before overload resolution, so it has
2042 no way of knowing if the method that will be called will be
2043 instace or static, triggering an erroneous report for cs0188 (Bug
2046 We now do the check for instance method invocations after we know
2047 what method will be called.
2049 (This.CheckThisUsage): Move the actual use of this structure
2050 checking into its own method and expose it.
2052 * Everywhere that called Error_ValueCannotBeConverted: pass a new
2055 Exceptions: Null.ConvertImplicitly,
2056 Constant.ImplicitConversionRequired as there are too many call
2057 sites for passing the ec.
2059 * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
2060 EmitContext, if the value is null, then we do not try to provide
2061 the extra information from the error (If a userdefined conversion
2062 exists, as UserDefinedConversion requires a non null-EmitContext).
2066 2006-12-30 Raja R Harinath <rharinath@novell.com>
2068 * flowanalysis.cs (MyBitVector): Document some invariants.
2069 (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
2070 introduced below, and add a couple of others,
2072 2006-12-30 Marek Safar <marek.safar@gmail.com>
2074 * attribute.cs (GetMethodObsoleteAttribute): Uses new
2075 GetPropertyFromAccessor and GetEventFromAccessor.
2077 * class.cs (MethodCore.CheckBase): A new warning when obsolete member
2078 overrides non-obsolete one.
2079 (Indexer.Define): Error message has been moved to the parser.
2081 * cs-parser.jay: Better syntax errors handling.
2083 * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
2084 when an invocation has no arguments.
2086 * ecore.cs: Removed not used caching.
2088 * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
2091 * report.cs: Add a new warning.
2093 * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
2095 * typemanager.cs (enumeration_type): Removed.
2096 (CSharpSignature): Reuses IsSpecialMethod.
2097 (IsEqual): Hack for MS BCL.
2098 (GetPropertyFromAccessor): New method.
2099 (GetEventFromAccessor): New method.
2100 (IsSpecialMethod): Fixed to handle more cases.
2102 2006-12-30 Marek Safar <marek.safar@gmail.com>
2104 * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
2105 Made white spaces array static.
2107 * ecore.cs (RemoveGenericArity): Optimized.
2109 * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
2111 (MyBitVector.initialize_vector): Simplified.
2113 2006-12-22 Miguel de Icaza <miguel@novell.com>
2115 * ecore.cs: Am not entirely happy with this hack, but it seems to
2116 address the issue in 80257 (a small test case for
2119 I set the MethodGroupExpr.Type to an internal compiler type
2120 (itself in this case) to force the resolution to take place. Why
2121 it does not take place with a null is beyond me.
2123 2006-12-20 Marek Safar <marek.safar@gmail.com>
2125 A fix for bug #80288
2126 * expression.cs (ResolveOperator): Consider user defined conversion for
2127 logical and operator too.
2128 (EmitBranchable): Optimization for logical and when full constant folding
2129 could not be applied but one operand is constant.
2131 2006-12-19 Marek Safar <marek.safar@gmail.com>
2133 * class.cs (GetClassBases): Write 5 times every day, will never use
2134 FullName for error reporting.
2136 * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
2138 2006-12-19 Martin Baulig <martin@ximian.com>
2140 * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
2141 the symbol file info here.
2143 2006-12-18 Marek Safar <marek.safar@gmail.com>
2145 * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
2146 of `elseif' is taking then following sections are not taking.
2147 Fixes an issue reported on mono mailing list.
2149 2006-12-18 Marek Safar <marek.safar@gmail.com>
2151 A fix for bug #80300
2152 * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
2153 a caller is not taking.
2155 2006-12-18 Raja R Harinath <rharinath@novell.com>
2157 * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
2158 (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
2159 (RootScopeInfo, AnonymousMethodMethod): Update to changes.
2160 * iterator.cs: Change several TypeContainer declarations to DeclSpace.
2161 * class.cs: Update to changes.
2163 2006-12-17 Marek Safar <marek.safar@gmail.com>
2165 A fix for bug #79934
2166 * anonymous.cs (CompilerGeneratedClass): Register class in a shared
2169 * class.cs (ResolveMembers): Register an iterator in current container and
2172 2006-12-16 Raja R Harinath <rharinath@novell.com>
2175 * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
2176 satisfy a params annotated parameter.
2178 2006-12-16 Marek Safar <marek.safar@gmail.com>
2180 A fix for bug #77014
2181 * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
2182 paramters correctly and not rely on hacks in Parameters class.
2183 (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
2185 (Invocation.VerifyArgumentsCompat): Ditto.
2186 (Invocation.EmitArguments): Changed to correctly emit params arguments at
2189 * parameter.cs (HasParams): Don't assume that params is the last one.
2191 * support.cs (ReflectionParameters.ctor): Look for params attribute
2193 (ReflectionParameters.ParameterType): Removed hack when we returned last
2194 parameter for out of range parameters.
2195 (ParameterName, ParameterModifier): Ditto.
2197 2006-12-14 Marek Safar <marek.safar@gmail.com>
2199 A fix for bug #79987
2200 * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
2201 when assembly is not CLS compliant but type is. I have no idea why is this
2204 * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
2206 2006-12-13 Miguel de Icaza <miguel@novell.com>
2208 * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
2209 in struct constructors, they are basically no-ops.
2211 2006-12-12 Marek Safar <marek.safar@gmail.com>
2213 * cs-tokenizer.cs (Position): Save preprocessor status too.
2215 2006-12-12 Marek Safar <marek.safar@gmail.com>
2217 A fix for bug #77794
2218 * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
2220 2006-12-12 Marek Safar <marek.safar@gmail.com>
2222 * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
2224 (pp_expr): Report error for an invalid expression.
2225 (handle_preprocessing_directive): Simplified; add more error checking.
2227 2006-12-11 Marek Safar <marek.safar@gmail.com>
2229 A fix for bug #74939
2230 * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
2231 directives handling.
2233 2006-12-10 Marek Safar <marek.safar@gmail.com>
2235 A fix for bugs #80093, and #75984
2236 * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
2237 logic, it seems to me as it worked before "by coincidence".
2238 (xtoken): Simplified to use reworked handle_preprocessing_directive.
2239 (cleanup): Enabled endif check.
2241 2006-12-09 Marek Safar <marek.safar@gmail.com>
2243 A fix for bug #80162
2244 * statement.cs (CollectionForeach.TryType): Generics and non-generics
2245 enumerators are never ambiguous.
2247 2006-12-08 Raja R Harinath <rharinath@novell.com>
2250 * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
2252 2006-12-06 Marek Safar <marek.safar@gmail.com>
2254 A fix for bug #80144
2255 * class.cs (EventProperty.Define): Explicit implementation means
2256 that an even is used.
2258 2006-12-06 Marek Safar <marek.safar@gmail.com>
2260 Fixes the operators implementation (part II)
2262 * cfold.cs (DoConstantNumericPromotions): Renamed to
2263 DoBinaryNumericPromotions and simplified.
2264 (BinaryFold): Couple of conversion fixes; simplified.
2266 * constant.cs, ecore.cs, literal.cs
2267 (ToType): Renamed to ConvertImplicitly.
2268 (Reduce): Renamed to ConvertExplicitly.
2270 * class.cs, convert.cs: Updated.
2272 * expression.cs: TryReduce doesn't throw an exception.
2274 2006-12-01 Marek Safar <marek.safar@gmail.com>
2276 A fix for bug #80108
2277 * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
2280 2006-11-30 Marek Safar <marek.safar@gmail.com>
2282 Fixes unary operators implementation (part I)
2285 * cfold.cs (Error_CompileTimeOverflow): Made internal
2287 * const.cs (IConstant): Changed to use reference to constant and
2288 not constant itself.
2289 Updated IConstant implementations.
2291 * constant.cs (CreateConstant): New factory method.
2292 Updated IConstant implementation.
2294 * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
2296 * ecore.cs: Updated to use CreateConstantReference.
2298 * enum.cs: Reflects IConstant changes.
2300 * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
2302 * literal.cs (NullConstant): Change to be independently usable.
2304 2006-11-29 Martin Baulig <martin@ximian.com>
2306 * class.cs (Constructor.Emit): Correctly handle anonymous methods;
2307 we need to emit the scope initializer before calling the base .ctor.
2309 * anonymous.cs: Merged back from the new anonymous methods branch.
2310 (AnonymousMethodHost): Renamed to `RootScopeInfo'.
2312 * expression.cs (ParameterReference.DoResolveBase): Create a
2313 "normal" ScopeInfo when capturing parameters rather than using the
2314 root scope; this makes things work with anonymous methods having
2318 (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
2320 2006-11-22 Marek Safar <marek.safar@gmail.com>
2322 A fix for bug #79987
2323 * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
2324 check to a base class.
2325 * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
2326 only when assembly has missing attribute.
2327 * report.cs: Update.
2329 2006-11-21 Marek Safar <marek.safar@gmail.com>
2331 * cs-tokenizer.cs: Merged with gmcs version.
2333 2006-11-20 Marek Safar <marek.safar@gmail.com>
2336 * cs-parser.jay: Better error message when partial keyword is misplaced.
2338 2006-11-19 Gert Driesen <drieseng@users.sourceforge.net>
2340 A fix for bug #79810
2341 report.cs: CS1058 only applies to 2.0 profile (gmcs).
2342 codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
2343 a RuntimeWrappedException by default.
2345 2006-11-18 Marek Safar <marek.safar@gmail.com>
2347 A fix for bug #79843
2348 * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
2350 (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
2352 2006-11-18 Marek Safar <marek.safar@gmail.com>
2354 * driver.cs, namespace.cs: Uses faster IndexOf version.
2356 2006-11-17 Marek Safar <marek.safar@gmail.com>
2358 A fix for bug #79941
2359 * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
2361 (Operator.Define): Implicit/Explicit operator of same type is duplicate
2362 even if internal name is different.
2363 * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
2364 (UserDefinedConversion): Simplified as the operators cannot be internal.
2365 * ecore.cs (Error_ValueCannotBeConverted): Take account of user
2367 (MethodLookup): Replaced EmitContext with parentType.
2368 * expression.cs: Updated.
2370 2006-11-09 Raja R Harinath <rharinath@novell.com>
2372 * driver.cs (BadAssembly): Handle all the ugliness of
2373 DefineDynamicAssembly.
2375 2006-11-08 Raja R Harinath <rharinath@novell.com>
2377 Address parts of #58244 -- most of what's left is in the runtime
2378 * driver.cs (LoadAssembly): Simplify slightly. Add CS0009 and
2379 CS1509 error checks, and handle them for all assembly loads, not
2380 just the first invocation.
2381 (LoadModule): Likewise. Move handling of 'adder_method' ...
2382 * codegen.cs (AssemblyClass.AddModule): ... here.
2384 2006-11-02 Marek Safar <marek.safar@gmail.com>
2386 * statement.cs.cs (CollectionForeach.TryType): Issue a error when
2387 IEnumerable<T> is ambiguous.
2389 2006-10-31 Marek Safar <marek.safar@gmail.com>
2391 A fix for bug #67689
2392 * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
2393 GetEnumerator is ambiguous.
2395 * report.cs: Add new warning.
2397 2006-10-29 Marek Safar <marek.safar@gmail.com>
2399 A fix for bug #78602
2400 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
2401 to protected member can be nested type.
2403 2006-10-28 Marek Safar <marek.safar@gmail.com>
2405 A fix for bug #78965
2406 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
2407 to protected member must derive from current type.
2409 2006-10-27 Marek Safar <marek.safar@gmail.com>
2411 assign.cs: Reuses error method.
2413 ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
2414 instead of type for constants.
2415 (Expression.Error_ValueAssignment): Common error method.
2417 * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
2420 2006-10-27 Marek Safar <marek.safar@gmail.com>
2422 A fix for bug #79081
2423 * expression.cs (MemberAccess.DoResolve): Check nested type
2426 2006-10-27 Atsushi Enomoto <atsushi@ximian.com>
2428 * doc.cs : nested delegates were not handled. Fixed bug #79754.
2430 2006-10-26 Marek Safar <marek.safar@gmail.com>
2432 A fix for bug #76591
2433 * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
2435 2006-10-26 Marek Safar <marek.safar@gmail.com>
2437 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
2438 type forwarder of the same type multiple times.
2440 2006-10-26 Raja R Harinath <rharinath@novell.com>
2443 * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
2444 instance as an rvalue, even when we later resolve as an lvalue.
2446 2006-10-25 Martin Baulig <martin@ximian.com>
2448 * anonymous.cs: Fix #79673.
2450 2006-10-24 Marek Safar <marek.safar@seznam.cz>
2452 A fix for bug #79666
2453 expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
2454 ignored when is optimized (= default value) as its value is already set.
2456 2006-10-23 Marek Safar <marek.safar@seznam.cz>
2458 A fix for bug #79724
2459 * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
2460 TypeContainer for type lookup.
2462 2006-10-23 Marek Safar <marek.safar@seznam.cz>
2464 A fix for bug #79231
2465 * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
2466 * expression.cs (OverloadResolve): Always convert type name for
2468 (ResolveNamespaceOrType): Don't confuse a nested type with any
2471 2006-10-18 Martin Baulig <martin@ximian.com>
2473 * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
2475 2006-10-17 Miguel de Icaza <miguel@novell.com>
2477 * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
2478 an int32, but requesting an int64 from the conversion
2480 2006-10-12 Martin Baulig <martin@ximian.com>
2483 (AnonymousContainer.Resolve): Inflate the `ReturnType'. Fixes #79592.
2485 2006-10-12 Martin Baulig <martin@ximian.com>
2488 (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
2490 2006-10-11 Miguel de Icaza <miguel@novell.com>
2492 * convert.cs: Remove broken code: I was doing the "Existance"
2493 tests for Implicit conversions.
2495 2006-10-10 Miguel de Icaza <miguel@novell.com>
2497 * convert.cs: Added one missing case in
2498 ImplicitStandardConversionExists uint64 to intptr.
2502 * typemanager.cs (uintptr_type): another core known type.
2504 * ecore.cs (OperatorCast): routine used to do cast operations that
2505 depend on op_Explicit. We could change some of the Decimal
2506 conversions to use this.
2508 This one has a probe mechanism that checks both types for an op_
2509 which it coudl be used to eliminate two classes: CastToDecimal
2510 and CastFromDecimal.
2512 * convert.cs: Implement the conversions documented in #59800
2514 2006-10-10 Martin Baulig <martin@ximian.com>
2516 * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
2517 before RootScope.ResolveMembers().
2519 * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
2520 `CurrentType' if appropriate.
2522 2006-10-09 Marek Safar <marek.safar@seznam.cz>
2524 A fix for bug #78568
2525 * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
2526 when contains binary operators.
2527 * cs-parser.jay: Updated.
2529 2006-10-09 Martin Baulig <martin@ximian.com>
2532 (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
2533 moved that into Define() and also do the other type parameter
2534 checks there. Fixes #79094. Added gtest-292.cs.
2537 (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
2538 since that doesn't include type parameters; don't use `Ldelema'
2539 for type parameters. Fixes #78980. Added gtest-293.cs.
2541 2006-10-08 Marek Safar <marek.safar@seznam.cz>
2544 * convert.cs (ExplicitReferenceConversion): Only enum to enum value
2545 conversion is allowed.
2547 2006-10-06 Marek Safar <marek.safar@seznam.cz>
2549 * ecore.cs (Expression.MemberLookup): Don't register any symbol for
2550 error reporting when no error occurs.
2552 2006-10-06 Marek Safar <marek.safar@seznam.cz>
2554 * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
2557 2006-10-06 Raja R Harinath <rharinath@novell.com>
2560 * class.cs (DefineTypeBuilder): Check circular dependencies before
2561 setting the parent of the TypeBuilder.
2562 (CheckRecursiveDefinition): Don't use 'BaseType', since
2563 it may not be valid until after DefineTypeBuilder. Use
2564 'base_type' instead.
2566 2006-10-04 Martin Baulig <martin@ximian.com>
2568 Merged the Anonymous Methods patch.
2570 * anonymous.cs, iterators.cs: The new anonymous methods code.
2572 * statement.cs (Variable): New public abstract class.
2573 (LocalInfo.Variable): New public property.
2574 (LocalInfo.ResolveVariable): New public method.
2575 (Block.Flags): Add `IsIterator'.
2576 (Block.AddVariable): Improved the CS0136 check.
2577 (Block.AnonymousChildren): New public property.
2578 (Block.AddAnonymousChild): New public method.
2579 (ToplevelBlock): Update to use the new anonymous method framework.
2580 (ToplevelBlock.ctor): `container' is now a `Block' and not a
2581 `ToplevelBlock'; this is required to correctly implement the
2583 (Fixed, Using): Use `TemporaryVariable' instead of directly
2584 creating the `LocalBuilder'.
2586 * parameter.cs (Parameter.ResolveVariable): New public method.
2587 (Parameters.ResolveVariable): Likewise.
2589 * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
2591 * class.cs (TypeContainer): Replaced the `iterators' list and
2592 corresponding methods with a list of `CompilerGeneratedClass'es.
2593 (TypeContainer.ResolveMembers): New public method.
2594 (Method): `IIteratorContainer' has been replaced by
2597 * expression.cs (VariableReference): New public abstract base
2598 class for `LocalVariableReference', `ParameterReference' and
2601 * codegen.cs (EmitContext): Removed `capture_context',
2602 `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
2603 (EmitContext.EmitThis): Removed.
2605 * cs-parser.jay: Replace `iterator_container' with
2608 2006-10-04 Martin Baulig <martin@ximian.com>
2610 * generic.cs (GenericMethod): Don't make this abstract.
2611 (Constraints.Clone): Added dummy implementation.
2613 2006-10-04 Raja R Harinath <harinath@gmail.com>
2616 * namespace.cs (LookForAnyGenericType): Avoid nullref on
2617 'declspaces'. Avoid allocating arrays willy-nilly.
2620 * cfold.cs (BinaryFold): Move boolean Equality and Inequality
2621 cases out of the switch.
2623 2006-09-28 Marek Safar <marek.safar@seznam.cz>
2625 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
2626 message when non-generic type is used with the type arguments.
2627 * expression.cs: Updated.
2629 2006-09-28 Raja R Harinath <rharinath@novell.com>
2632 * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
2633 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
2634 Change semantics slightly. Don't insist on having only one
2635 temporary EmptyExpression -- just throttle the creation of new ones.
2638 * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
2639 non-interfaces too. If no methods are found, don't try to create
2642 2006-09-28 Marek Safar <marek.safar@seznam.cz>
2644 * ecore.cs (ResolveAsTypeStep): Print better error when type can be
2647 * namespace.cs (Namespace.LookForAnyGenericType): New method to help
2648 us produce better error message.
2650 2006-09-27 Marek Safar <marek.safar@seznam.cz>
2652 * expression.cs (Binary.ResolveOperator): Warn about a side effect
2653 of the `|' operator.
2655 * report.cs: A new warning added.
2657 2006-09-27 Martin Baulig <martin@ximian.com>
2659 * generic.cs (GenericMethod): Don't make this abstract.
2661 2006-09-27 Martin Baulig <martin@ximian.com>
2664 (InternalErrorException): Added overloaded ctor taking a params array.
2666 2006-09-26 Marek Safar <marek.safar@seznam.cz>
2668 * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
2669 Fixed the cases when same error was reported twice.
2671 * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
2672 now report symbol information.
2674 2006-09-25 Martin Baulig <martin@ximian.com>
2676 * class.cs: Completely unified with the gmcs version.
2678 2006-09-25 Martin Baulig <martin@ximian.com>
2680 * typemanager.cs (TypeManager.IsNullableType): New public function.
2681 (TypeManager.IsNullableTypeOf): Likewise.
2682 (TypeManager.IsNullableValueType): Likewise.
2684 * class.cs (MethodCore): Added the `GenericMethod' argument from
2685 gmcs and also unified all classes derived from `MethodCore' with gmcs.
2687 2006-09-24 Raja R Harinath <harinath@gmail.com>
2689 * convert.cs: Unify with gmcs version.
2691 2006-09-24 Marek Safar <marek.safar@seznam.cz>
2693 * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
2694 verify them as well.
2696 * report.cs: New warning.
2698 2006-09-24 Marek Safar <marek.safar@seznam.cz>
2700 * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
2701 for anonymous block with out argument.
2703 2006-09-24 Marek Safar <marek.safar@seznam.cz>
2705 * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
2706 not used private events only.
2708 2006-09-23 Marek Safar <marek.safar@seznam.cz>
2710 * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
2712 * const.cs (Const.Define): Check for constant type.
2713 (Const.IsConstantTypeValid): Looks for valid constant types.
2715 * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
2717 * ecore.cs (EmptyConstantCast): New common class for all constant based
2720 * expression.cs (Is.DoResolve): Handle null constant especially.
2721 (New.DoResolve): Check for new void().
2722 (MemberAccess.DoResolve): Cope with all kind of nulls.
2724 * literal.cs (NullConstant): Uses EmptyConstantCast.
2725 (NullDefault): Based on EmptyConstantCast.
2726 (NullLiteral): Uses EmptyConstantCast.
2728 * statement.cs (Block.ResolveMeta): Check for constant type.
2730 2006-09-22 Martin Baulig <martin@ximian.com>
2732 * delegate.cs, attribute.cs: Merged with the gmcs versions.
2734 2006-09-22 Raja R Harinath <rharinath@novell.com>
2736 * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
2740 * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
2741 * decl.cs (DeclSpace.FindMemberToOverride): Likewise. Reorganize
2744 2006-09-22 Martin Baulig <martin@ximian.com>
2746 * ecore.cs: Merged with the gmcs version.
2748 * generic.cs (ConstructedType): New dummy class.
2749 (TypeArguments): Don't make this abstract.
2752 (TypeManager.IsGenericTypeDefinition): New method.
2753 (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
2755 2006-09-22 Raja R Harinath <rharinath@novell.com>
2757 * expression.cs (ComposedCast): Check for arrays of TypedReference
2758 before creating the type, not after.
2760 2006-09-21 Marek Safar <marek.safar@seznam.cz>
2762 * cfold.cs, const.cs, enum.cs, statement.cs: Updated
2763 after ToType change.
2765 * constant.cs (Constant.ImplicitConversionRequired): Designed to used
2766 when constant must be implicitly convertible.
2768 * convert.cs (ImplicitReferenceConversion): Reuse ToType.
2770 * ecore.cs (NullCast): Derives from NullConstant.
2772 * expression.cs (Is.DoResolve): Removed useless variables.
2773 (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
2774 (New.Constantify): Add enum support.
2775 (MemberAccess.DoResolve): Add warning when accessing null constant or
2778 * generic.cs (GenericConstraints.IsReferenceType): Another dummy
2781 * literal.cs (NullConstant): New abstract class with common
2782 functionality for all null specializations.
2783 (NullDefault): Represents default(X) when result can be
2785 (NullLiteral): Updated.
2787 * report.cs: Add new warning.
2789 2006-09-21 Martin Baulig <martin@ximian.com>
2791 * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
2793 2006-09-21 Martin Baulig <martin@ximian.com>
2795 * generic.cs (GenericConstraints): New dummy class.
2796 (Constraints): Likewise.
2797 (TypeParameter): Likewise.
2798 (TypeParameterName): Likewise.
2799 (GenericMethod): Likewise.
2801 * typemanager.cs (TypeManager.GetGenericArguments): New method.
2803 * decl.cs: Merged with the gmcs version.
2805 2006-09-21 Raja R Harinath <rharinath@novell.com>
2807 * generic.cs (TypeParameter): Implement IMemberContainer.
2808 (GenericTypeParameterBuilder): New. An abominable repugnant hack.
2810 * rootcontext.cs: Unify with gmcs version.
2812 * report.cs: Unify with gmcs version.
2813 * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
2814 from gmcs/generics.cs.
2815 * generics.cs (TypeParameter): New dummy class.
2817 * support.cs: Unify with gmcs version.
2819 2006-09-20 Raja R Harinath <rharinath@novell.com>
2821 * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
2822 * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
2824 * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
2825 * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
2826 * mcs.exe.sources: Add generic.cs.
2828 * codegen.cs: Unify with gmcs version.
2830 * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
2831 (EmitContext): Add GenericDeclContainer implementation.
2832 * decl.cs (MemberCore, DeclSpace): Likewise.
2833 * namespace.cs: Remove #ifdef GMCS_SOURCE.
2835 * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
2836 MCS TypeManager has a corresponding dummy method.
2838 2006-09-19 Martin Baulig <martin@ximian.com>
2840 * expression.cs: Completely merged with the gmcs version.
2842 2006-09-19 Martin Baulig <martin@ximian.com>
2844 * expression.cs (Invocation): Merged with the gmcs version.
2845 (ArrayAccess.GetStoreOpcode): Likewise.
2847 2006-09-19 Martin Baulig <martin@ximian.com>
2850 (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
2851 (TypeManager.IsGenericMethodDefinition): Likewise.
2853 2006-09-19 Martin Baulig <martin@ximian.com>
2856 (TypeManager.IsEqual): Moved the gmcs implementation here.
2857 (TypeManager.DropGenericTypeArguments): Likewise.
2858 (TypeManager.DropGenericMethodArguments): Likewise.
2859 (TypeManager.GetTypeArguments): Moved here from gmcs.
2860 (TypeManager.HasGenericArguments): Likewise.
2862 2006-09-19 Martin Baulig <martin@ximian.com>
2864 * expression.cs (Binary): Merged with the gmcs version.
2866 2006-09-19 Martin Baulig <martin@ximian.com>
2868 * expression.cs (Probe, As, Is): Merged with the gmcs version.
2870 2006-09-19 Martin Baulig <martin@ximian.com>
2872 * typemanager.cs: Merged with the gmcs version.
2874 2006-09-16 Raja R Harinath <rharinath@novell.com>
2876 * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
2877 * driver.cs: Likewise.
2879 2006-09-16 Marek Safar <marek.safar@seznam.cz>
2882 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
2883 only if parent type is class.
2884 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
2887 2006-09-15 Marek Safar <marek.safar@seznam.cz>
2890 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
2892 * typemanager.cs(CSharpName): Converts NullType to null.
2894 2006-09-15 Martin Baulig <martin@ximian.com>
2897 (TypeManager.GetMethodName): Added mcs implementation.
2898 (TypeManager.IsEqual): Likewise.
2901 (SimpleName.RemoveGenericArity): Added dummy implementation.
2903 * pending.cs: Merged with the gmcs version.
2905 2006-09-15 Martin Baulig <martin@ximian.com>
2907 * statement.cs: Merge with the gmcs version.
2909 2006-09-15 Martin Baulig <martin@ximian.com>
2911 * statement.cs (Switch): Merge with the gmcs implementation
2912 (without nullables), which is newer.
2914 2006-09-15 Martin Baulig <martin@ximian.com>
2916 * statement.cs (Block.Variables): Make this public.
2917 (ToplevelBlock.Parameters): Make this a property.
2918 (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
2920 2006-09-15 Martin Baulig <martin@ximian.com>
2922 * namespace.cs: Merge with the gmcs version.
2924 2006-09-15 Martin Baulig <martin@ximian.com>
2926 * decl.cs (MemberName): Minor code cleanups.
2928 2006-09-15 Martin Baulig <martin@ximian.com>
2930 * parameter.cs: Merge with the gmcs version.
2932 2006-09-15 Martin Baulig <martin@ximian.com>
2934 * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
2935 and an error in mcs.
2937 2006-09-15 Martin Baulig <martin@ximian.com>
2939 * flowanalysis.cs: Merged from GMCS; added the generics code into
2940 a `GMCS_SOURCE' conditional so we can share this file.
2942 2006-09-08 Martin Baulig <martin@ximian.com>
2944 * typemanager.cs (TypeManager.interlocked_type): New public field.
2945 (TypeManager.int_interlocked_compare-exchange): New public field.
2946 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
2947 enumerator types here and call InitGenericCoreTypes().
2948 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
2949 after calling InitEnumUnderlyingTypes().
2952 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
2953 `classes_second_stage'.
2955 2006-09-14 Marek Safar <marek.safar@seznam.cz>
2957 * assign.cs, ecore.cs, expression.cs: Share error message text.
2958 * class.cs (FieldMember.Define): Check for varible of static type.
2959 * driver.cs (LoadAssembly): Uses error output for errors.
2960 * statement.cs: Updated.
2962 2006-09-08 Marek Safar <marek.safar@seznam.cz>
2964 * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
2967 2006-09-07 Martin Baulig <martin@ximian.com>
2970 (MainDriver): Revert r62663 from Marek; see #70506 for details.
2972 2006-08-29 Miguel de Icaza <miguel@novell.com>
2974 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
2976 2006-08-17 Miguel de Icaza <miguel@novell.com>
2978 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
2979 #52019 and #79064, the use of the \uXXXX sequence in source code
2980 to represent unicode characters.
2982 2006-08-15 Marek Safar <marek.safar@seznam.cz>
2984 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
2986 * class.cs, ecore.cs, statement.cs: Merged to one error message.
2988 2006-08-13 Miguel de Icaza <miguel@novell.com>
2990 * assign.cs: Catch attempts to assign to a method groups in += and
2993 2006-08-13 Marek Safar <marek.safar@seznam.cz>
2996 * cs-parser.jay: Don't destroy current array type by typeof of array's.
2998 2006-08-12 Marek Safar <marek.safar@seznam.cz>
3000 * class.cs (Method.Define): Issue a warning when generic method looks like
3002 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
3005 2006-08-09 Marek Safar <marek.safar@seznam.cz>
3007 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
3009 * decl.cs (MemberCache.FindMembers): When container is interface we need to
3010 search all base interfaces as a member can be ambiguous.
3011 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
3012 Constructor member type filter.
3013 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
3014 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
3015 reporting for returned memberinfos.
3016 * report.cs: Updated.
3017 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
3018 version to work on all runtimes.
3019 (TypeManager.RealMemberLookup): Removed members filtering.
3021 2006-08-08 Raja R Harinath <rharinath@novell.com>
3023 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
3024 (PropertyExpr.EmitAssign): Likewise.
3025 * expression.cs (Indirection.EmitAssign): Likewise.
3026 (LocalVariableReference.EmitAssign): Likewise.
3027 (ParameterReference.EmitAssign): Likewise.
3028 (Invocation.EmitArguments): Likewise.
3029 (ArrayAccess.EmitAssign): Likewise.
3030 (IndexerAccess.EmitAssign): Likewise.
3031 (This.EmitAssign): Likewise.
3032 (ConditionalLogicalOperator.Emit): Likewise.
3035 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
3036 instead of ArrayList. If the hashtable has a LocalBuilder, don't
3037 leave it in after returning it.
3038 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
3040 2006-08-06 Marek Safar <marek.safar@seznam.cz>
3042 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
3045 2006-08-03 Raja R Harinath <rharinath@novell.com>
3047 Fix cs0146-3.cs and cs0146-4.cs.
3048 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
3049 enclosing types don't depend on the current type.
3051 2006-08-02 Raja R Harinath <rharinath@novell.com>
3054 * class.cs (TypeContainer.DoDefineMembers): Use
3055 FindBaseMemberWithSameName on Parent, since we're interested in
3056 whether we hide inherited members or not.
3057 (FindBaseMemberWithSameName): Make slightly more robust.
3059 Fix the non-generic testcase from #77396
3060 * decl.cs (DeclSpace.DeclContainer): Remove override.
3062 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
3063 declspaces for doppelgangers too.
3064 (UsingEntry): Implement IResolveContext.
3065 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
3066 'this' as the resolve context.
3067 (LocalAliasEntry): Likewise.
3069 Implement parts of #77403
3070 * roottypes.cs (RootDeclSpace): New. Used to represent the
3071 toplevel declaration space. Each namespace declaration introduces
3072 a "partial" root declaretion space.
3073 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
3074 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
3075 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
3076 from 'current_namespace.SlaveDeclSpace'.
3077 (namespace_declaration): Likewise.
3078 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
3079 check. It can't happen now.
3080 * decl.cs (DeclSpace.LookupType): Likewise.
3081 * driver.cs (MainDriver): Sanity check.
3083 2006-08-01 Raja R Harinath <rharinath@novell.com>
3085 * decl.cs (DeclSpace.FindNestedType): Remove.
3086 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
3087 LookupTypeContainer to get the container of the nested type.
3088 * class.cs (TypeContainer.FindNestedType): Make non-override.
3090 2006-07-31 Raja R Harinath <rharinath@novell.com>
3092 * decl.cs (DeclSpace.PartialContainer): Move field from ...
3093 * class.cs (TypeContainer.PartialContainer): ... here.
3094 (TypeContainer.AddBasesForPart): New helper.
3095 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
3097 * cs-parser.jay (current_class): Convert to DeclSpace.
3098 (struct_declaration, interface_declaration, class_declaration):
3099 Use AddBasesForPart instead of .Bases directly.
3100 * const.cs, iterators.cs: Update to changes.
3102 2006-07-28 Raja R Harinath <rharinath@novell.com>
3104 * class.cs (TypeContainer.AddMemberType): Rename from
3106 (TypeContainer.AddMember): Rename from AddToMemberContainer.
3107 (AddTypeContainer): New. Combine AddClassOrStruct and
3109 (AddPartial): Update. Add 'is_partial' argument.
3110 * roottypes.cs: Update to changes.
3111 * cs-parser.jay (push_current_class): New helper for handling
3112 current_container and current_class.
3113 (struct_declaration, interface_declaration, class_declaration):
3116 2006-07-26 Raja R Harinath <rharinath@novell.com>
3118 * roottypes.cs: Rename from tree.cs.
3120 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
3121 * tree.cs (Tree, ITreeDump): Remove types.
3122 * rootcontext.cs (tree, Tree): Remove fields.
3123 (root, ToplevelTypes): New.
3124 * *.cs: Update to rename.
3126 * tree.cs (Tree.RecordDecl): Remove.
3127 (RootTypes.AddToTypeContainer): Record the toplevel type in its
3129 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
3131 2006-07-23 Raja R Harinath <harinath@gmail.com>
3133 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
3134 DoFlowAnalysis and OmitStructFlowAnalysis here.
3135 (ec.With): Rename from WithUnsafe and generalize.
3136 (ec.WithCheckState): Remove. All users can be handled by 'With'.
3137 (ec.WithFlowAnalyis): New.
3138 * ecore.cs, expression.cs, statement.cs: Update.
3140 2006-07-22 Raja R Harinath <harinath@gmail.com>
3142 * statement.cs (Block.ResolveMeta): Simplify slightly.
3144 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
3145 multiple boolean fields. Convert InUnsafe, constant_check_state,
3146 check_state to flags.
3147 (CheckState, ConstantCheckState): Update.
3148 (InUnsafe): New read-only property.
3149 (FlagsHandle): Rename from CheckStateHandle and convert to handle
3151 (WithUnsafe): New helper similar to WithCheckState.
3152 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
3153 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
3155 2006-07-21 Raja R Harinath <rharinath@novell.com>
3157 Make comparisons use the same IL irrespective of whether they're
3158 in a 'checked' or 'unchecked' context: one of the issues in #78899
3159 * codegen.cs (EmitContext.CheckState): Make read-only property.
3160 (EmitContext.ConstantCheckState): Likewise.
3161 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
3162 helper that implement a save/restore stack for CheckState
3163 values. This is the only way to change check-state.
3164 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
3165 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
3166 (CheckedExpr.EmitBranchable): New forwarding method.
3167 (UnCheckedExpr): Likewise.
3168 * statement.cs (Block.ResolveMeta): Use WithCheckState.
3169 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
3170 (Checked.Resolve, checked.DoEmit): Likewise.
3172 2006-07-20 Miguel de Icaza <miguel@novell.com>
3174 * anonymous.cs: Cache the resolved anonymous delegate, and return
3175 this so that the ResolveTopBlock is only triggered once, not
3178 Currently we trigger ResolvetopBlock twice due to a first pass of
3179 argument check compatibility, and a second pass that does the
3182 2006-07-15 Marek Safar <marek.safar@seznam.cz>
3184 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
3186 * rootcontext.cs (Reset): Add helper_classes.
3188 2006-07-15 Marek Safar <marek.safar@seznam.cz>
3191 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
3194 2006-07-13 Miguel de Icaza <miguel@novell.com>
3196 * statement.cs (Lock): Handle expressions of type
3197 TypeManager.null_type specially. Fixes #78770
3199 2006-07-08 Marek Safar <marek.safar@seznam.cz>
3201 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
3204 2006-07-08 Marek Safar <marek.safar@seznam.cz>
3206 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
3207 for accessors as well.
3208 * ecore.cs (EventExpr): Add AccessorTable.
3210 2006-07-01 Marek Safar <marek.safar@seznam.cz>
3213 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
3214 for CS0122 where appropriate.
3215 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
3217 (Filter): Assembly can be null in the case of top level attributes.
3219 2006-06-25 Marek Safar <marek.safar@seznam.cz>
3223 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
3224 is done at global level.
3226 2006-06-24 Marek Safar <marek.safar@seznam.cz>
3228 A fix for #77002, Implemented TypeForwarder support.
3230 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
3231 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
3232 * typemanager.cs (): Add type_forwarder_attr_type.
3234 2006-06-24 Marek Safar <marek.safar@seznam.cz>
3236 * report.cs: Add CS0469 warning.
3238 2006-06-21 Martin Baulig <martin@ximian.com>
3240 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
3241 the `try'-block, so we also report CS0016 etc. there.
3243 2006-06-21 Martin Baulig <martin@ximian.com>
3246 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
3248 2006-06-21 Martin Baulig <martin@ximian.com>
3250 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
3251 also report CS1686 for parameters.
3253 2006-06-21 Martin Baulig <martin@ximian.com>
3255 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
3256 instead of an error if the value is not implicitly convertible to
3257 the switch types; fixes #77964.
3259 2006-06-21 Raja R Harinath <rharinath@novell.com>
3262 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
3263 FieldBuilder is null.
3266 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
3267 'left' and 'right' before error-checking.
3269 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
3271 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
3273 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
3274 (FieldExpr.DoResolve): likewise.
3275 (PropertyExpr.InstanceResolve): likewise.
3276 (EventExpr.InstanceResolve): likewise.
3278 2006-06-04 Marek Safar <marek.safar@seznam.cz>
3280 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
3281 attribute applicable tests for attribute argument.
3283 2006-06-02 Raja R Harinath <rharinath@novell.com>
3286 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
3287 (Binary.OverloadResolve_PredefinedIntegral): New.
3288 (Binary.OverloadResolve_PredefinedFloating): New.
3289 (Binary.OverloadResolve_PredefinedString): New.
3290 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
3291 Follow the standard more closely, and treat numeric promotions in
3292 terms of overload resolution.
3293 (Binary.CheckShiftArguments): Simplify.
3295 2006-06-01 Raja R Harinath <rharinath@novell.com>
3297 * flowanalysis.cs (MyBitVector): Simplify representation.
3298 (MyBitVector.Clone): Avoid allocating BitArray.
3299 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
3300 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
3301 (*): Update. Change all references to MyBitVector.And and
3302 MyBitVector.Or to &= and |=.
3304 2006-05-29 Raja R Harinath <rharinath@novell.com>
3307 * cs-parser.jay (formal_parameter_list): Extend the pattern below
3308 to param arguments too.
3310 2006-05-26 Miguel de Icaza <miguel@novell.com>
3312 * cs-parser.jay: Catch another parsing form for arglist being
3313 followed by other arguments. Fixes #78313.
3315 2006-05-24 Raja R Harinath <rharinath@novell.com>
3317 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
3318 checking of out parameters to ...
3319 (FlowBranchingToplevel.Merge): ... here.
3320 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
3321 set, propagate the origin upward, and only complain if there was
3323 (FlowBranchingException.AddContinueOrigin): Likewise.
3324 (FlowBranchingException.AddReturnOrigin): Likewise.
3325 (FlowBranchingException.AddGotoOrigin): Likewise.
3327 2006-05-23 Raja R Harinath <rharinath@novell.com>
3329 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
3330 unreachable, skip it.
3331 (FlowBranchingException.Merge): Always propagate jumps, even if
3332 the finally block renders subsequent code unreachable.
3334 2006-05-18 Raja R Harinath <rharinath@novell.com>
3337 * statement.cs (Goto.Resolve): Move responsibility for resolving
3338 'goto' to FlowBranching.AddGotoOrigin.
3339 (Goto.SetResolvedTarget): New. Callback to set the
3340 LabeledStatement that's the target of the goto.
3341 (Goto.DoEmit): Use Leave instead of Br when crossing an
3342 unwind-protect boundary.
3343 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
3344 LookupLabel and adjust to new semantics.
3345 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
3346 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
3347 Goto.SetResolvedTarget to update target.
3348 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
3349 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
3350 AddBreakOrigin & co. Delay propagation until ...
3351 (FlowBranchingException.Merge): ... this.
3353 * statement.cs (Block.Resolve): Always depend on flow-branching to
3354 determine unreachability. Kill workaround that originally emitted
3355 only one statement after an "unreachable" label (see infloop in
3358 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
3359 This is still "wrong", but anything better would probably need a
3360 multi-pass algorithm.
3361 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
3362 usage vector. Force current usage vector to be reachable, to
3363 optimistically signify backward jumps.
3364 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
3366 (FlowBranchingLabeled.Merge): New. If no backward jump was
3367 detected, return the original salted-away usage vector instead,
3368 updated with appropriate changes. Print unreachable warning if
3370 * statement.cs (Block.Resolve): Don't print unreachable warning on
3371 a labeled statement.
3373 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
3375 * driver.cs: Pass filename without path to AssemblyBuilder's
3376 AddResourceFile. Fixes bug #78407.
3378 2006-05-17 Raja R Harinath <rharinath@novell.com>
3380 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
3381 * flowanalysis.cs (FlowBranchingLabeled): ... here.
3382 (FlowBranching.MergeChild): Overwrite
3383 reachability information from Labeled branchings too.
3385 2006-05-16 Raja R Harinath <rharinath@novell.com>
3387 * statement.cs (Goto.Resolve): Merge jump origins here ...
3388 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
3390 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
3391 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
3392 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
3393 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
3395 * statement.cs (Goto.Resolve): ... not here.
3396 (Goto.Emit): Remove CS1632 check.
3398 2006-05-14 Marek Safar <marek.safar@seznam.cz>
3400 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
3403 2006-05-11 Raja R Harinath <rharinath@novell.com>
3405 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
3406 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
3407 (FlowBranchingException.Label): Likewise.
3409 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
3411 (MyBitVector.Or): Use it to avoid losing information (Count).
3412 (FlowBranching.MergeOrigins): Likewise.
3414 * flowanalysis.cs (UsageVector.IsDirty): Remove.
3415 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
3416 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
3417 (UsageVector.ToString): Simplify.
3418 (UsageVector.MergeSiblings): Move here from ...
3419 (FlowBranching.Merge): ... here.
3420 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
3423 2006-05-10 Raja R Harinath <rharinath@novell.com>
3425 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
3426 null bitvector is treated as all-true.
3428 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
3429 (MyBitVector): Rationalize invariants. 'vector != null' implies
3430 that we have our own copy of the bitvector. Otherwise,
3431 'InheritsFrom == null' implies all inherited bits are true.
3433 2006-05-09 Marek Safar <marek.safar@seznam.cz>
3435 * statement.cs (LocalInfo): Add IsConstant.
3436 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
3437 local variable for constants.
3439 2006-05-09 Raja R Harinath <rharinath@novell.com>
3441 * flowanalysis.cs (MyBitVector.Empty): New.
3442 (MyBitVector): Don't allow InheritedFrom to be null.
3443 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
3444 (UsageVector, FlowBranching): Update to changes.
3446 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
3447 recursion. The 'Parent == null' condition isn't sufficient for
3449 (FlowBranching.AddBreakOrigin): Likewise.
3450 (FlowBranching.AddContinueOrigin): Likewise.
3451 (FlowBranching.AddReturnOrigin): Likewise.
3452 (FlowBranching.StealFinallyClauses): Likewise.
3453 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
3454 (FlowBranching.CheckOutParameters): Likewise.
3455 (FlowBranchingToplevel): Terminate all the above recursions here.
3456 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
3457 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
3459 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
3461 (FlowBranchingToplevel): New. Empty for now.
3462 (FlowBranching.MergeTopBlock): Update.
3463 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
3464 branching for the anonymous delegate.
3465 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
3467 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
3468 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
3469 information at the start of the merge. Reorganize.
3471 2006-05-07 Marek Safar <marek.safar@seznam.cz>
3473 * class.cs (MethodData.Define): Method cannot implement interface accessor.
3475 2006-05-07 Marek Safar <marek.safar@seznam.cz>
3477 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
3478 to newly introduced ctor.
3480 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
3481 message to one place.
3482 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
3485 2006-05-07 Marek Safar <marek.safar@seznam.cz>
3487 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
3489 * ecore.cs (Expression.ResolveAsConstant): Updated.
3491 * statement.cs (ResolveMeta): Updated.
3493 2006-05-06 Marek Safar <marek.safar@seznam.cz>
3495 * cs-parser.jay: __arglist cannot be used in initializer.
3497 2006-05-06 Marek Safar <marek.safar@seznam.cz>
3500 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
3503 2006-05-05 Raja R Harinath <rharinath@novell.com>
3505 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
3506 (LabeledStatement): Add 'name' parameter.
3507 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
3508 (Block.AddLabel): Update to changes.
3509 * cs-parser.jay (labeled_statement): Likewise.
3511 * flowanalysis.cs (BranchingType.Labeled): New.
3512 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
3513 (FlowBranchingLabeled): New. Does nothing for now, but will
3514 eventually handle 'goto' flows.
3515 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
3516 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
3517 that's terminated ...
3518 (Block.Resolve): ... here.
3520 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
3521 (UsageVector.MergeFinallyOrigins): Likewise.
3522 (FlowBranching.InTryOrCatch): Likewise.
3523 (FlowBranching.AddFinallyVector): Likewise.
3524 (FlowBranchingException): Update to changes.
3527 * statement.cs (Return.Resolve): Move error checking to ...
3528 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
3529 (FlowBranchingException): Handle return origins like break and
3531 (FlowBranching.UsageVector.CheckOutParameters): Remove.
3533 2006-05-04 Marek Safar <marek.safar@seznam.cz>
3536 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
3539 2006-05-04 Marek Safar <marek.safar@seznam.cz>
3542 * class.cs (MethodData.Define): Do public accessor check only when method
3543 implements an interface.
3545 2006-05-04 Raja R Harinath <rharinath@novell.com>
3547 Remove special handling of 'break'
3548 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
3549 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
3550 (UsageVector.Break): Remove.
3551 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
3553 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
3555 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
3556 UsageVector.Breaks (). Don't set NeedsReturnLabel.
3558 2006-05-03 Marek Safar <marek.safar@seznam.cz>
3561 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
3562 be the interface member.
3564 2006-05-03 Marek Safar <marek.safar@seznam.cz>
3567 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
3568 for emitting small (int) values.
3570 2006-05-03 Raja R Harinath <rharinath@novell.com>
3573 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
3574 control-flow passes through the 'finally' after merging-in all the
3575 control-flows from 'try' and the 'catch' clauses.
3577 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
3578 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
3579 always true at the only non-recursive entry point.
3580 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
3581 FlowBranchingBreakable.
3582 (FlowBranchingLoop): Remove.
3583 * statement.cs (Return.DoResolve): Update to changes.
3586 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
3587 (FlowBranching.CreateBranching): Handle it: create a
3588 FlowBranchingContinuable.
3589 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
3590 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
3591 except that it handles the 'continue' command.
3592 (FlowBranching.UsageVector.MergeOrigins): Rename from
3594 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
3595 except that it overrides AddContinueOrigin.
3596 (FlowBranchingException): Override AddContinueOrigin, similar to
3598 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
3599 Create a new branching around the embedded statement.
3600 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
3601 control flow after the embedded statement.
3602 (Continue.Resolve): Move all error checking to AddContinueOrigin.
3604 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
3605 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
3606 FlowBranchingBreakable.
3607 (FlowBranchingSwitch): Remove.
3610 * statement.cs (Break.Resolve): Simplify. Move responsibility for
3611 error reporting to ...
3612 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
3613 Rename from 'AddBreakVector'. Add new location argument. Return
3614 a bool indicating whether the 'break' crosses an unwind-protect.
3615 (FlowBranchingException.AddBreakOrigin): Add.
3616 (FlowBranchingException.Merge): Propagate 'break's to surrounding
3617 flowbranching after updating with the effects of the 'finally'
3619 (FlowBranchingBreakable): New common base class for
3620 FlowBranchingLoop and FlowBranchingSwitch.
3622 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
3624 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
3626 2006-05-02 Raja R Harinath <rharinath@novell.com>
3628 * statement.cs (Do.Resolve): If the loop is infinite, set the
3630 (While.Resolve, For.Resolve): Set a barrier after the embedded
3631 statement. There's no direct control flow that goes from the end
3632 of the embedded statement to the end of the loop.
3633 * flowanalysis.cs (FlowBranching.Infinite): Remove.
3634 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
3635 above ensure that the reachability is correctly computed.
3637 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
3638 (UsageVector.MergeBreakOrigins): If the current path is
3639 unreachable, treat it as if all parameters/locals are initialized.
3640 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
3641 infinite loops before merging-in break origins.
3643 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
3644 (Reachability.Reachable): Split part into ...
3645 (Reachability.Unreachable): ... this. Simplify.
3646 (Reachability.IsUnreachable): Use 'Unreachable' instead.
3648 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
3649 (Reachability.SetThrowsSometimes): Likewise.
3650 (FlowBranchingBlock.MergeTopBlock): Don't compare against
3651 TriState.Always, use corresponding property.
3652 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
3653 (Block.Resolve): Likewise. Remove some redundant checks.
3655 2006-05-02 Raja R Harinath <harinath@gmail.com>
3657 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
3658 (Reachability.Meet): Don't bother checking AlwaysThrows --
3659 barrier is always set.
3660 (FlowBranchingBlock.Merge): Likewise.
3662 2006-05-01 Raja R Harinath <harinath@gmail.com>
3664 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
3665 checks for unreachable.
3667 2006-05-01 Marek Safar <marek.safar@seznam.cz>
3670 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
3672 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
3673 whether field is really assigned.
3675 2006-04-30 Raja R Harinath <harinath@gmail.com>
3677 * flowanalysis.cs (Reachability): Make 4-argument constructor
3679 (Reachability.Meet): Rename from 'And'. Remove static variant.
3680 (Reachability.Always): Rename from the highly misleading
3681 'Reachability.Never'.
3682 (FlowBranching.Merge): Update to changes. Mark an impossible
3683 situation with a 'throw'.
3684 (*): Update to changes.
3686 2006-04-29 Raja R Harinath <harinath@gmail.com>
3688 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
3690 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
3691 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
3692 (*): Update to changes.
3693 * statement.cs: Update to changes.
3695 2006-04-28 Marek Safar <marek.safar@seznam.cz>
3698 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
3700 2006-04-28 Raja R Harinath <harinath@gmail.com>
3702 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
3705 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
3706 argument to two arguments: an usage-vector and a bool. Move call
3707 to FlowBranching.Merge () ...
3708 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
3710 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
3711 handling of loop and switch reachability to ...
3712 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
3714 2006-04-27 Raja R Harinath <harinath@gmail.com>
3716 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
3717 handling to FlowBranchingLoop.InLoop.
3718 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
3720 2006-04-26 Marek Safar <marek.safar@seznam.cz>
3723 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
3724 anonymous method is allowed from AnonymousContainer here.
3726 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
3728 2006-04-24 Raja R Harinath <rharinath@novell.com>
3731 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
3733 2006-04-23 Marek Safar <marek.safar@seznam.cz>
3736 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
3737 (DoubleConstant.Reduce): Ditto.
3739 2006-04-23 Raja R Harinath <rharinath@novell.com>
3741 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
3742 Remove 'lvalue_right_side' argument. Move parts to ...
3743 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
3744 (LocalVariable.DoResolveLValue): ... these.
3746 2006-04-21 Raja R Harinath <rharinath@novell.com>
3749 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
3750 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
3751 (LocalVariableReference.DoResolveBase): Use it to implement new
3753 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
3754 (Argument.Resolve): Simplify. Move CS1510 check ...
3755 * ecore.cs (Expression.ResolveLValue): ... here.
3756 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
3757 (PropertyExpr.DoResolveLValue): Likewise.
3758 (FieldExpr.Report_AssignToReadonly): Likewise.
3759 (FieldExpr.DoResolve): Add 'out_access' argument. Use
3760 LValueMemberAccess or LValueMemberOutAccess on instance depending
3762 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
3763 DoResolve as appropriate.
3765 2006-04-20 Raja R Harinath <rharinath@novell.com>
3768 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
3769 implicit conversions on 'out' and 'ref' arguments.
3771 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
3772 improve clarity. Remove dead code.
3775 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
3776 (Catch.Resolve): Resolve VarBlock if it exists.
3778 2006-04-19 Miguel de Icaza <miguel@novell.com>
3780 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
3781 twice, this was some residual code, the enumerator was emitted
3782 properly in the two branche of if later.
3784 2006-04-19 Raja R Harinath <rharinath@novell.com>
3786 * expression.cs (Cast.ResolveLValue): Remove. The result of a
3787 cast is never an lvalue.
3788 (Cast.DoResolve, Cast.ResolveRest): Combine.
3789 (Argument.Emit): Simplify slightly. Move 'Expr is
3790 IMemoryLocation' check ...
3791 (Argument.Resolve): ... here.
3792 (Argument.Error_LValueRequired): Remove. Inline into only user.
3794 Simplifications. Fix cs0191-2.cs
3795 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
3796 CS1649 and CS1651 to ...
3797 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
3798 the actual selection of the error code and message to a lookup
3799 table. Add a dummy return value to simplify callsites.
3800 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
3801 readonly fields of other instances of the same type. Move CS0197
3803 * expression.cs (Argument.Resolve): ... here. Simplify code.
3804 Ensure that ec.InRefOutArgumentResolving is only set during LValue
3805 resolution of an out or ref argument. The code simplification
3806 above uses this invariant.
3808 2006-04-18 Raja R Harinath <rharinath@novell.com>
3810 Possibly fix #77752. Fix cs1690-[4-7].cs.
3811 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
3812 CheckMarshallByRefAccess. Drop parameter.
3813 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
3815 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
3817 * report.cs (AllWarnings): Add CS1690.
3818 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
3820 (LocalVariableReference.DoResolveBase): Update.
3822 2006-04-09 Marek Safar <marek.safar@seznam.cz>
3824 * class.cs (MethodOrOperator): Moved common parts from method class.
3825 detect obsolete attributes.
3826 (Method.Define): Simplified as it reuses code from base.
3827 (Constructor.ValidAttributeTargets): Fixed issue found during
3829 (Destructor.ValidAttributeTargets): Fixed issue found during
3831 (Operator): Finished refactoring set off by #78020. Operator class is now
3832 ordinary method class.
3834 * anonymous.cs: Updated.
3836 * decl.cs (DeclSpace): Add IsGeneric
3838 2006-04-09 Marek Safar <marek.safar@seznam.cz>
3840 * class.cs (Constructor.Emit): Don't emit the attributes twice.
3842 2006-04-09 Marek Safar <marek.safar@seznam.cz>
3844 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
3845 detect obsolete attributes.
3846 (Method.CreateEmitContext): Moved to MethodOrOperator.
3848 2006-04-09 Marek Safar <marek.safar@seznam.cz>
3851 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
3852 customized exception to make crash detection easier.
3853 (MethodOrOperator): Started to work on new base class for methods and
3855 (Method): Derives from MethodOrOperator.
3856 (Constructor.Emit): Emits its own attributes.
3857 (AbstractPropertyEventMethod.Emit): Ditto.
3858 (Operator): Derives from MethodOrOperator, will refactor fully in extra
3860 (Operator.Emit): It's temporary more tricky than should be.
3862 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
3864 * report.cs (InternalErrorException): Add ctor with inner exception.
3866 2006-04-08 Marek Safar <marek.safar@seznam.cz>
3869 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
3872 2006-04-07 Marek Safar <marek.safar@seznam.cz>
3875 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
3878 2006-04-06 Marek Safar <marek.safar@seznam.cz>
3880 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
3881 attribute is present and Guid not.
3882 (Interface.ApplyAttributeBuilder): Ditto.
3884 * attribute.cs: Add error message.
3886 2006-04-06 Marek Safar <marek.safar@seznam.cz>
3890 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
3891 sources (it's composite) so hold them in extra array as they are used in
3892 Emit phase only. It worked in the previous versions by mistake.
3893 (Attribute.Emit): Emit attribute for more owners when exist.
3895 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
3896 it has now different behaviour.
3898 2006-04-04 Marek Safar <marek.safar@seznam.cz>
3900 * constant.cs (Constant.IsDefaultInitializer): New method.
3902 * class.cs: Updated.
3904 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
3905 re-initialize default values. It saves KBs almost for every assembly.
3906 Thanks Zoltan for the idea.
3907 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
3908 (ArrayCreation.DoResolve): Resolve only once.
3909 (ArrayCreation.Emit): Emit static initializer only when it is faster.
3910 (ArrayCreation.GetAttributableValue): Cope with optimized values.
3912 2006-04-03 Zoltan Varga <vargaz@gmail.com>
3914 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
3917 2006-04-01 Marek Safar <marek.safar@seznam.cz>
3919 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
3920 in an embedded statement too.
3922 2006-04-01 Raja R Harinath <rharinath@novell.com>
3925 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
3927 2006-04-01 Marek Safar <marek.safar@seznam.cz>
3931 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
3934 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
3936 2006-03-31 Marek Safar <marek.safar@seznam.cz>
3938 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
3941 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
3942 LocalTemporary change.
3944 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
3946 (ClassOrStruct.DefineFieldInitializers): Implemented static field
3947 initializers optimization.
3948 (ClassOrStruct.TypeAttr): Moved from modifiers.
3949 (Constructor.CheckBase): Don't crash when static ctor has parameters.
3950 (FieldBase.ResolveInitializer): Resolves initializer.
3951 (FieldBase.HasDefaultInitializer): New property.
3953 * cs-parser.jay: Removed message.
3955 * expression.cs (CompilerGeneratedThis): New specialization.
3957 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
3959 2006-03-28 Marek Safar <marek.safar@seznam.cz>
3961 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
3963 2006-03-27 Marek Safar <marek.safar@seznam.cz>
3965 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
3966 be now EnumConstants only.
3968 2006-03-27 Marek Safar <marek.safar@seznam.cz>
3970 * attribute.cs, driver.cs: Reset more caches.
3972 2006-03-26 Marek Safar <marek.safar@seznam.cz>
3974 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
3976 2006-03-26 Marek Safar <marek.safar@seznam.cz>
3978 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
3979 for easier reuse. Updated all overrides.
3980 (IntegralConstant): New base class for all integral constants.
3981 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
3982 of the constant range, report custom error.
3983 (UIntConstant.Reduce): Fixed uint conversion.
3985 * ecore.cs, literal.cs: Reduce updates.
3987 2006-03-26 Marek Safar <marek.safar@seznam.cz>
3991 * class.cs (Constructor.Define): Removed extra if for default ctors.
3992 A patch from Atsushi Enomoto.
3994 2006-03-26 Marek Safar <marek.safar@seznam.cz>
3996 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
3997 GetAttributableValue.
3999 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
4002 * convert.cs (ImplicitConversionRequired): Error message moved to
4005 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
4006 automatic implicit conversion of an output value.
4007 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
4009 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
4011 (TypeOf.GetAttributableValue): Add extra handling for object type.
4013 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
4014 special error message.
4016 2006-03-25 Marek Safar <marek.safar@seznam.cz>
4018 * class.cs (Constructor.Emit): Don't crash when struct ctor is
4020 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
4021 compatible with MS runtime.
4023 2006-03-23 Marek Safar <marek.safar@seznam.cz>
4025 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
4026 attribute arguments here.
4028 * class.cs (Indexer.Define): The check was moved to attribute class.
4030 2006-03-22 Marek Safar <marek.safar@seznam.cz>
4032 * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
4033 expression.cs, typemanager.cs: Minor changes from gmcs to make merging
4036 2006-03-22 Raja R Harinath <rharinath@novell.com>
4038 Support ParameterDefaultValueAttribute in gmcs. Also applied to
4039 mcs to keep code differences small.
4040 * attribute.cs (Attribute.GetParameterDefaultValue): New.
4041 * typemanager.cs (parameter_default_value_attribute_type): New.
4042 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
4045 2006-03-21 Marek Safar <marek.safar@seznam.cz>
4047 * expression.cs (StringConcat.Append): Reverted back to no warning state.
4049 2006-03-21 Marek Safar <marek.safar@seznam.cz>
4051 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
4053 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
4056 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
4058 * doc-bootstrap.cs : fix build.
4060 2006-03-20 Marek Safar <marek.safar@seznam.cz>
4062 * expression.cs (StringConcat.Append): Issue a warning when empty string
4065 2006-03-20 Marek Safar <marek.safar@seznam.cz>
4067 * assign.cs (CompoundAssign.ResolveSource): Removed.
4069 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
4072 * class.cs (TypeContainer.FindMethods): Removed.
4073 (TypeContainer.CheckMemberUsage): Made static.
4075 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
4077 * constant.cs (CheckRange): Removed unused type argument.
4078 (CheckUnsigned): Removed unused type argument.
4080 * cs-parser.jay: Updated after MemberAccess clean up.
4081 Uses Length for empty string test.
4083 * cs-tokenizer.cs: Uses Length for empty string test.
4084 (IsCastToken): Made static.
4085 (is_hex): Made static.
4086 (real_type_suffix): Made static.
4088 * decl.cs (SetupCache): Made static.
4089 (OnGenerateDocComment): Removed unused ds argument.
4091 * delegate.cs (VerifyDelegate): Removed unused argument.
4093 * doc.cs: Uses Length for empty string test.
4095 * driver.cs: Uses Length for empty string test.
4097 * enum.cs (IsValidEnumType): Made static
4099 * expression.cs (EnumLiftUp): Removed unused argument.
4100 (ResolveMethodGroup): Ditto.
4101 (BetterConversion): Ditto.
4102 (GetVarargsTypes): Ditto.
4103 (UpdateIndices): Ditto.
4104 (ValidateInitializers): Ditto.
4105 (MemberAccess.ctor): Ditto.
4106 (GetIndexersForType): Ditto.
4108 * flowanalysis.cs: (MergeFinally): Removed unused argument.
4110 * iterators.cs: Updated after MemberAccess clean up.
4112 * location.cs: Uses Length for empty string test.
4114 * namespace.cs: Uses Length for empty string test.
4116 * report.cs (CheckWarningCode): Made static.
4118 * statement.cs (LabeledStatement): Removed unused argument.
4120 * typemanager.cs (FilterNone): Removed.
4122 2006-03-18 Marek Safar <marek.safar@seznam.cz>
4124 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
4127 * class.cs: Updated.
4129 2006-03-18 Marek Safar <marek.safar@seznam.cz>
4131 * cs-parser.jay.cs: __arglist is not allowed for delegates.
4133 2006-03-18 Marek Safar <marek.safar@seznam.cz>
4137 * expression.cs (VerifyArgumentsCompat): Reverted to double error
4138 reporting, it's more tricky than I thought.
4140 2006-03-18 Marek Safar <marek.safar@seznam.cz>
4144 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
4146 (AnonymousMethod.ImplicitStandardConversionExists): New method.
4147 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
4148 Add more error reporting; Fixed issue with params.
4150 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
4152 * cs-parser.jay: AnonymousMethod requires host container.
4154 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
4156 2006-03-18 Raja R Harinath <harinath@gmail.com>
4158 * class.cs: Change 'TypeContainer ds' constructor argument to
4159 'DeclSpace parent'. Some classes were missed below due to
4160 different naming convention.
4162 * class.cs (MemberCore.Parent): Delete. This makes the
4163 ParentContainer changes below enforceable by the compiler.
4165 Treat pointers to enclosing declaration space as 'DeclSpace', not
4167 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
4168 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
4170 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
4172 (Block.AddThisVariable): Likewise.
4173 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
4174 (AbstractPropertyEventMethod.Emit): Likewise.
4175 (AbstractPropertyEventMethod.EmitMethod): Likewise.
4176 (GetMethod.Define, SetMethod.Define): Likewise.
4177 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
4178 (DelegateMethod.EmitMethod): Likewise.
4180 Fix regression test-partial-13.cs.
4181 Rationalize use of PartialContainer. Ensure that the partial
4182 class semantics can be tied to type-correctness, i.e., any
4183 violation will cause a compile error.
4184 * class.cs, const.cs: Access all fields that belong to class
4185 TypeContainer via ParentContainer. Arguments of EmitContexts and
4186 Resolve()-like functions still use 'Parent'.
4188 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
4189 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
4190 (PropertyMethod.CheckModifiers): Remove unused argument.
4191 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
4194 2006-03-17 Raja R Harinath <harinath@gmail.com>
4196 Make semantics of PartialContainer simpler.
4197 * decl.cs (DeclSpace.IsPartial): Remove.
4198 * class.cs (TypeContainer.IsPartial): Likewise.
4199 (TypeContainer..ctor): Set PartialContainer to point to self.
4200 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
4201 (TypeContainer.FindNestedType): Likewise.
4202 (MemberCore.ParentContainer): Simplify. Remove deprecation.
4204 2006-03-17 Marek Safar <marek.safar@seznam.cz>
4206 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
4208 2006-03-15 Marek Safar <marek.safar@seznam.cz>
4210 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
4213 2006-03-15 Marek Safar <marek.safar@seznam.cz>
4215 * class.cs (Operator.Define): An error for base conversion was not
4218 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
4220 * iterator.cs : yield break is allowed in try statement which has
4221 catch clauses. Fixed bug #77767.
4223 2006-03-13 Marek Safar <marek.safar@seznam.cz>
4225 A fix for #77593, #77574.
4227 * class.cs (MethodCore.CheckBase): Another if for operator.
4229 2006-03-09 Marek Safar <marek.safar@seznam.cz>
4231 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
4234 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
4235 (DelegateCreation.ImplicitStandardConversionExists): New method for just
4238 *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
4241 * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
4242 Updated after another emitcontext usage was clean up. It should help us to
4243 synchronize with gmcs easier.
4245 2006-03-04 Marek Safar <marek.safar@seznam.cz>
4249 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
4250 (Event.Define): ditto
4251 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
4253 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
4254 Removed redundant code and set NewSlot for Invoke method too.
4256 * parameter.cs (Parameters.ctor): Add custom, type ctor.
4257 (Parameters.MergeGenerated): New method. Use this method when you merge
4258 compiler generated argument with user arguments.
4260 2006-03-03 Marek Safar <marek.safar@seznam.cz>
4262 * attribute.cs (ResolveAsTypeTerminal): Removed.
4264 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
4265 specialization for predefined types; 30% speed up.
4266 Finally placed obsolete check to right place.
4267 (Expression.ResolveType): Removed.
4269 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
4270 Updated after ResolveType was removed.
4272 * expression.cs (Cast.ctor): Check void cast.
4273 (Binary.ResolveAsTypeTerminal): Is never type.
4274 (Conditional.ResolveAsTypeTerminal): Is never type.
4276 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
4278 2006-03-01 Raja R Harinath <rharinath@novell.com>
4281 * expression.cs (ParameterReference.DoResolveBase): Change return
4283 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
4287 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
4290 * typemanager.cs (GetFullNameSignature): Don't nullref on
4291 protected accessors.
4293 2006-02-27 Marek Safar <marek.safar@seznam.cz>
4295 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
4296 these two separated members to simplify the code.
4297 (Attribute.Resolve): Refactored to use new fields and methods.
4298 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
4299 implemented obsolete attribute checking.
4300 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
4301 implemented obsolete checking again. It look line never ending quest ;-)
4302 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
4304 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
4306 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
4308 *class.cs (Property.Define): Add RegisterProperty call.
4310 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
4311 argument groups (only 2).
4313 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
4314 encoding expression to arguments.
4315 (Expression.ExprClassToResolveFlags): Just turned to property.
4317 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
4318 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
4319 optimized as well as implemented support for zero-length attributes.
4321 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
4322 Add caching of PropertyInfo's.
4324 2006-02-25 Marek Safar <marek.safar@seznam.cz>
4326 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
4327 error multiple times.
4329 2006-02-25 Marek Safar <marek.safar@seznam.cz>
4331 New partial class implementation.
4332 A fix for #77027, #77029, #77403
4334 * attribute.cs (Attributable): Made attributes protected.
4336 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
4337 the replacements of ClassPart and PartialContainer.
4338 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
4339 (TypeContainer.AddInterface): Ditto.
4340 (TypeContainer.AddPartial): The main method for partial classes. It checks
4341 for errors and merges ModFlags and attributes. At the end class is added to
4343 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
4345 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
4346 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
4347 from the rest of partial classes.
4348 (TypeContainer.GetClassBases): Simplified.
4349 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
4351 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
4352 (TypeContainer.HasExplicitLayout): Uses Flags now.
4353 (PartialContainer): Removed.
4354 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
4355 (StaticClass): Was merged with Class.
4356 (Class.GetClassBases): class and static class bases are verified here.
4357 (Class.TypeAttr): Added static attributes when class is static.
4358 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
4359 (MemberBase): In some cases we need to call parent container for partial
4360 class. It should be eliminated but it's not easy now.
4362 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
4364 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
4365 partial classed to accumulate class comments.
4366 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
4368 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
4370 * driver.cs (MainDriver): Tree.GetDecl was removed.
4372 * modifiers.cs (Modifiers): Add partial modifier.
4374 * tree.cs (Tree.decl): Removed.
4375 (RootTypes): Started to use this class more often for root types
4378 2006-02-22 Marek Safar <marek.safar@seznam.cz>
4382 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
4383 external interface does not have an attribute.
4385 2006-02-22 Marek Safar <marek.safar@seznam.cz>
4387 Another prerequisites for new partial classs implementation.
4389 * attribute.cs (Attribute.Equal): Implemented.
4390 (Attribute.Emit): Changed as attributes can be applied more than twice.
4391 (Attributes.Emit): Check for duplicate attributes here.
4393 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
4394 as a parameter, clean-up.
4396 2006-02-11 Marek Safar <marek.safar@seznam.cz>
4400 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
4401 contains obsolete attribute check which can in some cases look for base
4402 type of current class which is not initialized yet.
4403 (TypeContainer.BaseType): Replacement of ptype.
4405 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
4407 2006-02-11 Marek Safar <marek.safar@seznam.cz>
4409 First of prerequisites for new partial classs implemention.
4411 * attribute.cs (Attributable): Extended by ResolveContext;
4412 Attributes finally have correct context for resolving in all cases.
4413 (AttachTo): Attribute owner is assigned here.
4415 * codegen.cs (IResolveContext): Introduce new interface to hold
4416 all information needed in resolving phase.
4417 (EmitContext): Implements IResolveContext; more clean-up needed here.
4419 * decl.cs (MemberCore): Implemented IResolveContext.
4421 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
4422 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
4423 parameter.cs, statement.cs, tree.cs, typemanager.cs:
4424 Refactored to use new IResolveContext instead of EmitContext; cleanup
4426 2006-02-06 Miguel de Icaza <miguel@novell.com>
4428 * codegen.cs (EmitScopeInitFromBlock): check here the
4429 capture_context, there is no need to make two calls to the
4432 * anonymous.cs: Add some debugging messages that might help me
4433 track other instances of this problem in the future (the
4434 regression of test 467).
4436 * cs-parser.jay: track the variable block, as we need to initalize
4437 any captured variables declared in this block for the "catch"
4438 portion of the "Try" statement.
4440 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
4441 scope initialization for captured variables.
4443 Also, move the emit for the variables after the block location has
4446 2006-02-06 Marek Safar <marek.safar@seznam.cz>
4448 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
4450 2006-02-02 Miguel de Icaza <miguel@novell.com>
4452 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
4453 commit yesterday, the initialization for the roots is necessary.
4454 What is not necessary is the scope activation.
4456 2006-02-02 Raja R Harinath <rharinath@novell.com>
4458 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
4459 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
4461 (Argument.Resolve): Remove CS0206 checks.
4463 2006-02-01 Miguel de Icaza <miguel@novell.com>
4465 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
4466 scopes for all the roots, the scopes will now be emitted when the
4467 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
4469 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
4470 code. This reduces a lot of existing cruft.
4472 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
4473 that the ScopeInfo is generated as we enter the scope, not at the
4474 time of use, which is what we used to do before.
4476 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
4477 every time a Block is about to be emitted if we have a
4480 2006-02-01 Raja R Harinath <rharinath@novell.com>
4482 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
4484 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
4486 * typemanager.cs (cons_param_array_attribute): Make private.
4487 (Reset): Set it to null.
4488 (InitCoreHelpers): Don't initialize it.
4489 (ConsParamArrayAttribute): New. Initialize it as needed.
4490 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
4492 2006-01-31 Miguel de Icaza <miguel@novell.com>
4494 * expression.cs: There might be errors reported during the
4495 selection of applicable methods. If there are errors, do not
4496 continue execution as it will lead the compiler to crash.
4498 2006-01-30 Miguel de Icaza <miguel@novell.com>
4500 * expression.cs: Member access is not allowed on anonymous
4501 methods. Fixes #77402.
4503 2006-01-30 Raja R Harinath <rharinath@novell.com>
4506 * cs-parser.jay (VariableDeclaration): Don't set
4507 current_array_type to null.
4508 (field_declaration, event_declaration, declaration_statement):
4509 Set it to null here.
4511 2006-01-28 Raja R Harinath <harinath@gmail.com>
4513 * typemanager.cs (GenericParameterPosition): New.
4516 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
4518 * doc.cs : To process "include" elements, first we should create
4519 another list than XmlNodeList, because it could result in node
4520 removal, which could result in that the XmlNodeList gives up
4523 (Also made code identical to gmcs again.)
4525 2006-01-25 Miguel de Icaza <miguel@novell.com>
4527 * ecore.cs: Introduce an error report that we were not catching
4528 before, if not silent, we must report the error. Gonzalo ran into
4531 2006-01-23 Miguel de Icaza <miguel@novell.com>
4533 A fix for bug: #76957
4535 * iterators.cs (MoveNextMethod.CreateMethodHost): call
4536 ComputeMethodHost before creating the method, this is a new
4539 * anonymous.cs (AnonymousContainer): Now we track all the scopes
4540 that this method references (RegisterScope). The actual scope
4541 where the method is hosted is computed with the ComputeMethodHost
4542 before we create the method.
4544 Moved the Deepest routine here.
4546 (AnonymousContainer.ComputeMethodHost): New routine used to
4547 compute the proper ScopeInfo that will host the anonymous method.
4549 (ScopeInfo): Deal with multiple roots. The problem was that we
4550 did not have a unique root where all ScopeInfos could be hanged
4551 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
4554 Remove AdjustMethodScope which is now computed at the end. Remove
4555 LinkScope which did a partial link, instead link all ScopeInfos
4556 before code generation from the new "LinkScopes" routine.
4558 Simplify all the Add* routines as they no longer need to maintain
4559 the tree, they just need to record that they are using variables
4562 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
4563 routines to produce the forest of ScopeInfo trees.
4565 * class.cs (TypeContainer.AppendMethod): This is just like
4566 AddMethod, but ensures that an interface implementation method
4567 (IEnumerable.XXX) is not inserted at the beginning of the queue of
4568 methods, but at the end.
4570 We use this functionality to ensure that the generated MoveNext
4571 method in the iterator class is resolved/emitted before the
4572 enumerator methods created.
4574 This is required because the MoveNext method computes the right
4575 ScopeInfo for the method. And the other methods will eventually
4576 need to resolve and fetch information computed from the anonymous
4579 2006-01-21 Raja R Harinath <harinath@gmail.com>
4580 Carlos Alberto Cortez <calberto.cortez@gmail.com>
4583 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
4585 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
4586 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
4588 2006-01-18 Raja R Harinath <rharinath@novell.com>
4590 Fix #76656, cs0231-2.cs.
4591 * cs-parser.jay (formal_parameter_list): Make error case catch
4593 (parenthesized_expression_0): Add CS1026 check.
4594 (invocation_expression): Remove unused { $$ = lexer.Location }.
4596 2006-01-17 Raja R Harinath <rharinath@novell.com>
4599 * cs-parser.jay (statement_expression): Don't list out the
4600 individual statement-expressions. Convert syntax error into
4603 2006-01-16 Raja R Harinath <rharinath@novell.com>
4606 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
4607 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
4608 CheckIntermediateModification.
4609 (FieldExpr.DoResolve): Add new two-argument version that
4610 allows us to resolve the InstanceExpression as an lvalue.
4611 The one-argument variant is now just a wrapper.
4612 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
4613 Resolve the lhs as an lvalue if the it has a value type.
4614 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
4615 from Assign.DoResolve.
4616 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
4617 resolved as an lvalue.
4618 (PropertyExpr.DoResolve): Update.
4619 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
4620 has a value type. Move CS1612 check here from
4621 CheckIntermediateModification.
4622 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
4623 * expression.cs (EmptyExpression.OutAccess): New. Used as the
4624 'right_side' of a ResolveLValue on an 'out' argument.
4625 (EmptyExpression.LValueMemberAccess): New. Used as the
4626 'right_side' of a propagated ResolveLValue on a value type.
4627 (LocalVariableReference.DoResolveBase): Recognize
4628 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
4630 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
4631 EmptyExpression.Null.
4633 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
4635 * typemanager.cs : added IsGenericParameter(). In mcs it always
4637 * doc.cs : for generic parameters, use GenericParameterPosition,
4640 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
4642 * expression.cs: Fix Console.WriteLine ((this = x).foo);
4644 2006-01-12 Miguel de Icaza <miguel@novell.com>
4646 This fixes the problem where we used ldfld instead of ldflda to
4647 load the "THIS" pointer on captured parameters, when THIS is a
4648 value type. See bug #77205.
4650 * iterators.cs (CapturedThisReference.Emit): Pass false to
4651 EmitThis (we do not need the address).
4653 * codegen.cs (EmitThis): it needs to know whether we need the
4654 address of `this' or not. This is used by value types.
4656 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
4657 every other call passes false.
4659 2006-01-12 Raja R Harinath <rharinath@novell.com>
4662 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
4664 * expression.cs (Invocation.OverloadResolve): Update.
4665 (Invocation.DoResolve): Avoid double resolution of invocation.
4667 2006-01-11 Raja R Harinath <rharinath@novell.com>
4670 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
4671 unary negation of floating point types as 0-expr; negation cannot
4672 overflow in floating point types.
4675 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
4676 on operands of 'void' type.
4679 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
4680 and ExclusiveOr for boolean constants too.
4682 2006-01-09 Raja R Harinath <rharinath@novell.com>
4685 * expression.cs (Invocation.OverloadResolve): Replace reflected
4686 override methods with their base virtual methods, rather than
4688 * typemanager.cs (TypeManager.GetOverride): New.
4690 2006-01-05 Jb Evain <jbevain@gmail.com>
4692 * class.cs (Property.Define, Indexer.Define): do not tag the
4693 properties as SpecialName | RTSpecialName.
4695 2006-01-04 Miguel de Icaza <miguel@novell.com>
4697 * class.cs (MethodCore.IsDuplicateImplementation): This method was
4698 doing a low-level comparission of parameter types. It was lacking
4699 a check for __argslist.
4701 2005-12-30 Miguel de Icaza <miguel@novell.com>
4703 * expression.cs (ParameterReference.DoResolveBase): Allow
4704 reference parameters if they are local to this block.
4706 This allows the ref and out parameters of a delegate to be used in
4707 an anonymous method, for example:
4709 delegate void set (out int x);
4711 set s = delegate (out int x){
4715 This is used by functionality introduced late in the C# language.
4717 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
4718 method that take ref and out parameters.
4720 Fixes #77119 which was a late change in the spec.
4722 2005-12-23 Miguel de Icaza <miguel@novell.com>
4724 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
4725 parent if its the same scope. Fixes #77060.
4727 2005-12-21 Miguel de Icaza <miguel@novell.com>
4729 * driver.cs: Report the case of no source files and no -out:
4732 2005-12-20 Raja R Harinath <rharinath@novell.com>
4735 * expression.cs (ComposedCast.GetSignatureForError): Define.
4737 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
4741 * namespace.cs (NamespaceEntry): Add extern_aliases as a
4742 ListDictionary, to contain the ExternAliasEntry entries (in
4743 addition to the NamespaceEntry.aliases hashtable). This field is
4744 shared between the original entry and its doppelganger (bodyless
4746 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
4747 extern_aliases field.
4748 (NamespaceEntry.Lookup): Move the IsImplicit check after the
4749 lookup in extern_aliases.
4751 2005-12-16 Raja R Harinath <rharinath@novell.com>
4754 * class.cs (TypeContainer.Mark_HasEquals): New.
4755 (TypeContainer.Mark_HasGetHashCode): New.
4756 (ClassPart): Override them.
4757 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
4760 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
4761 'parent' argument to the base constructor.
4763 Remove all mention of TypeContainer from decl.cs.
4764 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
4765 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
4766 (DeclSpace.DeclSpace): Likewise.
4767 (DeclSpace.DefineMembers): Remove unused argument.
4768 * cs-parser.jay (pop_current_class): Update to changes. Simplify
4769 debugging check -- we don't care if the debug code throws an
4770 InvalidCastException instead of an InternalErrorException.
4771 * class.cs (TypeContainer.DefineMembers): Update to changes.
4772 (TypeContainer.DoDefineMembers): Likewise.
4773 (TypeContainer.GetMethods): Likewise.
4774 (PropertyMember.Define): Likewise.
4775 (MemberBase.Parent): New property that forwards to
4776 MemberCore.Parent, but ensures that we get a TypeContainer.
4777 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
4778 (RootContext.PopulateTypes): Likewise. Remove special case code
4779 for !RootContext.StdLib: DefineMembers is idempotent.
4781 2005-12-14 Miguel de Icaza <miguel@novell.com>
4783 * convert.cs (ExplicitConversionCore): Check the return value from
4784 ExplicitConversionCore which can return null on failure. Fixes #76914
4786 2005-12-13 Marek Safar <marek.safar@seznam.cz>
4788 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
4790 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
4792 * doc.cs : The search for referenced namespace was insufficient to
4793 get global one as it used to do. Fixed bug #76965.
4795 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
4797 * doc.cs : check name in cref in the last phase that whether it is
4800 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
4802 * cs-tokenizer.cs : reverted the latest change: it somehow broke
4805 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
4807 * doc.cs : so it turned out that we cannot skip override check for
4808 interface members. Fixed bug #76954.
4810 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
4812 * cs-tokenizer.cs : fixed bug #75984:
4813 - #warning and #error should not be handled when the source line
4815 - #line is not checked strictly when the source line is disabled.
4816 - #define and #undef is on the other hand checked strictly at any
4819 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
4821 * cs-tokenizer.cs : missing Location (actually, filename) in one of
4824 2005-12-05 Marek Safar <marek.safar@seznam.cz>
4826 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
4828 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
4830 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
4831 (FieldBase.Initializer): Initializer is now optional.
4832 (EventField.Define): Only event field can have initializer.
4834 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
4836 * const.cs (Const): Reuse initializer.
4838 * cs-parser.jay: Updated after FieldBase changes.
4839 Added current_array_type to simplify array initializers.
4841 * ecore.cs (NullCast.IsDefaultValue): Implemented.
4843 * expression.cs, iterators.cs: Updated.
4845 * namespace.cs (NamespaceEntry): Made UsingFound private.
4847 2005-12-05 Marek Safar <marek.safar@seznam.cz>
4849 * parameterCollection.cs: Obsolete, removed.
4850 * parser.cs: Obsolete, removed.
4852 2005-12-05 Marek Safar <marek.safar@seznam.cz>
4855 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
4857 * enum.cs (Enum.Define): Set obsolete context here.
4859 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
4862 - FindDocumentedMember() now expects 1) paramList as null
4863 when "we don't have to check the number of parameters" and
4864 2) Type.EmptyTypes when "there is no arguments".
4865 - Introduced FoundMember struct to hold the exact type which was
4866 used to find the documented member (the above change broke
4867 test-xml-044; it might be better just to use DeclaringType than
4868 what MS does, like this change does, but it depends on usage.)
4870 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
4872 * doc.cs : documented member might be from DeclaringType for nested
4873 types. Fixed bug #76782.
4875 2005-12-03 Ben Maurer <bmaurer@ximian.com>
4877 * anonymous.cs: Have the param code handle leaving copies on the
4878 stack etc. Allows anonymous params to take part in the assignment
4879 code (++, +=, etc). Fixes bug #76550
4881 * expression.cs: Handle the prepare_for_load/leave_copy by passing
4882 it down to the anon code.
4884 * iterators.cs: Use dummy var here
4886 * codegen.cs: Handle new vars
4888 2005-12-01 Marek Safar <marek.safar@seznam.cz>
4891 * class.cs (MethodData.Define): Set proper Obsolete context.
4893 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
4895 (FieldExpr.DoResolve): Ditto.
4897 2005-12-01 Marek Safar <marek.safar@seznam.cz>
4900 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
4901 parent is not obsolete.
4903 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
4905 * doc.cs : (FindDocumentedMember) find parameterless members first
4906 and get CS0419 in the early stage. Fixed first case of bug #76727.
4908 2005-11-30 Marek Safar <marek.safar@seznam.cz>
4911 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
4912 no error was reported.
4914 *expression.cs (Binary.DoResolve): left can be null.
4916 2005-11-22 Marek Safar <marek.safar@seznam.cz>
4919 * class.cs (MethodData.Emit): Parameters should be labeled first.
4921 2005-11-21 Marek Safar <marek.safar@seznam.cz>
4924 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
4926 2005-11-18 Marek Safar <marek.safar@seznam.cz>
4928 * attribute.cs (AreParametersCompliant): Moved to Parameter.
4930 * class.cs (MethodCore): Parameter clean up.
4931 (IMethodData): Added ParameterInfo.
4932 (MethodData): Parameter clean up.
4933 (Indexer.Define): Parameter clean up.
4945 * typemanager.cs: Parameter clean up.
4947 * delegate.cs (Define): Get rid of duplicated code.
4949 * expression.cs (ParameterReference): Removed useless parameters
4951 (Invocation): Ditto.
4953 * parameter.cs (ParamsParameter): New class, params specialization.
4954 (ArglistParameter): Attemp to separate arglist.
4955 (Parameter): Refactored to be reusable and faster.
4956 (Parameter.Modifier): Made understandable.
4957 (Parameters): Changed to be used as a class for `this' assembly
4958 parameters. Refactored to use new specialized classes.
4960 * support.cs (ParameterData): Added Types property.
4961 (InternalParameters): Deleted.
4963 2005-08-20 Martin Baulig <martin@ximian.com>
4965 Merging this patch from GMCS to fix #75867.
4967 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
4968 scope if we don't already have it.
4970 2005-11-17 Martin Baulig <martin@ximian.com>
4973 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
4974 inherit the scope from our parent. Fixes #76653.
4976 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
4978 * doc.cs : the previous patch does not actually fix the bug.
4979 PropertyInfo override check is now implemented and really fixed it.
4980 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
4982 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
4984 * doc.cs : apply "override filter" also to properties.
4987 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
4989 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
4990 no need to check overrides. For classes, omit those results from
4991 interfaces since they must exist in the class. Fixed bug #76726.
4993 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
4995 * typemanager.cs : (GetFullNameSignature) differentiate indexers
4996 with different parameters. Fixed the second problem in #76685.
4998 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
5000 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
5001 get expected 'protected' access in CheckValidFamilyAccess()).
5004 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
5006 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
5007 Fixed bug #76705. CS1569 was incorrectly commented out.
5009 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
5011 * doc.cs : use Invocation.IsOverride() to do real override check.
5012 * expression.cs : made Invocation.IsOverride() internal.
5014 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
5016 * doc.cs : use TypeManager.FindMembers() instead of (possible)
5017 TypeBuilder.FindMembers() and filter overriden base members out.
5020 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
5022 * doc.cs : ref/out parameters are represented as '@' (instead of
5023 '&' in type FullName). Fixed bug #76630 (additionally crefs).
5025 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
5027 * doc.cs : when there was no '.' in cref to methods in doc comment,
5028 then parameters were missing in the output. Fixed bug #76691.
5030 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
5032 * driver.cs : don't output docs when there is an error.
5035 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
5038 Now it should detect indexers. Fixed primary concern in bug #76685.
5039 Fixed CS0419 message to not show the identical member signature in
5042 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
5044 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
5045 instead of Type.FindMembers() since it does not handle events.
5048 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
5050 * codegen.cs: Fixed typo (speficied -> specified).
5052 2005-11-11 Marek Safar <marek.safar@seznam.cz>
5055 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
5057 2005-11-11 Marek Safar <marek.safar@seznam.cz>
5059 * attribute.cs: Changed error message.
5061 * cs-tokenizer.cs: One more check.
5063 2005-11-10 Marek Safar <marek.safar@seznam.cz>
5065 * statement.cs (Block.Resolve): Ignore empty statement.
5067 2005-11-10 Marek Safar <marek.safar@seznam.cz>
5069 * report.cs: Made error/warning methods more strict to avoid
5072 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
5073 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
5074 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
5075 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
5077 2005-11-08 Marek Safar <marek.safar@seznam.cz>
5079 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
5080 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
5082 * class.cs (TypeContainer.IsComImport): New property.
5083 (Constructor.Define): Create proper ctor for ComImport types.
5085 * expression.cs (New.CheckComImport): Fixed.
5087 2005-11-07 Miguel de Icaza <miguel@novell.com>
5089 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
5090 that a parameter has been captured does not mean that we do not
5091 have to do the rest of the processing. This fixes the second part
5092 of #76592. If there was another anonymous method capturing
5093 values in the past, the Scope would never be set for the second
5094 method that captured the same parameter.
5096 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
5097 properly manipulate the stack. Second part of fix for #76592.
5099 * expression.cs (New): Add support for invoking "new" on
5100 interfaces that have been flagged with the ComImport attribute and
5101 the CoClass. Fixes #76637
5103 * statement.cs (Try.DoEmit): When a variable is captured, do not
5104 try to emit the vi.LocalBuilder variable as it has been captured.
5105 Create a temporary variable and store the results on the
5106 FieldBuilder. Fixes #76642
5108 2005-11-07 Marek Safar <marek.safar@seznam.cz>
5110 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
5112 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
5114 * expression.cs (Binary.DoResolve): Added && optimalization.
5116 * typemanager.cs (AddUserType): Removed useless argument.
5118 2005-11-04 Marek Safar <marek.safar@seznam.cz>
5120 * statement.cs (Block.variables): Uses ListDictionary.
5122 2005-11-03 Marek Safar <marek.safar@seznam.cz>
5125 * class.cs (PartialContainer.EmitType): Customized to emit
5126 security attributes.
5127 (ClassPart.ApplyAttributeBuilder): Transform security attribute
5128 for partial classes.
5130 2005-11-03 Marek Safar <marek.safar@seznam.cz>
5133 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
5134 access has to be fixed.
5136 * typemanager.cs (IsUnmanagedType): Wrong common field type.
5138 2005-11-01 Marek Safar <marek.safar@seznam.cz>
5141 * ecore.cs (NullCast.Reduce): Implemented.
5143 * expression.cs (ArrayCreation.CheckIndices): Correcly check
5146 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
5148 (Foreach.Resolve): Catch null properly.
5150 2005-10-29 Marek Safar <marek.safar@seznam.cz>
5152 * cs-tokenizer.cs: Warning text fix.
5154 * driver.cs: AllWarningNumbers exposed on public interface.
5156 * report.cs (): Reviewed warning numbers.
5157 (IsValidWarning): Use binary search.
5159 2005-10-29 Marek Safar <marek.safar@seznam.cz>
5161 * driver.cs: Implemeted resource visibility.
5162 (Resources): New class for code sharing between /res: and
5165 2005-10-28 Marek Safar <marek.safar@seznam.cz>
5168 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
5171 * convert (Convert.ImplicitReferenceConversion): NullCast holds
5174 * ecore.cs (NullCast): Child is contant only.
5176 * literal.cs (NullLiteral.Reduce): null can be converted to any
5179 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
5181 * driver.cs: Use Encoding.Default as default code page instead
5184 2005-10-27 Raja R Harinath <rharinath@novell.com>
5187 * expression.cs (Invocation.Error_InvalidArguments): Handle
5188 __arglist parameters.
5189 (Invocation.VerifyArgumentsCompat): Likewise.
5190 * support.cs (ReflectionParameters.GetSignatureForError): Print
5191 __arglist parameters.
5192 (InternalParamters.GetSignatureForError): Likewise.
5193 * parameter.cs (Parameters.GetSignatureForError): Likewise.
5195 2005-10-26 Marek Safar <marek.safar@seznam.cz>
5197 * attribute.cs (GetPropertyValue): Made public.
5199 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
5201 Add new property WrapNonExceptionThrows to handle 2.0 assembly
5203 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
5206 * driver.cs: Reflect method name change.
5208 * statement.cs (Try.Resolve): Warn when try has both general
5211 * typemanager.cs: runtime_compatibility_attr_type new predefined
5214 2005-10-26 Raja R Harinath <harinath@gmail.com>
5217 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
5218 treat it as an empty parameter list.
5220 2005-10-26 Raja R Harinath <rharinath@novell.com>
5223 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
5224 ResolveAsTypeStep silent.
5225 * statement.cs (Block.AddConstant): Mark block as used.
5226 (Block.ResolveMeta): Avoid piling on error messages
5227 if a constant initializer resolution fails.
5229 2005-10-25 Raja R Harinath <rharinath@novell.com>
5231 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
5233 (NamespaceEntry.VerifyAllUsing): New.
5234 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
5235 behaviour. Delegates actual resolution of alias to ...
5236 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
5237 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
5239 * driver.cs (Driver.MainDriver): Update.
5241 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
5242 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
5244 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
5246 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
5247 RootNamespace.DefineNamespacesForAll.
5249 2005-10-24 Raja R Harinath <harinath@gmail.com>
5251 * typemanager.cs (assemblies, external_aliases, modules)
5252 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
5253 (ComputeNamespaces, GetRootNamespace): Remove extra staging
5254 overhead. Move resposibility ...
5255 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
5256 * driver.cs, attribute.cs, codegen.cs: Update to changes.
5258 2005-10-23 Raja R Harinath <harinath@gmail.com>
5260 * namespace.cs (RootNamespace.all_namespaces): Renamed from
5261 cached_namespaces. Improve usage.
5262 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
5263 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
5264 Move from GlobalRootNamespace and simplify.
5265 (RootNamespace.Global): Make instance variable.
5266 (RootNamespace.RootNamespace): Add "alias name" parameter.
5267 (GlobalRootNamespace): Simplify drastically.
5268 (Namespace.Lookup): Don't use GetNamespace.
5269 * typemanager.cs (GetRootNamespace): Rename from
5270 ComputeNamespaceForAlias.
5271 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
5273 2005-10-23 Marek Safar <marek.safar@seznam.cz>
5275 * anonymous.cs (AnonymousContainer): Don't crash when container
5278 2005-10-23 Marek Safar <marek.safar@seznam.cz>
5280 * expression.cs (Binary.DoResolve): Warn when comparing same
5283 2005-10-23 Marek Safar <marek.safar@seznam.cz>
5286 * expression.cs (Binary.DoResolve): It looks like there are no
5287 convetsion rules in enum context.
5289 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
5291 Add support for extern alias qualifiers.
5292 * typemanager.cs: Move some LookupTypeReflection code
5293 to namespace.cs, to have cleaner code. Added some methods
5294 to help us keep track of the extern aliased references.
5295 * driver.cs: Add suport for extern alias assemblies on command
5296 line and check for their warnings/errors. Also keep track of the
5297 extern aliased assemblies.
5298 * namespace.cs: Move the global functionality of Namespace
5299 to GlobalRootNamespace/RootNamespace. Now the global namespace
5300 is GlobalRootNamespace.Globa. Also the code moved from
5301 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
5302 Finally added LocalAliasEntry (AliasEntry before) and
5303 ExternAliasEntry, to handle alias statements.
5304 * cs-parser.jay: Add support in the grammar for extern alias
5306 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
5307 Update callings to Namespace (now in GlobalRootNamespace).
5309 2005-10-18 Raja R Harinath <rharinath@novell.com>
5312 * class.cs (TypeContainer.DefineType): Move updating of
5313 topological sort earlier in the code.
5314 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
5316 2005-10-18 Marek Safar <marek.safar@seznam.cz>
5319 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
5321 * constant.cs (Constant.TryReduce): Moved from Cast class.
5322 (Reduce): Made little bit more OO and fixed missing conversions.
5324 * ecore.cs (Reduce): Implemented.
5325 (Binary.EnumLiftUp): New method to upgrade values to enum values.
5327 * literal.cs (Reduce): Implemented.
5329 * class.cs: Reverted Miguel's wrong commit.
5331 2005-10-14 Miguel de Icaza <miguel@novell.com>
5333 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
5335 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
5337 * cs-parser.jay, expression.cs : CS0214 was missing error location
5338 for constants. Fixed bug #76404.
5340 2005-10-11 Marek Safar <marek.safar@seznam.cz>
5343 * convert.cs (ExplicitConversionCore): Fixed object->enum
5346 2005-10-10 Raja R Harinath <rharinath@novell.com>
5348 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
5350 (PropertyExpr.EmitCall): Likewise.
5351 * expression.cs (Invocation.EmitArguments): Handle case where
5353 (Invocation.EmitCall): Avoid allocating temporary variable if
5354 there are no arguments.
5356 2005-10-07 Raja R Harinath <rharinath@novell.com>
5359 * convert.cs (ImplicitConversionStandard): Move conversion of
5360 void* to arbitrary pointer types ...
5361 (ExplicitConversionStandard): .. here.
5362 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
5363 error to always print typenames.
5365 2005-10-07 Raja R Harinath <rharinath@novell.com>
5367 * convert.cs (GetConversionOperator): Rename from
5368 GetConversionOperators. Move operator selection code from ...
5369 (UserDefinedConversion): ... here.
5371 2005-10-06 Marek Safar <marek.safar@seznam.cz>
5373 * convert.cs (ExplicitConversionCore): Removed duplicate enum
5376 2005-10-05 Marek Safar <marek.safar@seznam.cz>
5378 * assign.cs (Assign.DoResolve): Error method changed.
5380 * cfold.cs (DoConstantNumericPromotions): Error method changed.
5382 * const.cs (ResolveValue): Reset in_transit immediately.
5384 * constant.cs: Error method changed.
5386 * convert.cs: Removed useless location parameter.
5387 (ExplicitNumericConversion): Don't do double enum check.
5388 (ExplicitConversionCore): Renamed from ExplicitConversion.
5389 (ExplicitUnsafe): Extracted from ExplicitConversion.
5390 (ExplicitConversion): Uses for error reporting.
5392 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
5394 (ResolveBoolean): Uses common error method.
5395 (CastToDecimal): Get rid of ec.
5396 (CastFromDecimal): Optimized.
5397 (ConvCast): Get rid of ec.
5399 * enum.cs (ResolveValue): Reset in_transit immediately.
5400 (Emit): Return after first error.
5402 * expression.cs: Convert changes.
5404 * literal.cs: Error method changed.
5406 * statement.cs: Error method changed.
5408 2005-10-03 Raja R Harinath <rharinath@novell.com>
5410 * support.cs (SeekableStreamReader.Position): Don't error out when
5411 the requested position is just beyond the end of the current
5414 2005-09-28 Raja R Harinath <rharinath@novell.com>
5416 * support.cs (SeekableStreamReader): Simplify drastically. Don't
5417 try to keep in sync with the byte count of the underlying Stream.
5418 However, this limits us to a window size of 2048 characters: i.e.,
5419 the maximum lookahead of our lexer/parser can be 2048 characters.
5421 2005-09-28 Marek Safar <marek.safar@seznam.cz>
5424 * driver.cs: Fix compilation files with full root path.
5426 2005-09-25 Miguel de Icaza <miguel@novell.com>
5428 * report.cs (SymbolRelatedToPreviousError): Format the output so
5429 it does not use an open parenthesis that is never closed.
5431 * driver.cs: Follow coding guidelines
5433 2005-09-27 Marek Safar <marek.safar@seznam.cz>
5436 * const.cs (Const.ResolveValue): Check for assigning non-null
5437 value to reference type.
5439 2005-09-27 Marek Safar <marek.safar@seznam.cz>
5441 * anonymous.cs: Implemented ExprClassName.
5443 * assign.cs (Assign.DoResolve): Don't chrash when type is not
5446 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
5449 * class.cs (StaticClass.DefineContainerMembers): Report protected
5452 * codegen.cs: if(ed) PRODUCTION.
5454 * convert.cs (Error_CannotImplicitConversion): Better error
5457 * cs-parser.jay: More error checks.
5459 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
5461 * driver.cs (CSCParseOption): Enabled wrong option check.
5463 * ecore.cs (Expression.ExprClassName): Turned to property.
5464 (MemberExpr.CheckIntermediateModification): For checking boxed
5465 value types modification.
5467 * statement.cs (Fixed.Resolve): Expression type must be
5468 convertible to fixed type.
5469 (CollectionForeach.GetEnumeratorFilter,TryType):
5470 Small refactoring for easier error checking.
5472 2005-09-26 Marek Safar <marek.safar@seznam.cz>
5474 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
5477 * class.cs (GeneratedBaseInitializer): New class for customization
5478 compiler generated initializers.
5479 (MemberBase.DoDefine): Check Obsolete attribute here.
5480 (FieldMember.DoDefine): Ditto.
5482 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
5485 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
5486 (MemberCore.GetObsoleteAttribute): Removed argument.
5487 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
5488 (MemberCore.CheckObsoleteType): New helper.
5492 * statement.cs: Updates after MemberCore changes.
5494 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
5495 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
5497 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
5498 obsolete attribute for compiler construct.
5499 (As.DoResolve): Cache result.
5501 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
5503 2005-09-26 Raja R Harinath <rharinath@novell.com>
5506 * expression.cs (This.VerifyFixed): In a value type T, the type of
5507 'this' is T&, iow, 'this' is either an out or ref parameter. In a
5508 value type R, 'this' is treated as a value parameter.
5510 2005-09-22 Miguel de Icaza <miguel@novell.com>
5512 * statement.cs (Lock): Use the TemporaryVariable class instead of
5513 manually using local variables as those do not work when variables
5516 * ecore.cs: Moved the TemporaryVariable class from being a nested
5517 class inside Foreach to be a public class that can be employed in
5520 2005-09-19 Marek Safar <marek.safar@seznam.cz>
5522 * cs-parser.jay: interface_accessors replaced by
5523 accessor_declarations.
5525 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
5528 * statement.cs (GotoCase.Resolve): Convert null constant to
5530 (SwitchLabel.ResolveAndReduce): Ditto.
5531 (SwitchLabel.NullStringCase): Custom null stamp.
5532 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
5534 typemanager.cs (CSharpSignature): Don't skip first argument
5537 2005-09-18 Miguel de Icaza <miguel@novell.com>
5539 * driver.cs: Set InEmacs based on the environment variable EMACS.
5541 * location.cs (InEmacs): in this mode, do not report column
5542 location as it confuses Emacs.
5544 2005-09-16 Marek Safar <marek.safar@seznam.cz>
5546 * cfold.cs, constant.cs, convert.cs, ecore.cs,
5547 expression.cs, iterators.cs, literal.cs: Store constants and
5550 * class.cs (MemberBase.ShortName): Pass location.
5552 * cs-parser.jay: Some location fixes.
5554 * ecore.cs (Expression.Location): Made virtual.
5556 2005-09-05 Miguel de Icaza <miguel@novell.com>
5558 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
5559 if the underlying types are the same, otherwise we need to produce
5560 code that will do the proper cast.
5562 This was exposed by Marek's constant rewrite which produced
5563 invalid code for the call site:
5566 void Method (X v) {}
5570 This fixes test-49.cs
5572 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
5574 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
5575 Type/Object should be allowed as well. Fixed bug #75968.
5577 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
5579 * expression.cs : (Binary.DoResolve): when one is enum constant and
5580 another is constant 0, then return enum one *as enum type*.
5583 2005-09-02 Raja R Harinath <rharinath@novell.com>
5585 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
5589 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
5590 flow-branching for LocalVariableReferences in case we were invoked
5591 from a MemberAccess.
5592 * expression.cs (LocalVariableReference.VerifyAssigned): New.
5594 (LocalVariableReference.DoResolveBase): ... this.
5595 (MemberAccess.Resolve): Do the check that was disabled during
5598 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
5601 (PartialContainer.Create): check abstract/sealed/static strictly
5602 but abstract/sealed can exist only at one side. Fixed bug #75883.
5604 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
5607 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
5608 specified, don't default to UnmanagedType.I4.
5610 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
5612 * expression.cs : conditional operator should check possibly
5613 incorrect assign expression. Fixed bug #75946.
5615 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
5617 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
5618 Reverting the change. gmcs is much complex than mcs on this matter.
5620 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
5622 * cs-tokenizer.cs : To read another token ahead of the actual
5623 consumption, use new SavedToken and cache token instead of moving
5624 back the stream with SeekableStreamReader (it seemed problematic).
5626 driver.cs : Thus use StreamReader directly.
5627 * support.cs : Thus removed SeekableStreamReader.
5629 2005-08-30 Raja R Harinath <rharinath@novell.com>
5632 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
5633 (ScopeInfo.EmitScopeType): Use it to construct field names from
5634 names of captured locals.
5637 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
5638 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
5639 Pass 'target_type' to BoxedCast. Don't default to 'object'.
5640 (ExplicitConversion): Remove enum cases already handled by
5641 implicit conversion. Move implicit conversion check to the beginning.
5642 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
5643 * expression.cs (ArrayCreation.EmitDynamicInitializers):
5644 Don't treat System.Enum as a struct.
5646 2005-08-30 Jb Evain <jbevain@gmail.com>
5648 * attribute.cs: handles as expression in parameters.
5650 2005-08-30 Raja R Harinath <rharinath@novell.com>
5653 * class.cs (TypeContainer.VerifyClsName): Don't use a
5654 PartialContainer when verifying CLS compliance.
5655 (AbstractPropertyEventMethod): Set Parent here, ...
5656 (PropertyMethod): ... not here.
5658 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
5660 * attribute.cs : escaped attribute name should not be allowed to be
5661 resolved (e.g. @class as classAttribute). Fixed bug #75930.
5663 2005-08-29 Raja R Harinath <rharinath@novell.com>
5666 * convert.cs (ImplicitStandardConversionExists): Allow zero also
5667 when converting a long constant to unsigned long.
5668 * expression.cs (Invocation.OverloadResolve): Add sanity check to
5669 detect where IsApplicable and VerifyArgumentsCompat disagree.
5671 2005-08-29 Raja R Harinath <rharinath@novell.com>
5672 and Carlos Alberto Cortez <carlos@unixmexico.org>
5675 * class.cs (TypeContainer.CanElideInitializer): New helper.
5676 (TypeContainer.EmitFieldInitializers): Use it to determine if we
5677 can safely emitting the initializer of a field.
5679 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
5681 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
5682 allowed inside a switch (without loop). Fixed bug #75433.
5684 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
5686 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
5687 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
5689 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
5691 * driver.cs : kinda reverting the default encoding changes (not exact
5692 revert since I noticed that "codepage:reset" might not work fine).
5694 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
5696 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
5697 Location. Now getter and setter store location correctly.
5698 (errors/cs0111-12.cs now reports the expected location.)
5700 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
5702 * driver.cs : Use default encoding on the environment.
5703 Removed (now that) extra parameter for SeekableStreamReader.
5704 * support.cs : (SeekableStreamReader) third .ctor() argument for
5705 StreamReader is not required (always true). preamble size could
5706 be acquired in simpler and safe way.
5708 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
5710 * cs-parser.jay: report CS0642 at warning level 3
5711 and report CS0642 for an if else statement also
5712 fixes bug #74745. Patch by John Luke (and a bit
5714 Removed extra CS0642 warning check for "while",
5716 * statement.cs: In Block.Resolve(), CS0642 check
5717 is reimplemented to check a sequence of an empty
5718 statement and a block.
5720 Both fix bug #66777.
5722 2005-08-24 Marek Safar <marek.safar@seznam.cz>
5724 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
5725 detection until I fix it.
5727 * cs-tokenizer.cs: Changed error message.
5729 * cs-parser.jay: Fixed 2 error locations.
5731 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
5732 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
5735 * enum.cs (GetSignatureForError): Fixed.
5737 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
5741 * typemanager.cs (RegisterProperty): Removed.
5743 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
5745 2005-08-24 Raja R Harinath <rharinath@novell.com>
5748 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
5749 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
5751 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
5753 * expression.cs : tiny fix is required for not warning positive ulong.
5756 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
5758 * expression.cs : add CS0652 check for constant and integral
5759 expression. Fixed bug #53974.
5761 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
5763 * expression.cs : in DoNumericPromotions(), check if there is implicit
5764 conversion overload for string (to check CS0034). Fixed bug #52492.
5766 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
5768 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
5770 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
5772 * ecore.cs : report location when it is *not* Null.
5774 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
5780 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
5781 correctly. Fixed bug #75721.
5783 2005-08-23 Raja R Harinath <rharinath@novell.com>
5785 * support.cs (SeekableStreamReader.Position): Avoid an expensive
5786 loop that performs 'min (pos, char_count)'.
5789 * expression.cs (Unary.ResolveOperator): Don't discard implicit
5790 converted value in Operator.OnesComplement.
5792 2005-08-22 Ben Maurer <bmaurer@ximian.com>
5794 * anonymous.cs: If the anon method is pulled into a helper class,
5795 it needs to be `internal' not `private'. Fixes runtime behavior on
5798 2005-08-20 Martin Baulig <martin@ximian.com>
5800 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
5801 scope if we don't already have it.
5803 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
5804 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
5807 2005-08-17 Marek Safar <marek.safar@seznam.cz>
5810 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
5813 2005-08-16 Marek Safar <marek.safar@seznam.cz>
5815 The big constants rewrite
5816 Fix #75746, #75685 and more
5817 As a side effect saved 1MB for MWF ;-)
5819 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
5820 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
5821 enum based for corlib compilation.
5823 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
5826 * class.cs (FixedField.Define): Use ResolveAsConstant.
5828 * const.cs (IConstant): Interface constants and enums.
5829 (Const.ResolveValue): New method for constant resolvning.
5830 (ExternalConstant): Constants from imported assemblies.
5832 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
5833 conversion; like enums.
5834 (Constant.ToType): Converts this constant to different type.
5835 (Constant.Increment): Adds 1.
5837 * convert.cs (ImplicitConversionRequired): Simplified.
5839 * cs-parser.jay: Create EnumMember directly.
5841 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
5843 * doc.cs (GenerateEnumDocComment): Removed.
5845 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
5846 (ConvertIntLiteral): Removed.
5847 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
5849 * enum.cs (EnumMember): Implement IConstant.
5850 (Enum.IsValidEnumConstant): Removed.
5851 (Enum.GetNextDefaultValue): Removed.
5852 (Enum.FindMembers): Updated.
5853 (Enum.GenerateDocComment): Iterate enum members.
5855 * expression.cs (Cast.TryReduce): Handle enums correctly.
5856 (New.Constantify): Made public.
5857 (MemberAccess.DoResolve): Removed contant specific if(s).
5859 * literal.cs (NullLiteral): Implement new abstract methods.
5861 * statement.cs (GotoCase.Resolve): Use new constant methods.
5862 (SwitchLabel.ResolveAndReduce): Use new constant methods.
5864 * typemanager.cs (LookupEnum): Removed.
5865 (IsEnumType): Fixed to work with corlib.
5866 (RegisterConstant): Removed.
5867 (LookupConstant): Removed.
5868 (GetConstant): Changed to work with IConstant.
5870 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
5872 * location.cs : Fixed overflown (>255) column number.
5874 2005-08-03 Raja R Harinath <rharinath@novell.com>
5876 First cut of the qualified-alias-member feature.
5877 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
5879 * cs-parser.jay (DOUBLE_COLON): New token.
5880 (namespace_or_type_name): Add rule for recognizing
5881 qualified-alias-members.
5882 (primary_expression): Likewise.
5883 (element_access): Allow QualifiedAliasMember as a possible
5884 type-bearing expression.
5885 (local_variable_type, local_variable_pointer_type): Likewise.
5886 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
5887 aliases in the current and enclosing namespace declarations.
5888 (NamespaceEntry.UsingAlias): Add CS0440 warning.
5889 * decl.cs (MemberName.is_double_colon): New.
5890 (MemberName.MemberName): Add new constructor for alias-member.
5891 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
5892 * expression.cs (QualifiedAliasMember): New expression type.
5894 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
5896 * location.cs : it borked when no argument was specified.
5898 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
5900 * location.cs : tiny ToString() format fix.
5902 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
5904 * statement.cs : oops, it was missing.
5906 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
5908 A set of fixes for precise line/column location.
5911 "token" field now holds a file/line "delta", a line number offset
5912 from the segment, and a column number. See also:
5913 http://lists.ximian.com/pipermail/mono-devel-list/2004-
5914 December/009508.html
5915 Removed static IsNull. Use instance IsNull property instead.
5917 For some tokens it stores Location. For Identifier it stores
5918 LocatedToken which is a pair of string name and location.
5919 Column numbers are adjusted only at getChar().
5921 Use Location.ToString() for reporting (it now contains column).
5923 Largely modified to use LocatedToken instead of
5924 string (IDENTIFIER), and to acquire Location from some tokens.
5925 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
5926 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
5928 Now MemberName holds Location. DeclSpace.ctor() receives Location
5929 as a parameter. Removed extra parameters to all derived classes.
5930 Replaced Location.IsNull() with instance property.
5931 * assign.cs, expression.cs :
5932 Added .ctor() overload that omits Location.
5934 Added "nameEscaped" flag that indicates the identifier was escaped
5935 in the source file. This fixes bug #57047.
5937 2005-08-02 Marek Safar <marek.safar@seznam.cz>
5939 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
5940 New method, looking for lo-case imported cls type.
5942 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
5945 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
5947 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
5949 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
5951 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
5953 Optimized to save 3.5 MB for SWF compilation.
5955 2005-08-01 Marek Safar <marek.safar@seznam.cz>
5957 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
5958 (PartialContainer.Create): Moved logic AddToContainer.
5959 (PartialContainer.MarkForDuplicationCheck): Shares name.
5961 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
5964 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
5966 (Namespace.GetSignatureForError): New method.
5968 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
5969 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
5971 2005-08-01 Raja R Harinath <rharinath@novell.com>
5974 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
5975 member lookup rather than qualifier_type, since qualifier_type can
5978 2005-08-01 Marek Safar <marek.safar@seznam.cz>
5980 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
5983 2005-07-31 Miguel de Icaza <miguel@novell.com>
5985 * statement.cs: Copy the local exception into the exception
5986 captured local. Fixes 75674
5988 2005-07-31 Raja R Harinath <harinath@gmail.com>
5991 * expression.cs (Invocation.OverloadResolve): Don't report error
5992 CS1501 if error CS1502 has been reported.
5993 (New.DoResolve): Delegate CS1501 reporting to
5994 Invocation.OverloadResolve.
5997 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
5998 invariant-meaning-in-block property in an enclosing block if
6001 2005-07-29 Marek Safar <marek.safar@seznam.cz>
6003 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
6004 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
6005 (Switch.CheckSwitch): Just save 50kb for SWF.
6007 2005-07-27 Martin Baulig <martin@ximian.com>
6009 * anonymous.cs (CaptureContext.AddField): Added
6010 `AnonymousContainer am' argument; compute its toplevel scope if
6011 it's not already computed. Fixes #75649.
6013 2005-07-26 Raja R Harinath <rharinath@novell.com>
6016 * class.cs (Constructor.Emit): Reset block to null if the block
6019 2005-07-25 Marek Safar <marek.safar@seznam.cz>
6021 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
6023 2005-07-25 Marek Safar <marek.safar@seznam.cz>
6025 * class.cs (MethodData.Define): Check whether accessor implementing
6026 interface is public.
6028 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
6030 2005-07-22 Marek Safar <marek.safar@seznam.cz>
6033 * namespace.cs (LookupType): Moved same type check to...
6035 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
6038 2005-07-21 Raja R Harinath <rharinath@novell.com>
6040 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
6041 already found a typebuilder.
6042 * class.cs (MethodCore.IsDuplicateImplementation): Compare
6043 MemberNames, not strings.
6045 * const.cs (Error_ExpressionMustBeConst):
6046 Rename from Error_EpressionMustBeConst.
6047 * const.cs, class.cs, statement.cd: Update.
6049 2005-07-21 Marek Safar <marek.safar@seznam.cz>
6053 * const.cs (Const.LookupConstantValue): Report missing contant expression
6055 (Error_EpressionMustBeConstant): Only one error method.
6057 * class.cs, statement.c: Updated.
6059 2005-07-20 Raja R Harinath <rharinath@novell.com>
6061 * statement.cs (Block.Flags): Add back HasVarargs.
6062 (Block.flags): Make protected.
6063 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
6065 * typemanager.cs (types, typecontainers, user_types): Remove.
6066 (UserTypes, TypeContainers): Likewise.
6067 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
6068 (CleanUp, Reset): Update.
6069 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
6070 (GetNestedType): Use Type.GetNestedType.
6071 (CoreLookupType): Take two arguments, the namespace and the
6072 basename of the type. Update to use the Namespace.Lookup
6074 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
6075 (RealMemberLookup): Use IsNestedChildOf instead of playing with
6076 string concatenation and substring matches.
6077 * class.cs, enum.cs, delegate.cs: Update to changes.
6079 2005-07-20 Marek Safar <marek.safar@seznam.cz>
6081 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
6082 Expression and made virtual.
6084 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
6085 (ImplicitStandardConversionExists): Fixed `byte' typo ?
6087 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
6089 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
6092 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
6095 2005-07-18 Marek Safar <marek.safar@seznam.cz>
6098 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
6099 AssemblyCultureAttribute is not used on executable.
6102 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
6104 2005-07-16 Raja R Harinath <rharinath@novell.com>
6107 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
6108 New. Reports CS0252/CS0253.
6109 Mostly taken from preliminary patch by Duncak Mak.
6110 (Binary.DoResolveOperator): Store results of operator lookup.
6111 Use them to detect if we need to warn about unintended reference
6114 2005-07-15 Raja R Harinath <rharinath@novell.com>
6117 * namespace.cs (Namespace.Lookup): Add back location parameter.
6118 (Namespace.LookupType): Add CS0436 report. Add location parameter.
6119 * delegate.cs, ecore.cs, expression.cs: Update to changes.
6121 * codegen.cs (EmitContext.DeclSpace): Make readonly.
6122 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
6123 (Namespace.LookupType): ... this.
6124 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
6126 * typemanager.cs (LookupTypeReflection): Remove buggy code that
6127 purported to handle pointers.
6128 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
6131 2005-07-15 Marek Safar <marek.safar@seznam.cz>
6133 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
6136 2005-07-15 Raja R Harinath <rharinath@novell.com>
6138 * namespace.cs (Namespace.Lookup): Drop location parameter.
6139 (NamespaceEntry.LookupAlias): Remove. Merge into ...
6140 (NamespaceEntry.Lookup): ... this.
6141 (NamespaceEntry.Error_AmbiguousTypeReference):
6142 Move here from DeclSpace.
6143 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
6145 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
6146 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
6147 Move to NamespaceEntry.
6148 * delegate.cs, expression.cs: Update to changes.
6150 2005-07-14 Marek Safar <marek.safar@seznam.cz>
6152 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
6153 CheckAttributeType and refactored.
6154 (Attribute.ResolvePossibleAttributeType): Changed to reuse
6155 ResolveAsTypeTerminal error handling.
6156 (ResolveAsTypeTerminal): Introduced because of global attributes extra
6158 (GetSignatureForError): Print errors in same way.
6161 * codegen.cs: Reflect attribute GetSignatureForError change.
6164 * expression.cs: Add silent parameter to ResolveAsTypeStep.
6166 * namespace.cs (UsingEntry): Refactored to make fields private.
6169 statement.cs: Error_UnexpectedKind has extra parameter.
6171 2005-07-14 Raja R Harinath <rharinath@novell.com>
6173 * ecore.cs (IAlias): Remove.
6174 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
6175 that implement the interface.
6176 * namespace.cs (Namespace): Likewise.
6177 (Namespace.declspaces): Renamed from 'defined_names'.
6178 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
6179 DeclSpace instead of an IAlias.
6180 * tree.cs (Tree.AddDecl): Update.
6182 2005-07-12 Raja R Harinath <rharinath@novell.com>
6184 * statement.cs (Block.Flags); Remove HasVarargs.
6185 (Block.HasVarargs): Move to ToplevelBlock.
6186 (Block.ThisVariable, Block.AddThisVariable): Likewise.
6187 (Block.Variables): Make protected. Initialize variable hashtable
6189 (Block.AddVariable): Update.
6190 (Block.Resolve): Update to changes.
6191 (ToplevelBlock.HasVarargs): New boolean.
6192 (ToplevelBlock.ThisVariable): Move here from Block.
6193 (ToplevelBlock.AddThisVariable): Likewise.
6194 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
6195 * expression.cs (This.ResolveBase): Update to changes.
6196 (ArglistAccess.DoResolve): Likewise.
6198 2005-07-11 Marek Safar <marek.safar@seznam.cz>
6201 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
6203 * class.cs (TypeContainer.VerifyMembers): Distinguish between
6204 not used and not used & assigned.
6205 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
6207 2005-07-11 Marek Safar <marek.safar@seznam.cz>
6210 * expression.cs (Is.DoResolve): null is never provided type.
6212 2005-07-08 Marek Safar <marek.safar@seznam.cz>
6215 * cs-parser.jay: Less strict event error rule to catch more errors.
6217 2005-07-08 Martin Baulig <martin@ximian.com>
6219 Fix test-iter-10.cs - distinguish whether we `yield' in a property
6220 gettter (allowed) or setter (not allowed).
6222 * class.cs (Accessor): Implement IIteratorContainer.
6223 (Accessor.Yields): New public field.
6224 (PropertyBase.PropertyMethod.Define): Handle iterators on a
6228 (get_accessor_declaration, set_accessor_declaration): Set the
6229 `yields' flag on the accessor, not the property.
6230 (property_declaration): Do the iterators check on a per-accessor
6231 basis and not for the whole property.
6233 2005-07-08 Martin Baulig <martin@ximian.com>
6235 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
6236 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
6238 2005-07-07 Marek Safar <marek.safar@seznam.cz>
6241 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
6242 (ExtractSecurityPermissionSet): Cope with self referencing security
6243 attributes properly.
6245 * driver.cs (SetOutputFile): Made public property OutputFile.
6247 2005-07-07 Raja R Harinath <rharinath@novell.com>
6250 * class.cs (TypeContainer.first_nonstatic_field): Rename from
6251 has_nonstatic_fields. Make into a FieldBase pointer.
6252 (TypeContainer.AddField): Add CS0282 check.
6253 (TypeContainer.EmitType): Update.
6255 2005-07-06 Miguel de Icaza <miguel@novell.com>
6257 * cs-tokenizer.cs (consume_identifier): Do not create strings to
6258 compare if they start with __.
6260 2005-07-06 Raja R Harinath <rharinath@novell.com>
6262 * statement.cs (Switch.SwitchGoverningType): Only look at
6263 UserCasts that don't need implicit standard conversions to one of
6264 the allowed switch types (Fixes test-322.cs).
6265 (LocalInfo.Resolve): Re-enable sanity-test.
6267 2005-07-06 Marek Safar <marek.safar@seznam.cz>
6269 * cs-tokenizer.cs (consume_identifier): Detect double undescores
6271 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
6273 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
6275 2005-07-06 Raja R Harinath <rharinath@novell.com>
6278 * ecore.cs (SimpleName.GetSignatureForError): Add.
6279 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
6280 (MemberAccess.GetSignatureForError): Add.
6282 2005-07-05 Marek Safar <marek.safar@seznam.cz>
6284 The big error and warning messages review.
6314 * typemanager.cs: Updated.
6316 * class.cs: (MethodCore.SetYields): Moved here to share.
6317 (PropertyMethod.Define): Moved iterator setup here.
6319 * iterators.cs: Add orig_method to have full access to parent
6322 2005-07-05 Raja R Harinath <rharinath@novell.com>
6324 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
6325 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
6326 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
6327 variable of struct type.
6328 * expression.cs (Unary.ResolveOperator): Update to change.
6329 (Indirection.VerifyFixed): Likewise.
6330 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
6331 (ParameterReference.VerifyFixed): Value parameters are fixed.
6332 (This.VerifyFixed): Treat 'this' as a value parameter.
6333 * statement.cs (LocalInfo.IsFixed): Remove.
6335 2005-07-01 Martin Baulig <martin@ximian.com>
6337 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
6338 `ec.EmitThis ()' to get the correct scope.
6340 2005-07-01 Martin Baulig <martin@ximian.com>
6342 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
6343 instance is a ParameterReference; fixes #75299.
6345 2005-07-01 Martin Baulig <martin@ximian.com>
6347 Reverted Marek's latest patch (r46725):
6348 - it contains structural changes which are neither mentioned in
6349 the ChangeLog nor explained anywhere; for example the additional
6350 argument of EmitContext's and Iterator's .ctor's and the
6351 TypeContainer.DefineMembers() change.
6352 - structural changes like this should go in in seperate patches
6353 and not be hidden in a huge patch which just seems to affect
6354 warnings and errors.
6355 a big and hard to understand patch.
6356 - it breaks iterators and causes regressions, for instance in
6359 2005-06-30 Raja R Harinath <rharinath@novell.com>
6362 * expression.cs (Indexers.map): Remove.
6363 (Indexers.Append): Filter out inaccessible setters and getters.
6364 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
6367 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
6369 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
6370 (FieldExpr.Emit, PropertyExpr.Emit): Update.
6371 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
6372 * expression.cs (Invocation.EmitCall): Add CS0120 check.
6374 2005-06-30 Marek Safar <marek.safar@seznam.cz>
6377 * class.cs (FieldBase.GetInitializerExpression): One more field
6380 2005-06-28 Miguel de Icaza <miguel@novell.com>
6382 * pending.cs: Do not define a proxy if the base method is virtual,
6383 it will be picked up by the runtime (bug 75270).
6385 2005-06-08 Martin Baulig <martin@ximian.com>
6387 The big Iterators rewrite :-)
6389 * iterators.cs: Rewrite this to use the anonymous methods framework.
6391 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
6392 before the TypeContainers; see 2test-21.cs.
6395 (TypeContainer.DefineType): Don't create a new EmitContext if we
6396 already have one (this only happens if we're an Iterator).
6397 (TypeContainer.Define): Also call Define() on all our iterators.
6398 (Method.CreateEmitContext): Added support for iterators.
6401 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
6402 (AnonymousContainer.CreateMethodHost): Moved here from
6403 AnonymousMethod and made abstract.
6404 (AnonymousContainer.CreateScopeType): New abstract method.
6405 (AnonymousContainer.IsIterator): New public property.
6406 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
6407 get the ScopeTypeBuilder rather than manually defining it here.
6408 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
6411 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
6412 before RootContext.DefineTypes().
6414 * codegen.cs (EmitContext.RemapToProxy): Removed.
6415 (EmitContext.CurrentAnonymousMethod): Changed type from
6416 AnonymousMethod -> AnonymousContainer.
6417 (EmitContext.ResolveTopBlock): Protect from being called twice.
6418 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
6419 (EmitContext.EmitThis): Removed the iterators hacks; use the
6420 anonymous methods framework for that.
6423 (ToplevelBlock.Container): Make this a property, not a field.
6424 (ToplevelBlock.ReParent): New public method; move the
6425 ToplevelBlock into a new container.
6426 (Foreach.TemporaryVariable): Simplify.
6428 2005-06-05 Martin Baulig <martin@ximian.com>
6430 * statement.cs (LocalInfo.CompilerGenerated): New flag.
6431 (Block.AddTemporaryVariable): New public method; creates a new
6432 `LocalInfo' for a temporary variable.
6433 (Block.EmitMeta): Create the LocalBuilders for all the temporary
6435 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
6436 non-iterator variables.
6438 2005-06-05 Martin Baulig <martin@ximian.com>
6440 * statement.cs (Foreach.TemporaryVariable): Create the
6441 LocalBuilder in the Emit phase and not in Resolve since in some
6442 situations, we don't have an ILGenerator during Resolve; see
6443 2test-19.cs for an example.
6445 2005-06-04 Martin Baulig <martin@ximian.com>
6447 **** Merged r45395 from GCS ****
6449 The big Foreach rewrite - Part II.
6451 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
6452 with `PropertyInfo ienumerator_getcurrent'.
6454 * codegen.cs (VariableStorage): Removed.
6457 (Foreach): Derive from Statement, not ExceptionStatement.
6458 (Foreach.CollectionForeach): New nested class. Moved all the code
6459 dealing with collection foreach here.
6460 (Foreach.ForeachHelperMethods): Removed.
6461 (Foreach.TemporaryVariable): Implement IMemoryLocation.
6463 2005-05-23 Martin Baulig <martin@ximian.com>
6465 * statement.cs (Try.DoResolve): Don't create a `finally' if we
6466 don't need to. Fix #75014.
6468 2005-05-20 Martin Baulig <martin@ximian.com>
6470 Merged r44808 from GMCS.
6472 * class.cs (TypeContainer.CircularDepException): Removed.
6473 (TypeContainer.DefineType): Removed the `InTransit' stuff.
6474 (TypeContainer.CheckRecursiveDefinition): Check for circular class
6475 (CS0146) and interface (CS0529) dependencies here.
6477 2005-06-21 Raja R Harinath <rharinath@novell.com>
6479 * expression.cs (Invocation.EmitCall): Fix initialization
6480 'this_call' to reflect current behaviour. Fix indentation.
6482 * convert.cs (FindMostEncompassedType): Add two trivial special
6483 cases (number_of_types == 0 || number_of_types == 1).
6484 (FindMostEncompasingType): Likewise.
6486 2005-06-17 Raja R Harinath <rharinath@novell.com>
6488 Some cleanups preparing for the fix of #75283.
6489 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
6491 (EventExpr.InstanceResolve): Likewise.
6492 (EventExpr.DoResolve): Remove redundant checks.
6494 2005-06-10 Duncan Mak <duncan@novell.com>
6496 * cs-tokenizer.cs (process_directives): New flag for controlling
6497 the processing of preprocessor directives.
6498 (x_token): After seeing a '#', return Token.NONE instead of going
6499 to handle_preprocessing_directive() when not processing
6500 directives. This avoids unnecessary processing during the token peek in
6505 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
6506 the existing error reporting methods instead of Report.Error.
6508 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
6509 after Raja's rewrite.
6511 2005-06-08 Miguel de Icaza <miguel@novell.com>
6513 * class.cs: Small fix.
6515 2005-06-08 Raja R Harinath <rharinath@novell.com>
6518 * class.cs (GetPartialBases): Fix return value check of
6521 2005-06-07 Raja R Harinath <rharinath@novell.com>
6523 Ensure that partial classes are registered in their enclosing
6524 namespace. Initial part of fix of #75160.
6525 * tree.cs (Tree.RecordDecl): Add new namespace argument.
6526 Register declspace with namespace here, not in
6527 DeclSpace.RecordDecl.
6528 * cs-parser.jay: Pass namespace to RecordDecl.
6529 * class.cs (PartialContainer.Create): Likewise.
6530 (ClassPart.DefineType): New sanity-check. Throws an exception if
6532 * decl.cs (Declspace.RecordDecl): Remove.
6533 * namespace.cs (NamespaceEntry.DefineName): Remove.
6535 2005-06-06 Marek Safar <marek.safar@seznam.cz>
6537 * rootcontext.cs: Reset TargetExt as well.
6539 2005-06-03 Raja R Harinath <rharinath@novell.com>
6541 * ecore.cs (Expression.Resolve): Emit CS0654 error when
6544 2005-06-02 Raja R Harinath <rharinath@novell.com>
6546 Fix #75080, cs0119.cs.
6547 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
6549 (Expression.Resolve): ... this. Use it. Remove bogus code
6550 allowing ExprClass.Type and ExprClass.Namespace for
6551 ResolveFlags.VariableOrValue.
6552 (Expression.Resolve) [1-argument variant]: Change default resolve
6553 flags based on language version.
6554 (Expression.Error_UnexpectedKind): Use a simple string array
6555 rather than an ArrayList.
6556 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
6558 (TypeOfVoid.DoResolve): Likewise.
6559 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
6560 flags argument -- it always has the same value.
6562 2005-05-31 Raja R Harinath <rharinath@novell.com>
6565 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
6566 Use it in the error message.
6567 * assign.cs, expression.cs, statement.cs: Update.
6569 2005-05-30 Raja R Harinath <rharinath@novell.com>
6572 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
6573 the "almostMatchedMember" case too.
6574 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
6575 that failed the accessibility checks to 'almost_match'.
6577 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
6579 * attribute.cs: Use internal MethodBuilder methods to set
6580 ExactSpelling and SetLastError on PInvoke methods, instead
6581 of passing them via charset. Fixes #75060.
6583 2005-05-27 Raja R Harinath <rharinath@novell.com>
6585 * parameter.cs (Parameter): Remove TODO comment.
6586 (Parameter.DefineParameter): Remove Location parameter.
6587 (Parameters.LabelParameters): Likewise.
6588 * class.cs (Constructor.Emit): Update to change.
6589 (MethodData.Emit): Likewise.
6590 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
6591 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
6593 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
6596 Removed Parameters.Location and added Parameter.Location instead.
6597 Removed Location parameter from Emit() and GetSignature().
6604 Modified all related calls.
6606 2005-05-26 Raja R Harinath <rharinath@novell.com>
6608 Improve user-defined conversion handling.
6609 * convert.cs (GetConversionOperators): Rewrite. Return only the
6610 applicable operators.
6611 (AddConversionOperators): New. Helper for GetConversionOperators.
6612 (FindMostEncompassedType, FindMostEncompassingType): Verify that
6613 there is only one most encompassed/encompassing type.
6614 (FindMostSpecificSource, FindMostSpecificTarget): Remove
6615 "applicable operator" handling.
6616 (UserConversion): Move cache here from GetConversionOperators.
6617 Directly cache the chosen operator, rather than the whole
6619 (ExplicitNumericConversion): Fix buggy implementation of Decimal
6620 case. Allow conversion of decimal to sbyte and byte too.
6621 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
6622 New static methods. Used to avoid allocating EmptyExpressions in
6625 2005-05-24 Duncan Mak <duncan@novell.com>
6627 * ecore.cs (CastFromDecimal): New class for casting a decimal to
6628 another class, used in Convert.ExplicitNumericConversion.
6629 (CastToDecimal): New class, similar to above, but casts to
6630 System.Decimal, used in Convert.ImplicitNumericConversion and also
6631 in explicit convesion from double/float to decimal.
6633 * convert.cs (ImplicitNumericConversion): Handle implicit
6634 conversions to System.Decimal.
6635 (ExplicitNumericConversion): handle explicit conversions to
6640 2005-05-20 Miguel de Icaza <miguel@novell.com>
6642 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
6643 know the type at this stage, just break through. Fixes #75008
6645 2005-05-19 Martin Baulig <martin@ximian.com>
6648 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
6649 to disable error reporting.
6651 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
6652 here since we don't want to report an error; see the new test-336.cs.
6654 2005-05-19 Raja R Harinath <rharinath@novell.com>
6656 * statement.cs (ToplevelBlock.GetParameterReference)
6657 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
6658 Move here from class Block.
6659 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
6660 * expression.cs (ParameterReference.DoResolveBase): Likewise.
6662 2005-05-18 Martin Baulig <martin@ximian.com>
6667 (FlowBranching.Reachability): Add non-static public And() and Or()
6669 (FlowBranchingSwitch): New class; do the `break_origins' thing
6670 like in FlowBranchingLoop.
6671 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
6672 reachability, not just locals and parameters.
6673 (FlowBranching.MergeChild): Remove some of the hacks for loop and
6674 switch; MergeBreakOrigins() now takes care of that.
6676 2005-05-18 Martin Baulig <martin@ximian.com>
6678 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6679 a loop and may leave it, reset the barrier; fixes #74974.
6681 2005-05-17 Marek Safar <marek.safar@seznam.cz>
6683 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
6686 * cs-parser.jay: Catch more lexical errors.
6688 * report.cs: Add one more Error method.
6691 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
6693 2005-05-17 Martin Baulig <martin@ximian.com>
6695 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
6698 2005-05-16 Raja R Harinath <rharinath@novell.com>
6700 Fix test-382.cs. Emit values of decimal constants.
6701 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
6703 (TypeContainer.AddField): ... this.
6704 (TypeContainer.EmitFieldInitializers): Allow the list of fields
6705 with initializers to include 'Const's.
6706 (ClassPart.RegisterFieldForInitialization): Forward to
6708 * const.cs (Const.Const): Pass initializer to base class.
6709 (Const.Define): In case of decimal constants, register them for
6710 initialization in a static constructor.
6712 2005-05-14 Martin Baulig <martin@ximian.com>
6714 * statement.cs (Block.Resolve): Correctly handle unreachable code;
6715 do not call ResolveUnreachable() on unreachable statements in
6716 here, see the comment in the source code.
6718 2005-05-13 Raja R Harinath <rharinath@novell.com>
6721 * expression.cs (BinaryResolveOperator): If one of the operands of
6722 an equality comparison is 'null' and the other is a pointer type,
6723 convert the null to a NullPointer.
6724 * convert.cs (ImplicitReferenceConversion): If the expression is a
6725 NullLiteral and the target type is a pointer type, return a
6726 NullPointer instead.
6727 (ImplicitConversionStandard): Likewise.
6729 2005-05-13 Marek Safar <marek.safar@seznam.cz>
6731 * cs-parser.jay: Set readonly context based on special constructs.
6733 * expression.cs (LocalVariableReference.DoResolveBase): Improved
6734 readonly variable error handling.
6736 * rootcontext.cs (EmitCode): Don't verify members when error
6739 * statement.cs (LocalInfo): Add reaodnly context information.
6740 (SetReadOnlyContext, GetReadOnlyContext): New methods.
6742 2005-05-13 Raja R Harinath <rharinath@novell.com>
6744 * statement.cs (Block.Resolve): Revert change below. Modify fix
6745 for #74041 to initialize 'resolved' to false only for explicit
6746 blocks. Fixes #74873.
6748 2005-05-12 Raja R Harinath <harinath@gmail.com>
6751 * typemanager.cs (unmanaged_enclosing_types): New.
6752 (IsUnmanagedType): Avoid infloops by using
6753 'unmanaged_enclosing_types' to talk with recursive invocations.
6755 2005-05-13 Martin Baulig <martin@ximian.com>
6757 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
6758 instance variable, not a local. Fix #74873.
6759 (Block.ResolveUnreachable): Set it to true here.
6761 2005-05-11 Duncan Mak <duncan@novell.com>
6763 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
6764 continuing to process for 'arg'.
6765 (handle_preprocessing_directive): Check the argument of the #endif
6766 directive and report error CS1025 if there are any trailing
6769 According to the C# spec, having even whitespace after the #endif
6770 directive is illegal; however, because we call arg.TrimEnd ()
6771 beforehand, we have the same behavior as csc, allowing whitespace
6772 after the directive.
6776 2005-05-11 Marek Safar <marek.safar@seznam.cz>
6780 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
6781 (Constructor.GetObsoleteAttribute): Implemented correctly.
6783 2005-05-10 Martin Baulig <martin@ximian.com>
6785 * support.cs (ReflectionParameters.ParameterModifier): Use
6786 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
6787 and `ParameterAttributes.In'. Fixes #74884.
6789 2005-05-10 Marek Safar <marek.safar@seznam.cz>
6791 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
6793 * expression.cs (Argument.GetParameterModifier): Turned to property.
6794 (Invocation.Error_InvalidArguments): Add more descriptive errors.
6796 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
6799 2005-05-09 Raja R Harinath <rharinath@novell.com>
6802 * decl.cs (MemberCache.AddMethods): Register override methods,
6803 rather than non-override methods.
6804 * typemanager.cs (RegisterOverride): New.
6805 (IsOverride): Update.
6807 2005-05-09 Marek Safar <marek.safar@seznam.cz>
6811 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
6812 recursive declaration.
6814 * statement.cs (Block.ResolveMeta): Report any error in resolving.
6816 2005-05-06 Marek Safar <marek.safar@seznam.cz>
6818 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
6820 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
6822 2005-05-05 Raja R Harinath <rharinath@novell.com>
6825 * decl.cs (DeclSpace.FamilyAccessible):
6826 Use TypeManager.IsNestedFamilyAccessible.
6828 Fix reopened #64812.
6829 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
6832 2005-05-04 Raja R Harinath <rharinath@novell.com>
6833 Abin Thomas <projectmonokochi@rediffmail.com>
6834 Anoob V E <projectmonokochi@rediffmail.com>
6835 Harilal P R <projectmonokochi@rediffmail.com>
6838 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
6839 allow access to all static members.
6841 2005-05-04 Martin Baulig <martin@ximian.com>
6843 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
6845 2005-05-04 Martin Baulig <martin@ximian.com>
6849 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
6850 section at the end; make things work if `default' is not the last
6853 2005-05-04 Martin Baulig <martin@ximian.com>
6857 * statement.cs (Switch): Replaced the `got_default' field with a
6858 `default_section' one.
6859 (Switch.CheckSwitch): Set `default_section' here.
6860 (Switch.Resolve): If we're a constant switch and the constant is
6861 not found, use the default section.
6863 2005-05-03 Martin Baulig <martin@ximian.com>
6865 * expression.cs (ArrayAccess.EmitGetLength): New public method.
6867 * statement.cs (Foreach.ArrayForeach): New nested class.
6868 (Foreach.TemporaryVariable): New nested class.
6869 (Foreach.EmitArrayForeach): Removed; this is now in the new
6872 2005-05-03 Raja R Harinath <rharinath@novell.com>
6874 * pending.cs (BaseImplements): Move the #74773 fix here. This is
6876 (VerifyPendingMethods): Revert change below.
6878 * typemanager.cs (IsOverride, RegisterNonOverride): New.
6879 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
6880 that used to trigger warning -28. Remove warning -28.
6881 * expression.cs (Invocation.OverloadResolve): Use
6882 TypeManager.IsOverride to distinguish override methods.
6885 * pending.cs (VerifyPendingMethods): If a base type implements the
6886 requested interface, don't bother checking individual methods of
6887 the base type. As a side-effect, this prevents the creation of
6888 unnecessary proxies.
6890 2005-05-02 Martin Baulig <martin@ximian.com>
6894 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
6895 Also `And' the locals if the old vector is null.
6896 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
6897 null; in this case we basically reset all the variables.
6899 2005-05-02 Martin Baulig <martin@ximian.com>
6903 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
6904 Added `FlowBranching branching' argument; always `and' the
6905 variables instead of `or'ing them unless we're an infinite loop.
6907 * statement.cs (While.Resolve): Create a new sibling unless we're
6910 2005-05-02 Martin Baulig <martin@ximian.com>
6914 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
6915 arguments; use it instead of creating a new TopLevelBlock.
6916 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
6917 our ConstructorInitializer.
6920 (TopLevelBlock.TopLevelBranching): New public property.
6921 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
6922 and create our `TopLevelBranching'.
6924 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
6925 anonymous method host, use `block.TopLevelBranching' rather than
6926 creating a new branching.
6928 2005-04-20 Miguel de Icaza <miguel@novell.com>
6930 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
6931 a ScopeInfo, if any of the current children is a child of the new
6932 entry, move those children there.
6934 2005-04-30 Martin Baulig <martin@ximian.com>
6936 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
6937 at the beginning of a SwitchSection. Fix #73335.
6939 2005-04-27 Marek Safar <marek.safar@seznam.cz>
6942 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
6944 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
6945 (FieldExpr.DoResolve): Obsolete members are ignored for field
6948 2005-04-26 Marek Safar <marek.safar@seznam.cz>
6950 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
6951 of arrays detection.
6953 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
6955 (Field.VerifyClsCompliance): Volatile fields are not compliant.
6957 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
6960 2005-04-25 Ben Maurer <bmaurer@ximian.com>
6962 * cs-parser.jay: Use the prefered version of -unsafe in error
6965 2005-04-22 Marek Safar <marek.safar@seznam.cz>
6967 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
6970 2005-04-20 John Luke <john.luke@gmail.com>
6972 * driver.cs: fix typo in error message, --outout to --output
6974 2005-04-20 Marek Safar <marek.safar@seznam.cz>
6976 * codegen.cs (InRefOutArgumentResolving): New field.
6978 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
6979 fields outside contructor.
6981 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
6983 2005-04-19 Miguel de Icaza <miguel@novell.com>
6985 * anonymous.cs (CaptureContext.EmitParameterInstance): The
6986 parameter code was not completed ever, so it was not as up-to-date
6987 as local variables. Must finish it.
6989 The bug fix was to compare the Toplevel of the block, not the
6990 current block. Thanks for Ben for pointing this out.
6992 2005-04-19 Raja R Harinath <rharinath@novell.com>
6994 * decl.cs (AddMethods): Use the declaring type of the problem
6995 method to determine if we want to squash a warning.
6997 2005-04-19 Marek Safar <marek.safar@seznam.cz>
6999 * attribute.cs: Removed debug output.
7001 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
7003 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
7006 2005-04-18 Raja R Harinath <rharinath@novell.com>
7009 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
7010 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
7011 all null comparisons against reference types.
7013 2005-04-18 Marek Safar <marek.safar@seznam.cz>
7016 * class.cs (TypeContainer.CircularDepException) New nested
7018 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
7019 (TypeContainer.DefineType): Removed error, reset InTransit before
7021 (Class.DefineType): Throw exception when is in Transit.
7022 Catch exception and report error.
7023 (Struct.DefineType): Throw exception when is in Transit.
7024 Catch exception and report error.
7025 (Interface.DefineType): Throw exception when is in Transit.
7026 Catch exception and report error.
7028 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
7029 handle nested exception handlers.
7031 * flowanalysis.cs (InTryWithCatch): New method, search for try with
7034 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
7035 InFinally and InCatch storage.
7037 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
7038 (Catch.Resolve): Set and Restore ec.InCatch.
7039 (Try.Resolve): Set and Restore ec.InFinally.
7040 (Try.HasCatch): True when try has catch.
7042 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
7044 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
7045 for the same event member, so exclude such cases from warning 419.
7048 2005-04-16 Miguel de Icaza <miguel@novell.com>
7050 * expression.cs (Binary.ResolveOperator): Apply patch from John
7051 Luke to fix bug 59864: operators &, | and ^ on enumerations
7052 require that the same enum type on both sides.
7054 * driver.cs: Add warnings to old flag usage, this is to assist
7055 people who produce Makefiles and hope that the Makefiles will be
7058 * class.cs (TypeContainer.EmitType): Moved the definition of the
7059 special $PRIVATE$ field from the resolve phase to the Emit phase.
7060 During resolve we do not know if we are a struct with
7061 HasExplicitLayout, we know this only after the attributes for the
7064 Set the FieldOffset to zero on the dummy field that we create for
7065 the class. Fixes 74590.
7067 2005-04-16 Raja R Harinath <rharinath@novell.com>
7070 * ecore.cs (PropertyExpr.resolved): New.
7071 (DoResolve): Use it to handle a case of double resolution here.
7072 Handle a case of identical-name-and-type-name.
7073 * expression.cs (ArrayCreation.CheckIndices): Avoid double
7074 resolution by storing the results of expression resolution back
7075 into the "probes" array.
7077 2005-04-15 Raja R Harinath <rharinath@novell.com>
7079 Fix cs0208-7.cs and cs0208-8.cs.
7080 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
7081 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
7082 error reporting to point out the reason a struct is not unmanaged.
7084 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
7086 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
7087 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
7089 2005-04-13 Raja R Harinath <rharinath@novell.com>
7092 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
7093 IdenticalNameAndTypeName here.
7094 (EventExpr.InstanceResolve): Likewise.
7096 2005-04-13 Marek Safar <marek.safar@seznam.cz>
7098 C# 2.0 DefaultCharSetAttribute implementation
7100 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
7101 which allows us to set GlobalNamespace for every resolve.
7102 (Attribute.ResolveArguments): Cut from Resolve.
7103 (Attribute.GetCharSetValue): Returns CharSet named argument.
7104 (Attribute.DefinePInvokeMethod): Gets default charset from
7106 (GlobalAttribute.ResolveAsTypeStep): Override.
7107 (GlobalAttribute.ResolveArguments): Override.
7109 * class.cs (TypeAttr): Is protected.
7111 * codegen.cs (ModuleClass.DefaultCharSet): New member.
7112 (ModuleClass.DefaultCharSetType): New memeber.
7113 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
7115 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
7116 charset from module.
7118 * delegate.cs (TypeAttr): Override.
7119 (Delegate.DefineType): Use this TypeAttr.
7121 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
7122 at very early stage (before types are defined) to resolve model
7123 module attributes. It will probably not work with corlib but it
7126 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
7127 charset from module.
7129 * typemanager.cs (default_charset_type): New type.
7131 2005-04-13 Raja R Harinath <rharinath@novell.com>
7133 * decl.cs (MemberCache.AddMethods): Don't warn if
7134 System.Object.Finalize has buggy MethodAttributes.
7136 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
7139 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
7141 * doc.cs : detect ambiguous reference to overloaded members.
7142 Fixed bug #71603. MS 1.1 csc does not detect it.
7144 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
7146 * doc.cs : delegates must not be referenced with parameters.
7149 2005-04-12 Miguel de Icaza <miguel@novell.com>
7151 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
7153 2005-04-10 Miguel de Icaza <miguel@novell.com>
7155 * driver.cs (MainDriver): Stop processing if the CLS stage found
7158 (CompilerCallableEntryPoint.InvokeCompiler): Always
7159 reset after execution; Take a TextWriter argument for the
7162 * report.cs: Use the error stream instead of hardcoding stderr.
7164 2005-04-09 Miguel de Icaza <miguel@novell.com>
7166 * class.cs: Reduce code paths to test, too small of an
7167 optimization to make it worth the extra testing. Always perform
7170 2005-04-08 Raja R Harinath <rharinath@novell.com>
7173 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
7174 operators that had errors reported on them.
7176 2005-04-08 Marek Safar <marek.safar@seznam.cz>
7178 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
7180 (Attribute.Resolve): Add named argument type checking.
7182 * class.cs (FixedField.Define): Use IsPrimitiveType
7184 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
7186 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
7187 unsafe parameter types.
7189 * statement.cs (Using.ResolveExpression): Add better error description.
7191 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
7193 2005-04-08 Raja R Harinath <rharinath@novell.com>
7196 * attribute.cs (Attribute.GetAttributeUsage): Resolve
7197 AttributeUsageAttribute in the emitcontext of the attribute class,
7198 not in the emitcontext of the attributable entity it was attached to.
7199 * cs-parser.jay: Use 'current_class', not 'current_container',
7200 when creating a GlobalAttribute.
7202 2005-04-08 Alp Toker <alp@atoker.com>
7204 * pending.cs: The fix to #58413 failed to compile methods implementing
7205 interfaces with/without params modifiers and vice versa, even though
7206 params modifiers aren't part of the signature. Make the modifier check
7207 less strict as in csc.
7209 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
7210 Anoob V E <projectmonokochi@rediffmail.com>
7211 Harilal P R <projectmonokochi@rediffmail.com>
7214 * pending.cs (TypeAndMethods.mods): New. Store the parameter
7215 modifiers of pending methods.
7216 (PendingImplementation.PendingImplementation): Initialize it.
7217 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
7218 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
7219 with ParameterData. Add check for modifiers.
7220 * class.cs (MethodData.Define): Update to changes.
7222 2005-04-07 Raja R Harinath <rharinath@novell.com>
7224 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
7226 2005-04-07 Marek Safar <marek.safar@seznam.cz>
7228 * class.cs (PropertyMethod.Define): Check private accessor in abstract
7231 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
7234 * typemanager.cs: Registered RequiredAttributeAttribute.
7236 2005-04-06 Marek Safar <marek.safar@seznam.cz>
7238 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
7239 Warning CS0169 is back at level 3.
7240 (IMethodData.SetMemberIsUsed): New method.
7242 * decl.cs (IsUsed): New value; moved from FieldBase.Status
7243 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
7245 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
7247 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
7249 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
7252 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
7255 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
7256 to avoid the problems with nested types.
7258 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
7259 Anoob V.E <projectmonokochi@rediffmail.com>
7260 Harilal P.R <projectmonokochi@rediffmail.com>
7261 Raja R Harinath <rharinath@novell.com>
7264 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
7266 * typemanager (GetConstructor): Make public.
7268 2005-04-05 John Luke <john.luke@gmail.com>
7269 Raja R Harinath <rharinath@novell.com>
7272 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
7273 struct too. Return false quicker in a few cases.
7274 (VerifyUnManaged): Use it.
7276 2005-04-05 Raja R Harinath <rharinath@novell.com>
7279 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
7280 not 'unreachable_seen'.
7282 2005-04-04 Marek Safar <marek.safar@seznam.cz>
7284 * attribute.cs (Attribute.GetValue): Removed unused.
7286 * codegen.cs (CodeGen.TrimExt): Removed unused.
7288 * cs-parser.jay (output): Removed unused.
7290 * cs-tokenizer.cs (hex_digits): Removed unused.
7292 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
7294 * expression.cs (Indirection.LoadExprValue): Removed unused.
7295 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
7297 * iterators.cs (Iterator.param_types): Removed unused.
7299 * statement.cs (Goto.block): Removed unused.
7300 (ToplevelBlock.did): Removed unused.
7301 (Switch.ResolveConstantSwitch): Removed unused.
7303 2005-04-01 Ben Maurer <bmaurer@ximian.com>
7305 * rootcontext.cs: Allow mcs to bootstrap with the compilation
7308 2005-04-01 Raja R Harinath <rharinath@novell.com>
7310 Fix #74232 and cs0208-3.cs.
7311 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
7312 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
7313 unmanaged type. Don't use FieldBuilders when 't' is a
7314 TypeBuilder. Use ModFlags and MemberType fields.
7315 * class.cs (MemberBase.member_type): Rename from MemberType.
7316 (MemberBase.MemberType): New property. Determines member_type on
7318 (MemberBase.DoDefine): Don't initialize MemberType here.
7319 (FieldMember.Define): Likewise.
7321 2005-04-01 Marek Safar <marek.safar@seznam.cz>
7324 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
7325 Attributes are emitted there.
7327 2005-04-01 Raja R Harinath <rharinath@novell.com>
7329 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
7330 keyword in 'partial enum' too.
7331 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
7333 Report from Kamil Skalski <nazgul@omega.pl>.
7336 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
7337 have partial containers too.
7339 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
7340 in block' checks to Block.CheckInvariantMeaningInBlock.
7341 * statement.cs (Block.GetKnownVariableInfo): Make private.
7342 (Block.IsVariableUsedInChildBlock): Remove.
7343 (Block.IsVariableUsedInBlock): Likewise.
7344 (Block.CheckInvariantMeaningInBlock): New. Show location of
7345 conflicting declaration.
7346 (Block.AddVariable): Make error messages less long-winded and more
7347 specific. Show location of conflicting declaration.
7348 * parameter.cs (Parameters.Location): New readonly property.
7350 2005-03-31 Raja R Harinath <rharinath@novell.com>
7352 Clean up semantics of invoking ResolveMemberAccess.
7353 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
7354 can have an instance, ensure that we pass in a non-TypeExpression
7355 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
7356 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
7357 argument. Update to changes and simplify.
7358 (FieldExpr.Emitinstance): Remove CS0120 check.
7359 (PropertyExpr.EmitInstance): Likewise.
7360 * expression.cs (Argument.Resolve): Likewise.
7361 (Invocation.DoResolve): Update to changes in semantics of
7364 2005-03-31 Marek Safar <marek.safar@seznam.cz>
7367 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
7370 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
7372 2005-03-31 Raja R Harinath <rharinath@novell.com>
7374 Fix difference in behaviour with commandline invocation.
7375 * driver.cs (Driver.Reset): New.
7376 (CompilerCallableEntryPoint): Call it.
7378 * statement.cs (If.Resolve): Avoid spurious "uninitialized
7379 variable" warnings if the boolean expression failed to resolve.
7381 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
7383 * attribute.cs: Fix the union of several permissions when some of them
7384 are unrestricted (so the result isn't an unrestricted permission set).
7387 2005-03-30 Raja R Harinath <rharinath@novell.com>
7389 * ecore.cs (MemberExpr): New class. Convert from interface
7391 (MemberExpr.ResolveMemberAccess): Refactor and move here from
7392 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
7394 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
7395 (MethodGroupExpr.IsExplicitImpl): Remove.
7396 (Expression.GetFieldFromEvent): Remove.
7397 (SimpleName.MemberStaticCheck): Remove.
7398 (SimpleName.DoSimpleNameResolve): Update to changes.
7399 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
7400 (MemberAccess.IdenticalNameAndTypeName): Remove.
7401 (MemberAccess.error176): Move to MemberExpr.
7402 (MemberAccess.DoResolve): Update to changes.
7403 (BaseAccess.DoResolve): Likewise.
7405 2005-03-30 Marek Safar <marek.safar@seznam.cz>
7407 C# 2.0 Conditional attribute class implementation
7409 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
7410 Analyzes class whether it has attribute which has ConditionalAttribute
7411 and its condition is not defined.
7413 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
7414 (Class.IsExcluded): New method. Search for at least one defined
7415 condition in ConditionalAttribute of attribute class.
7417 2005-03-30 Raja R Harinath <rharinath@novell.com>
7419 * ecore.cs (PropertyExpr): Derive from Expression, not
7420 ExpressionStatement.
7421 (PropertyExpr.EmitStatement): Remove.
7423 2005-03-29 Raja R Harinath <rharinath@novell.com>
7426 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
7427 internal field "value__" of an enum be private. The examples for
7428 "value__" that I found on MSDN all used FieldAttributes.Private.
7430 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
7431 Don't mention IL method attribute names.
7433 Fix #47991. Remove a TODO.
7434 * statement.cs (Block.Toplevel): Make into a field.
7435 (Block.Parameters): Move into ToplevelBlock.
7436 (Block.known_variables): Rename from child_variable_names.
7437 (Block.Block): Remove variants that take Parameters. Initialize
7438 'Toplevel' with the immediately surrounding toplevel block.
7439 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
7440 LocalInfo parameter.
7441 (Block.GetKnownVariableInfo): New.
7442 (Block.IsVariableNameUsedInChildBlock): Update.
7443 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
7444 the block, even though it may not be in scope.
7445 (Block.AddVariable): Remove Parameters parameter. Use
7446 Toplevel.Parameters instead.
7447 (Block.AddConstant): Remove Parameters parameter.
7448 (Block.GetParameterReference): Update to use Toplevel.Parameters.
7449 (Block.IsParamaterReference): Likewise.
7450 (Block.IsLocalParameter): Likewise. Simplify a lot.
7451 (ToplevelBlock.Parameters): New. Moved from Block.
7452 (ToplevelBlock.ToplevelBlock): Update to changes. Always
7453 initialize Parameters to a non-null value.
7454 * cs-parser.jay: Update to changes.
7455 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
7456 simple names that mean different things in the same block. Use
7457 Block.IsVariableNameUsedInBlock.
7459 2005-03-28 Raja R Harinath <rharinath@novell.com>
7461 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
7462 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
7463 GetTypeHandle. It is possible for a reflected type to derive from
7464 a TypeBuilder (e.g., int[] derives from the TypeBuilder
7465 System.Array during mscorlib compilation).
7466 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
7467 contain a method_hash, don't create one either. Don't create a
7468 deep copy of the base cache's method_hash.
7469 (MemberCache.SetupCache): Rename back from DeepCopy.
7470 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
7471 already initialized. If we see an override function, add its
7472 underlying base virtual function to the member_hash too.
7474 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
7476 2005-03-26 Raja R Harinath <harinath@acm.org>
7479 * assign.cs (Assign.DoResolve): When the RHS of an assignment
7480 fails to resolve, ensure that the LHS is still resolved as an
7483 2005-03-25 Raja R Harinath <harinath@acm.org>
7485 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
7487 (Enum.current_ec): Remove.
7488 (Enum.LookupEnumValue): Remove EmitContext argument.
7489 Just uses the one created during DefineType.
7490 (Enum.FindMembers): Update.
7491 * expression.cs (MemberAccess.DoResolve): Update.
7493 2005-03-22 Marek Safar <marek.safar@seznam.cz>
7495 * assign.cs (Assign.DoResolve): Check for CS1717 when
7496 source and target are same (uses Equals).
7498 * expression.cs (LocalVariableReference, ParameterReference,
7499 This): Implemented Equals, GetHashCode.
7501 * statement.cs (Block.GetParameterReference): Removed useless
7504 2005-03-22 Raja R Harinath <rharinath@novell.com>
7507 * statement.cs (Block.AddVariable): Ensure that we skip implicit
7508 blocks before deciding whether the error is cs0136 or cs0128.
7510 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
7511 (using_alias_directive, using_namespace_directive): Pass
7512 MemberName, not an expression to Namespace.UsingAlias and
7514 (MakeName): Use the MemberName of the namespace.
7515 * namespace.cs (Namespace.MemberName): New.
7516 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
7517 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
7519 * decl.cs (MemberName.Name): Make readonly.
7520 (MemberName.FromDotted): New "constructor".
7521 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
7522 (MemberCore.Name): Compute from MemberName on demand.
7523 (MemberCore.SetMemberName): Provide a way to change the
7525 (MemberCore.AddToContainer): Don't take a fullname parameter.
7526 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
7527 fully qualified name of the container to the member name.
7528 (TypeContainer.AddToTypeContainer): Use a fully qualified name
7529 only if the type is a member of the root container.
7530 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
7531 MemberName.Left rather than searching for an embedded ".".
7532 (PartialContainer.CreatePart): Update to changes in RootContext.
7533 (MemberBase.ShortName): Turn into a property. Use
7534 MemberCore.SetMemberName.
7535 (MemberBase.ExplicitInterfaceName): Remove.
7536 (MemberBase.UpdateMemberName): Remove.
7537 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
7538 (PropertyBase.SetMemberName): New override.
7539 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
7540 (Tree.GetDecl): New.
7541 (Tree.AllDecls): Rename from Decls.
7542 * attribute.cs, enum.cs, report.cs: Update to changes.
7543 * driver.cs (MainDriver): Use MemberName.FromDotted on
7544 RootContext.MainClass.
7546 2005-03-21 Marek Safar <marek.safar@seznam.cz>
7548 * class.cs (FixedField.Define): Check for CS1664 and more sanity
7551 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
7553 2005-03-18 Marek Safar <marek.safar@seznam.cz>
7555 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
7556 property accessor modifiers.
7558 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
7559 fixed buffer attribute (CS1716).
7560 (PropertyMethod.HasCustomAccessModifier): When property accessor
7561 has custom modifier.
7563 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
7565 (PropertyExpr.DoResolveLValue): Add CS0272.
7567 2005-03-17 Miguel de Icaza <miguel@novell.com>
7569 * convert.cs: When converting to a pointer, use the proper Conv.U
7570 or Conv.I depending on the source data type.
7572 * cs-tokenizer.cs: Make the size for large decimal constants,
7575 2005-03-17 Martin Baulig <martin@ximian.com>
7577 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
7578 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
7580 2005-03-17 Martin Baulig <martin@ximian.com>
7582 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
7583 to bool so we can return an error condition.
7584 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
7587 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
7589 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
7592 2005-03-16 Raja R Harinath <rharinath@novell.com>
7594 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
7595 Refactor to avoid traversing the list of assemblies, and to avoid
7596 string concatenation.
7597 * typemanager.cs (guid_attr_type): Remove.
7598 (negative_hits, pointers, references): Remove hashes.
7600 (GetConstructedType): New. Uses type_hash to handle constructed
7601 types (arrays, references, pointers).
7602 (GetReferenceType, GetPointerType): Use it.
7603 (GetNestedType): New. Uses type_hash to handle nested types of
7605 (LookupType, LookupTypeDirect): Remove.
7606 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
7607 'types' hash and LookupTypeReflection directly.
7608 (params_string, params_object): Use GetConstructedType.
7609 * namespace.cs (Namespace.cached_types): New. Cache of reflected
7611 (Namespace.Lookup): Use cached_types.
7612 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
7613 provided by old TypeManager.LookupType.
7614 * rootcontext.cs (MakeFQN): Remove.
7615 * decl.cs (DeclSpace.MakeFQN): Likewise.
7616 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
7617 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
7618 TypeManager.GetConstructedType.
7619 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
7621 2005-03-15 Marek Safar <marek.safar@seznam.cz>
7623 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
7626 * cs-parser.jay: Reports CS1527 for any namespace element.
7628 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
7631 * expression.cs (ParameterReference.IsAssigned): Changed error to
7633 (Error_WrongNumArguments): Moved CS0245 detection here.
7635 * statement.cs (Return.Resolve): Add CS1622 report.
7637 2005-03-11 Marek Safar <marek.safar@seznam.cz>
7639 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
7641 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
7643 * attribute.cs expression.cs: Get rid of some allocations.
7645 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
7647 * doc.cs : just eliminate the latest change.
7649 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
7651 * doc.cs : commented out the latest change. It breaks xml-030.cs
7653 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
7655 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
7656 fail. So invoke CreateType() in FindDocumentedType().
7658 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
7660 * cs-tokenizer.cs : added IsKeyword().
7661 * doc.cs : Detect keyword incorrectly used as identifier.
7662 Allow identifiers prefixed by @.
7664 2005-03-10 Marek Safar <marek.safar@seznam.cz>
7666 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
7667 It caused exception in namespace resolving (again!).
7669 * class.cs (Class.ctor): Removed exit.
7670 (PropertyMethod.ctor): ditto.
7672 * codegen.cs (Codegen.Reset): Reset static data.
7673 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
7675 * cs-tokenizer.cs (Cleanup): Removed.
7677 * driver.cs (GetSystemDir): Rewrote to one line command.
7678 It caused problem with unloaded dynamic modules.
7679 (UnixParseOption): Removed Exit.
7680 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
7681 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
7682 Now can be mcs used as library.
7684 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
7687 * location.cs (Reset): Reset static data.
7689 * namespace.cs (Reset): Reset static data.
7691 * report.cs (Report.Reset): Reset static data.
7693 * rootcontext.cs (RootContext.Reset): Reset static data.
7695 * tree.cs (RootTypes.ctor): Use Location.Null
7697 * typemanager.cs (TypeManager.Reset): Reset static data.
7698 (CoreLookupType): Removed Exit.
7699 (TypeHandle.Reset): Reset static data.
7701 2005-03-10 Raja R Harinath <rharinath@novell.com>
7704 * typemanager.cs (ComputeNamespaces): Import namespaces from
7705 referenced modules too.
7707 2005-03-09 Raja R Harinath <rharinath@novell.com>
7709 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
7712 2005-03-09 Raja R Harinath <rharinath@novell.com>
7714 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
7715 enclosing DeclSpace. This ensures that a name-lookup populates
7716 more caches and there are fewer 'TypeExpression's. Carve out
7717 nested type lookup into ...
7718 (LookupNestedTypeInHierarchy): ... this.
7720 2005-03-09 Raja R Harinath <rharinath@novell.com>
7722 Clean up a few partial-class semantics.
7723 Fixes test-357.cs and cs1618-2.cs.
7724 * cs-parser.jay (struct_declaration): Use 'current_class' as
7725 parent of newly-created struct. Remove call to Register ().
7726 Use 'pop_current_class' to complete handing the current struct.
7727 (interface_declaration): Likewise.
7728 (class_declaration): Likewise.
7729 (enum_declaration): Use 'current_class' as parent of newly created
7731 (delegate_declaration): Likewise.
7732 (pop_current_class): New function. This is used to handle closing
7733 up the 'current_class' and 'current_container', and pointing them
7734 to the enclosing class/container.
7735 (CSharpParser): Initialize 'current_class' too.
7736 * decl.cs (MemberCore): Add check for invariant: a partial
7737 container is not a parsed entity, and thus does not enclose any
7739 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
7740 (DeclSpace.BaseTypeExpr): Use it.
7741 (DeclSpace.LookupType): Add check for invariant.
7742 * class.cs (TypeContainer): Add check for invariant: a nested
7743 class should have the same NamespaceEntry as its enclosing class.
7744 (TypeContainer.EmitFieldInitializers): Make virtual.
7745 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
7747 (TypeContainer.Register): Remove.
7748 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
7749 null. Use TypeResolveEmitContext for resolving base types and
7750 interfaces. Move initialization of Parts.TypeBuilder here from
7752 (TypeContainer.DefineNestedTypes): ... here.
7753 (PartialContainer): Take a Namespace not a NamespaceEntry.
7754 (PartialContainer.Create): Don't use Register. Call the
7755 appropriate Add... function directly.
7756 (ClassPart): Take both the PartialContainer and the enclosing
7757 class as constructor arguments.
7758 (ClassPart.EmitFieldInitializers): Override.
7759 (ClassPart.PartFindNestedTypes): Remove.
7760 (FieldBase.GetInitializerExpression): Resolve the initializer
7761 expression in the emit context of the enclosing class.
7762 * tree.cs (RootTypes): Remove Register ().
7764 2005-03-08 Marek Safar <marek.safar@seznam.cz>
7766 * cs-parser.jay: Removed CS0134.
7768 * driver.cs: Removed CS1901.
7770 * expression.cs (SizeOf.DoResolve): Don't report CS0233
7771 for predefined types.
7773 2005-03-07 Duncan Mak <duncan@novell.com>
7775 * codegen.cs (Save): Catch UnauthorizedAccessException as
7776 well. Fixes bug #73454.
7778 2005-03-07 Marek Safar <marek.safar@seznam.cz>
7780 * cs-tokenizer.cs (xtoken): Add CS1035.
7782 * class.cs (MethodData.Define): Add CS0683.
7783 (FieldMember.ctor): Add CS0681.
7785 2005-03-07 Raja R Harinath <rharinath@novell.com>
7787 * ecore.cs (SimpleName.DoResolve): Rename from
7788 SimpleName.DoResolveAllowStatic.
7789 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
7790 Pass 'intermediate' flag to MemberStaticCheck.
7791 (SimpleName.MemberStaticCheck): Skip "static check" only in case
7792 of "intermediate" lookups via MemberAccess.
7793 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
7794 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
7796 2005-03-07 Raja R Harinath <rharinath@novell.com>
7799 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
7800 slipped in because of variable names that are identical to a
7801 builtin type's BCL equivalent ('string String;', 'int Int32;').
7802 (PropertyExpr.EmitInstance): Likewise.
7804 2005-03-04 Marek Safar <marek.safar@seznam.cz>
7806 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
7808 * report.cs (warning_ignore_table): Made public.
7810 2005-03-04 Raja R Harinath <rharinath@novell.com>
7813 * class.cs (MethodData.Emit): Pass 'container' to
7814 container.GetObsoleteAttribute instead of 'container.Parent'.
7816 2005-03-03 Marek Safar <marek.safar@seznam.cz>
7818 * cs-parser.jay: Add 1534 error test.
7820 * iterators.cs (Yield.CheckContext): Add error 1629.
7821 (Iterator.ctor): Save unsafe modifier.
7822 (MoveNextMethod.DoEmit): Restore unsafe context.
7824 * namespace.cs (UsingAlias): Better error message.
7826 2005-03-03 Dan Winship <danw@novell.com>
7828 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
7829 the warning message [#73219]
7831 2005-03-03 Raja R Harinath <rharinath@novell.com>
7833 Fix compile with MCS 1.0.0.0.
7834 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
7835 w_restore to not depend on string constant folding.
7837 2005-03-03 Raja R Harinath <rharinath@novell.com>
7839 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
7840 CS0246 check to users who passed 'silent = false'.
7841 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
7843 (SimpleName.SimpleNameResolve): Update.
7844 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
7845 (MemberAccess.IdenticalNameAndTypeName): Update.
7846 * doc.cs (FindDocumentedTypeNonArray): Update.
7848 2005-03-03 Raja R Harinath <rharinath@novell.com>
7850 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
7851 * parameters.cs (ComputeAndDefineParameters): Remove.
7852 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
7853 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
7854 Use GetParameterInfo.
7856 2005-03-02 Marek Safar <marek.safar@seznam.cz>
7858 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
7860 2005-03-02 Raja R Harinath <rharinath@novell.com>
7862 Unify DeclSpace.LookupType and DeclSpace.FindType.
7863 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
7864 is in charge of defining nested types on demand.
7865 (DeclSpace.LookupType): Use it when the current_type is a
7866 TypeBuilder. Use LookupTypeDirect for reflected types.
7867 (DeclSpace.FindType): Remove.
7868 (DeclSpace.LookupInterfaceOrClass): Likewise.
7869 (DeclSpace.DefineTypeAndParents): Likewise.
7870 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
7871 DeclSpace.LookupType.
7872 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
7873 * typemanager.cs (LookupType): Simplify.
7874 (AddUserType): Remove type from negative_hits.
7875 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
7876 * class.cs (TypeContainer.FindMembers): Move handling of nested
7878 (TypeContainer.FindMembers_NestedTypes): ... here.
7879 (TypeContainer.FindNestedType): Implement override.
7880 (ClassPart.FindNestedType): Delegate to PartialContainer.
7881 (ClassPart.PartFindNestedType): Looks up the nested types of the
7884 2005-03-02 Martin Baulig <martin@ximian.com>
7886 * class.cs (TypeContainer.DoDefineMembers): We also need a default
7887 static constructor in static classes.
7889 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
7891 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
7892 sizeParamIndex is not specified.
7894 2005-03-01 Marek Safar <marek.safar@seznam.cz>
7897 * report.cs (WarningMessage.IsEnabled): Missing null check.
7899 2005-02-28 Marek Safar <marek.safar@seznam.cz>
7901 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
7902 in the fields and not in the properties.
7904 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
7906 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
7909 2005-02-28 Marek Safar <marek.safar@seznam.cz>
7911 * attribute.cs: Small refactoring (improved robustness).
7912 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
7913 (ValidateGuid): Removed.
7914 (Resolve): Removed referenced to above mentioned.
7915 (GetAttributeUsage): Made private and changed to work without
7917 (GetIndexerAttributeValue): Don't crash.
7918 (GetConditionalAttributeValue): Ditto.
7919 (GetClsCompliantAttributeValue): Ditto.
7920 (ExtractSecurityPermissionSet): All attributes exceptions are
7922 (GetPropertyValue): New helper.
7923 (GetMethodImplOptions): New method.
7924 (DefinePInvokeMethod): Reuse common code. Implemented handling of
7925 some missing properties.
7927 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
7928 (Method.ApplyAttributeBuilder): Updated.
7930 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
7933 2005-02-28 Raja R Harinath <rharinath@novell.com>
7936 * report.cs (Report.SymbolRelatedToPreviousError): Handle
7937 non-simple types (array, pointer, reference).
7939 2005-02-28 Marek Safar <marek.safar@seznam.cz>
7941 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
7943 * class.cs (MethodCore.IsDuplicateImplementation): Special error
7945 (Method.CheckBase): Catch wrong destructor here.
7946 (MethodData.Define): Add errors 550, 668.
7948 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
7950 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
7952 * pending.cs (VerifyPendingMethods): Add error 551.
7954 * typemanager.cs (CSharpName): Next error report helper.
7956 2005-02-25 Marek Safar <marek.safar@seznam.cz>
7958 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
7959 attributes. Removed useless attribute double check.
7960 It saves almost 2MBs for corlib.
7962 2005-02-25 Raja R Harinath <rharinath@novell.com>
7965 * statement.cs (ExpressionStatement.Resolve): Make robust to being
7966 called twice in case of error.
7968 2005-02-23 Chris Toshok <toshok@ximian.com>
7970 Fix compiler portions of #72827.
7971 * statement.cs (Block.Emit): call Begin/EndScope on the
7972 EmitContext instead of the ILGenerator.
7974 * codegen.cs (EmitContext.BeginScope): new method, call
7975 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
7977 (EmitContext.BeginScope): same, but EndScope and CloseScope
7979 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
7980 offset and call the superclass's OpenScope(int) with it.
7981 (SymbolWriter.CloseScope): get the current il
7982 offset and call superclass's CloseScope(int) with it.
7984 2005-02-23 Marek Safar <marek.safar@seznam.cz>
7986 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
7987 CS1677 for out and ref as well.
7989 * class.cs (Method.Define): Add error CS1599 detection.
7991 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
7993 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
7995 * delegate.cs (Delegate.Define): Add error CS1599 detection.
7997 * support.cs.cs (ModifierDesc): New helper method.
7999 2005-02-23 Raja R Harinath <rharinath@novell.com>
8000 Abin Thomas <projectmonokochi@rediffmail.com>
8001 Anoob V E <projectmonokochi@rediffmail.com>
8002 Harilal P R <projectmonokochi@rediffmail.com>
8005 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
8006 MemberLookup (used for error reporting) actually returns a result.
8007 Fix error report number (122, not 112).
8009 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
8010 Anoob V E <projectmonokochi@rediffmail.com>
8011 Harilal P R <projectmonokochi@rediffmail.com>
8014 * pending.cs (PendingImplementation.GetAbstractMethods):
8015 Find NonPublic members too.
8017 2005-02-22 Marek Safar <marek.safar@seznam.cz>
8019 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
8022 * class.cs (MethodCore.CheckMethodAgainstBase):
8023 Add error 239 report.
8025 2005-02-21 Raja R Harinath <rharinath@novell.com>
8028 * expression.cs (Invocation.IsApplicable): Make public.
8029 (Invocation.IsParamsMethodApplicable): Likewise.
8030 * delegate.cs (Delegate.VerifyApplicability): Don't use
8031 Invocation.VerifyArgumentCompat for parameter applicability
8032 testing. Use Invocation.IsApplicable and
8033 Invocation.IsParamsMethodApplicable.
8035 2005-02-21 Marek Safar <marek.safar@seznam.cz>
8037 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
8039 * class.cs (Operator.Define): Add error 217 report.
8041 2005-02-21 Raja R Harinath <rharinath@novell.com>
8043 * namespace.cs (UsingEntry.Resolve): Undo change below.
8045 2005-02-21 Raja R Harinath <rharinath@novell.com>
8048 * ecore.cs (Expression.MemberLookupFailed): Add argument to
8049 disable the error message when the extended MemberLookup also
8051 (Expression.MemberLookupFinal): Update.
8052 (SimpleName.DoSimpleNameResolve): Update.
8053 * expression.cs (MemberAccess.ResolveNamespaceOrType):
8054 Don't use MemberLookupFinal.
8055 (New.DoResolve): Update.
8056 (BaseAccess.CommonResolve): Update.
8058 2005-02-21 Raja R Harinath <rharinath@novell.com>
8061 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
8062 occured previously, don't resolve again.
8064 2005-02-21 Marek Safar <marek.safar@seznam.cz>
8067 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
8068 argument. Call ResolveAttributeUsage for unresolved.
8069 when types doesn't match ctor arguments.
8071 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
8072 for nested attribute classes.
8073 (Class.attribute_usage): Removed.
8074 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
8075 for attribute class.
8077 * ecore.cs (IsAttribute): Removed.
8079 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
8081 * rootcontext.cs (RegisterAttribute): Removed, attributes are
8083 (attribute_types): Removed.
8084 (EmitCode): Global attributes are emited as the latest.
8086 2005-02-18 Marek Safar <marek.safar@seznam.cz>
8088 * class.cs (EmitFieldInitializers): Don't emit field initializer
8089 for default values when optimilization is on.
8091 * constant.cs (Constant.IsDefaultValue): New property.
8093 * driver.cs: Add /optimize handling.
8097 * literal.cs: Implement new IsDefaultValue property.
8099 * rootcontext.cs (Optimize): New field, holds /optimize option.
8101 2005-02-18 Raja R Harinath <rharinath@novell.com>
8103 Fix crasher in re-opened #72347.
8104 * namespace.cs (Namespace.Lookup): Return null if
8105 DeclSpace.DefineType returns null.
8108 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
8110 2005-02-18 Raja R Harinath <rharinath@novell.com>
8112 Fix remainder of #63202. Change semantics of DoResolveLValue: it
8113 now returns null if it cannot resolve to an lvalue.
8114 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
8115 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
8116 returned null. Remove check for SimpleName.
8117 (EventExpr.DoResolveLValue): New.
8118 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
8119 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
8121 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
8123 (Unary.ResolveOperator): Move CS0211 check ...
8124 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
8126 (Unary.DoResolveLValue): Simplify.
8127 (AddressOf.DoResolveLValue): New.
8128 (ArrayAccess.DoResolveLValue): New.
8130 2005-02-16 Marek Safar <marek.safar@seznam.cz>
8132 * attribute.cs (Attribute.Resolve): Add arguments casting for
8133 when types doesn't match ctor arguments.
8135 2005-02-16 Raja R Harinath <rharinath@novell.com>
8137 Fix parts of #63202.
8138 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
8139 lookup of operator in base type. Ensure that all checks happen
8140 when the operator resolves to an "op_..." method.
8142 2005-02-15 Raja R Harinath <rharinath@novell.com>
8145 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
8146 'ignore_cs0104' parameter. Pass it to ...
8147 (NamespaceEntry.Lookup): ... this.
8148 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
8149 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
8150 (TypeLookupExpression.DoResolveAsTypeStep): Update.
8151 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
8152 Update. Request that cs0104 errors be ignored.
8153 (ComposedCast.ResolveAsTypeStep): Update.
8155 2005-02-14 Raja R Harinath <rharinath@novell.com>
8158 * expression.cs (Invocation.BetterFunction): Remove support for
8159 comparing virtual functions and their overrides.
8160 (Invocation.IsOverride): New.
8161 (Invocation.OverloadResolve): Don't consider 'override' functions
8162 during candidate selection. Store them in a lookaside list.
8163 If the selected method is a 'virtual' function, use the list to
8164 find any overrides that are closer to the LHS type.
8166 2005-02-14 Marek Safar <marek.safar@seznam.cz>
8168 * expression.cs (New.DoResolve): Add complex core type reduction.
8169 (New.Constantify): Converts complex core type syntax like 'new int ()'
8172 2005-02-14 Raja R Harinath <rharinath@novell.com>
8174 * decl.cs (EntryType.EntryType): New constructor to create an
8175 updated copy of a cache entry.
8176 (MemberCache.AddMethods): Use it.
8177 (MemberCache.ClearDeclaredOnly): Remove.
8178 (MemberCache.MemberCache): Update.
8180 2005-02-11 Miguel de Icaza <miguel@novell.com>
8182 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
8183 variable. This one is represents the actual low-level declaration
8184 of the method, as opposed to the semantic level `IsStatic'.
8186 An anonymous method which is hosted into a static method might be
8187 actually an instance method. IsStatic would reflect the
8188 container, while MethodIsStatic represents the actual code
8191 * expression.cs (ParameterReference): Use the new MethodIsStatic
8192 instead of IsStatic.
8194 * anonymous.cs (AnonymousMethod.Compatible): Pass the
8195 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
8196 set on the current EmitContext.
8198 * expression.cs (Cast): Overload DoResolveLValue so we can pass
8199 resolve our casted expression as an LValue. This triggers the
8200 proper LValue processing that is later required by Assign.
8204 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
8206 2005-02-11 Marek Safar <marek.safar@seznam.cz>
8208 C# 2.0 Fixed buffer implementation
8210 * anonymous.cs: Update after RegisterHelperClass renaming.
8212 * attribute.cs (AttributeTester.fixed_buffer_cache):
8213 Cache of external fixed buffers.
8214 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
8215 implementation if field is fixed buffer else null.
8218 (TypeContainer.AddField): Accept FieldMember instead of Field.
8219 (FieldBase.IsFieldClsCompliant): Extracted code from
8220 VerifyClsCompliance descendant customization.
8221 (FixedField): New class handles fixed buffer fields.
8222 (FixedFieldExternal): Keeps information about imported fixed
8224 (IFixedField): Make access to internal or external fixed buffer
8227 * cs-parser.jay: Add fixed buffer parsing.
8229 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
8232 * expression.cs (Indirection): Extended implementation to accept
8234 (PointerArithmetic.Emit): Get element from fixed buffer as well.
8235 (ElementAccess.MakePointerAccess): Get type as parameter.
8236 (DoResolve): Add fixed buffer field expression conversion.
8237 (DoResolveLValue): Ditto.
8238 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
8239 (ArrayPtr): Derives from FixedBufferPtr.
8240 (ArrayPtr.Emit): Add extra emit for array elements.
8242 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
8244 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
8245 for compiler generated types.
8246 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
8248 * statement.cs (Fixed): Refactored to be easier add fixed buffer
8249 and consume less memory.
8250 (Fixed.Resolve): Add fixed buffer case.
8252 * typemanager.cs (compiler_generated_attr_ctor,
8253 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
8254 (HasElementType): Add our own implementation to work on every
8257 2005-02-11 Miguel de Icaza <miguel@novell.com>
8259 * anonymous.cs (CaptureContext): Track whether `this' has been
8262 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
8263 only captured `this' if it was implicitly done (instance
8264 methods/variables were used).
8266 * codegen.cs (EmitContext.CaptureThis): New method to flag that
8267 `this' must be captured.
8269 2005-01-30 Miguel de Icaza <miguel@novell.com>
8271 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
8272 is null it means that there has been no need to capture anything,
8273 so we just create a sibling.
8275 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
8277 Just a partial fix. The other half is fairly elusive.
8279 2005-02-10 Raja R Harinath <rharinath@novell.com>
8281 Fix #52586, cs0121-4.cs.
8282 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
8283 and return a hashtable.
8284 (MemberCache.ClearDeclaredOnly): New.
8285 (MemberCache.MemberCache): Update to change. Make a deep copy of
8286 the method_hash of a base type too.
8287 (MemberCache.AddMethods): Adapt to having a deep copy of the base
8288 type methods. Overwrite entries with the same MethodHandle so
8289 that the ReflectedType is correct. The process leaves in base
8290 virtual functions and their overrides as distinct entries.
8291 (CacheEntry): Now a class instead of a struct. It shouldn't alter
8292 matters since it was boxed in a ArrayList before.
8293 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
8295 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
8296 case of a virtual function and its override (choose the overload
8298 (Invocation.OverloadResolve): Avoid 'override' members during
8299 'applicable_type' calculation.
8301 2005-02-09 Raja R Harinath <rharinath@novell.com>
8303 Combine two near-redundant caches.
8304 * typemanager.cs (method_params): Rename from method_internal_params.
8305 (TypeManager.GetParameterData): New. Replace
8306 Invocation.GetParameterData.
8307 (TypeManager.LookupParametersByBuilder): Remove.
8308 * expression.cs (Invocation.method_parameter_cache): Remove.
8309 (Invocation.GetParameterData): Remove.
8311 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
8314 2005-02-08 Raja R Harinath <rharinath@novell.com>
8317 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
8318 TypeManager.multicast_delegate_type is null, resolve it by looking
8319 up "System.MulticastDelegate".
8320 * rootcontext.cs (RootContext.ResolveCore): Simplify.
8322 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
8323 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
8324 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
8327 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
8328 (LabeledStatement.AddReference): New. Set 'referenced'.
8329 (Goto.Resolve): Use it.
8331 2005-02-05 John Luke <john.luke@gmail.com>
8333 * driver.cs: remove duplicate -doc line in Usage ()
8335 2005-02-04 Raja R Harinath <rharinath@novell.com>
8337 * location.cs (Location.AddFile): Fix CS2002 error report.
8339 2005-02-02 Martin Baulig <martin@ximian.com>
8341 * delegate.cs (Delegate.DefineType): Report an internal error if
8342 TypeManager.multicast_delegate_type is null. See bug #72015 for
8345 2005-02-02 Raja R Harinath <rharinath@novell.com>
8347 Fix a crasher in a variant of #31984.
8348 * const.cs (Constant.CheckBase): New override that defers the
8349 new-or-override check in case the base type hasn't been populated
8351 (Constant.Define): Ensure the new-or-override check is performed.
8353 2005-02-01 Duncan Mak <duncan@ximian.com>
8355 * const.cs (LookupConstantValue): Check that `ce' is not null
8356 before calling GetValue ().
8358 2005-02-01 Raja R Harinath <rharinath@novell.com>
8360 Fix test-334.cs (#69519).
8361 * cs-parser.jay (using_alias_directive): Pass in an expression to
8362 NamespaceEntry.UsingAlias.
8363 (using_namespace_directive): Pass in an expression to
8364 NamespaceEntry.Using.
8365 (namespace_name): Don't flatten to a string.
8366 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
8367 (NamespaceEntry.AliasEntry.Resolve): Lookup using
8369 (NamespaceEntry.UsingEntry): Likewise.
8370 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
8372 (NamespaceEntry.LookupForUsing): Remove.
8373 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
8375 (NamespaceEntry.Lookup): Remove support for dotted names.
8377 2005-02-01 Raja R Harinath <rharinath@novell.com>
8379 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
8381 (NamespaceEntry.ImplicitParent): Compute on demand.
8382 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
8383 parallels the current.
8384 (NamespaceEntry.LookupForUsing): Use it.
8385 (NamespaceEntry.Lookup): If the current namespace-entry is
8386 implicit, don't search aliases and using tables.
8388 2005-02-01 Raja R Harinath <rharinath@novell.com>
8391 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
8393 (TypeContainer.BaseCache): Compute on demand.
8394 (TypeContainer.FindMembers): Define constants and types if they're
8395 not already created.
8396 (FieldMember.Define): Move resetting of ec.InUnsafe before error
8398 * const.cs (Constant.Define): Make idempotent.
8400 2005-01-29 Miguel de Icaza <miguel@novell.com>
8402 * pending.cs: Produce better code (no nops produced by using Ldarg
8405 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
8406 i - 1' it should be arg + 1.
8410 2005-01-28 Raja R Harinath <rharinath@novell.com>
8412 * attribute.cs (Attribute.CheckAttributeType): Make private
8414 (Attribute.ResolveType): Make virtual.
8415 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
8416 handling of RootContext.Tree.Types.
8418 2005-01-27 Raja R Harinath <rharinath@novell.com>
8420 Update attribute-handling to use the SimpleName/MemberAccess
8422 * cs-parser.jay (attribute): Pass in an expression to the
8423 constructors of Attribute and GlobalAttribute.
8424 * attribute.cs (Attribute): Take an expression for the name.
8425 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
8426 passed in attribute name expression.
8427 (Attribute.CheckAttributeType): Use it.
8428 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
8429 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
8430 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
8431 argument to prevent error messages if the lookup fails.
8433 2005-01-27 Marek Safar <marek.safar@seznam.cz>
8435 * expression.cs (Indirection): Implemented IVariable interface
8436 to support indirection in AddressOf operator.
8437 (PointerArithmetic.Emit): Add optimalization for case where
8438 result can be precomputed.
8440 2005-01-26 Martin Baulig <martin@ximian.com>
8442 * class.cs (TypeContainer.AttributeTargets): Return the correct
8443 AttributeTargets depending on our `Kind' instead of throwing an
8444 exception; fixes #71632.
8446 2005-01-26 Marek Safar <marek.safar@seznam.cz>
8449 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
8452 2005-01-25 Raja R Harinath <rharinath@novell.com>
8455 * expression.cs (MemberAccess.DoResolve): Don't complain with
8456 cs0572 when the LHS of a member access has identical name and type
8459 2005-01-25 Marek Safar <marek.safar@seznam.cz>
8462 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
8464 Create custom PermissionSet only for PermissionSetAttribute.
8466 2005-01-24 Marek Safar <marek.safar@seznam.cz>
8469 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
8470 delegates in static class.
8472 2005-01-24 Martin Baulig <martin@ximian.com>
8474 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8475 merging an implicit block, just use its reachability.
8477 * statement.cs (Block.Resolve): Make the unreachable code check
8478 work wrt. implicit blocks; see test-337 from #63842.
8480 2005-01-21 Alp Toker <alp@atoker.com>
8482 * cs-parser.jay: destructor_declaration's container is PartialContainer
8483 not Class when partial types are used, so use Kind prop instead of
8486 2005-01-22 Miguel de Icaza <miguel@ximian.com>
8488 * cs-parser.jay: Improve error reporting when an interface
8491 2005-01-20 Dick Porter <dick@ximian.com>
8493 * support.cs: SeekableStreamReader fix from Sandor Dobos
8494 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
8495 chars are read. Fixes bug 70369.
8497 2005-01-20 Raja R Harinath <rharinath@novell.com>
8499 * cs-parser.jay (catch_clause): Simplify current_block handling
8502 2005-01-17 Miguel de Icaza <miguel@ximian.com>
8504 * convert.cs (ImplicitStandardConversionExists): Synchronize the
8505 code with ImplicitStandardConversion to handle the implicit
8506 conversion of method groups into valid delegate invocations.
8508 The problem is that in parameter handling we were using this code
8509 path. Fixes bug #64698
8511 2005-01-19 Raja R Harinath <rharinath@novell.com>
8513 * cs-parser.jay: Fix several infelicities.
8514 - Avoid assigning to the parser value stack. Code like
8515 '$3 = null' is unclean. Synthesize a value for the code block
8517 - Avoid using oob_stack for storing location information. Use ...
8518 (_mark_): ... this. New (empty) rule. Saves the current location
8520 (foreach_statement): Avoid using oob_stack for current_block
8521 handling. Use technique used in for_statement and
8522 using_statement. Synthesize a value for the code block to store
8523 additional intermediate information.
8525 2005-01-13 Miguel de Icaza <miguel@ximian.com>
8527 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
8528 of a different type is only allowed to private fields of a
8529 containing type, not on fields of a base class.
8531 See test-174.cs and error cs0122-9.cs
8533 2005-01-13 Raja R Harinath <rharinath@novell.com>
8535 Fix test-335.cs (bug #58126).
8536 * cs-parser.jay (argument): Split out non-expression parts of the
8537 rule into 'non_simple_argument'.
8538 (invocation_expression): Support parenthesized invocations with
8539 multiple arguments, and with single non-simple arguments.
8541 2005-01-13 Raja R Harinath <rharinath@novell.com>
8543 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
8546 2005-01-12 Raja R Harinath <rharinath@novell.com>
8548 Fix cs0038-1.cs, cs1640-6.cs.
8549 * ecore.cs (Expression.Resolve): Remove special-case for
8550 SimpleName in error-handling.
8551 (Expression.almostMatchedMembers): Relax access permission to
8553 (Expression.MemberLookupFailed): Handle duplicates in
8554 almostMatchedMembers list.
8555 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
8556 * expression.cs (New.DoResolve): Report CS1540 for more cases.
8557 * typemanager.cs (GetFullNameSignature): Use the MethodBase
8558 overload if the passed in MemberInfo is a MethodBase.
8560 2005-01-12 Marek Safar <marek.safar@seznam.cz>
8563 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
8564 for non-CAS & merge permission sets properly.
8566 2005-01-11 Raja R Harinath <rharinath@novell.com>
8568 Improve standard-compliance of simple name and member access
8569 resolution. Fixes bugs #52697, #57200, #67520, #69519.
8570 * ecore.cs (FullNamedExpression): New abstract base class
8571 for Namespaces and TypeExpressions.
8572 (ResolveFlags.SimpleName): Remove.
8573 (SimpleName): Remove support for dotted names.
8574 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
8575 DeclSpace.FindType and DeclSpace.LookupType.
8576 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
8577 (Expression.ExprClassName): Make member function.
8578 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
8579 a namespace. Remove creation of dotted "SimpleName"s.
8580 (MemberAccess.DoResolve): Likewise.
8581 * decl.cs (DeclSpace.Cache): Make private.
8582 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
8583 (DeclSpace.FindType): Update.
8584 (DeclSpace.LookupType): Move here from RootContext. Return a
8585 FullNamedExpression.
8586 * namespace.cs (Namespace): Derive from FullNamedExpression
8587 so that it can be part of expression resolution.
8588 (Namespace.Lookup): Return an FullNamedExpression.
8589 (NamespaceEntry.LookupAlias): Lookup aliases only in current
8591 * rootcontext.cs (NamespaceLookup): Remove.
8592 (LookupType): Move to DeclSpace.
8593 * attribute.cs (CheckAttributeType): Update.
8594 * doc.cs (FindDocumentedType): Remove allowAlias argument.
8595 (FindDocumentedTypeNonArray): Likewise.
8597 2005-01-11 Raja R Harinath <rharinath@novell.com>
8599 Fix cs0509.cs, cs1632.cs.
8600 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
8601 is the same as IsInterface.
8602 (TypeContainer.GetClassBases): Likewise.
8603 * statement.cs (LabeledStatement.ig): New field.
8604 (LabeledStatement.LabelTarget): Save ILGenerator which created the
8606 (LabeledStatement.DoEmit): Check that the label was created with
8607 the same ILGenerator.
8609 2005-01-10 Marek Safar <marek.safar@seznam.cz>
8612 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
8613 accessors to its properties.
8615 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
8616 from accessors to property.
8618 2005-01-10 Marek Safar <marek.safar@seznam.cz>
8621 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
8624 2005-01-08 Miguel de Icaza <miguel@ximian.com>
8626 * attribute.cs: Check for null and empty strings.
8628 I have lost another battle to Paolo.
8630 2005-01-07 Marek Safar <marek.safar@seznam.cz>
8633 * class.cs (PropertyMethod): Set Parent field in ctors.
8634 (SetMethod.InternalParameters): Add unsafe switch hack.
8635 Override MarkForDuplicationCheck where it is appropriate.
8637 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
8638 It says whether container allows members with the same name.
8640 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
8641 Removed is_method parameter.
8643 2005-01-06 Duncan Mak <duncan@ximian.com>
8645 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
8646 because the previous change led to incorrect reporting of CS1032
8647 ("Cannot define/undefine preprocessor symbols after first token in
8648 file"). Instead of using `tokens_seen' as the only flag that
8649 triggers CS1040, introduce `comments_seen'. This new flag is used
8650 to signify having seen comments on the current line, so it is
8651 unset after a newline.
8653 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
8655 * doc.cs : When searching for a type, find nested type too.
8656 This fixes bug #71040.
8658 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
8661 - Warn missing member comment on those classes which also does not
8662 have doc comments. Fixed bug #71041.
8663 - Don't warn missing doc comment on default constructor.
8666 2005-01-06 Duncan Mak <duncan@ximian.com>
8668 * cs-tokenizer.cs (xtoken): After handling traditional C-style
8669 comments, set `tokens_seen' to true. This allows us to detect
8670 misplaced preprocessor directives (i.e. not at the beginning of
8671 the a line, nor after whitespaces). In that case, report error
8672 CS1040. This fixes bug #56460.
8674 * cs-parser.jay (interface_member_declaration): Add checks for
8675 IsExplicitImpl, and report CS0541 error if an interface member is
8676 defined as an explicit interface declaration.
8678 2005-01-06 Marek Safar <marek.safar@seznam.cz>
8681 * class.cs (PropertyMethod): Set Parent field in ctors.
8682 (SetMethod.InternalParameters): Add unsafe switch hack.
8684 * decl.cs (MemberCore.Parent): Cannot be readonly.
8686 2005-01-06 Raja R Harinath <rharinath@novell.com>
8688 * decl.cs (DeclSpace.ResolveType): Remove.
8689 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
8690 Merge in code from ...
8691 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
8692 * class.cs, enum.cs: Update to changes.
8694 2005-01-06 Miguel de Icaza <miguel@ximian.com>
8696 * anonymous.cs: Ensure that we init the scope of our parent if it
8697 has not been initialized yet.
8699 2004-12-30 Duncan Mak <duncan@ximian.com>
8701 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
8702 if field.FieldBuilder is null. Fixes #70758.
8704 * convert.cs: Fixed some typos and updated some of the comments.
8705 (ImplicitStandardConversionExists):
8706 (TryImplicitIntConversion): If `target_type' is an interface and
8707 the type of `ic' implements this interface, return true or a new
8708 BoxedCast instead of null. This fixes #70468.
8710 2004-12-29 Duncan Mak <duncan@ximian.com>
8712 * expression.cs (Argument.Emit): Check that Expr is
8713 IMemoryLocation before casting to it, and report CS1510 otherwise.
8717 2004-12-21 Ben Maurer <bmaurer@ximian.com>
8719 * statement.cs (Block.ThisVariable): remove the recursion here, to
8720 make the --profile more sane.
8722 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
8724 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
8725 assembly, by JB Evain.
8727 2004-12-17 Raja R Harinath <rharinath@novell.com>
8729 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
8730 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
8731 "parent" refers to enclosing type/class. "base" refers to superclass.
8733 2004-12-17 Raja R Harinath <rharinath@novell.com>
8735 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
8736 Ensure that we only have GlobalAttributes.
8737 * attribute.cs (Attribute.Emit): Make non-virtual.
8738 (GlobalAttribute.Emit): Remove.
8739 (Attribute.Resolve): Make virtual.
8740 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
8741 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
8742 the argument. Don't create one.
8743 (Attribute.GetObsoleteAttribute): Likewise.
8744 (Attribute.GetClsCompliantAttributeValue): Likewise.
8745 * class.cs, decl.cs: Update to changes.
8747 2004-12-17 Marek Safar <marek.safar@seznam.cz>
8749 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
8751 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
8753 * statement.cs (Foreach.Resolve): Add error 186 report.
8755 2004-12-16 Marek Safar <marek.safar@seznam.cz>
8757 * expression.cs (Conditional.DoResolve): Add warning 429.
8759 * statement.cs (If.Resolve): Add warning 665.
8761 2004-12-16 Raja R Harinath <rharinath@novell.com>
8763 New invariant: RootContext.Tree.Types.NamespaceEntry == null
8764 except when in the parser, and in GlobalAttribute.
8765 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
8766 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
8767 RootContext.Tree.Types.NamespaceEntry once work is done.
8768 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
8769 and resets RootContext.Tree.Types.NamespaceEntry.
8771 2004-12-15 Marek Safar <marek.safar@seznam.cz>
8773 * cs-parser.jay: Don't create a block for every variable.
8775 2004-12-14 Miguel de Icaza <miguel@ximian.com>
8777 * location.cs: Provide extra information.
8779 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
8780 variables from the captured environment, it is the ldarg_0.
8782 2004-12-14 Marek Safar <marek.safar@seznam.cz>
8784 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
8787 * class.cs: Changed warning level for 169 to avoid developer
8788 displeasure from warning flooding. It will be changed back when they
8789 fix most of current BCL warnings.
8791 * RootContext.cs: Pushed default WarningLevel to 3.
8793 * statement.cs: Removed unused variable.
8795 2004-12-14 Marek Safar <marek.safar@seznam.cz>
8797 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
8798 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
8799 Add error 502 report.
8800 (StaticClass.DefineType): Add error 441 report.
8801 (Class.AllowedModifiersProp): New virtual property as temporary
8802 extension to AllowedModifiers.
8803 (Class.DefineType): Add error 418 report. Moved ModFlags check here
8804 to share implementation with StaticClass and don't call virtual
8807 * driver.cs (MainDriver): Add error 1558 test.
8809 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
8810 report. Moved error 36 test here.
8812 * statement.cs (Throw.Resolve): Add error 724 report.
8814 * typemanager.cs: Add out_attribute_type core type.
8816 2004-12-13 Marek Safar <marek.safar@seznam.cz>
8818 * class.cs (TypeContainer.VerifyClsCompliance): Add error
8820 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
8822 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
8825 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
8827 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
8828 Add error 3023 report.
8829 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
8831 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
8834 2004-12-12 John Luke <john.luke@gmail.com>
8836 * driver.cs (AddArgs): take -- into account when
8837 adding arguments, fixes bug 65710
8839 2004-12-12 Martin Baulig <martin@ximian.com>
8841 * expression.cs (Unary.TryReduceNegative): Added support for
8842 SByteConstant and ByteConstant.
8843 (Unary.Reduce): Check error values from TryReduceNegative().
8845 2004-12-10 Marek Safar <marek.safar@seznam.cz>
8847 * attributes.cs (Attribute.Resolve): Avoid multiple error report
8848 and report exception as error 182.
8850 2004-12-10 Raja R Harinath <rharinath@novell.com>
8852 * driver.cs (Main): Fix message when there are warnings.
8854 2004-12-09 Miguel de Icaza <miguel@ximian.com>
8856 * delegate.cs: Fixed my fix from yesterday, sorry about that.
8858 2004-12-09 Marek Safar <marek.safar@seznam.cz>
8860 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
8861 Reduced number of warnings.
8863 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
8865 2004-12-08 Miguel de Icaza <miguel@ximian.com>
8867 * driver.cs: Removed message.
8869 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
8871 2004-12-08 <vargaz@freemail.hu>
8873 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
8875 2004-12-08 Martin Baulig <martin@ximian.com>
8877 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
8878 instead of a CS3002 for properties and indexer.
8880 2004-12-08 Martin Baulig <martin@ximian.com>
8882 * decl.cs (MemberName.ToString): Make this work again.
8884 2004-12-08 Marek Safar <marek.safar@seznam.cz>
8886 * attribute.cs (Resolve): Add error 591 detection.
8888 * class.cs (FieldMember.Define): Add error 1547 detection.
8889 (Indexer.Define): Add error 620 detection.
8890 (Operator.Define): Add error 590 detection.
8892 * ecore.cs: Missing argument for error 79.
8894 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
8897 2004-12-07 Marek Safar <marek.safar@seznam.cz>
8900 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
8903 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
8905 * cs-parser.jay : handle doc comments on implicit/explicit operators.
8906 Some operator comments were suppressed.
8907 * doc.cs : Implicit/explicit operator name in doc comments are like
8908 "op_Explicit(type)~returnType", so added suffix handling.
8910 2004-12-07 Martin Baulig <martin@ximian.com>
8913 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
8914 (MemberCore.GetClsCompliantAttributeValue): Likewise.
8915 (DeclSpace.ec): New protected field; store the EmitContext here.
8916 (DeclSpace.EmitContext): New public property; moved here from
8918 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
8921 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
8922 (Enum.Emit): Don't create a new EmitContext.
8924 * delegate.cs (Delegate.DefineType): Always create the
8927 * iterators.cs (Iterators.DefineIterator): Create a new
8928 EmitContext and store it in `ec'.
8930 2004-08-24 Martin Baulig <martin@ximian.com>
8933 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
8934 this for accessibility checks.
8935 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
8936 IsNestedFamilyAccessible.
8937 (TypeManager.IsSubclassOf): New method, do what the name actually
8940 2004-12-06 Raja R Harinath <rharinath@novell.com>
8942 Fix crash on cs0657-17.cs.
8943 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
8944 Use RootContext.Tree.Types, not 'new RootTypes ()'.
8945 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
8946 the case where the NamespaceEntry gets overwritten.
8948 2004-12-06 Marek Safar <marek.safar@seznam.cz>
8950 Fixed #69195, #56821
8951 * ecore.cs (ResolveBoolean): Tiny refactoring.
8953 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
8954 of right expression resolving when left is false constant and
8955 operator is LogicalAnd OR true constant and operator is LogicalOr.
8957 * statement.cs (ResolveUnreachable): Always reports warning.
8959 2004-12-05 Miguel de Icaza <miguel@ximian.com>
8961 * class.cs: Distinguish between 1721 and 1722 (just a little help
8962 for the programmer).
8964 2004-12-03 Miguel de Icaza <miguel@ximian.com>
8966 * delegate.cs: Only allow this on new versions of the language.
8968 2004-12-02 Duncan Mak <duncan@ximian.com>
8970 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
8972 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
8973 here as a static method. Take an additional bool out parameter
8974 `must_do_cs1540_check' for signaling to InstanceResolve.
8975 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
8976 member field from PropertyExpr class and made it an argument of
8978 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
8979 check for MarshalByRefObject, and report CS0122 instead of CS1540.
8980 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
8981 and `remove_accessor' as well as InstanceResolve: report CS0122
8986 2004-12-03 Raja R Harinath <rharinath@novell.com>
8988 Fix test-327.cs, test-328.cs, and put in early infrastructure
8989 for eventually fixing #52697.
8990 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
8991 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
8993 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
8994 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
8995 (VerifyUsing, error246): Update.
8996 * rootcontext.cs (RootContext.NamespaceLookup): Just use
8997 'NamespaceEntry.LookupNamespaceOrType'.
8999 2004-12-03 Martin Baulig <martin@ximian.com>
9001 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
9002 method as our child, call AnonymousMethod.Compatible() on it.
9004 2004-12-03 Raja R Harinath <rharinath@novell.com>
9006 Disable XML documentation support in 'basic' profile.
9007 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
9008 Redirect XmlElement to System.Object.
9009 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
9010 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
9011 * mcs.exe.sources: Add doc-bootstrap.cs.
9012 * doc-bootstrap.cs: New file. Contains empty stub implementation
9015 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
9017 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
9018 comments are allowed.
9020 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
9022 * delegate.cs: Add checks for subtypes in paramaters and return values
9023 in VerifyMethod () to add support for Covariance/Contravariance
9026 2004-12-02 Miguel de Icaza <miguel@ximian.com>
9028 * report.cs: Remove extra closing parenthesis.
9030 * convert.cs (Error_CannotImplicitConversion): If the name of the
9031 types are the same, provide some extra information.
9033 * class.cs (FieldBase): Use an unused bit field from the field to
9034 encode the `has_offset' property from the FieldMember. This saves
9035 a couple of Ks on bootstrap compilation.
9037 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
9038 method as our child, return the AnonymousMethod resolved
9041 * expression.cs (New.DoResolve): Allow return values from
9042 NewDelegate to also include AnonymousMethods.
9046 2004-12-02 Marek Safar <marek.safar@seznam.cz>
9049 * attribute.cs (Resolve): Improved implementation of params
9050 attribute arguments.
9052 * support.cs (ParameterData): Add HasParams to be faster.
9054 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
9056 all things are for /doc support:
9058 * doc.cs: new file that supports XML documentation generation.
9059 * mcs.exe.sources: added doc.cs.
9061 Handle /doc command line option.
9062 Report error 2006 instead of 5 for missing file name for /doc.
9063 Generate XML documentation when required, after type resolution.
9065 Added support for picking up documentation (/// and /** ... */),
9066 including a new XmlCommentState enumeration.
9068 Added lines to fill Documentation element for field, constant,
9069 property, indexer, method, constructor, destructor, operator, event
9070 and class, struct, interface, delegate, enum.
9071 Added lines to warn incorrect comment.
9073 Added Documentation field (passed only when /doc was specified).
9075 Added DocComment, DocCommentHeader, GenerateDocComment() and
9076 OnGenerateDocComment() and some supporting private members for
9077 /doc feature to MemberCore.
9079 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
9081 Added overriden DocCommentHeader.
9083 Added overriden DocCommentHeader and GenerateDocComment().
9085 2004-12-01 Miguel de Icaza <miguel@ximian.com>
9087 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
9088 unwrapping the enumeration values, chain to
9089 DoConstantNumericPromotions again, so we can promote things to the
9090 fundamental types (takes care of enums that are bytes, sbytes).
9094 2004-12-01 Raja R Harinath <rharinath@novell.com>
9096 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
9097 Fix long-standing bug in type-lookup. Use FindType instead of
9098 LookupType when ec.ResolvingTypeTree.
9099 (Attribute.ResolveType, Attribute.Resolve)
9100 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
9102 (Attributes.Search): Remove internal version. Update.
9103 (Attributes.SearchMulti): Update.
9104 (Attributes.GetClsCompliantAttribute): Remove.
9105 (Attributes.GetIndexerNameAttribute): Remove.
9106 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
9107 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
9108 * class.cs (Indexer.Define): Likewise.
9110 2004-12-01 Marek Safar <marek.safar@seznam.cz>
9113 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
9114 MarshallByReference members access.
9116 * expression.cs: Use CheckMarshallByRefAccess;
9117 Better error CS0197 message.
9119 * report.cs: Print whole related error message.
9121 2004-11-30 Raja R Harinath <rharinath@novell.com>
9123 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
9124 the current directory to help debugging.
9126 2004-11-29 Marek Safar <marek.safar@seznam.cz>
9128 * class (GetClassBases): Better error 60 report.
9129 (EventProperty): Disabled warning 67 detection.
9131 2004-11-29 Marek Safar <marek.safar@seznam.cz>
9134 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
9136 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
9139 2004-11-29 Marek Safar <marek.safar@seznam.cz>
9142 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
9144 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
9146 2004-11-26 Miguel de Icaza <miguel@ximian.com>
9148 * attribute.cs (Attribute.Resolve): Refine error reporting and
9149 report a cs0117 if the identifier does not exist, to distinguish
9150 from 0617 which is a miss-use of the actual identifier.
9152 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
9153 between cs0070 and cs0079.
9155 * class.cs (MemberBase.DoDefine): When reporting a wrong
9156 accessibility level, we use MethodCore to compare instead of
9157 Method (this was a regression in some refactoring effort).
9159 So now we correctly report cs0056 again.
9161 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
9162 testing the target_type (which was known to be object_type) and
9163 not the source type (which is anonymous_method).
9165 Fixed reporting of error cs1660.
9167 * expression.cs (UserCast.Source): Expose the underlying cast.
9169 * statement.cs (Switch.SwitchGoverningType): Sort the list of
9170 allowed types to find a match to int32 first (most common).
9172 In addition, it ignores any ImplicitUserConversions that did an
9173 internal implicit conversion (as the switch statement allows only
9174 one integral conversion to exist).
9176 * class.cs (PartialContainer.Create): rename `name' to
9177 `member_name' for clarity. Then replace the string calls with a
9178 call to MemberName.GetPartialName, as now using
9179 MemberName.ToString is an error (this is due to the side effects
9180 it had, that were fixed in the past).
9182 This will restore the error reporting on a number of partial class
9183 errors that were missusing this (and getting an exception as a
9184 results, which is now just a plain textual warning, because
9185 yyparse debug output would crash otherwise).
9187 2004-11-26 Raja R Harinath <rharinath@novell.com>
9189 * Makefile (PROGRAM_INSTALL_DIR): Remove.
9191 2004-11-25 Ben Maurer <bmaurer@ximian.com>
9193 * rootcontext.cs (LookupType): Make sure to cache lookups that
9194 don't give us a negative result. This saves about 5% of corlib
9197 2004-11-25 Miguel de Icaza <miguel@ximian.com>
9199 * report.cs (AbstractMessage.Print): messages are sent to stderr
9201 * class.cs (TypeContainer.GetClassBases): It is an error to have a
9202 non-interface in the list of interfaces (at this point, either
9203 parent was properly set, or a base class is being listed in the
9204 interfaces section).
9206 This flags error 1722, and resolves the crash from bug 69259.
9208 2004-11-25 Ben Maurer <bmaurer@ximian.com>
9210 * statement.cs (Using.EmitExpressionFinally): make this work right
9211 for valuetypes. Fixes 69926.
9213 2004-11-25 Miguel de Icaza <miguel@ximian.com>
9215 * const.cs (Const.ChangeType): Cope with the "0 literal can be
9216 converted to an enum" here, before we try to change the underlying
9217 type. This code exists, but it is a different code path than the
9218 one used while encoding constants.
9220 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
9221 old bug: when converting from the null literal to a pointer,
9222 return an EmptyCast, not the NullLiteral.
9224 This fixes #69921, the recent null_type changes probably made this
9227 (ImplicitReferenceConversionExists): In addition, resynchronized
9228 the code here, so it matches the same code in
9229 ImplicitReferenceConversionExists for the `from any class-type S
9230 to any interface-type T'.
9233 2004-11-25 Marek Safar <marek.safar@seznam.cz>
9235 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
9237 2004-11-24 Miguel de Icaza <miguel@ximian.com>
9239 * cs-parser.jay: Use verbosity accordingly.
9241 2004-11-24 Marek Safar <marek.safar@seznam.cz>
9243 * expression.cs (Unary.ResolveOperator): Do not report warning;
9244 AddressOf reads from variable.
9246 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
9248 2004-11-24 Marek Safar <marek.safar@seznam.cz>
9252 * attribute.cs (Attributable): Removed CheckTargets.
9253 (Attributes.Emit): Explicit attribute targets are tested here.
9255 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
9256 not enabled for interfaces.
9258 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
9259 (GetAssemblyName): Ouch next bug there.
9261 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
9263 * expression.cs: Error 275 added.
9265 2004-11-23 Marek Safar <marek.safar@seznam.cz>
9267 Fix bug #69177 (Implemented decimal constant support)
9269 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
9270 (BinaryFold): Add DecimalConstant.
9272 * const.cs (Define): Decimal constant
9274 (ChangeType): Add decimal type handling.
9275 (LookupConstantValue): Don't set value for decimal type but
9276 emit DecimalConstantAttribute. Needed for constant optimization.
9278 * constant.cs (ToDecimal): New method.
9279 (ConvertToDecimal): New method.
9280 (IntConstant): Implemented ConvertToDecimal.
9281 (DecimalConstant.Emit): Emit optimized version for decimals in
9284 * expression.cs (ResolveOperator): Changed order of constant
9285 reduction to work correctly with native types which have
9286 overloaded operators.
9287 (ResolveMemberAccess): Extract constant value from attribute
9290 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
9292 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
9293 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
9294 (ChangeType): Decimal is special.
9295 (TypeToCoreType): Add decimal type.
9297 2004-11-22 Marek Safar <marek.safar@seznam.cz>
9299 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
9302 2004-11-22 Marek Safar <marek.safar@seznam.cz>
9304 * class.cs (EventField.ApplyAttributeBuilder): Fix error
9307 2004-11-19 Marek Safar <marek.safar@seznam.cz>
9309 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
9311 * pending.cs (PendingImplementation): Grab only interfaces.
9313 2004-11-19 Marek Safar <marek.safar@seznam.cz>
9315 * statement.cs (ForeachHelperMethods): Add location member and
9316 error 202 detection.
9318 2004-11-19 Raja R Harinath <rharinath@novell.com>
9320 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
9321 automatically handled by executable.make.
9322 (PROGRAM): Make profile-specific.
9324 2004-11-18 Marek Safar <marek.safar@seznam.cz>
9326 * expression.cs (DoResolveBase): Fixed wrong warning for out
9329 2004-11-18 Martin Baulig <martin@ximian.com>
9331 Merged latest changes into gmcs. Please keep this comment in
9332 here, it makes it easier for me to see what changed in MCS since
9333 the last time I merged.
9335 2004-11-17 Raja R Harinath <rharinath@novell.com>
9337 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
9338 (TypeHandle.GetMemberCache): New.
9339 (TypeHandle.TypeHandle): Update.
9340 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
9341 (TypeManager.LookupParentInterfacesCache):
9342 Rename from LookupInterfaceCache. Optimize slightly.
9343 (TypeManager.MemberLookup_FindMembers): Update.
9344 * decl.cs (MemberCache.MemberCache): Set Container to null in the
9346 (AddCacheContents): Rename from AddHashtable.
9347 * class.cs (TypeContainer.parent_container): Remove.
9348 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
9349 (TypeContainer.DoDefineMembers): Don't initialize it.
9350 Update to name changes.
9352 2004-11-17 Miguel de Icaza <miguel@ximian.com>
9354 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
9355 that factors the code to check access modifiers on override.
9357 (PropertyBase): Use the code here.
9359 Patch from Lluis S'anchez, fixes bug #69361.
9361 2004-11-15 Miguel de Icaza <miguel@ximian.com>
9363 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
9364 routine that is used to report the use of a captured variable
9365 whose address has been taken.
9367 There are two checks: one when variables are being captured and
9368 the other check is when the address of a variable is taken.
9370 (because an anonymous methods might be resolved before *or* after
9371 the address has been taken) and
9373 * expression.cs (Conditional.DoResolve): Remove the special
9374 casing that Martin added to trueExpr and falseExpr being both
9375 NullLiteral. We get the right behavior now just by introducing
9376 the null_type into the compiler.
9378 * convert.cs (ExplicitConversion): Change the code to use
9379 null_type instead of testing `expr is NullLiteral'.
9380 (ImplicitConversionStandard): use null_type too.
9381 (ImplicitReferenceConversionExists): use null_type too.
9382 (ImplicitReferenceConversion): use null_type too.
9384 * literal.cs: The type of `NullLiteral' is now null_type instead
9386 (Resolve): Set the type here.
9388 * typemanager.cs: Introduce null_type.
9390 2004-11-17 Martin Baulig <martin@ximian.com>
9392 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
9393 direction, like FindMembers() does. Fixes #69546, testcase is in
9396 2004-11-16 Martin Baulig <martin@ximian.com>
9398 This is based on a patch from Marek Safar, see bug #69082.
9399 Fixes bugs #63705 and #67130.
9401 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
9402 method; create a MemberCache for an interface type and cache the
9405 * decl.cs (IMemberContainer.ParentContainer): Removed.
9406 (IMemberContainer.ParentCache): New property.
9407 (MemberCache.SetupCacheForInterface): Removed.
9408 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
9409 to create a cache for an interface's "parent".
9411 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
9414 2004-11-16 Martin Baulig <martin@ximian.com>
9416 Merged back from gmcs; these changes already went into gmcs a
9417 couple of weeks ago.
9420 (TypeManager.AddUserType): Removed the `ifaces' argument.
9421 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
9423 (TypeManager.AddUserInterface): Removed.
9424 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
9426 (TypeManager.GetInterfaces): Likewise.
9427 (TypeManager.GetExplicitInterfaces): Likewise.
9429 * ecore.cs (TypeExpr.GetInterfaces): Removed.
9431 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
9432 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
9434 2004-11-14 Ben Maurer <bmaurer@ximian.com>
9436 * statement.cs: Avoid adding bools to a hashtable.
9438 2004-11-07 Miguel de Icaza <miguel@ximian.com>
9440 * expression.cs (Invocation.OverloadResolve): Flag error if we are
9441 calling an unsafe method from a safe location.
9443 2004-11-06 Marek Safar <marek.safar@seznam.cz>
9446 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
9448 2004-11-06 Miguel de Icaza <miguel@ximian.com>
9450 * namespace.cs (VerifyUsing): use GetPartialName instead of
9453 2004-11-05 Miguel de Icaza <miguel@ximian.com>
9455 * statement.cs (Return.Resolve): Fix regression in typo: if
9456 `in_exc', we have to request a NeedReturnLabel, this was a typo
9457 introduced in the anonymous method check-in. Fixes #69131.
9459 * Indexers were using the ShortName when defining themselves,
9460 causing a regression in the compiler bootstrap when applying the
9461 patch from 2004-11-02 (first part), now they use their full name
9462 and the bug is gone.
9464 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
9466 * driver.cs: Strip the path from the names of embedded resources. Fixes
9469 2004-11-04 Raja R Harinath <rharinath@novell.com>
9471 Fix error message regression: cs0104-2.cs.
9472 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
9473 (AliasEntry.Resolve): Update.
9474 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
9476 (RootContext.LookupType): Update.
9478 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
9480 * cs-parser.jay: Add support for handling accessor modifiers
9481 * class: Add support port accessor modifiers and error checking,
9482 define PropertyMethod.Define as virtual (not abstract anymore)
9483 * ecore.cs: Add checking for proeprties access with access modifiers
9484 * iterators.cs: Modify Accessor constructor call based in the modified
9486 2004-11-02 Ben Maurer <bmaurer@ximian.com>
9488 * expression.cs (StringConcat): Handle being called twice,
9489 as when we have a concat in a field init with more than two
9492 2004-11-02 Miguel de Icaza <miguel@ximian.com>
9494 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
9495 special case explicit implementations, we should always produce
9496 the .property or .event declaration.
9498 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
9499 since it will not return correct data if people use this
9500 unresolved in the presence of using statements (see test-313).
9502 * class.cs (MethodData.Define): If we are an explicit interface
9503 implementation, set the method name to the full name of the
9504 interface plus the name of the method.
9506 Notice that using the method.MethodName.GetFullName() does not
9507 work, as it will only contain the name as declared on the source
9508 file (it can be a shorthand in the presence of using statements)
9509 and not the fully qualifed type name, for example:
9513 class D : ICloneable {
9514 object ICloneable.Clone () {
9518 Would produce a method called `ICloneable.Clone' instead of
9519 `System.ICloneable.Clone'.
9521 * namespace.cs (Alias.Resolve): Use GetPartialName.
9523 2004-11-01 Marek Safar <marek.safar@seznam.cz>
9525 * cs-parser.jay: Add error 1055 report.
9527 2004-11-01 Miguel de Icaza <miguel@ximian.com>
9529 * assign.cs (Assign.DoResolve): Only do the transform of
9530 assignment into a New if the types are compatible, if not, fall
9531 through and let the implicit code deal with the errors and with
9532 the necessary conversions.
9534 2004-11-01 Marek Safar <marek.safar@seznam.cz>
9536 * cs-parser.jay: Add error 1031 report.
9538 * cs-tokenizer.cs: Add location for error 1038.
9540 2004-10-31 Marek Safar <marek.safar@seznam.cz>
9542 * cs-parser.jay: Add error 1016 report.
9544 2004-10-31 Marek Safar <marek.safar@seznam.cz>
9546 * cs-parser.jay: Add errors 1575,1611 report.
9548 2004-10-31 Marek Safar <marek.safar@seznam.cz>
9550 * cs-parser.jay: Add error 1001 report.
9552 2004-10-31 Marek Safar <marek.safar@seznam.cz>
9555 * attribute.cs (GetMarshal): Add method argument for
9556 caller identification.
9558 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
9559 agument for GetMarshal and RuntimeMissingSupport.
9561 2004-10-31 Marek Safar <marek.safar@seznam.cz>
9563 * attribute.cs (ExtractSecurityPermissionSet): Removed
9564 TypeManager.code_access_permission_type.
9566 * typemanager.cs: Removed TypeManager.code_access_permission_type.
9568 2004-10-27 Miguel de Icaza <miguel@ximian.com>
9570 * expression.cs (LocalVariableReference.DoResolveLValue): Check
9571 for obsolete use of a variable here. Fixes regression on errors
9572 cs0619-25 and cs0619-26.
9574 2004-10-27 Marek Safar <marek.safar@seznam.cz>
9576 Fix #62358, implemented security attribute encoding.
9578 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
9579 Tests permitted SecurityAction for assembly or other types.
9580 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
9581 data from SecurityPermissionAttribute to PermisionSet class.
9583 * class.cs (ApplyAttributeBuilder): Added special handling
9584 for System.Security.Permissions.SecurityAttribute based types.
9586 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
9587 special handling for System.Security.Permissions.SecurityAttribute
9590 * enum.cs (ApplyAttributeBuilder): Added special handling
9591 for System.Security.Permissions.SecurityAttribute based types.
9593 * parameter.cs (ApplyAttributeBuilder): Added special handling
9594 for System.Security.Permissions.SecurityAttribute based types.
9596 * rootcontext.cs: Next 2 core types.
9598 * typemanager.cs (TypeManager.security_permission_attr_type):
9599 Built in type for the SecurityPermission Attribute.
9600 (code_access_permission_type): Build in type.
9602 2004-10-17 Miguel de Icaza <miguel@ximian.com>
9604 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
9605 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
9606 all of this information into
9607 EmitContext.EmitCapturedVariableInstance.
9609 * codegen.cs (EmitCapturedVariableInstance): move here the
9610 funcionality of emitting an ldarg.0 in the presence of a
9611 remapping. This centralizes the instance emit code.
9613 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
9614 then emit a load of this: it means that we have reached the
9615 topmost ScopeInfo: the one that contains the pointer to the
9616 instance of the class hosting the anonymous method.
9618 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
9619 captures to the topmost CaptureContext.
9621 2004-10-12 Miguel de Icaza <miguel@ximian.com>
9623 * expression.cs (LocalVariableReference): Move the knowledge about
9624 the iterators into codegen's EmitCapturedVariableInstance.
9626 2004-10-11 Miguel de Icaza <miguel@ximian.com>
9628 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
9629 all code paths return a value from an anonymous method (it is the
9630 same as the 161 error, but for anonymous methods).
9632 2004-10-08 Miguel de Icaza <miguel@ximian.com>
9634 The introduction of anonymous methods in the compiler changed
9635 various ways of doing things in the compiler. The most
9636 significant one is the hard split between the resolution phase
9637 and the emission phases of the compiler.
9639 For instance, routines that referenced local variables no
9640 longer can safely create temporary variables during the
9641 resolution phase: they must do so from the emission phase,
9642 since the variable might have been "captured", hence access to
9643 it can not be done with the local-variable operations from the runtime.
9647 (Block.Flags): New flag `IsTopLevel' to indicate that this block
9648 is a toplevel block.
9650 (ToplevelBlock): A new kind of Block, these are the blocks that
9651 are created by the parser for all toplevel method bodies. These
9652 include methods, accessors and anonymous methods.
9654 These contain some extra information not found in regular blocks:
9655 A pointer to an optional CaptureContext (for tracking captured
9656 local variables and parameters). A pointer to the parent
9659 (Return.Resolve): Catch missmatches when returning a value from an
9660 anonymous method (error 1662).
9661 Invoke NeedReturnLabel from the Resolve phase instead of the emit
9664 (Break.Resolve): ditto.
9666 (SwitchLabel): instead of defining the labels during the
9667 resolution phase, we now turned the public ILLabel and ILLabelCode
9668 labels into methods called GetILLabelCode() and GetILLabel() that
9669 only define the label during the Emit phase.
9671 (GotoCase): Track the SwitchLabel instead of the computed label
9672 (its contained therein). Emit the code by using
9673 SwitchLabel.GetILLabelCode ().
9675 (LocalInfo.Flags.Captured): A new flag has been introduce to track
9676 whether the Local has been captured or not.
9678 (LocalInfo.IsCaptured): New property, used to tell whether the
9679 local has been captured.
9681 * anonymous.cs: Vastly updated to contain the anonymous method
9684 The main classes here are: CaptureContext which tracks any
9685 captured information for a toplevel block and ScopeInfo used to
9686 track the activation frames for various local variables.
9688 Each toplevel block has an optional capture context associated
9689 with it. When a method contains an anonymous method both the
9690 toplevel method and the anonymous method will create a capture
9691 context. When variables or parameters are captured, they are
9692 recorded on the CaptureContext that owns them, for example:
9696 MyDelegate d = delegate {
9701 Here `a' will be recorded as captured on the toplevel
9702 CapturedContext, the inner captured context will not have anything
9703 (it will only have data if local variables or parameters from it
9704 are captured in a nested anonymous method.
9706 The ScopeInfo is used to track the activation frames for local
9707 variables, for example:
9709 for (int i = 0; i < 10; i++)
9710 for (int j = 0; j < 10; j++){
9711 MyDelegate d = delegate {
9716 At runtime this captures a single captured variable `i', but it
9717 captures 10 different versions of the variable `j'. The variable
9718 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
9719 recorded on a child.
9721 The toplevel ScopeInfo will also track information like the `this'
9722 pointer if instance variables were referenced (this is necessary
9723 as the anonymous method lives inside a nested class in the host
9724 type of the method).
9726 (AnonymousMethod): Expanded to track the Toplevel, implement
9727 `AnonymousMethod.Compatible' to tell whether an anonymous method
9728 can be converted to a target delegate type.
9730 The routine now also produces the anonymous method content
9732 (AnonymousDelegate): A helper class that derives from
9733 DelegateCreation, this is used to generate the code necessary to
9734 produce the delegate for the anonymous method that was created.
9736 * assign.cs: API adjustments for new changes in
9737 Convert.ImplicitStandardConversionExists.
9739 * class.cs: Adjustments to cope with the fact that now toplevel
9740 blocks are of type `ToplevelBlock'.
9742 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
9743 insteda of standard blocks.
9745 Flag errors if params arguments are passed to anonymous methods.
9747 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
9748 `CurrentAnonymousMethod' which points to the current Anonymous
9749 Method. The variable points to the AnonymousMethod class that
9750 holds the code being compiled. It is set in the new EmitContext
9751 created for the anonymous method.
9753 (EmitContext.Phase): Introduce a variable and an enumeration to
9754 assist in enforcing some rules about when and where we are allowed
9755 to invoke certain methods (EmitContext.NeedsReturnLabel is the
9756 only one that enfonces this right now).
9758 (EmitContext.HaveCaptureInfo): new helper method that returns
9759 whether we have a CapturedContext initialized.
9761 (EmitContext.CaptureVariable): New method used to register that a
9762 LocalInfo must be flagged for capturing.
9764 (EmitContext.CapturedParameter): New method used to register that a
9765 parameters must be flagged for capturing.
9767 (EmitContext.CapturedField): New method used to register that a
9768 field must be flagged for capturing.
9770 (EmitContext.HaveCapturedVariables,
9771 EmitContext.HaveCapturedFields): Return whether there are captured
9772 variables or fields.
9774 (EmitContext.EmitMethodHostInstance): This is used to emit the
9775 instance for the anonymous method. The instance might be null
9776 (static methods), this (for anonymous methods that capture nothing
9777 and happen to live side-by-side with the current method body) or a
9778 more complicated expression if the method has a CaptureContext.
9780 (EmitContext.EmitTopBlock): Routine that drives the emission of
9781 code: it will first resolve the top block, then emit any metadata
9782 and then emit the code. The split is done so that we can extract
9783 any anonymous methods and flag any captured variables/parameters.
9785 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
9786 during this phase, the ILGenerator should not be used as labels
9787 and local variables declared here might not be accessible to any
9788 code that is part of an anonymous method.
9790 Exceptions to this include the temporary variables that are
9791 created by some statements internally for holding temporary
9794 (EmitContext.EmitMeta): New routine, in charge of emitting all the
9797 (EmitContext.TemporaryReturn): This method is typically called
9798 from the Emit phase, and its the only place where we allow the
9799 ReturnLabel to be defined other than the EmitMeta. The reason is
9800 that otherwise we would have to duplicate a lot of logic in the
9801 Resolve phases of various methods that today is on the Emit
9804 (EmitContext.NeedReturnLabel): This no longer creates the label,
9805 as the ILGenerator is not valid during the resolve phase.
9807 (EmitContext.EmitThis): Extended the knowledge in this class to
9808 work in anonymous methods in addition to iterators.
9810 (EmitContext.EmitCapturedVariableInstance): This emits whatever
9811 code is necessary on the stack to access the instance to a local
9812 variable (the variable will be accessed as a field).
9814 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
9815 EmitContext.EmitAddressOfParameter): Routines to support
9816 parameters (not completed at this point).
9818 Removals: Removed RemapLocal and RemapLocalLValue. We probably
9819 will also remove the parameters.
9821 * convert.cs (Convert): Define a `ConstantEC' which points to a
9822 null. This is just to prefity some code that uses
9823 ImplicitStandardConversion code and do not have an EmitContext
9826 The idea is to flag explicitly that at that point in time, it is
9827 known that the conversion will not trigger the delegate checking
9828 code in implicit conversions (which requires a valid
9831 Everywhere: pass new EmitContext parameter since
9832 ImplicitStandardConversionExists now requires it to check for
9833 anonymous method conversions.
9835 (Convert.ImplicitStandardConversionExists): If the type of an
9836 expression is the anonymous_method_type, and the type is a
9837 delegate, we invoke the AnonymousMethod.Compatible method to check
9838 whether an implicit conversion is possible.
9840 (Convert.ImplicitConversionStandard): Only do implicit method
9841 group conversions if the language level is not ISO_1.
9843 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
9844 MethodInfo for the Invoke method. used by Delegate and
9847 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
9848 method conversions if the target type is a delegate.
9850 Removed extra debugging nops.
9852 (LocalVariableReference): Turn the `local_info' into a public
9855 Add `prepared' field, the same hack used for FieldExprs to cope
9856 with composed assignments, as Local variables do not necessarily
9857 operate purely on the stack as they used to: they can be captured
9860 Add `temp' for a temporary result, like fields.
9862 Refactor DoResolve and DoResolveLValue into DoResolveBase.
9864 It now copes with Local variables that are captured and emits the
9865 proper instance variable to load it from a field in the captured
9868 (ParameterReference.DoResolveBase): During the resolve phase,
9869 capture parameters if we are in an anonymous method.
9871 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
9872 anonymous method, use the EmitContext helper routines to emit the
9873 parameter reference.
9875 * iterators.cs: Set RemapToProxy to true/false during the
9878 * parameters.cs (GetParameterByName): New helper method.
9880 * typemanager.cs (anonymous_method_type) a new type that
9881 represents an anonyous method. This is always an internal type,
9882 used as a fencepost to test against the anonymous-methodness of an
9885 2004-10-20 Marek Safar <marek.safar@seznam.cz>
9887 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
9889 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
9891 2004-10-18 Martin Baulig <martin@ximian.com>
9893 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
9894 `Type' directly, but call ResolveType() on it.
9895 (Catch.Resolve): Likewise.
9896 (Foreach.Resolve): Likewise.
9898 2004-10-18 Martin Baulig <martin@ximian.com>
9900 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
9901 `Type' directly, but call ResolveType() on it.
9902 (Probe.DoResolve): Likewise.
9903 (ArrayCreation.LookupType): Likewise.
9904 (TypeOf.DoResolve): Likewise.
9905 (SizeOf.DoResolve): Likewise.
9907 2004-10-18 Martin Baulig <martin@ximian.com>
9909 * expression.cs (Invocation.BetterFunction): Put back
9910 TypeManager.TypeToCoreType().
9912 2004-10-18 Raja R Harinath <rharinath@novell.com>
9914 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
9917 2004-10-18 Martin Baulig <martin@ximian.com>
9919 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
9920 `Type' directly, but call ResolveType() on it.
9922 2004-10-18 Martin Baulig <martin@ximian.com>
9924 * class.cs (FieldMember.Define): Don't access the TypeExpr's
9925 `Type' directly, but call ResolveType() on it.
9926 (MemberBase.DoDefine): Likewise.
9928 * expression.cs (New.DoResolve): Don't access the TypeExpr's
9929 `Type' directly, but call ResolveType() on it.
9930 (ComposedCast.DoResolveAsTypeStep): Likewise.
9932 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
9933 `Type' directly, but call ResolveType() on it.
9935 2004-10-17 John Luke <john.luke@gmail.com>
9937 * class.cs (Operator.GetSignatureForError): use CSharpName
9939 * parameter.cs (Parameter.GetSignatureForError): Returns
9940 correct name even if was not defined.
9942 2004-10-13 Raja R Harinath <rharinath@novell.com>
9945 * class.cs (TypeContainer.EmitContext): New property.
9946 (DefineNestedTypes): Create an emitcontext for each part.
9947 (MethodCore.DoDefineParameters): Use container's emitcontext.
9948 Pass type array to InternalParameters.
9949 (MemberBase.DoDefine): Use container's emitcontext.
9950 (FieldMember.Define): Likewise.
9951 (Event.Define): Likewise.
9952 (SetMethod.GetParameterInfo): Change argument to EmitContext.
9953 Pass type array to InternalParameters.
9954 (SetIndexerMethod.GetParameterInfo): Likewise.
9955 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
9956 * delegate.cs (Define): Pass emitcontext to
9957 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
9958 array to InternalParameters.
9959 * expression.cs (ParameterReference.DoResolveBase): Pass
9960 emitcontext to GetParameterInfo.
9961 (ComposedCast.DoResolveAsTypeStep): Remove check on
9962 ec.ResolvingTypeTree.
9963 * parameter.cs (Parameter.Resolve): Change argument to
9964 EmitContext. Use ResolveAsTypeTerminal.
9965 (Parameter.GetSignature): Change argument to EmitContext.
9966 (Parameters.ComputeSignature): Likewise.
9967 (Parameters.ComputeParameterTypes): Likewise.
9968 (Parameters.GetParameterInfo): Likewise.
9969 (Parameters.ComputeAndDefineParameterTypes): Likewise.
9970 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
9971 * support.cs (InternalParameters..ctor): Remove variant that takes
9973 * typemanager.cs (system_intptr_expr): New.
9974 (InitExpressionTypes): Initialize it.
9976 2004-10-12 Chris Toshok <toshok@ximian.com>
9978 * cs-parser.jay: fix location for try_statement and catch_clause.
9980 2004-10-11 Martin Baulig <martin@ximian.com>
9982 * report.cs: Don't make --fatal abort on warnings, we have
9983 -warnaserror for that.
9985 2004-10-07 Raja R Harinath <rharinath@novell.com>
9987 More DeclSpace.ResolveType avoidance.
9988 * decl.cs (MemberCore.InUnsafe): New property.
9989 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
9990 with newly created EmitContext.
9991 (FieldMember.Define): Likewise.
9992 * delegate.cs (Delegate.Define): Likewise.
9993 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
9994 only if normal name-lookup fails.
9995 (TypeExpr.DoResolve): Enable error-checking.
9996 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
9997 (SizeOf.DoResolve): Likewise.
9998 (ComposedCast.DoResolveAsTypeStep): Likewise.
9999 (StackAlloc.DoResolve): Likewise.
10000 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
10001 (Block.Unsafe): New property.
10002 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
10003 (Unsafe): Set 'unsafe' flag of contained block.
10004 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
10005 (Fixed.Resolve): Likewise.
10006 (Catch.Resolve): Likewise.
10007 (Using.ResolveLocalVariableDecls): Likewise.
10008 (Foreach.Resolve): Likewise.
10010 2004-10-05 John Luke <john.luke@gmail.com>
10012 * cs-parser.jay: add location to error CS0175
10014 2004-10-04 Miguel de Icaza <miguel@ximian.com>
10016 * ecore.cs (Expression.Constantity): Add support for turning null
10019 * const.cs (Const.Define): Allow constants to be reference types
10020 as long as the value is Null.
10022 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
10024 * namespace.cs (NamespaceEntry.Using): No matter which warning
10025 level is set, check if this namespace name has already been added.
10027 2004-10-03 Ben Maurer <bmaurer@ximian.com>
10029 * expression.cs: reftype [!=]= null should always use br[true,false].
10032 2004-10-03 Marek Safar <marek.safar@seznam.cz>
10035 * attribute.cs: Enum conversion moved to
10036 GetAttributeArgumentExpression to be applied to the all
10039 2004-10-01 Raja R Harinath <rharinath@novell.com>
10041 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
10042 * class.c (TypeContainer.DefineType): Flag error if
10043 base types aren't accessible due to access permissions.
10044 * decl.cs (DeclSpace.ResolveType): Move logic to
10045 Expression.ResolveAsTypeTerminal.
10046 (DeclSpace.ResolveTypeExpr): Thin layer over
10047 Expression.ResolveAsTypeTerminal.
10048 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
10049 Refactor code into NestedAccess. Use it.
10050 (DeclSpace.NestedAccess): New.
10051 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
10052 argument to silence errors. Check access permissions.
10053 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
10054 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
10055 (Cast.DoResolve): Likewise.
10056 (New.DoResolve): Likewise.
10057 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
10058 (TypeOf.DoResolve): Likewise.
10060 * expression.cs (Invocation.BetterConversion): Return the Type of
10061 the better conversion. Implement section 14.4.2.3 more faithfully.
10062 (Invocation.BetterFunction): Make boolean. Make correspondence to
10063 section 14.4.2.2 explicit.
10064 (Invocation.OverloadResolve): Update.
10065 (Invocation): Remove is_base field.
10066 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
10067 (Invocation.Emit): Likewise.
10069 2004-09-27 Raja R Harinath <rharinath@novell.com>
10071 * README: Update to changes.
10073 2004-09-24 Marek Safar <marek.safar@seznam.cz>
10075 * cs-parser.jay: Reverted 642 warning fix.
10077 2004-09-23 Marek Safar <marek.safar@seznam.cz>
10080 * decl.cs (FindMemberWithSameName): Indexer can have more than
10083 2004-09-23 Marek Safar <marek.safar@seznam.cz>
10085 * expression.cs (LocalVariableReference.DoResolveLValue):
10086 Do not report warning 219 for out values.
10087 (EmptyExpression.Null): New member to avoid extra allocations.
10089 2004-09-23 Marek Safar <marek.safar@seznam.cz>
10091 * cs-parser.jay: Fix wrong warning 642 report.
10093 * cs-tokenizer.cs (CheckNextToken): New helper;
10094 Inspect next character if is same as expected.
10096 2004-09-23 Martin Baulig <martin@ximian.com>
10098 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
10099 (Convert.ImplicitReferenceConversionExists): Likewise.
10101 2004-09-23 Marek Safar <marek.safar@seznam.cz>
10103 * class.cs (Operator.Define): Add error 448 and 559 report.
10105 2004-09-22 Marek Safar <marek.safar@seznam.cz>
10107 * class.cs (MemberBase.IsTypePermitted): New protected
10108 method for checking error CS0610.
10110 2004-09-22 Marek Safar <marek.safar@seznam.cz>
10112 * class.cs (TypeContainer.HasExplicitLayout): New property
10113 Returns whether container has StructLayout attribute set Explicit.
10114 (FieldMember): New abstract class for consts and fields.
10115 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
10116 (Field): Reuse FieldMember.
10118 * const.cs (Const): Reuse FieldMember.
10120 * rootcontext.cs: EmitConstants call moved to class.
10122 2004-09-22 Martin Baulig <martin@ximian.com>
10124 Thanks to Peter Sestoft for this bug report.
10126 * expression.cs (Conditional): If both the `trueExpr' and the
10127 `falseExpr' is a NullLiteral, return a NullLiteral.
10129 2004-09-22 Martin Baulig <martin@ximian.com>
10131 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
10132 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
10133 for the "get_Current" call.
10135 2004-09-22 Martin Baulig <martin@ximian.com>
10137 Marek and me just fixed one of our oldest bugs: #28562 :-)
10139 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
10141 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
10142 we're an EnumConstant, just return that.
10143 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
10144 an EnumConstant. In this case, we need to use GetValueAsEnumType()
10145 to get the value which'll actually be written into the attribute.
10146 However, we have to use GetValue() to access the attribute's value
10149 2004-09-22 Marek Safar <marek.safar@seznam.cz>
10151 * constant.cs (Constant.IsNegative): New abstract property
10154 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
10155 (StackAlloc.DoResolve): Reused IsNegative.
10157 2004-09-21 Martin Baulig <martin@ximian.com>
10159 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
10160 if we're used in an iterator, we may be called from different
10163 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
10164 we actually have an exception block.
10166 2004-09-20 John Luke <jluke@cfl.rr.com>
10168 * class.cs, cs-parser.jay: Improve the error report for 1520:
10169 report the actual line where the error happens, not where the
10170 class was declared.
10172 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
10173 Pass location information that was available elsewhere.
10175 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
10177 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
10178 runtime to delay sign assemblies.
10180 2004-09-19 Miguel de Icaza <miguel@ximian.com>
10182 * cs-parser.jay: Do not report the stack trace, this is barely
10185 2004-08-22 John Luke <john.luke@gmail.com>
10187 * driver.cs : check that a resource id is not already used
10188 before adding it, report CS1508 if it is, bug #63637
10190 2004-09-19 Miguel de Icaza <miguel@ximian.com>
10192 * ecore.cs: Removed dead code.
10194 2004-09-18 Marek Safar <marek.safar@seznam.cz>
10196 * class.cs: Do not report warning CS0067 on the interfaces.
10198 2004-09-16 Marek Safar <marek.safar@seznam.cz>
10200 * cs-parser.jay: Add error 504 report.
10202 2004-09-16 Marek Safar <marek.safar@seznam.cz>
10204 * rootcontext.cs: WarningLevel is 4 by default now.
10206 * statement.cs (Fixed.Resolve): Do not null
10209 2004-09-16 Marek Safar <marek.safar@seznam.cz>
10212 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
10213 deep search when property is not virtual.
10214 (PropertyExpr.ResolveAccessors): Make one call for both
10217 2004-09-15 Marek Safar <marek.safar@seznam.cz>
10220 * statement.cs: Error 152 report constains also location.
10222 2004-09-15 Marek Safar <marek.safar@seznam.cz>
10225 * const.cs: Explicitly set constant as static.
10227 2004-09-15 Marek Safar <marek.safar@seznam.cz>
10230 * cs-parser.jay: Add error 1017 report.
10232 2004-09-15 Marek Safar <marek.safar@seznam.cz>
10234 Fixed bug #59980, #64224
10235 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
10237 * typemanager.cs (IsSpecialMethod): Simplified
10239 2004-09-14 Marek Safar <marek.safar@seznam.cz>
10241 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
10242 condition with better params.
10244 2004-09-14 Marek Safar <marek.safar@seznam.cz>
10247 * attribute.cs (Resolve): Property has to have both
10250 2004-09-14 Martin Baulig <martin@ximian.com>
10252 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
10254 2004-09-14 Marek Safar <marek.safar@seznam.cz>
10257 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
10258 called and is obsolete then this member suppress message
10259 when call is inside next [Obsolete] method or type.
10261 * expression.cs: Use TestObsoleteMethodUsage member.
10263 2004-09-14 Martin Baulig <martin@ximian.com>
10265 * cs-parser.jay: Sync a bit with the GMCS version.
10267 2004-09-14 Martin Baulig <martin@ximian.com>
10269 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
10270 (CSharpParser.yacc_verbose_flag): New public field.
10272 * genericparser.cs: Removed.
10274 2004-09-14 Raja R Harinath <rharinath@novell.com>
10276 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
10278 2004-09-13 Marek Safar <marek.safar@seznam.cz>
10280 * class.cs (MethodCore.CheckBase): Fix bug #65757.
10282 2004-09-10 Martin Baulig <martin@ximian.com>
10284 Backported my MemberName changes from GMCS into MCS.
10286 - we are now using a special `MemberName' class instead of using
10287 strings; in GMCS, the `MemberName' also contains the type
10290 - changed the grammar rules a bit:
10291 * the old `member_name' is now a `namespace_or_type_name':
10292 The rule is that we use `namespace_or_type_name' everywhere
10293 where we expect either a "member name" (GetEnumerator) or a
10294 "member name" with an explicit interface name
10295 (IEnumerable.GetEnumerator).
10296 In GMCS, the explicit interface name may include type arguments
10297 (IEnumerable<T>.GetEnumerator).
10298 * we use `member_name' instead of just `IDENTIFIER' for
10300 The rule is that we use `member_name' wherever a member may
10301 have type parameters in GMCS.
10303 * decl.cs (MemberName): New public class.
10304 (MemberCore.MemberName): New public readonly field.
10305 (MemberCore.ctor): Take a `MemberName' argument, not a string.
10306 (DeclSpace): Likewise.
10308 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
10309 * enum.cs (Enum.ctor): Likewise.
10311 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
10313 (AliasEntry.ctor): Take a MemberName, not an Expression.
10314 (AliasEntry.UsingAlias): Likewise.
10316 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
10317 (IMethodData.MemberName): Changed type from string to MemberName.
10318 (MemberBase.ExplicitInterfaceName): Likewise.
10319 (AbstractPropertyEventMethod.SetupName): Make this private.
10320 (AbstractPropertyEventMethod.ctor): Added `string prefix'
10321 argument; compute the member name here.
10322 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
10323 on the `member.MemberName' and the `prefix'.
10325 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
10327 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
10328 thus, we get a `MemberName' instead of a `string'. These
10329 declarations may have type parameters in GMCS.
10330 (interface_method_declaration, delegate_declaration): Likewise.
10331 (class_declaration, interface_declaration): Likewise.
10332 (method_header): Use `namespace_or_type_name' instead of
10333 `member_name'. We may be an explicit interface implementation.
10334 (property_declaration, event_declaration): Likewise.
10335 (member_name): This is now just an `IDENTIFIER', not a
10336 `namespace_or_type_name'.
10337 (type_name, interface_type): Removed.
10338 (namespace_or_type_name): Return a MemberName, not an Expression.
10339 (primary_expression): Use `member_name' instead of `IDENTIFIER';
10340 call GetTypeExpression() on the MemberName to get an expression.
10341 (IndexerDeclaration.interface_type): Changed type from string to
10343 (MakeName): Operate on MemberName's instead of string's.
10345 2004-09-13 Raja R Harinath <rharinath@novell.com>
10348 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
10349 (NamespaceEntry.Lookup): Add new argument to flag if we want the
10350 lookup to avoid symbols introduced by 'using'.
10351 * rootcontext.cs (NamespaceLookup): Update.
10353 2004-09-12 Marek Safar <marek.safar@seznam.cz>
10355 * class.cs (TypeContainer.DoDefineMembers): Do not call
10356 DefineDefaultConstructor for static classes.
10358 2004-09-12 Marek Safar <marek.safar@seznam.cz>
10360 * attribute.cs (Attribute.Resolve): Add error 653 report.
10362 * class.cs (Class.ApplyAttributeBuilder): Add error 641
10364 (Method.ApplyAttributeBuilder): Add error 685 report.
10365 (Operator.Define): Add error 564 report.
10367 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
10369 * expression.cs (Invocation.DoResolve): Add error
10370 245 and 250 report.
10372 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
10375 2004-09-11 Marek Safar <marek.safar@seznam.cz>
10377 * class.cs (ConstructorInitializer.Resolve):
10378 Wrong error number (515->516).
10380 2004-09-11 Marek Safar <marek.safar@seznam.cz>
10382 * class.cs (Indexer.Define): Add error 631 report.
10384 2004-09-11 Marek Safar <marek.safar@seznam.cz>
10386 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
10388 2004-09-11 Marek Safar <marek.safar@seznam.cz>
10390 * expression.cs (Probe.DoResolve): Add error CS0241 report.
10392 2004-09-10 Marek Safar <marek.safar@seznam.cz>
10394 * cs-parser.jay: Added error CS0241 report.
10396 2004-09-10 Raja R Harinath <rharinath@novell.com>
10398 * cs-parser.jay (fixed_statement): Introduce a scope for the
10399 declaration in the 'fixed' statement.
10401 2004-09-09 Marek Safar <marek.safar@seznam.cz>
10403 * cs-parser.jay: Added CS0230 error report.
10405 2004-09-09 Marek Safar <marek.safar@seznam.cz>
10407 * cs-parser.jay: Added errors CS0231 and CS0257 report.
10409 2004-09-09 Marek Safar <marek.safar@seznam.cz>
10411 * expression.cs (Argument.Resolve): Added error CS0192 and
10414 2004-09-09 Marek Safar <marek.safar@seznam.cz>
10416 C# 2.0 #pragma warning feature
10418 * cs-tokenizer.cs (PreProcessPragma): New method;
10419 Handles #pragma directive.
10421 * report.cs (WarningRegions): New class; Support
10422 class for #pragma warning directive. It tests whether
10423 warning is enabled for a given line.
10425 2004-09-08 Miguel de Icaza <miguel@ximian.com>
10427 * const.cs: Add more descriptive error report, tahnks to
10430 2004-09-08 Marek Safar <marek.safar@seznam.cz>
10432 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
10434 2004-09-07 Miguel de Icaza <miguel@ximian.com>
10436 * expression.cs: Apply patch from Ben: Remove dead code from
10437 ArrayCreation, and remove the TurnintoConstant call in const.cs,
10438 as that code just threw an exception anwyays.
10440 * const.cs: Remove the call to the turnintoconstant, for details
10443 * literal.cs: The type of the null-literal is the null type; So
10444 we use a placeholder type (literal.cs:System.Null, defined here)
10447 * expression.cs (Conditional.DoResolve): Remove some old code that
10448 is no longer needed, conversions have been fixed.
10450 (ArrayCreationExpression.DoResolve): Return false if we fail to
10451 resolve the inner expression.
10453 2004-09-07 Raja R Harinath <rharinath@novell.com>
10456 * cs-parser.jay (delegate_declaration): Record a delegate
10457 declaration as a type declaration.
10458 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
10460 2004-09-06 Miguel de Icaza <miguel@ximian.com>
10462 * parameter.cs: Do not crash if the type can not be resolved.
10464 * expression.cs: Report errors with unsafe pointers, fixes #64896
10466 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
10468 * expression.cs: Pointer arith always needs to do a conv.i
10469 if the operand is a long. fix 65320
10471 2004-09-04 Marek Safar <marek.safar@seznam.cz>
10473 Fixed cs0619-37.cs, cs0619-38.cs
10475 * enum.cs (GetObsoleteAttribute): Removed.
10477 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
10478 on Enum member is double staged. The first is tested member
10481 2004-09-04 Marek Safar <marek.safar@seznam.cz>
10483 Fixed #56986, #63631, #65231
10485 * class.cs: (TypeContainer.AddToMemberContainer): New method,
10486 adds member to name container.
10487 (TypeContainer.AddToTypeContainer): New method, adds type to
10489 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
10490 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
10491 AddOperator): Simplified by reusing AddToMemberContainer.
10492 (TypeContainer.UserDefinedStaticConstructor): Changed to property
10494 (Method.CheckForDuplications): Fixed implementation to test all
10496 (MemberBase): Detection whether member is explicit interface
10497 implementation is now in constructor.
10498 (MemberBase.UpdateMemberName): Handles IndexerName.
10499 (Accessor): Changed to keep also location information.
10500 (AbstractPropertyEventMethod): Is derived from MemberCore.
10501 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
10502 will be emited or not.
10503 (PropertyBase.AreAccessorsDuplicateImplementation):
10504 Tests whether accessors are not in collision with some method.
10505 (Operator): Is derived from MethodCore to simplify common
10508 * decl.cs (Flags.TestMethodDuplication): Test for duplication
10510 (DeclSpace.AddToContainer): Adds the member to defined_names
10511 table. It tests for duplications and enclosing name conflicts.
10513 * enum.cs (EnumMember): Clean up to reuse the base structures
10515 2004-09-03 Martin Baulig <martin@ximian.com>
10517 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
10518 into TypeContainer, to make partial classes work again.
10520 2004-09-03 Martin Baulig <martin@ximian.com>
10522 * rootcontext.cs (RootContext.V2): Removed.
10524 2004-03-23 Martin Baulig <martin@ximian.com>
10526 * expression.cs (Invocation.OverloadResolve): Added `bool
10527 may_fail' argument and use it instead of the Location.IsNull() hack.
10529 2004-09-03 Martin Baulig <martin@ximian.com>
10531 Merged latest changes into gmcs. Please keep this comment in
10532 here, it makes it easier for me to see what changed in MCS since
10533 the last time I merged.
10535 2004-09-03 Raja R Harinath <rharinath@novell.com>
10538 * expression.cs (BetterConversion): Don't allow either conversion
10539 to be null. Remove redundant implicit conversion test when 'q ==
10540 null' -- when this function is invoked, we already know that the
10541 implicit conversion exists.
10542 (BetterFunction): Assume that 'best' is non-null. Remove
10543 redundant reimplementation of IsApplicable when 'best' is null.
10544 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
10545 number of arguments.
10546 (IsAncestralType): Extract from OverloadResolve.
10547 (OverloadResolve): Make robust to the MethodGroupExpr being
10548 unsorted. Implement all the logic of Section 14.5.5.1, and
10549 support overloading of methods from multiple applicable types.
10550 Clean up logic somewhat. Don't pass null methods to BetterFunction.
10552 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
10553 (RealError, Warning): Append type of report to related symbol.
10555 2004-09-03 Marek Safar <marek.safar@seznam.cz>
10557 * enum.cs: Fixed CLS-Compliance checks for enum members.
10558 Error tests cs3008-8.cs, cs3014-8.cs
10560 2004-09-02 Marek Safar <marek.safar@seznam.cz>
10562 Fixed bug #62342, #63102
10563 * class.cs: ImplementIndexer uses member.IsExplicitImpl
10564 like ImplementMethod.
10566 2004-09-02 Marek Safar <marek.safar@seznam.cz>
10568 * attribute.cs (Attribute.GetAttributeArgumentExpression):
10571 2004-09-02 Martin Baulig <martin@ximian.com>
10573 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
10574 TypeManager.GetArgumentTypes() rather than calling GetParameters()
10577 2004-09-01 Marek Safar <marek.safar@seznam.cz>
10579 C# 2.0 Static classes implemented
10581 * class.cs (TypeContainer): instance_constructors,
10582 initialized_fields, initialized_static_fields,
10583 default_constructor, base_inteface_types are protected to be
10584 accessible from StaticClass.
10585 (TypeContainer.DefineDefaultConstructor): New virtual method
10586 for custom default constructor generating
10587 (StaticClass): New class to handle "Static classes" feature.
10589 * cs-parser.jay: Handle static keyword on class like instance
10592 * driver.cs: Added "/langversion" command line switch with two
10593 options (iso-1, default).
10595 2004-08-31 Marek Safar <marek.safar@seznam.cz>
10597 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
10599 2004-08-31 Miguel de Icaza <miguel@ximian.com>
10601 * delegate.cs: Style.
10603 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
10605 * delegate.cs: Add seperate instance expr field for miguel.
10607 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
10609 * PointerArithmetic (Resolve): make sure we are not doing
10610 pointer arith on void*. Also, make sure we are resolved
10611 by not setting eclass until resolve.
10613 All callers: Make sure that PointerArithmetic gets resolved.
10615 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
10617 * ArrayCreation (LookupType): If the type does not resolve
10618 to an array, give an error.
10620 2004-08-27 Marek Safar <marek.safar@seznam.cz>
10622 * statement.cs (Try.Resolve): Fixed bug #64222
10624 2004-08-27 Martin Baulig <martin@ximian.com>
10627 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
10630 2004-08-26 Marek Safar <marek.safar@seznam.cz>
10632 * ecore.cs (Constantify): Get underlying type via
10633 System.Enum.GetUnderlyingType to avoid StackOverflow on the
10634 Windows in special cases.
10636 2004-08-26 Marek Safar <marek.safar@seznam.cz>
10638 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
10639 for obtaining also private methods.
10640 (GetRemoveMethod): Used GetRemoveMethod (true)
10641 for obtaining also private methods.
10643 2004-08-24 Martin Baulig <martin@ximian.com>
10645 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
10646 MethodAttributes.HideBySig for operators.
10648 2004-08-23 Martin Baulig <martin@ximian.com>
10650 Back to the old error reporting system :-)
10652 * report.cs (Message): Removed.
10653 (Report.MessageData, ErrorData, WarningData): Removed.
10654 (Report.Error, Warning): Back to the old system.
10656 2004-08-23 Martin Baulig <martin@ximian.com>
10658 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
10660 * class.cs (TypeContainer.ParentContainer): New public virtual
10661 method; replaces the explicit interface implementation.
10662 (ClassPart.ParentContainer): Override.
10664 2004-08-23 Martin Baulig <martin@ximian.com>
10666 * statement.cs (Switch): Added support for constant switches; see
10667 #59428 or test-285.cs.
10669 2004-08-22 Marek Safar <marek.safar@seznam.cz>
10672 * statement.cs (GetEnumeratorFilter): Removed useless
10673 logic because C# specs is strict. GetEnumerator must be
10676 2004-08-22 Martin Baulig <martin@ximian.com>
10678 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
10679 a switch and may break, reset the barrier. Fixes #59867.
10681 2004-08-22 Marek Safar <marek.safar@seznam.cz>
10683 CLS-Compliance speed up (~5% for corlib)
10685 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
10686 New method. Tests container for CLS-Compliant names
10688 * class.cs (TypeContainer.VerifyClsName): New method.
10689 Checks whether container name is CLS Compliant.
10690 (Constructor): Implements IMethodData.
10692 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
10693 low-case table for CLS Compliance test.
10694 (MemberCache.VerifyClsParameterConflict): New method.
10695 Checks method parameters for CS3006 error.
10697 * enum.cs (EnumMember): Is derived from MemberCore.
10698 (Enum.VerifyClsName): Optimized for better performance.
10700 2004-08-06 Marek Safar <marek.safar@seznam.cz>
10702 * report.cs: Renamed Error_T to Error and changed all
10705 2004-08-06 Marek Safar <marek.safar@seznam.cz>
10707 * class.cs (TypeContainer.IndexerArrayList): New inner class
10708 container for indexers.
10709 (TypeContainer.DefaultIndexerName): New constant for default
10710 indexer name. Replaced all "Item" with this constant.
10711 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
10713 * typemanager.cs (TypeManager.default_member_ctor): Cache here
10714 DefaultMemberAttribute constructor.
10716 2004-08-05 Martin Baulig <martin@ximian.com>
10718 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
10721 2004-08-05 Marek Safar <marek.safar@seznam.cz>
10723 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
10724 multi platforms problem.
10726 * compiler.csproj: Included shared files.
10728 2004-08-04 Marek Safar <marek.safar@seznam.cz>
10730 Fix bug 60333, 55971 in the more general way
10731 * attribute.cs (Attribute.GetAttributeArgumentExpression):
10732 Added arg_type argument for constant conversion.
10733 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
10735 2004-08-04 Marek Safar <marek.safar@seznam.cz>
10738 * class.cs (TypeContainer ): New inner classes MethodArrayList,
10739 OperatorArrayList, MethodCoreArrayList for typecontainer
10740 containers. Changed class member types to these new types.
10741 (MethodArrayList.DefineMembers): Added test for CS0659.
10743 2004-08-04 Miguel de Icaza <miguel@ximian.com>
10745 * cfold.cs: Synchronize the folding with the code in expression.cs
10746 Binary.DoNumericPromotions for uint operands.
10748 * attribute.cs: Revert patch from Raja, it introduced a regression
10749 while building Blam-1.2.1 (hard to isolate a test case).
10751 2004-08-04 Marek Safar <marek.safar@seznam.cz>
10755 (TypeContainer.Define): Renamed to DefineContainerMembers because of
10757 (MethodCore.parent_method): New member. The method we're overriding
10758 if this is an override method.
10759 (MethodCore.CheckBase): Moved from Method class and made common.
10760 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
10762 (MethodCore.CheckForDuplications): New abstract method. For custom
10763 member duplication search in a container
10764 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
10765 method and its return type.
10766 (Event.conflict_symbol): New member. Symbol with same name in the
10770 (MemberCache.FindMemberWithSameName): New method. The method
10771 is looking for conflict with inherited symbols.
10773 2004-08-04 Martin Baulig <martin@ximian.com>
10775 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
10777 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
10779 2004-08-03 Marek Safar <marek.safar@seznam.cz>
10781 * report.cs (Message): New enum for better error, warning reference in
10783 (MessageData): New inner abstract class. It generally handles printing of
10784 error and warning messages.
10785 Removed unused Error, Warning, Message methods.
10787 2004-08-03 Marek Safar <marek.safar@seznam.cz>
10789 Fix for cs0592-8.cs test
10791 (Attributable.ValidAttributeTargets): Made public.
10792 (Attribute.ExplicitTarget): New member for explicit target value.
10793 (Attribute.CheckTargets): Now we translate explicit attribute
10794 target to Target here.
10796 2004-08-03 Ben Maurer <bmaurer@ximian.com>
10798 * ecore.cs (MethodGroupExpr): new IsBase property.
10800 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
10802 * delegate.cs (DelegateCreation): store a MethodGroupExpr
10803 rather than an instance expr.
10805 (DelegateCreation.Emit): Use the method group rather than
10806 the instance expression. Also, if you have base.Foo as the
10807 method for a delegate, make sure to emit ldftn, not ldftnvirt.
10809 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
10811 (NewDelegate.DoResolve): Only check for the existance of Invoke
10812 if the method is going to be needed. Use MethodGroupExpr.
10814 (NewDelegate.Emit): Remove, DelegateCreation implements this.
10816 * expression.cs: For pointer arith., make sure to use
10817 the size of the type, not the size of the pointer to
10820 2004-08-03 Marek Safar <marek.safar@seznam.cz>
10823 * class.cs (Class): Added error CS0502 test.
10825 2004-08-03 John Luke <jluke@cfl.rr.com>
10826 Raja R Harinath <rharinath@novell.com>
10829 * attribute.cs (Attribute.complained_before): New flag.
10830 (Attribute.ResolveType, Attribute.Resolve),
10831 (Attribute.DefinePInvokeMethod): Set it.
10832 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
10834 2004-08-03 Martin Baulig <martin@ximian.com>
10836 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
10837 use a user-defined operator; we still need to do numeric
10838 promotions in case one argument is a builtin type and the other
10839 one has an implicit conversion to that type. Fixes #62322.
10841 2004-08-02 Martin Baulig <martin@ximian.com>
10843 * statement.cs (LocalInfo.Flags): Added `IsThis'.
10844 (LocalInfo.IsThis): New public property.
10845 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
10847 2004-08-01 Martin Baulig <martin@ximian.com>
10849 * class.cs (TypeContainer.GetClassBases): Don't set the default
10850 here since we may get called from GetPartialBases().
10851 (TypeContainer.DefineType): If GetClassBases() didn't return a
10852 parent, use the default one.
10854 2004-07-30 Duncan Mak <duncan@ximian.com>
10856 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
10858 2004-07-30 Martin Baulig <martin@ximian.com>
10860 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
10862 * class.cs (SourceMethod): New public class, derive from the
10863 symbol writer's ISourceMethod.
10864 (Method): Use the new symbol writer API.
10866 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
10867 as argument and use the new symbol writer.
10870 (SourceFile): Implement the symbol writer's ISourceFile.
10871 (Location.SymbolDocument): Removed.
10872 (Location.SourceFile): New public property.
10874 * symbolwriter.cs: Use the new symbol writer API.
10876 2004-07-30 Raja R Harinath <rharinath@novell.com>
10878 * Makefile (install-local): Remove. Functionality moved to
10881 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
10883 * Makefile: Install mcs.exe.config file together with mcs.exe.
10884 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
10885 correct runtime version.
10887 2004-07-25 Martin Baulig <martin@ximian.com>
10890 (TypeContainer.RegisterOrder): Removed, this was unused.
10891 (TypeContainer, interface_order): Removed.
10892 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
10893 TypeContainer as argument since we can also be called with a
10894 `PartialContainer' for a partial class/struct/interface.
10895 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
10896 of checking whether we're an `Interface' - we could be a
10897 `PartialContainer'.
10898 (PartialContainer.Register): Override; call
10899 AddClass()/AddStruct()/AddInterface() on our parent.
10901 * cs-parser.jay (interface_member_declaration): Add things to the
10902 `current_container', not the `current_class'.
10904 * rootcontext.cs (RegisterOrder): The overloaded version which
10905 takes an `Interface' was unused, removed.
10907 * typemanager.cs (TypeManager.LookupInterface): Return a
10908 `TypeContainer', not an `Interface'.
10909 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
10910 contain a `PartialContainer' for an interface, so check it's
10911 `Kind' to figure out what it is.
10913 2004-07-25 Martin Baulig <martin@ximian.com>
10915 * class.cs (Class.DefaultTypeAttributes): New public constant.
10916 (Struct.DefaultTypeAttributes): Likewise.
10917 (Interface.DefaultTypeAttributes): Likewise.
10918 (PartialContainer.TypeAttr): Override this and add the
10919 DefaultTypeAttributes.
10921 2004-07-25 Martin Baulig <martin@ximian.com>
10923 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
10924 we can just use the `Parent' field instead.
10926 2004-07-25 Martin Baulig <martin@ximian.com>
10928 * class.cs (TypeContainer.Emit): Renamed to EmitType().
10930 2004-07-25 Martin Baulig <martin@ximian.com>
10932 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
10933 our parts before defining any methods.
10934 (TypeContainer.VerifyImplements): Make this virtual.
10935 (ClassPart.VerifyImplements): Override and call VerifyImplements()
10936 on our PartialContainer.
10938 2004-07-25 Martin Baulig <martin@ximian.com>
10940 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
10942 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
10943 argument, we can just use the `Parent' field instead.
10946 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
10947 (MemberBase.DoDefine): Likewise.
10949 2004-07-24 Martin Baulig <martin@ximian.com>
10951 * decl.cs (MemberCore.Parent): New public field.
10952 (DeclSpace.Parent): Moved to MemberCore.
10954 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
10955 (MemberBase.ctor): Added TypeContainer argument, pass it to our
10957 (FieldBase, Field, Operator): Likewise.
10958 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
10959 (EventField, Event): Likewise.
10961 2004-07-23 Martin Baulig <martin@ximian.com>
10963 * class.cs (PartialContainer): New public class.
10964 (ClassPart): New public class.
10965 (TypeContainer): Added support for partial classes.
10966 (TypeContainer.GetClassBases): Splitted some of the functionality
10967 out into GetNormalBases() and GetPartialBases().
10969 * cs-tokenizer.cs (Token.PARTIAL): New token.
10970 (Tokenizer.consume_identifier): Added some hacks to recognize
10971 `partial', but only if it's immediately followed by `class',
10972 `struct' or `interface'.
10974 * cs-parser.jay: Added support for partial clases.
10976 2004-07-23 Martin Baulig <martin@ximian.com>
10978 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
10979 a `DeclSpace' and also made it readonly.
10980 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
10981 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
10982 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
10984 * cs-parser.jay: Pass the `current_class', not the
10985 `current_container' (at the moment, this is still the same thing)
10986 to a new Method, Property, Event, Indexer or Constructor.
10988 2004-07-23 Martin Baulig <martin@ximian.com>
10990 * cs-parser.jay (CSharpParser): Added a new `current_class' field
10991 and removed the `current_interface' one.
10992 (struct_declaration, class_declaration, interface_declaration):
10993 Set `current_class' to the newly created class/struct/interface;
10994 set their `Bases' and call Register() before parsing their body.
10996 2004-07-23 Martin Baulig <martin@ximian.com>
10998 * class.cs (Kind): New public enum.
10999 (TypeContainer): Made this class abstract.
11000 (TypeContainer.Kind): New public readonly field.
11001 (TypeContainer.CheckDef): New public method; moved here from
11003 (TypeContainer.Register): New public abstract method.
11004 (TypeContainer.GetPendingImplementations): New public abstract
11006 (TypeContainer.GetClassBases): Removed the `is_class' and
11007 `is_iface' parameters.
11008 (TypeContainer.DefineNestedTypes): Formerly known as
11010 (ClassOrStruct): Made this class abstract.
11012 * tree.cs (RootTypes): New public type.
11014 2004-07-20 Martin Baulig <martin@ximian.com>
11016 * tree.cs (Tree.RecordNamespace): Removed.
11017 (Tree.Namespaces): Removed.
11019 * rootcontext.cs (RootContext.IsNamespace): Removed.
11021 * cs-parser.jay (namespace_declaration): Just create a new
11022 NamespaceEntry here.
11024 2004-07-20 Martin Baulig <martin@ximian.com>
11026 * statement.cs (ExceptionStatement): New abstract class. This is
11027 now used as a base class for everyone who's using `finally'.
11028 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
11029 our local variables before using them.
11031 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
11032 virtual method. This is used by Yield.Resolve() to "steal" an
11033 outer block's `finally' clauses.
11034 (FlowBranchingException): The .ctor now takes an ExceptionStatement
11037 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
11038 version which takes an ExceptionStatement. This version must be
11039 used to create exception branchings.
11042 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
11043 (Iterator.EmitMoveNext): Added exception support; protect the
11044 block with a `fault' clause, properly handle 'finally' clauses.
11045 (Iterator.EmitDispose): Run all the `finally' clauses here.
11047 2004-07-20 Martin Baulig <martin@ximian.com>
11049 * iterator.cs: This is the first of a set of changes in the
11050 iterator code. Match the spec more closely: if we're an
11051 IEnumerable, then GetEnumerator() must be called. The first time
11052 GetEnumerator() is called, it returns the current instance; all
11053 subsequent invocations (if any) must create a copy.
11055 2004-07-19 Miguel de Icaza <miguel@ximian.com>
11057 * expression.cs: Resolve the constant expression before returning
11060 2004-07-19 Martin Baulig <martin@ximian.com>
11062 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
11063 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
11064 the return type of the new EmitContext.
11066 2004-07-18 Martin Baulig <martin@ximian.com>
11068 * class.cs (Property.Define): Fix iterators.
11070 * iterators.cs (Iterator.Define): Moved the
11071 `container.AddInterator (this)' call here from the .ctor; only do
11072 it if we resolved successfully.
11074 2004-07-17 Miguel de Icaza <miguel@ximian.com>
11076 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
11077 `true' for preprocessing directives that we parse. The return
11078 value indicates whether we should return to regular tokenizing or
11079 not, not whether it was parsed successfully.
11081 In the past if we were in: #if false ... #line #endif, we would
11082 resume parsing after `#line'. See bug 61604.
11084 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
11085 building: IsEnumType should return true only for enums, not for
11086 enums or System.Enum itself. This fixes #61593.
11088 Likely what happened is that corlib was wrong: mcs depended on
11089 this bug in some places. The bug got fixed, we had to add the
11090 hack, which caused bug 61593.
11092 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
11093 that was a workaround for the older conditions.
11095 2004-07-16 Ben Maurer <bmaurer@ximian.com>
11097 * assign.cs: IAssignMethod has a new interface, as documented
11098 inline. All assignment code now uses this new api.
11100 * ecore.cs, expression.cs: All classes which implement
11101 IAssignMethod now use the new interface.
11103 * expression.cs (Invocation): add a hack to EmitCall so that
11104 IndexerAccess can be the target of a compound assignment without
11105 evaluating its arguments twice.
11107 * statement.cs: Handle changes in Invocation api.
11109 2004-07-16 Martin Baulig <martin@ximian.com>
11111 * iterators.cs: Rewrote this. We're now using one single Proxy
11112 class for both the IEnumerable and the IEnumerator interface and
11113 `Iterator' derives from Class so we can use the high-level API.
11115 * class.cs (TypeContainer.AddIterator): New method.
11116 (TypeContainer.DoDefineType): New protected virtual method, which
11117 is called from DefineType().
11118 (TypeContainer.DoDefineMembers): Call DefineType() and
11119 DefineMembers() on all our iterators.
11120 (TypeContainer.Emit): Call Emit() on all our iterators.
11121 (TypeContainer.CloseType): Call CloseType() on all our iterators.
11123 * codegen.cs (EmitContext.CurrentIterator): New public field.
11125 2004-07-15 Martin Baulig <martin@ximian.com>
11128 (TypeManager.not_supported_exception_type): New type.
11130 2004-07-14 Martin Baulig <martin@ximian.com>
11132 * iterators.cs: Use real error numbers.
11134 2004-07-14 Martin Baulig <martin@ximian.com>
11136 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
11137 requires this to be a System.Collection.IEnumerable and not a
11138 class implementing that interface.
11139 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
11141 2004-07-13 Marek Safar <marek.safar@seznam.cz>
11143 * class.cs: Fixed previous fix, it broke some error tests.
11145 2004-07-12 Martin Baulig <martin@ximian.com>
11147 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
11150 2004-07-09 Miguel de Icaza <miguel@ximian.com>
11152 * assign.cs (LocalTemporary): Add new argument: is_address,If
11153 `is_address' is true, then the value that we store is the address
11154 to the real value, and not the value itself.
11156 * ecore.cs (PropertyExpr): use the new local temporary
11157 stuff to allow us to handle X.Y += z (where X is a struct)
11159 2004-07-08 Martin Baulig <martin@ximian.com>
11161 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
11162 not always return, just like we're doing in Using.Resolve().
11164 2004-07-07 Miguel de Icaza <miguel@ximian.com>
11166 * cs-parser.jay (fixed_statement): flag this as Pinned.
11168 2004-07-06 Miguel de Icaza <miguel@ximian.com>
11170 * typemanager.cs (TypeManager): Removed MakePinned method, this
11171 mechanism is replaced with the .NET 2.x compatible mechanism of
11172 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
11174 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
11175 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
11176 `IsFixed' property which has a different meaning.
11178 2004-07-02 Raja R Harinath <rharinath@novell.com>
11180 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
11181 visible from inside a nested class, not just the names of the
11182 immediately enclosing class.
11183 Fix for bug #60730.
11185 2004-06-24 Raja R Harinath <rharinath@novell.com>
11187 * expression.cs (BetterConversion): Remove buggy special-case
11188 handling of "implicit constant expression conversions". At this
11189 point, we already know that the conversion is possible -- we're
11190 only checking to see which is better.
11192 2004-06-24 Marek Safar <marek.safar@seznam.cz>
11194 * cs-parser.jay: Added error CS0210 test.
11196 2004-06-24 Marek Safar <marek.safar@seznam.cz>
11198 * cs-parser.jay: Added error CS0134 test.
11200 2004-06-24 Marek Safar <marek.safar@seznam.cz>
11203 * cs-parser.jay: Added error CS0145 test.
11205 2004-06-24 Marek Safar <marek.safar@seznam.cz>
11207 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
11209 2004-06-23 Ben Maurer <bmaurer@ximian.com>
11211 * expression.cs (StackAlloc.Resolve): The argument may not
11212 be a constant; deal with this case.
11214 2004-06-23 Marek Safar <marek.safar@seznam.cz>
11216 * attribute.cs (IndexerName_GetIndexerName): Renamed to
11217 GetIndexerAttributeValue.
11218 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
11220 * class.cs (Indexer.Define): Added error tests for CS0415,
11223 2004-06-23 Miguel de Icaza <miguel@ximian.com>
11225 * attribute.cs (Attribute.Resolve): Keep field code in sync with
11228 2004-06-23 Martin Baulig <martin@ximian.com>
11230 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
11231 neither return nor throw, reset the barrier as well. Fixes #60457.
11233 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
11235 * class.cs : EventAttributes is now set to None by default.
11236 This fixes bug #60459.
11238 2004-06-18 Marek Safar <marek.safar@seznam.cz>
11241 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
11242 Don't throw exception but return null (it's sufficient now).
11244 2004-06-18 Marek Safar <marek.safar@seznam.cz>
11246 * typemanager.cs (GetArgumentTypes): Faster implementation.
11248 2004-06-18 Martin Baulig <martin@ximian.com>
11250 * attribute.cs (Attribute.Resolve): Check whether we're an
11251 EmptyCast which a Constant child. Fixes #60333.
11253 2004-06-17 Ben Maurer <bmaurer@ximian.com>
11255 * statement.cs (EmitCollectionForeach): Account for the fact that
11256 not all valuetypes are in areas which we can take the address of.
11257 For these variables, we store to a temporary variable. Also, make
11258 sure that we dont emit a `callvirt' on a valuetype method.
11260 2004-06-15 Marek Safar <marek.safar@seznam.cz>
11262 * expression.cs (StackAlloc.DoReSolve): Added test for
11263 negative parameter (CS0247).
11265 2004-06-15 Marek Safar <marek.safar@seznam.cz>
11268 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
11270 2004-06-15 Marek Safar <marek.safar@seznam.cz>
11273 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
11276 2004-06-14 Marek Safar <marek.safar@seznam.cz>
11278 Fix bug #58254 & cs1555.cs, cs1556.cs
11279 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
11281 2004-06-14 Marek Safar <marek.safar@seznam.cz>
11283 * cs-parser.jay: Added error CS1669 test for indexers.
11285 2004-06-11 Martin Baulig <martin@ximian.com>
11287 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
11288 call this twice: for params and varargs methods.
11290 2004-06-11 Marek Safar <marek.safar@seznam.cz>
11293 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
11295 2004-06-11 Marek Safar <marek.safar@seznam.cz>
11297 * attribute.cs (Attribute.GetValidTargets): Made public.
11300 (AbstractPropertyEventMethod): New class for better code sharing.
11301 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
11303 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
11305 2004-06-11 Raja R Harinath <rharinath@novell.com>
11308 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
11309 that the call to Resolve is part of a MemberAccess.
11310 (Expression.Resolve): Use it for SimpleName resolution.
11311 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
11312 Add 'intermediate' boolean argument.
11313 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
11314 error message when the SimpleName can be resolved ambiguously
11315 between an expression and a type.
11316 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
11318 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
11319 call on the left-side.
11321 2004-06-11 Marek Safar <marek.safar@seznam.cz>
11324 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
11326 2004-06-11 Marek Safar <marek.safar@seznam.cz>
11328 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
11330 2004-06-11 Martin Baulig <martin@ximian.com>
11332 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
11333 varargs methods if applicable.
11335 2004-06-11 Martin Baulig <martin@ximian.com>
11337 * expression.cs (Invocation.EmitCall): Don't use
11338 `method.CallingConvention == CallingConventions.VarArgs' since the
11339 method could also have `CallingConventions.HasThis'.
11341 2004-06-11 Marek Safar <marek.safar@seznam.cz>
11343 * class.cs (Event.GetSignatureForError): Implemented.
11344 Fixed crash in error test cs3010.cs
11346 2004-06-10 Miguel de Icaza <miguel@ximian.com>
11348 * cs-tokenizer.cs: Change the way we track __arglist to be
11349 consistent with the other keywords.
11351 2004-06-09 Miguel de Icaza <miguel@ximian.com>
11353 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
11356 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
11358 * codegen.cs: Check that all referenced assemblies have a strongname
11359 before strongnaming the compiled assembly. If not report error CS1577.
11360 Fix bug #56563. Patch by Jackson Harper.
11361 * typemanager.cs: Added a method to return all referenced assemblies.
11362 Fix bug #56563. Patch by Jackson Harper.
11364 2004-06-08 Marek Safar <marek.safar@seznam.cz>
11367 (Method.ApplyAttributeBuilder): Moved and added conditional
11368 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
11371 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
11373 2004-06-08 Marek Safar <marek.safar@seznam.cz>
11376 * class.cs: (EventField.attribute_targets): Changed default target.
11378 2004-06-08 Martin Baulig <martin@ximian.com>
11380 * expression.cs (Invocation.EmitCall): Enable varargs methods.
11382 2004-06-08 Martin Baulig <martin@ximian.com>
11384 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
11386 2004-06-07 Martin Baulig <martin@ximian.com>
11388 Added support for varargs methods.
11390 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
11393 * cs-parser.jay: Added support for `__arglist'.
11395 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
11397 * expression.cs (Argument.AType): Added `ArgList'.
11398 (Invocation): Added support for varargs methods.
11399 (ArglistAccess): New public class.
11400 (Arglist): New public class.
11402 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
11404 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
11405 a method's top-level block if the method has varargs.
11407 * support.cs (ReflectionParameters, InternalParameters): Added
11408 support for varargs methods.
11410 2004-06-07 Miguel de Icaza <miguel@ximian.com>
11412 * class.cs: Provide location in indexer error report.
11414 * driver.cs: Use standard names.
11416 * namespace.cs: Catch the use of using after a namespace has been
11417 declared also on using aliases.
11419 2004-06-03 Raja R Harinath <rharinath@novell.com>
11422 * typemanager.cs (closure_private_ok, closure_invocation_type)
11423 (closure_qualifier_type, closure_invocation_assembly)
11424 (FilterWithClosure): Move to ...
11425 (Closure): New internal nested class.
11426 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
11427 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
11428 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
11429 (MemberLookup, MemberLookupFailed): Use it.
11430 * expression.cs (New.DoResolve): Treat the lookup for the
11431 constructor as being qualified by the 'new'ed type.
11432 (Indexers.GetIndexersForTypeOrInterface): Update.
11434 2004-06-03 Marek Safar <marek.safar@seznam.cz>
11437 (GetConditionalAttributeValue): New method. Returns
11438 condition of ConditionalAttribute.
11439 (SearchMulti): New method. Returns all attributes of type 't'.
11440 Use it when attribute is AllowMultiple = true.
11441 (IsConditionalMethodExcluded): New method.
11444 (Method.IsExcluded): Implemented. Returns true if method has conditional
11445 attribute and the conditions is not defined (method is excluded).
11446 (IMethodData): Extended interface for ConditionalAttribute support.
11447 (PropertyMethod.IsExcluded): Implemented.
11450 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
11453 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
11456 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
11458 * expression.cs (ArrayCreationExpression): Make this just an
11459 `expression'. It can't be a statement, so the code here was
11462 2004-06-02 Marek Safar <marek.safar@seznam.cz>
11465 * typemanager.cs (GetFullNameSignature): New method for
11468 2004-06-02 Marek Safar <marek.safar@seznam.cz>
11471 * class.cs (MemberBase.GetSignatureForError): New virtual method.
11472 Use this method when MethodBuilder is null.
11473 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
11474 Added test for error CS0626 (MONO reports error for this situation).
11475 (IMethodData.GetSignatureForError): Extended interface.
11477 2004-06-01 Marek Safar <marek.safar@seznam.cz>
11480 (AttributeTester.GetObsoleteAttribute): Returns instance of
11481 ObsoleteAttribute when type is obsolete.
11484 (TypeContainer.VerifyObsoleteAttribute): Override.
11485 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
11486 (MethodCode.VerifyObsoleteAttribute): Override.
11487 (MemberBase.VerifyObsoleteAttribute): Override.
11490 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
11491 and report proper error.
11494 Delegate.VerifyObsoleteAttribute): Override.
11497 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
11498 and report proper error.
11499 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
11502 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
11506 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
11507 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
11508 Added test for ObsoleteAttribute.
11511 (Catch): Derived from Statement.
11513 2004-06-01 Marek Safar <marek.safar@seznam.cz>
11515 Fixed bug #59071 & cs0160.cs
11517 * statement.cs (Try.Resolve): Check here whether order of catch
11518 clauses matches their dependencies.
11520 2004-05-31 Miguel de Icaza <miguel@ximian.com>
11522 * Reverted patch to namespace.cs (Use lookuptypedirect). This
11523 caused a regression: #59343. Referencing nested classes from an
11524 assembly stopped working.
11526 2004-05-31 Martin Baulig <martin@ximian.com>
11528 MCS is now frozen for beta 2.
11530 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
11532 * convert.cs: add a trivial cache for overload operator resolution.
11534 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
11536 * decl.cs: If possible, use lookuptypedirect here. We can only do
11537 this if there is no `.' after the namespace. Avoids using
11538 LookupType, which does lots of slow processing.
11539 (FindNestedType) New method, does what it says :-).
11540 * namespace.cs: use LookupTypeDirect.
11541 * rootcontext.cs: use membercache, if possible.
11542 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
11544 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
11547 According to the spec,
11549 In a member access of the form E.I, if E is a single identifier,
11550 and if the meaning of E as a simple-name (§7.5.2) is a constant,
11551 field, property, localvariable, or parameter with the same type as
11552 the meaning of E as a type-name (§3.8), then both possible
11553 meanings of E are permitted.
11555 We did not check that E as a simple-name had the same type as E as
11558 This trivial check gives us 5-7% on bootstrap time.
11560 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
11562 * expression.cs (Invocation.OverloadResolve): Avoid the
11563 use of hashtables and boxing here by allocating on demand.
11565 2004-05-30 Martin Baulig <martin@ximian.com>
11567 * rootcontext.cs (RootContext.LookupType): Don't cache things if
11568 we're doing a silent lookup. Don't try to lookup nested types in
11569 TypeManager.object_type (thanks to Ben Maurer).
11571 2004-05-30 Martin Baulig <martin@ximian.com>
11573 Committing a patch from Ben Maurer.
11575 * rootcontext.cs (RootContext.LookupType): Cache negative results.
11577 2004-05-29 Martin Baulig <martin@ximian.com>
11579 * class.cs (IMethodData.ShouldIgnore): New method.
11581 * typemanager.cs (TypeManager.MethodFlags): Don't take a
11582 `Location' argument, we don't need it anywhere. Use
11583 `IMethodData.ShouldIgnore ()' instead of
11584 `MethodData.GetMethodFlags ()'.
11585 (TypeManager.AddMethod): Removed.
11586 (TypeManager.AddMethod2): Renamed to AddMethod.
11588 2004-05-29 Martin Baulig <martin@ximian.com>
11590 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
11592 * convert.cs (Convert.ImplicitReferenceConversion): If we're
11593 converting from a class type S to an interface type and we already
11594 have an object on the stack, don't box it again. Fixes #52578.
11596 2004-05-29 Martin Baulig <martin@ximian.com>
11598 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
11599 Added support for `params' parameters. Fixes #59267.
11601 2004-05-29 Martin Baulig <martin@ximian.com>
11603 * literal.cs (NullPointer): Provide a private .ctor which sets
11604 `type' to TypeManager.object_type. Fixes #59048.
11606 2004-05-29 Martin Baulig <martin@ximian.com>
11608 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
11609 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
11611 * ecore.cs (EventExpr.instance_expr): Make the field private.
11613 2004-05-26 Marek Safar <marek.safar@seznam.cz>
11615 Fixed bug #50080 & cs0214-2.cs
11616 * expression.cs (Cast.DoResolve): Check unsafe context here.
11618 * statement.cs (Resolve.DoResolve): Likewise.
11620 2004-05-26 Martin Baulig <martin@ximian.com>
11622 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
11624 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
11625 (RootContext.LookupType): Pass down the `silent' flag.
11627 2004-05-25 Martin Baulig <martin@ximian.com>
11630 (MethodGroupExpr.IdenticalTypeName): New public property.
11631 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
11632 expression actually refers to a type.
11634 2004-05-25 Martin Baulig <martin@ximian.com>
11636 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
11637 for #56176 and made it actually work.
11639 2004-05-25 Martin Baulig <martin@ximian.com>
11641 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
11642 (FieldExpr, PropertyExpr): Override and implement
11643 CacheTemporaries. Fixes #52279.
11645 2004-05-25 Miguel de Icaza <miguel@ximian.com>
11647 * location.cs: In the new compiler listing a file twice is a
11648 warning, not an error.
11650 2004-05-24 Martin Baulig <martin@ximian.com>
11652 * enum.cs (Enum.DefineType): For the `BaseType' to be a
11653 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
11655 2004-05-24 Martin Baulig <martin@ximian.com>
11657 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
11658 walking the `using' list. Fixes #53921.
11660 2004-05-24 Martin Baulig <martin@ximian.com>
11662 * const.cs (Const.LookupConstantValue): Added support for
11663 EmptyCast's; fixes #55251.
11665 2004-05-24 Martin Baulig <martin@ximian.com>
11667 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
11668 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
11669 which does the CS0135 check. The reason is that we first need to
11670 check whether the variable actually exists.
11672 2004-05-24 Martin Baulig <martin@ximian.com>
11674 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
11675 than RootContext.LookupType() to find the explicit interface
11676 type. Fixes #58584.
11678 2004-05-24 Raja R Harinath <rharinath@novell.com>
11680 * Makefile: Simplify. Use executable.make.
11681 * mcs.exe.sources: New file. List of sources of mcs.exe.
11683 2004-05-24 Anders Carlsson <andersca@gnome.org>
11687 Use the invariant culture when doing String.Compare for CLS case
11690 2004-05-23 Martin Baulig <martin@ximian.com>
11692 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
11693 don't have any dots. Fixes #52622, added cs0246-8.cs.
11695 * namespace.cs (NamespaceEntry.Lookup): Likewise.
11697 2004-05-23 Marek Safar <marek.safar@seznam.cz>
11699 * class.cs (MemberBase.Define): Reuse MemberType member for
11700 resolved type. Other methods can use it too.
11702 2004-05-23 Martin Baulig <martin@ximian.com>
11704 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
11705 the variable also exists in the current block (otherwise, we need
11706 to report a CS0103). Fixes #58670.
11708 2004-05-23 Martin Baulig <martin@ximian.com>
11710 * flowanalysis.cs (Reachability.Reachable): Compute this
11711 on-the-fly rather than storing it as a field.
11713 2004-05-23 Martin Baulig <martin@ximian.com>
11715 * flowanalysis.cs (Reachability.And): Manually compute the
11716 resulting `barrier' from the reachability.
11718 2004-05-23 Marek Safar <marek.safar@seznam.cz>
11721 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
11722 instance of ObsoleteAttribute when symbol is obsolete.
11725 (IMethodData): Extended interface for ObsoleteAttribute support.
11727 2004-05-22 Marek Safar <marek.safar@seznam.cz>
11729 * attribute.cs: Fix bug #55970
11731 2004-05-22 Marek Safar <marek.safar@seznam.cz>
11735 (GetObsoleteAttribute): New method. Creates the instance of
11737 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
11738 ObsoleteAttribute when member is obsolete.
11739 (AttributeTester.Report_ObsoleteMessage): Common method for
11740 Obsolete error/warning reporting.
11743 (TypeContainer.base_classs_type): New member for storing parent type.
11746 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
11747 for this MemberCore.
11749 2004-05-21 Marek Safar <marek.safar@seznam.cz>
11751 * attribute.cs, const.cs: Fix bug #58590
11753 2004-05-21 Martin Baulig <martin@ximian.com>
11755 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
11756 out parameters if the end of the method is unreachable. Fixes
11759 2004-05-21 Marek Safar <marek.safar@seznam.cz>
11761 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
11762 Hari was right, why extra method.
11764 2004-05-21 Marek Safar <marek.safar@seznam.cz>
11766 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
11768 2004-05-20 Martin Baulig <martin@ximian.com>
11770 Merged this back from gmcs to keep the differences to a minumum.
11772 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
11773 instead of a Declspace.
11774 (Attribute.ResolveType): Likewise.
11775 (Attributes.Search): Likewise.
11776 (Attributes.Contains): Likewise.
11777 (Attributes.GetClsCompliantAttribute): Likewise.
11779 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
11781 (MethodData.ApplyAttributes): Take an EmitContext instead of a
11784 2004-05-19 Marek Safar <marek.safar@seznam.cz>
11786 Fix bug #58688 (MCS does not report error when the same attribute
11789 * attribute.cs (Attribute.Emit): Distinction between null and default.
11791 2004-05-19 Raja R Harinath <rharinath@novell.com>
11793 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
11794 of a top-level attribute without an attribute target.
11795 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
11797 (Attribute.Conditional_GetConditionName),
11798 (Attribute.Obsolete_GetObsoleteMessage): Update.
11799 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
11800 part of ScanForIndexerName.
11801 (Attribute.CanIgnoreInvalidAttribute): New function.
11802 (Attribute.ScanForIndexerName): Move to ...
11803 (Attributes.ScanForIndexerName): ... here.
11804 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
11805 (Attributes.Search): New internal variant that can choose not to
11806 complain if types aren't resolved. The original signature now
11808 (Attributes.GetClsCompliantAttribute): Use internal variant, with
11809 complaints suppressed.
11810 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
11811 only if it not useful.
11812 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
11813 top-level for attributes that are shared between the assembly
11814 and a top-level class.
11815 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
11816 * class.cs: Update to reflect changes.
11817 (DefineIndexers): Fuse loops.
11818 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
11819 a couple more variants of attribute names.
11821 2004-05-18 Marek Safar <marek.safar@seznam.cz>
11823 Fix bug #52585 (Implemented explicit attribute declaration)
11826 (Attributable.ValidAttributeTargets): New abstract method. It gets
11827 list of valid attribute targets for explicit target declaration.
11828 (Attribute.Target): It holds target itself.
11829 (AttributeSection): Removed.
11830 (Attribute.CheckTargets): New method. It checks whether attribute
11831 target is valid for the current element.
11834 (EventProperty): New class. For events that are declared like
11835 property (with add and remove accessors).
11836 (EventField): New class. For events that are declared like field.
11839 * cs-parser.jay: Implemented explicit attribute target declaration.
11841 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
11842 Override ValidAttributeTargets.
11845 (ReturnParameter): Class for applying custom attributes on
11847 (ParameterAtribute): New class. Class for applying custom
11848 attributes on the parameter type.
11850 2004-05-17 Miguel de Icaza <miguel@ximian.com>
11852 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
11855 (Method): Allow UNSAFE here.
11857 * modifiers.cs: Support unsafe reporting.
11859 2004-05-17 Marek Safar <marek.safar@seznam.cz>
11861 * decl.cs: Fix bug #58478.
11863 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11865 * statement.cs: When checking for unreachable code on an EmptyStatement,
11866 set the location. Fixes bug #58488.
11868 2004-05-13 Miguel de Icaza <miguel@ximian.com>
11870 * driver.cs: Add -pkg handling.
11872 From Gonzalo: UseShelLExecute=false
11874 2004-05-12 Marek Safar <marek.safar@seznam.cz>
11877 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
11879 (Attribute.IsClsCompliaceRequired): Moved to base for better
11881 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
11882 when attribute is AttributeUsageAttribute.
11883 (Attribute.GetValidTargets): Simplified.
11884 (Attribute.GetAttributeUsage): New method returns AttributeUsage
11885 attribute for this type.
11886 (Attribute.ApplyAttributes): Method renamed to Emit and make
11888 (GlobalAttributeSection): New class for special handling of global
11889 attributes (assembly, module).
11890 (AttributeSection.Emit): New method.
11892 * class.cs: Implemented Attributable abstract methods.
11893 (MethodCore.LabelParameters): Moved to Parameter class.
11894 (Accessor): Is back simple class.
11895 (PropertyMethod): Implemented Attributable abstract class.
11896 (DelegateMethod): Implemented Attributable abstract class.
11897 (Event): New constructor for disctintion between normal Event
11898 and Event with accessors.
11900 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
11902 * codegen.cs, const.cs, decl.cs, delegate.cs:
11903 (CommonAssemblyModulClass): Implemented Attributable abstract class
11906 * enum.cs: Implement IAttributeSupport interface.
11907 (EnumMember): New class for emum members. Implemented Attributable
11911 (ParameterBase): Is abstract.
11912 (ReturnParameter): New class for easier [return:] attribute handling.
11914 * typemanager.cs: Removed builder_to_attr.
11916 2004-05-11 Raja R Harinath <rharinath@novell.com>
11919 * attribute.cs (Attribute.GetPositionalValue): New function.
11920 * class.cs (TypeContainer.VerifyMembers): New function.
11921 (TypeContainer.Emit): Use it.
11922 (ClassOrStruct): New base class for Class and Struct.
11923 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
11924 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
11926 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
11927 then each non-static field should have a FieldOffset attribute.
11928 Otherwise, none of the fields should have a FieldOffset attribute.
11929 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
11930 and FieldOffset attributes.
11931 * typemanager.cs (TypeManager.struct_layout_attribute_type)
11932 (TypeManager.field_offset_attribute_type): New core types.
11933 (TypeManager.InitCoreTypes): Initialize them.
11935 2004-05-11 Michal Moskal <malekith@pld-linux.org>
11937 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
11938 Return correct type.
11941 2004-05-09 Miguel de Icaza <miguel@ximian.com>
11943 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
11944 be implicitly converted to ulong.
11946 * expression.cs: The logic for allowing operator &, | and ^ worked
11947 was wrong, it worked before because we did not report an error in
11948 an else branch. Fixes 57895.
11950 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
11951 allow volatile fields to be reference types.
11953 2004-05-07 Miguel de Icaza <miguel@ximian.com>
11955 * driver.cs: Add support for /debug-
11957 2004-05-07 Raja R Harinath <rharinath@novell.com>
11959 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
11960 Add a 'complain' parameter to silence errors.
11961 (Attribute.Resolve): Update to changes. Put in sanity check to catch
11962 silently overlooked type-resolutions.
11963 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
11964 to reflect changes.
11965 (Attributes.Search): New function.
11966 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
11967 (Attributes.GetAttributeFullName): Remove hack.
11968 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
11969 Update to reflect changes.
11970 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
11971 Use Attributes.Search instead of nested loops.
11973 2004-05-07 Marek Safar <marek.safar@seznam.cz>
11976 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
11977 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
11978 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
11980 * report.cs: (Report.Warning): Renamed to Warning_T because of
11981 parameter collision.
11983 2004-05-05 Raja R Harinath <rharinath@novell.com>
11985 * expression.cs (MemberAccess.ResolveMemberAccess):
11986 Exit with non-zero status after Report.Error.
11987 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
11989 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
11991 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
11993 * support.cs: Don't hang when the file is empty.
11995 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
11997 * support.cs: In SeekableStreamReader, compute the preamble size of the
11998 underlying stream. Position changes should take into account that initial
12001 2004-05-03 Todd Berman <tberman@sevenl.net>
12003 * driver.cs: remove unused GetSysVersion function.
12005 2004-05-03 Todd Berman <tberman@sevenl.net>
12007 * driver.cs: Remove the hack from saturday, as well as the hack
12008 from jackson (LoadAssemblyFromGac), also adds the CWD to the
12009 link_paths to get that bit proper.
12011 2004-05-01 Todd Berman <tberman@sevenl.net>
12013 * driver.cs: Try a LoadFrom before a Load, this checks the current
12014 path. This is currently a bug in mono that is be fixed, however, this
12015 provides a workaround for now. This will be removed when the bug
12018 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
12020 * CryptoConvert.cs: Updated to latest version. Fix issue with
12021 incomplete key pairs (#57941).
12023 2004-05-01 Todd Berman <tberman@sevenl.net>
12025 * driver.cs: Remove '.' from path_chars, now System.* loads properly
12028 2004-04-30 Jackson Harper <jackson@ximian.com>
12030 * codegen.cs: Open keys readonly.
12032 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12034 * typemanager.cs: don't report cyclic struct layout when a struct
12035 contains 2 or more fields of the same type. Failed for Pango.AttrShape
12036 which has 2 Pango.Rectangle fields.
12038 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
12040 * expression.cs: Handle IntPtr comparisons with IL code
12041 rather than a method call.
12043 2004-04-29 Martin Baulig <martin@ximian.com>
12045 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
12046 the list of PropertyInfo's in class hierarchy and find the
12047 accessor. Fixes #56013.
12049 2004-04-29 Martin Baulig <martin@ximian.com>
12051 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
12053 2004-04-29 Martin Baulig <martin@ximian.com>
12055 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
12057 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
12059 2004-04-29 Martin Baulig <martin@ximian.com>
12061 * class.cs (ConstructorInitializer.Resolve): Check whether the
12062 parent .ctor is accessible. Fixes #52146.
12064 2004-04-29 Martin Baulig <martin@ximian.com>
12066 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
12068 * statement.cs (Using.EmitLocalVariableDecls): Use
12069 TypeManager.idisposable_type, not typeof (IDisposable).
12070 (Foreach.EmitCollectionForeach): Added support for valuetypes.
12072 2004-04-29 Martin Baulig <martin@ximian.com>
12074 * class.cs (Event.Define): Don't emit the field and don't set
12075 RTSpecialName and SpecialName for events on interfaces. Fixes
12078 2004-04-29 Raja R Harinath <rharinath@novell.com>
12080 Refactor Attribute.ApplyAttributes.
12081 * attribute.cs (Attributable): New base class for objects that can
12082 have Attributes applied on them.
12083 (Attribute): Make AttributeUsage fields public.
12084 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
12085 (Attribute.IsInternalCall): New property.
12086 (Attribute.UsageAttr): Convert to a public read-only property.
12087 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
12088 (Attribute.ResolveType, Attribute.Resolve)
12089 (Attribute.ScanForIndexerName): Update to reflect changes.
12090 (Attribute.CheckAttributeTarget): Re-format.
12091 (Attribute.ApplyAttributes): Refactor, to various
12092 Attributable.ApplyAttributeBuilder methods.
12093 * decl.cs (MemberCore): Make Attributable.
12094 * class.cs (Accessor): Make Attributable.
12095 (MethodData.ApplyAttributes): Use proper attribute types, not
12097 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
12098 (TypeContainer.ApplyAttributeBuilder)
12099 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
12100 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
12101 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
12102 (Operator.ApplyAttributeBuilder): New factored-out methods.
12103 * const.cs (Const.ApplyAttributeBuilder): Likewise.
12104 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
12105 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
12106 * parameter.cs (ParameterBase): New Attributable base class
12107 that can also represent Return types.
12108 (Parameter): Update to the changes.
12110 2004-04-29 Jackson Harper <jackson@ximian.com>
12112 * driver.cs: Prefer the corlib system version when looking for
12113 assemblies in the GAC. This is still a hack, but its a better hack
12116 2004-04-29 Marek Safar <marek.safar@seznam.cz>
12118 * decl.cs, enum.cs: Improved error 3005 reporting.
12120 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
12121 (related_symbols): New private member for list of symbols
12122 related to reported error/warning.
12124 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
12126 2004-04-29 Martin Baulig <martin@ximian.com>
12128 * ecore.cs (Expression.Constantify): If we're an enum and
12129 TypeManager.TypeToCoreType() doesn't give us another type, use
12130 t.UnderlyingSystemType. Fixes #56178.
12132 2004-04-29 Martin Baulig <martin@ximian.com>
12134 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
12135 interfaces and for each interface, only add members directly
12136 declared in that interface. Fixes #53255.
12138 2004-04-28 Martin Baulig <martin@ximian.com>
12140 * expression.cs (ConditionalLogicalOperator): Use a temporary
12141 variable for `left' to avoid that we evaluate it more than once;
12144 2004-04-28 Martin Baulig <martin@ximian.com>
12146 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
12149 2004-04-28 Martin Baulig <martin@ximian.com>
12151 * statement.cs (LocalInfo.Resolve): Check whether the type is not
12154 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
12155 whether the type is not void (CS1547).
12157 2004-04-28 Martin Baulig <martin@ximian.com>
12159 * expression.cs (Unary.DoResolveLValue): Override this and report
12160 CS0131 for anything but Operator.Indirection.
12162 2004-04-28 Martin Baulig <martin@ximian.com>
12164 Committing a patch from Ben Maurer; see bug #50820.
12166 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
12169 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
12172 2004-04-28 Martin Baulig <martin@ximian.com>
12174 Committing a patch from Ben Maurer; see bug #50820.
12176 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
12179 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
12182 2004-04-28 Martin Baulig <martin@ximian.com>
12184 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
12185 (Block.AddLabel): Call DoLookupLabel() to only search in the
12188 2004-04-28 Martin Baulig <martin@ximian.com>
12190 * cfold.cs (ConstantFold.BinaryFold): Added special support for
12191 comparing StringConstants and NullLiterals in Equality and Inequality.
12193 2004-04-28 Jackson Harper <jackson@ximian.com>
12195 * driver.cs: Attempt to load referenced assemblies from the
12196 GAC. This is the quick and dirty version of this method that
12197 doesnt take into account versions and just takes the first
12198 canidate found. Will be good enough for now as we will not have more
12199 then one version installed into the GAC until I update this method.
12201 2004-04-28 Martin Baulig <martin@ximian.com>
12203 * typemanager.cs (TypeManager.CheckStructCycles): New public
12204 static method to check for cycles in the struct layout.
12206 * rootcontext.cs (RootContext.PopulateTypes): Call
12207 TypeManager.CheckStructCycles() for each TypeContainer.
12208 [Note: We only need to visit each type once.]
12210 2004-04-28 Martin Baulig <martin@ximian.com>
12212 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
12214 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
12215 success and added `out object value'. Use a `bool resolved' field
12216 to check whether we've already been called rather than
12217 `ConstantValue != null' since this breaks for NullLiterals.
12219 2004-04-28 Raja R Harinath <rharinath@novell.com>
12221 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
12222 setting of this flag, since the 'set' method may be non-public.
12224 2004-04-28 Raja R Harinath <rharinath@novell.com>
12226 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
12227 check on current_vector.Block.
12229 2004-04-27 Martin Baulig <martin@ximian.com>
12231 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
12232 a field initializer. Fixes #56459.
12234 2004-04-27 Martin Baulig <martin@ximian.com>
12236 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
12237 we're not attempting to use an indexer. Fixes #52154.
12239 2004-04-27 Martin Baulig <martin@ximian.com>
12241 * statement.cs (Return): Don't create a return label if we don't
12242 need it; reverts my change from January 20th. Thanks to Ben
12245 2004-04-27 Martin Baulig <martin@ximian.com>
12247 According to the spec, `goto' can only leave a nested scope, but
12250 * statement.cs (Block.LookupLabel): Only lookup in the current
12251 block, don't recurse into parent or child blocks.
12252 (Block.AddLabel): Check in parent and child blocks, report
12253 CS0140/CS0158 if we find a duplicate.
12254 (Block): Removed this indexer for label lookups.
12255 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
12256 this already does the error reporting for us.
12259 (FlowBranching.UsageVector.Block): New public variable; may be null.
12260 (FlowBranching.CreateSibling): Added `Block' argument.
12261 (FlowBranching.LookupLabel): New public virtual method. Lookup a
12262 label for the target of a `goto' and check whether we're not
12263 leaving a `finally'.
12265 2004-04-27 Martin Baulig <martin@ximian.com>
12267 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
12268 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
12271 2004-04-27 Martin Baulig <martin@ximian.com>
12273 * statement.cs (Block.AddLabel): Also check for implicit blocks
12274 and added a CS0158 check.
12276 2004-04-27 Martin Baulig <martin@ximian.com>
12278 * flowanalysis.cs (FlowBranchingLoop): New class.
12279 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
12280 UsageVector's instead of an ArrayList.
12281 (FlowBranching.Label): Likewise.
12282 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
12283 (FlowBranching.AddBreakVector): New method.
12285 2004-04-27 Miguel de Icaza <miguel@ximian.com>
12287 * attribute.cs: Small regression fix: only convert the type if we
12288 the type is different, fixes System.Drawing build.
12290 2004-04-27 Martin Baulig <martin@ximian.com>
12292 * attribute.cs (Attribute.Resolve): If we have a constant value
12293 for a named field or property, implicity convert it to the correct
12296 2004-04-27 Raja R Harinath <rharinath@novell.com>
12298 * statement.cs (Block.Block): Implicit blocks share
12299 'child_variable_names' fields with parent blocks.
12300 (Block.AddChildVariableNames): Remove.
12301 (Block.AddVariable): Mark variable as "used by a child block" in
12302 every surrounding block.
12303 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
12304 been used in a child block, complain about violation of "Invariant
12305 meaning in blocks" rule.
12306 * cs-parser.jay (declare_local_variables): Don't use
12307 AddChildVariableNames.
12308 (foreach_statement): Don't create an implicit block: 'foreach'
12309 introduces a scope.
12311 2004-04-23 Miguel de Icaza <miguel@ximian.com>
12313 * convert.cs (ImplicitNumericConversion): 0 is also positive when
12314 converting from 0L to ulong. Fixes 57522.
12316 2004-04-22 Marek Safar <marek.safar@seznam.cz>
12318 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
12319 derived class hides via 'new' keyword field from base class (test-242.cs).
12320 TODO: Handle this in the more general way.
12322 * class.cs (CheckBase): Ditto.
12324 2004-04-22 Marek Safar <marek.safar@seznam.cz>
12326 * decl.cs (caching_flags): New member for storing cached values
12328 (MemberCore.Flags): New enum where bit flags for caching_flags
12330 (MemberCore.cls_compliance): Moved to caching_flags.
12331 (DeclSpace.Created): Moved to caching_flags.
12333 * class.cs: Use caching_flags instead of DeclSpace.Created
12335 2004-04-21 Miguel de Icaza <miguel@ximian.com>
12337 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
12338 if we are only a derived class, not a nested class.
12340 * typemanager.cs: Same as above, but do this at the MemberLookup
12341 level (used by field and methods, properties are handled in
12342 PropertyExpr). Allow for the qualified access if we are a nested
12345 2004-04-21 Marek Safar <marek.safar@seznam.cz>
12347 * class.cs: Refactoring.
12348 (IMethodData): New inteface; Holds links to parent members
12349 to avoid member duplication (reduced memory allocation).
12350 (Method): Implemented IMethodData interface.
12351 (PropertyBase): New inner classes for get/set methods.
12352 (PropertyBase.PropertyMethod): Implemented IMethodData interface
12353 (Event): New inner classes for add/remove methods.
12354 (Event.DelegateMethod): Implemented IMethodData interface.
12356 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
12357 EmitContext (related to class.cs refactoring).
12359 2004-04-21 Raja R Harinath <rharinath@novell.com>
12361 * delegate.cs (Delegate.VerifyApplicability): If the number of
12362 arguments are the same as the number of parameters, first try to
12363 verify applicability ignoring any 'params' modifier on the last
12367 2004-04-16 Raja R Harinath <rharinath@novell.com>
12369 * class.cs (TypeContainer.AddIndexer): Use
12370 'ExplicitInterfaceName' to determine if interface name was
12371 explicitly specified. 'InterfaceType' is not initialized at this time.
12372 (TypeContainer.DefineIndexers): Remove use of temporary list. The
12373 Indexers array is already in the required order. Initialize
12374 'IndexerName' only if there are normal indexers.
12375 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
12376 (TypeContainer.Emit): Emit DefaultMember attribute only if
12377 IndexerName is initialized.
12380 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
12382 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
12385 2004-04-15 Raja R Harinath <rharinath@novell.com>
12387 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
12391 * attribute.cs (Attribute.Resolve): Check for duplicate named
12395 2004-04-15 Miguel de Icaza <miguel@ximian.com>
12397 * iterators.cs (MarkYield): track whether we are in an exception,
12398 and generate code accordingly. Use a temporary value to store the
12399 result for our state.
12401 I had ignored a bit the interaction of try/catch with iterators
12402 since their behavior was not entirely obvious, but now it is
12403 possible to verify that our behavior is the same as MS .NET 2.0
12407 2004-04-14 Miguel de Icaza <miguel@ximian.com>
12409 * iterators.cs: Avoid creating temporaries if there is no work to
12412 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
12413 Enumerations, use TypeManager.EnumToUnderlying and call
12416 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
12419 (This.Emit): Use EmitContext.EmitThis to emit our
12422 (This.EmitAssign): Ditto.
12424 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
12425 codepaths, we will move all the functionality into
12428 (FieldExpr.EmitAssign): Ditto.
12430 This fixes several hidden bugs that I uncovered while doing a code
12431 review of this today.
12433 * codegen.cs (EmitThis): reworked so the semantics are more clear
12434 and also support value types "this" instances.
12436 * iterators.cs: Changed so that for iterators in value types, we
12437 do not pass the value type as a parameter.
12439 Initialization of the enumerator helpers is now done in the caller
12440 instead of passing the parameters to the constructors and having
12441 the constructor set the fields.
12443 The fields have now `assembly' visibility instead of private.
12445 2004-04-11 Miguel de Icaza <miguel@ximian.com>
12447 * expression.cs (Argument.Resolve): Check if fields passed as ref
12448 or out are contained in a MarshalByRefObject.
12450 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
12451 another compiler type.
12453 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
12455 * class.cs (Indexer.Define): use the new name checking method.
12456 Also, return false on an error.
12457 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
12458 (is_identifier_[start/part]_character): make static.
12460 2004-04-10 Miguel de Icaza <miguel@ximian.com>
12462 * expression.cs (Binary.ResolveOperator): Do no append strings
12463 twice: since we can be invoked more than once (array evaluation)
12464 on the same concatenation, take care of this here. Based on a fix
12465 from Ben (bug #56454)
12467 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
12469 * codegen.cs: Fix another case where CS1548 must be reported (when
12470 delay-sign isn't specified and no private is available #56564). Fix
12471 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
12472 error when MCS is used on the MS runtime and we need to delay-sign
12473 (which seems unsupported by AssemblyBuilder - see #56621).
12475 2004-04-08 Marek Safar <marek.safar@seznam.cz>
12477 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
12478 (TypeManager.ComputeNamespaces): Faster implementation for
12481 * compiler.csproj: Updated AssemblyName to mcs.
12483 2004-04-07 Miguel de Icaza <miguel@ximian.com>
12485 * rootcontext.cs: Add new types to the boot resolution.
12487 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
12488 MulticastDelegate is not allowed.
12490 * typemanager.cs: Add new types to lookup: System.TypedReference
12493 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
12494 check for TypedReference or ArgIterator, they are not allowed.
12496 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
12497 makes us properly catch 1510 in some conditions (see bug 56016 for
12500 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
12502 * CryptoConvert.cs: update from corlib version
12505 2004-04-05 Miguel de Icaza <miguel@ximian.com>
12507 * class.cs (Indexer.Define): Check indexername declaration
12509 2004-04-05 Marek Safar <marek.safar@seznam.cz>
12511 * attribute.cs (IsClsCompliant): Fixed problem with handling
12512 all three states (compliant, not-compliant, undetected).
12514 2004-03-30 Marek Safar <marek.safar@seznam.cz>
12516 * attribute.cs (Attribute): Location is now public.
12517 (Resolve): Store resolved arguments (pos_values) in attribute class.
12518 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
12519 (GetClsCompliantAttributeValue): New method that gets
12520 CLSCompliantAttribute value.
12521 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
12522 if exists else null.
12523 (AttributeTester): New class for CLS-Compliant verification routines.
12525 * class.cs (Emit): Add CLS-Compliant verification.
12526 (Method.GetSignatureForError): Implemented.
12527 (Constructor.GetSignatureForError): Implemented
12528 (Constructor.HasCompliantArgs): Returns if constructor has
12529 CLS-Compliant arguments.
12530 (Constructor.Emit): Override.
12531 (Construcor.IsIdentifierClsCompliant): New method; For constructors
12532 is needed to test only parameters.
12533 (FieldBase.GetSignatureForError): Implemented.
12534 (TypeContainer): New member for storing base interfaces.
12535 (TypeContainer.FindMembers): Search in base interfaces too.
12537 * codegen.cs (GetClsComplianceAttribute): New method that gets
12538 assembly or module CLSCompliantAttribute value.
12539 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
12541 (ModuleClass.Emit): Add error 3012 test.
12543 * const.cs (Emit): Override and call base for CLS-Compliant tests.
12545 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
12546 state for all decl types.
12547 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
12548 if CLS-Compliant tests are required.
12549 (IsClsCompliaceRequired): New method. Analyze whether code
12550 must be CLS-Compliant.
12551 (IsExposedFromAssembly): New method. Returns true when MemberCore
12552 is exposed from assembly.
12553 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
12554 value or gets cached value.
12555 (HasClsCompliantAttribute): New method. Returns true if MemberCore
12556 is explicitly marked with CLSCompliantAttribute.
12557 (IsIdentifierClsCompliant): New abstract method. This method is
12558 used to testing error 3005.
12559 (IsIdentifierAndParamClsCompliant): New method. Common helper method
12560 for identifier and parameters CLS-Compliant testing.
12561 (VerifyClsCompliance): New method. The main virtual method for
12562 CLS-Compliant verifications.
12563 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
12564 null. I don't know why is null (too many public members !).
12565 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
12566 and get value of first CLSCompliantAttribute that found.
12568 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
12569 (VerifyClsCompliance): Override and add extra tests.
12571 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
12572 clscheck- disable CLS-Compliant verification event if assembly is has
12573 CLSCompliantAttribute(true).
12575 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
12576 ApllyAttribute is now called in emit section as in the other cases.
12577 Possible future Emit integration.
12578 (IsIdentifierClsCompliant): New override.
12579 (VerifyClsCompliance): New override.
12580 (GetEnumeratorName): Returns full enum name.
12582 * parameter.cs (GetSignatureForError): Implemented.
12584 * report.cs (WarningData): New struct for Warning message information.
12585 (LocationOfPreviousError): New method.
12586 (Warning): New method. Reports warning based on the warning table.
12587 (Error_T): New method. Reports error based on the error table.
12589 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
12590 verifications are done here.
12592 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
12594 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
12595 CLSCompliantAttribute.
12596 (all_imported_types): New member holds all imported types from other
12598 (LoadAllImportedTypes): New method fills static table with exported types
12599 from all referenced assemblies.
12600 (Modules): New property returns all assembly modules.
12602 2004-03-30 Miguel de Icaza <miguel@ximian.com>
12604 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
12605 throwing a parser error.
12607 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
12608 which removes the hardcoded get_/set_ prefixes for properties, as
12609 IL allows for the properties to be named something else.
12613 * expression.cs: Do not override operand before we know if it is
12614 non-null. Fix 56207
12616 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
12618 * typemanager.cs: support for pinned variables.
12620 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
12622 * decl.cs, typemanager.cs: Avoid using an arraylist
12623 as a buffer if there is only one result set.
12625 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
12627 * expression.cs: Make sure you cant call a static method
12628 with an instance expression, bug #56174.
12630 2004-03-29 Miguel de Icaza <miguel@ximian.com>
12632 * class.cs (IsDuplicateImplementation): Improve error reporting to
12633 flag 663 (method only differs in parameter modifier).
12635 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
12636 in preprocessor directives.
12638 * location.cs (LookupFile): Allow for the empty path.
12640 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
12641 better approach for some of that patch, but its failing with the
12642 CharSet enumeration. For now try/catch will do.
12644 * typemanager.cs: Do not crash if a struct does not have fields.
12647 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
12649 * expression.cs: cs0213, cant fix a fixed expression.
12652 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
12654 * cs-parser.jay: detect invalid embeded statements gracefully.
12657 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
12659 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
12662 the invocation type may not be a subclass of the tye of the item/
12663 The type of the item must be a subclass of the invocation item.
12668 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
12670 * attribute.cs: Added methods to get a string and a bool from an
12671 attribute. Required to information from AssemblyKeyFileAttribute,
12672 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
12673 * codegen.cs: Modified AssemblyName creation to include support for
12674 strongnames. Catch additional exceptions to report them as CS1548.
12675 * compiler.csproj: Updated include CryptoConvert.cs.
12676 * compiler.csproj.user: Removed file - user specific configuration.
12677 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
12678 Mono.Security assembly. The original class is maintained and tested in
12679 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
12680 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
12681 like CSC 8.0 (C# v2) supports.
12682 * Makefile: Added CryptoConvert.cs to mcs sources.
12683 * rootcontext.cs: Added new options for strongnames.
12685 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
12687 * driver.cs: For --expect-error, report error code `2'
12688 if the program compiled with no errors, error code `1' if
12689 it compiled with an error other than the one expected.
12691 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
12693 * compiler.csproj: Updated for Visual Studio .NET 2003.
12694 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
12695 * compiler.sln: Updated for Visual Studio .NET 2003.
12697 2004-03-24 Ravi Pratap M <ravi@ximian.com>
12699 * expression.cs: Fix bug #47234. We basically need to apply the
12700 rule that we prefer the conversion of null to a reference type
12701 when faced with a conversion to 'object' (csc behaviour).
12703 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
12705 * statement.cs: Shorter form for foreach, eliminates
12706 a local variable. r=Martin.
12708 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
12710 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
12711 checks if we can use brtrue/brfalse to test for 0.
12712 * expression.cs: use the above in the test for using brtrue/brfalse.
12713 cleanup code a bit.
12715 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
12717 * expression.cs: Rewrite string concat stuff. Benefits:
12719 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
12720 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
12721 rather than a concat chain.
12723 * typemanager.cs: Add lookups for more concat overloads.
12725 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
12727 * expression.cs: Emit shorter il code for array init.
12744 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
12746 * statement.cs: Before, two switch blocks would be merged if the
12747 total size of the blocks (end_item - begin_item + 1) was less than
12748 two times the combined sizes of the blocks.
12750 Now, it will only merge if after the merge at least half of the
12755 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
12757 * class.cs : csc build fix for GetMethods(). See bug #52503.
12759 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
12761 * expression.cs: Make sure fp comparisons work with NaN.
12762 This fixes bug #54303. Mig approved this patch a long
12763 time ago, but we were not able to test b/c the runtime
12766 2004-03-19 Miguel de Icaza <miguel@ximian.com>
12768 * ecore.cs (TypExpr.GetHashCode): implement this overload.
12770 2004-03-19 Martin Baulig <martin@ximian.com>
12772 * class.cs (MemberCore.IsDuplicateImplementation): Report the
12773 error here and not in our caller.
12775 2004-03-19 Martin Baulig <martin@ximian.com>
12777 * interface.cs: Completely killed this file.
12778 (Interface): We're now a TypeContainer and live in class.cs.
12780 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
12781 argument; we're now also called for interfaces.
12782 (TypeContainer.DefineMembers): Allow this method being called
12784 (TypeContainer.GetMethods): New public method; formerly known as
12785 Interface.GetMethod(). This is used by PendingImplementation.
12786 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
12787 it's now private and non-static.
12788 (Interface): Moved this here; it's now implemented similar to
12790 (Method, Property, Event, Indexer): Added `bool is_interface'
12791 argument to their .ctor's.
12792 (MemberBase.IsInterface): New public field.
12794 * cs-parser.jay: Create normal Method, Property, Event, Indexer
12795 instances instead of InterfaceMethod, InterfaceProperty, etc.
12796 (opt_interface_base): Removed; we now use `opt_class_base' instead.
12797 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
12799 2004-03-19 Martin Baulig <martin@ximian.com>
12801 * class.cs (MethodCore.IsDuplicateImplementation): New private
12802 method which does the CS0111 checking.
12803 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
12804 Use IsDuplicateImplementation().
12806 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
12808 * decl.cs (FindMemberToOverride): New method to find the correct
12809 method or property to override in the base class.
12811 - Make Method/Property use the above method to find the
12812 version in the base class.
12813 - Remove the InheritableMemberSignatureCompare as it is now
12816 This patch makes large code bases much faster to compile, as it is
12817 O(n) rather than O(n^2) to do this validation.
12819 Also, it fixes bug 52458 which is that nested classes are not
12820 taken into account when finding the base class member.
12822 Reviewed/Approved by Martin.
12824 2004-03-17 Marek Safar <marek.safar@seznam.cz>
12826 * interface.cs: In all interface classes removed redundant
12827 member initialization.
12829 2004-03-16 Martin Baulig <martin@ximian.com>
12831 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
12833 2004-03-15 Miguel de Icaza <miguel@ximian.com>
12835 * decl.cs (DefineTypeAndParents): New helper method to define a
12836 type's containers before the type itself is defined; This is a
12837 bug exposed by the recent changes to Windows.Forms when an
12838 implemented interface was defined inside a class that had not been
12841 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
12843 (Check): Loop correctly to report errors modifiers
12844 (UNSAFE was not in the loop, since it was the same as TOP).
12846 * interface.cs: Every interface member now takes a ModFlags,
12847 instead of a "is_new" bool, which we set on the base MemberCore.
12849 Every place where we called "UnsafeOk" in the interface, now we
12850 call the proper member (InterfaceMethod.UnsafeOK) instead to get
12851 the unsafe settings from the member declaration instead of the
12852 container interface.
12854 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
12856 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
12857 `set_indexer_name' to the pending bits (one per type).
12859 We fixed a bug today that was picking the wrong method to
12860 override, since for properties the existing InterfaceMethod code
12861 basically ignored the method name. Now we make sure that the
12862 method name is one of the valid indexer names.
12864 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
12866 * support.cs (SeekableStreamReader): Keep track of stream byte
12867 positions and don't mix them with character offsets to the buffer.
12869 Patch from Gustavo Giráldez
12871 2004-03-15 Marek Safar <marek.safar@seznam.cz>
12873 * interface.cs (InterfaceSetGetBase): Removed double member
12874 initialization, base class does it as well.
12876 2004-03-13 Martin Baulig <martin@ximian.com>
12878 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
12879 when compiling corlib.
12881 2004-03-13 Miguel de Icaza <miguel@ximian.com>
12883 * convert.cs (ExplicitConversion): We were reporting an error on
12884 certain conversions (object_type source to a value type, when the
12885 expression was `null') before we had a chance to pass it through
12886 the user defined conversions.
12888 * driver.cs: Replace / and \ in resource specifications to dots.
12891 * class.cs: Add check for duplicate operators. Fixes 52477
12893 2004-03-11 Miguel de Icaza <miguel@ximian.com>
12895 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
12896 that are in the middle of the statements, not only at the end.
12899 * class.cs (TypeContainer.AddField): No longer set the
12900 `HaveStaticConstructor' flag, now we call it
12901 `UserDefineStaticConstructor' to diferentiate the slightly
12902 semantic difference.
12904 The situation is that we were not adding BeforeFieldInit (from
12905 Modifiers.TypeAttr) to classes that could have it.
12906 BeforeFieldInit should be set to classes that have no static
12911 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
12913 And most importantly Zoltan's comment:
12915 http://bugzilla.ximian.com/show_bug.cgi?id=44229
12917 "I think beforefieldinit means 'it's ok to initialize the type sometime
12918 before its static fields are used', i.e. initialization does not need
12919 to be triggered by the first access to the type. Setting this flag
12920 helps the JIT to compile better code, since it can run the static
12921 constructor at JIT time, and does not need to generate code to call it
12922 (possibly lots of times) at runtime. Unfortunately, mcs does not set
12923 this flag for lots of classes like String.
12925 csc sets this flag if the type does not have an explicit static
12926 constructor. The reasoning seems to be that if there are only static
12927 initalizers for a type, and no static constructor, then the programmer
12928 does not care when this initialization happens, so beforefieldinit
12931 This bug prevents the AOT compiler from being usable, since it
12932 generates so many calls to mono_runtime_class_init that the AOT code
12933 is much slower than the JITted code. The JITted code is faster,
12934 because it does not generate these calls if the vtable is type is
12935 already initialized, which is true in the majority of cases. But the
12936 AOT compiler can't do this."
12938 2004-03-10 Miguel de Icaza <miguel@ximian.com>
12940 * class.cs (MethodData.Emit): Refactor the code so symbolic
12941 information is generated for destructors; For some reasons we
12942 were taking a code path that did not generate symbolic information
12945 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
12947 * class.cs: Create a Constructor.CheckBase method that
12948 takes care of all validation type code. The method
12949 contains some code that was moved from Define.
12951 It also includes new code that checks for duplicate ctors.
12952 This fixes bug #55148.
12954 2004-03-09 Joshua Tauberer <tauberer@for.net>
12956 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
12957 a { ... }-style array creation invokes EmitStaticInitializers
12958 which is not good for reference-type arrays. String, decimal
12959 and now null constants (NullCast) are not counted toward
12960 static initializers.
12962 2004-03-05 Martin Baulig <martin@ximian.com>
12964 * location.cs (SourceFile.HasLineDirective): New public field;
12965 specifies whether the file contains or is referenced by a "#line"
12967 (Location.DefineSymbolDocuments): Ignore source files which
12968 either contain or are referenced by a "#line" directive.
12970 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
12972 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
12973 direct access to our parent, so check the method inline there.
12975 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
12977 * expression.cs (Invocation.EmitCall): Miguel's last commit
12978 caused a regression. If you had:
12983 In Foo the implict this would be null.
12985 2004-02-27 Miguel de Icaza <miguel@ximian.com>
12987 * expression.cs (Invocation.EmitCall): If the method is not
12988 virtual, do not emit a CallVirt to it, use Call.
12990 * typemanager.cs (GetFullNameSignature): Improve the method to
12991 cope with ".ctor" and replace it with the type name.
12993 * class.cs (ConstructorInitializer.Resolve): Now the method takes
12994 as an argument the ConstructorBuilder where it is being defined,
12995 to catch the recursive constructor invocations.
12997 2004-02-26 Miguel de Icaza <miguel@ximian.com>
12999 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
13000 routines to check if a type is an enumerable/enumerator allow
13001 classes that implement the IEnumerable or IEnumerator interfaces.
13003 * class.cs (Property, Operator): Implement IIteratorContainer, and
13004 implement SetYields.
13006 (Property.Define): Do the block swapping for get_methods in the
13007 context of iterators. We need to check if Properties also
13008 include indexers or not.
13010 (Operator): Assign the Block before invoking the
13011 OperatorMethod.Define, so we can trigger the Iterator code
13014 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
13015 Property and Operator classes are not created when we parse the
13016 declarator but until we have the block completed, so we use a
13017 singleton SimpleIteratorContainer.Simple to flag whether the
13018 SetYields has been invoked.
13020 We propagate this setting then to the Property or the Operator to
13021 allow the `yield' to function.
13023 2004-02-25 Marek Safar <marek.safar@seznam.cz>
13025 * codegen.cs: Implemented attribute support for modules.
13026 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
13027 Assembly/Module functionality.
13029 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
13030 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
13031 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
13033 2004-02-16 Marek Safar <marek.safar@seznam.cz>
13035 * interface.cs (FindMembers): The operation is performed on all base
13036 interfaces and not only on the first. It is required for future CLS Compliance patch.
13038 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
13040 * statement.cs, codegen.cs:
13041 This patch deals with patterns such as:
13043 public class List : IEnumerable {
13045 public MyEnumerator GetEnumerator () {
13046 return new MyEnumerator(this);
13049 IEnumerator IEnumerable.GetEnumerator () {
13053 public struct MyEnumerator : IEnumerator {
13058 Before, there were a few things we did wrong:
13059 1) we would emit callvirt on a struct, which is illegal
13060 2) we emited ldarg when we needed to emit ldarga
13061 3) we would mistakenly call the interface methods on an enumerator
13062 type that derived from IEnumerator and was in another assembly. For example:
13064 public class MyEnumerator : IEnumerator
13066 Would have the interface methods called, even if there were public impls of the
13067 method. In a struct, this lead to invalid IL code.
13069 2004-02-11 Marek Safar <marek.safar@seznam.cz>
13071 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
13074 * delegate.cs (Define): Fixed crash when delegate type is undefined.
13076 2004-02-11 Miguel de Icaza <miguel@ximian.com>
13078 * cs-parser.jay: Fix small regression: we were not testing V2
13079 compiler features correctly.
13081 * interface.cs: If the emit context is null, then create one
13083 2004-02-09 Marek Safar <marek.safar@seznam.cz>
13085 * decl.cs (GetSignatureForError): New virtual method to get full name
13086 for error messages.
13088 * attribute.cs (IAttributeSupport): New interface for attribute setting.
13089 Now it is possible to rewrite ApplyAttributes method to be less if/else.
13091 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
13092 Duplicated members and code in these classes has been removed.
13093 Better encapsulation in these classes.
13095 2004-02-07 Miguel de Icaza <miguel@ximian.com>
13097 * assign.cs (Assign.DoResolve): When dealing with compound
13098 assignments, there is a new rule in ECMA C# 2.4 (might have been
13099 there before, but it is documented here) that states that in:
13103 If b is of type int, and the `op' is a shift-operator, then the
13104 above is evaluated as:
13108 * expression.cs (Binary.ResolveOperator): Instead of testing for
13109 int/uint/long/ulong, try to implicitly convert to any of those
13110 types and use that in pointer arithmetic.
13112 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
13113 method to print information for from the type, not from the
13114 null-method we were given.
13116 2004-02-01 Duncan Mak <duncan@ximian.com>
13118 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
13119 parsing for cmd, fixes bug #53694.
13121 2004-02-04 Marek Safar <marek.safar@seznam.cz>
13123 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
13124 in the member name duplication tests. Property and operator name duplication
13125 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
13127 2004-02-03 Marek Safar <marek.safar@seznam.cz>
13129 * interface.cs (PopulateMethod): Fixed crash when interface method
13130 returns not existing type (error test cs0246-3.cs).
13132 2004-02-02 Ravi Pratap M <ravi@ximian.com>
13134 * cs-parser.jay (interface_accessors): Re-write actions to also
13135 store attributes attached to get and set methods. Fix spelling
13138 (inteface_property_declaration): Modify accordingly.
13140 (InterfaceAccessorInfo): New helper class to store information to pass
13141 around between rules that use interface_accessors.
13143 * interface.cs (Emit): Apply attributes on the get and set
13144 accessors of properties and indexers too.
13146 * attribute.cs (ApplyAttributes): Modify accordingly to use the
13147 right MethodBuilder when applying attributes to the get and set accessors.
13149 2004-01-31 Miguel de Icaza <miguel@ximian.com>
13151 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
13153 2004-01-26 Miguel de Icaza <miguel@ximian.com>
13155 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
13157 2004-01-25 Miguel de Icaza <miguel@ximian.com>
13159 * cs-parser.jay: Remove YIELD token, instead use the new grammar
13160 changes that treat `yield' specially when present before `break'
13161 or `return' tokens.
13163 * cs-tokenizer.cs: yield is no longer a keyword.
13165 2004-01-23 Marek Safar <marek.safar@seznam.cz>
13167 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
13168 setting for default constructors.
13169 For default constructors are almost every time set wrong Modifier. The
13170 generated IL code has been alright. But inside mcs this values was
13171 wrong and this was reason why several of my CLS Compliance tests
13174 2004-01-22 Martin Baulig <martin@ximian.com>
13176 * cs-parser.jay (namespace_or_type_name): Return an Expression,
13177 not a QualifiedIdentifier. This is what `type_name_expression'
13178 was previously doing.
13179 (type_name_expression): Removed; the code is now in
13180 `namespace_or_type_name'.
13181 (qualified_identifier): Removed, use `namespace_or_type_name'
13183 (QualifiedIdentifier): Removed this class.
13185 2004-01-22 Martin Baulig <martin@ximian.com>
13187 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
13188 not a string as alias name.
13190 2004-01-21 Miguel de Icaza <miguel@ximian.com>
13192 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
13193 #52730 bug, and instead compute correctly the need to use a
13194 temporary variable when requesting an address based on the
13195 static/instace modified of the field and the constructor.
13197 2004-01-21 Martin Baulig <martin@ximian.com>
13199 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
13200 class and namespace before looking up aliases. Fixes #52517.
13202 2004-01-21 Martin Baulig <martin@ximian.com>
13204 * flowanalysis.cs (UsageVector.Merge): Allow variables being
13205 assinged in a 'try'; fixes exception4.cs.
13207 2004-01-21 Marek Safar <marek.safar@seznam.cz>
13208 * class.cs : Implemented parameter-less constructor for TypeContainer
13210 * decl.cs: Attributes are now stored here. New property OptAttributes
13212 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
13214 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
13216 2004-01-21 Marek Safar <marek.safar@seznam.cz>
13218 * typemanager.cs (CSharpSignature): Now reports also inner class name.
13219 (CSharpSignature): New method for indexer and property signature.
13221 2004-01-21 Marek Safar <marek.safar@seznam.cz>
13223 * pending.cs (IsVirtualFilter): Faster implementation.
13225 2004-01-21 Marek Safar <marek.safar@seznam.cz>
13227 * typemanager.cs: Avoid inclusion of same assembly more than once.
13229 2004-01-21 Marek Safar <marek.safar@seznam.cz>
13231 * cs-parser.jay: Fixed problem where the last assembly attribute
13232 has been applied also to following declaration (class, struct, etc.)
13234 2004-01-21 Marek Safar <marek.safar@seznam.cz>
13236 * class.cs: Added error CS0538, CS0539 reporting.
13237 Fixed crash on Microsoft runtime when field type is void.
13239 * cs-parser.jay: Added error CS0537 reporting.
13241 * pending.cs: Added error CS0535 reporting.
13242 Improved error report for errors CS0536, CS0534.
13244 2004-01-20 Miguel de Icaza <miguel@ximian.com>
13246 Merge a few bits from the Anonymous Method MCS tree.
13248 * statement.cs (ToplevelBlock): New class for toplevel methods,
13249 will hold anonymous methods, lifted variables.
13251 * cs-parser.jay: Create toplevel blocks for delegates and for
13252 regular blocks of code.
13254 2004-01-20 Martin Baulig <martin@ximian.com>
13256 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
13257 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
13258 and `NeedExplicitReturn'; added `IsLastStatement'.
13259 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
13260 have a `ReturnLabel' or we're not unreachable.
13262 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
13263 child's reachability; don't just override ours with it. Fixes
13264 #58058 (lluis's example).
13265 (FlowBranching): Added public InTryOrCatch(), InCatch(),
13266 InFinally(), InLoop(), InSwitch() and
13267 BreakCrossesTryCatchBoundary() methods.
13269 * statement.cs (Return): Do all error checking in Resolve().
13270 Unless we are the last statement in a top-level block, always
13271 create a return label and jump to it.
13272 (Break, Continue): Do all error checking in Resolve(); also make
13273 sure we aren't leaving a `finally'.
13274 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
13275 statement in a top-level block.
13276 (Block.Flags): Added `IsDestructor'.
13277 (Block.IsDestructor): New public property.
13279 2004-01-20 Martin Baulig <martin@ximian.com>
13281 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
13283 2004-01-20 Martin Baulig <martin@ximian.com>
13285 * statement.cs (Statement.ResolveUnreachable): New public method.
13286 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
13287 (Block.Resolve): Resolve unreachable statements.
13289 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
13291 * expression.cs: We need to fix the case where we do
13292 not have a temp variable here.
13294 * assign.cs: Only expression compound assignments need
13295 temporary variables.
13297 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
13299 * flowanalysis.cs: Reduce memory allocation in a few ways:
13300 - A block with no variables should not allocate a bit
13302 - A method with no out parameters does not need any tracking
13303 for assignment of the parameters, so we need not allocate
13306 public readonly Type[] VariableTypes;
13307 public readonly string[] VariableNames;
13308 Are redundant. The data is already stored in the variable
13309 map, so we need not allocate another array for it.
13310 - We need to add alot of checks for if (params | locals) == null
13311 due to the first two changes.
13313 2004-01-18 Miguel de Icaza <miguel@ximian.com>
13315 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
13316 implement IMemoryLocation, we store a copy on a local variable and
13317 take the address of it. Patch from Benjamin Jemlich
13319 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
13320 to use a special "type_name_expression" rule which reduces the
13321 number of "QualifiedIdentifier" classes created, and instead
13322 directly creates MemberAccess expressions.
13324 2004-01-17 Miguel de Icaza <miguel@ximian.com>
13326 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
13327 that fixes #52853. Null literal assignment to ValueType
13329 * class.cs (MethodData.Emit): Instead of checking the name of the
13330 method to determine if its a destructor, create a new derived
13331 class from Method called Destructor, and test for that.
13333 * cs-parser.jay: Create a Destructor object instead of a Method.
13335 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
13339 2004-01-16 Miguel de Icaza <miguel@ximian.com>
13341 * expression.cs (Binary.ResolveOperator): Perform an implicit
13342 conversion from MethodGroups to their delegate types on the
13343 Addition operation.
13345 * delegate.cs: Introduce a new class DelegateCreation that is the
13346 base class for `NewDelegate' and `ImplicitDelegateCreation',
13347 factor some code in here.
13349 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
13350 conversion from MethodGroups to compatible delegate types.
13352 * ecore.cs (Expression.Resolve): Do not flag error 654
13353 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
13354 we allow conversions from MethodGroups to delegate types now.
13356 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
13357 assignments in v2 either.
13359 2004-01-10 Miguel de Icaza <miguel@ximian.com>
13361 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
13362 static read-only fields in ctors.
13364 Applied patch from Benjamin Jemlich
13366 * expression.cs (UnaryMutator): Avoid leaking local variables.
13368 2004-01-09 Miguel de Icaza <miguel@ximian.com>
13370 * cs-tokenizer.cs (IsCastToken): Allow the various native types
13371 here to return true, as they can be used like this:
13373 (XXX) int.MEMBER ()
13375 Fixed 49836 and all the other dups
13377 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
13379 * driver.cs: Implement /win32res and /win32icon.
13381 2004-01-08 Miguel de Icaza <miguel@ximian.com>
13383 * cs-parser.jay: Add a rule to improve error handling for the
13384 common mistake of placing modifiers after the type.
13386 2004-01-07 Miguel de Icaza <miguel@ximian.com>
13388 * cs-parser.jay (interface_event_declaration): Catch
13389 initialization of events on interfaces, and report cs0068
13391 * cs-parser.jay (interface_event_declaration): Catch
13392 initialization of events.
13394 * ecore.cs: Better report missing constructors.
13396 * expression.cs (Binary.ResolveOperator): My previous bug fix had
13397 the error reporting done in the wrong place. Fix.
13399 * expression.cs (Binary.ResolveOperator): Catch the
13400 operator + (E x, E y) error earlier, and later allow for implicit
13401 conversions in operator +/- (E e, U x) from U to the underlying
13404 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
13405 52596, if the container class is abstract, the default constructor
13406 is protected otherwise its public (before, we were always public).
13408 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
13411 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
13412 Jemlich that fixes bug #52597, MCS was generating invalid code for
13413 idisposable structs. Thanks to Ben for following up with this
13416 2004-01-06 Miguel de Icaza <miguel@ximian.com>
13418 * driver.cs: Allow assemblies without code to be generated, fixes
13421 2004-01-07 Nick Drochak <ndrochak@gol.com>
13423 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
13425 2004-01-05 Miguel de Icaza <miguel@ximian.com>
13427 * cs-parser.jay: Add rules to improve error reporting if fields or
13428 methods are declared at the namespace level (error 116)
13430 * Add rules to catch event add/remove
13432 2004-01-04 David Sheldon <dave-mono@earth.li>
13434 * expression.cs: Added matching ")" to error message for
13437 2004-01-03 Todd Berman <tberman@gentoo.org>
13439 * ecore.cs, attribute.cs:
13440 Applying fix from #52429.
13442 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
13444 * ecore.cs, expression.cs, statement.cs:
13445 Total rewrite of how we handle branching. We
13446 now handle complex boolean expressions with fewer
13447 jumps. As well if (x == 0) no longer emits a ceq.
13449 if (x is Foo) is much faster now, because we generate
13452 Overall, we get a pretty big improvement on our benchmark
13453 tests. The code we generate is smaller and more readable.
13455 I did a full two-stage bootstrap. The patch was reviewed
13456 by Martin and Miguel.
13458 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
13460 * cs-parser.jay: Make primary_expression not take a QI.
13461 we dont need this because the member_access rule covers
13462 us here. So we replace the rule with just IDENTIFIER.
13464 This has two good effects. First, we remove a s/r conflict.
13465 Second, we allocate many fewer QualifiedIdentifier objects.
13467 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
13469 * attribute.cs: Handle MarshalAs attributes as pseudo, and
13470 set the correct information via SRE. This prevents
13471 hanging on the MS runtime. Fixes #29374.
13473 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
13475 * convert.cs: correctly handle conversions to value types
13476 from Enum and ValueType as unboxing conversions.
13478 Fixes bug #52569. Patch by Benjamin Jemlich.
13480 2004-01-02 Ravi Pratap <ravi@ximian.com>
13482 * expression.cs (BetterConversion): Prefer int -> uint
13483 over int -> ulong (csc's behaviour). This fixed bug #52046.
13485 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
13487 * decl.cs (MemberCache.FindMembers): now returns a
13490 * typemanager.cs: In general, go with with ^^.
13491 (CopyNewMethods): take an IList.
13492 (RealMemberLookup): Only allocate an arraylist
13493 if we copy from two sets of methods.
13495 This change basically does two things:
13496 1) Fewer array lists allocated due to CopyNewMethods.
13497 2) the explicit cast in MemberList costed ALOT.
13499 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
13501 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
13502 a hashtable to avoid needless string allocations when an identifier is
13503 used more than once (the common case).
13505 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
13507 * pending.cs: MS's TypeBuilder.GetInterfaces ()
13508 is broken, it will not return anything. So, we
13509 have to use the information we have in mcs to
13512 * typemanager.cs: Add a cache for GetInterfaces,
13513 since this will now be used more often (due to ^^)
13515 (GetExplicitInterfaces) New method that gets the
13516 declared, not effective, interfaces on a type
13517 builder (eg, if you have interface IFoo, interface
13518 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
13521 This patch makes MCS able to bootstrap itself on
13524 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
13526 * expression.cs: Remove the Nop's that Miguel put
13529 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
13531 * report.cs, codegen.cs: Give the real stack trace to
13532 the error when an exception is thrown.
13534 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
13536 * decl.cs: only allocate hashtables for ifaces if
13539 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
13541 * expression.cs: fix the error from cs0121-2.cs
13542 (a parent interface has two child interfaces that
13543 have a function with the same name and 0 params
13544 and the function is called through the parent).
13546 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
13548 * class.cs, rootcontext.cs, typmanager.cs: do not
13551 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
13553 * codegen.cs: remove stack for the ec flow branching.
13554 It is already a linked list, so no need.
13556 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
13558 * Makefile: Allow custom profiler here.
13560 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
13562 * typemanager.cs (LookupType):
13563 - Use a static char [], because split takes
13564 a param array for args, so it was allocating
13566 - Do not store true in a hashtable, it boxes.
13568 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
13570 * flowanalysis.cs: bytify common enums.
13572 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
13574 * modifiers.cs: Add a new set of flags for the
13575 flags allowed on explicit interface impls.
13576 * cs-parser.jay: catch the use of modifiers in
13577 interfaces correctly.
13578 * class.cs: catch private void IFoo.Blah ().
13580 All related to bug #50572.
13582 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
13584 * decl.cs: Rewrite the consistant accessability checking.
13585 Accessability is not linear, it must be implemented in
13586 a tableish way. Fixes #49704.
13588 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
13590 * expression.cs: Handle negation in a checked context.
13591 We must use subtraction from zero. Fixes #38674.
13593 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
13595 * class.cs: Ignore static void main in DLLs.
13596 * rootcontext.cs: Handle the target type here,
13597 since we are have to access it from class.cs
13598 * driver.cs: account for the above.
13600 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
13602 * report.cs: Give line numbers and files if available.
13604 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
13606 * driver.cs: Implement /addmodule.
13608 * typemanager.cs: Change 'modules' field so it now contains Modules not
13611 2003-12-20 Martin Baulig <martin@ximian.com>
13613 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
13614 (FieldBase.IsAssigned): Removed this field.
13615 (FieldBase.SetAssigned): New public method.
13616 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
13618 2003-12-20 Martin Baulig <martin@ximian.com>
13620 * expression.cs (LocalVariableReference.DoResolve): Don't set
13621 `vi.Used' if we're called from DoResolveLValue().
13623 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
13624 returns the usage vector it just merged into the current one -
13625 pass this one to UsageWarning().
13626 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
13627 of the `EmitContext', don't call this recursively on our children.
13629 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
13631 * driver.cs: Implement /target:module.
13633 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
13635 * support.cs (CharArrayHashtable): New helper class.
13637 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
13638 char arrays, not strings, so we can avoid creating a string in
13639 consume_identifier if the identifier is a keyword.
13641 2003-12-16 Martin Baulig <martin@ximian.com>
13643 * statement.cs (LocalInfo.Assigned): Removed this property.
13644 (LocalInfo.Flags): Removed `Assigned'.
13645 (LocalInfo.IsAssigned): New public method; takes the EmitContext
13646 and uses flow analysis.
13647 (Block.UsageWarning): Made this method private.
13648 (Block.Resolve): Call UsageWarning() if appropriate.
13650 * expression.cs (LocalVariableReference.DoResolve): Always set
13651 LocalInfo.Used here.
13653 2003-12-13 Martin Baulig <martin@ximian.com>
13655 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
13656 any value here; we're now using flow analysis to figure out
13657 whether a statement/block returns a value.
13659 2003-12-13 Martin Baulig <martin@ximian.com>
13661 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
13663 (FlowBranching.MergeFinally): Don't call
13664 `branching.CheckOutParameters()' here, this is called in
13666 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
13667 when adding the `finally' vector.
13669 2003-12-13 Martin Baulig <martin@ximian.com>
13672 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
13673 actually work and also fix #48962.
13675 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
13677 * decl.cs: Do not check System.Object for nested types,
13678 since we know it does not have any. Big bang for buck:
13681 Run 1: 8.35 seconds
13682 Run 2: 8.32 seconds
13683 corlib: 17.99 seconds
13685 Run 1: 8.17 seconds
13686 Run 2: 8.17 seconds
13687 corlib: 17.39 seconds
13689 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
13691 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
13692 time we are returning 0 members, so we save alot here.
13694 2003-12-11 Martin Baulig <martin@ximian.com>
13696 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
13697 `MergeChild()', also just take the `FlowBranching' as argument;
13698 call Merge() on it and return the result.
13699 (FlowBranching.Merge): We don't need to do anything if we just
13702 2003-12-11 Martin Baulig <martin@ximian.com>
13704 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
13705 them in an `ArrayList' to reduce memory usage. Thanks to Ben
13706 Maurer for this idea.
13708 2003-12-11 Martin Baulig <martin@ximian.com>
13710 * flowanalysis.cs (MergeResult): This class is now gone; we now
13711 use the `UsageVector' for this. The reason for this is that if a
13712 branching just has one sibling, we don't need to "merge" them at
13713 all - that's the next step to do.
13714 (FlowBranching.Merge): We now return a `UsageVector' instead of a
13717 2003-12-11 Martin Baulig <martin@ximian.com>
13719 Reworked flow analyis and made it more precise and bug-free. The
13720 most important change is that we're now using a special `Reachability'
13721 class instead of having "magic" meanings of `FlowReturns'. I'll
13722 do some more cleanups and optimizations and also add some more
13723 documentation this week.
13725 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
13726 largely reworked this class.
13727 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
13728 the new `Reachability' class instead of having "magic" values here.
13729 (FlowBranching): We're now using an instance of `Reachability'
13730 instead of having separate `Returns', `Breaks' etc. fields.
13732 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
13733 based on flow analysis; ignore the return value of block.Emit ().
13735 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
13737 * driver.cs typemanager.cs: Find the mono extensions to corlib even
13738 if they are private.
13740 2003-12-09 Martin Baulig <martin@ximian.com>
13742 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
13743 call them directly on the UsageVector.
13745 2003-12-09 Martin Baulig <martin@ximian.com>
13747 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
13748 Changed return type from `FlowReturns' to `Reachability'.
13750 2003-12-09 Martin Baulig <martin@ximian.com>
13752 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
13753 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
13754 `Reachable' fields with a single `Reachability' one.
13756 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
13758 * class.cs (FindMembers): Remove foreach's.
13763 Run 1: 8.74 seconds
13764 Run 2: 8.71 seconds
13767 Run 1: 8.64 seconds
13768 Run 2: 8.58 seconds
13771 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
13776 This patch does a few things:
13777 1. EmptyStatement is now a singleton, so it is never reallocated.
13778 2. All blah is EmptyStatement constructs have been changed to
13779 blah == EmptyStatement.Value, which is much faster and valid
13780 now that EmptyStatement is a singleton.
13781 3. When resolving a block, rather than allocating a new array for
13782 the non-empty statements, empty statements are replaced with
13783 EmptyStatement.Value
13784 4. Some recursive functions have been made non-recursive.
13785 Mainly the performance impact is from (3), however (1) and (2) are needed for
13786 this to work. (4) does not make a big difference in normal situations, however
13787 it makes the profile look saner.
13792 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13793 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13794 Total memory allocated: 56397 KB
13797 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
13798 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
13799 Total memory allocated: 55666 KB
13801 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
13803 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
13804 than the hashtable in a hashtable version
13806 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
13807 we always end up concating a string. This results in a huge perf
13808 loss, because many strings have to be tracked by the GC. In this
13809 patch, we first use a hashtable that works with two keys, so that
13810 the strings do not need to be concat'ed.
13814 Run 1: 8.74 seconds
13815 Run 2: 8.71 seconds
13818 Run 1: 8.65 seconds
13819 Run 2: 8.56 seconds
13821 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
13823 * Makefile: Add a new target `do-time' that does a quick and simple
13824 profile, leaving easy to parse output.
13826 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
13828 * codegen.cs (Init): Create the dynamic assembly with
13829 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
13831 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
13833 * support.cs: Make the PtrHashtable use only one
13834 instance of its comparer.
13836 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
13838 * typemanager.cs: Fix lookup of GetNamespaces.
13840 2003-11-29 Miguel de Icaza <miguel@ximian.com>
13842 * expression.cs: Removed redundant line.
13844 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
13845 ArrayLists, use for loops with bounds.
13847 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
13850 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
13851 arraylists, use for loop with bounds.
13853 The above three changes give us a 0.071 second performance
13854 improvement out of 3.294 seconds down to 3.223. On my machine
13855 the above changes reduced the memory usage by 1,387 KB during
13856 compiler bootstrap.
13858 * cs-parser.jay (QualifiedIdentifier): New class used to represent
13859 QualifiedIdentifiers. Before we created a new string through
13860 concatenation, and mostly later on, the result would be
13861 manipulated by DecomposeQI through string manipulation.
13863 This reduced the compiler memory usage for bootstrapping from
13864 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
13865 compile times in 0.05 seconds.
13867 2003-11-28 Dick Porter <dick@ximian.com>
13869 * support.cs: Do string compares with the Invariant culture.
13877 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
13878 the comparison is done with the Invariant culture.
13880 2003-11-27 Miguel de Icaza <miguel@ximian.com>
13882 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
13883 GetEnumerator method.
13885 (ProbeCollectionType): Iterate starting at the most specific type
13886 upwards looking for a GetEnumerator
13888 * expression.cs: Shift count can be up to 31 for int/uint and 63
13891 2003-11-26 Miguel de Icaza <miguel@ximian.com>
13893 * statement.cs (Block.LookupLabel): Also look for the label on the
13894 children blocks. Use a hash table to keep track of visited
13897 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
13898 we actually did transform the other operand, otherwise fall back
13899 to the common codepath that casts to long.
13901 * cs-tokenizer.cs: Use the same code pattern as the int case.
13902 Maybe I should do the parsing myself, and avoid depending on the
13903 Parse routines to get this done.
13905 2003-11-25 Miguel de Icaza <miguel@ximian.com>
13907 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
13908 which fixes bug 51347. This time test it.
13910 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
13911 attributes for example can not tell the difference between these.
13912 The difference was only a syntax feature of the language.
13914 * attribute.cs: Apply attributes to delegates.
13916 * delegate.cs: Call the apply attributes method.
13918 2003-11-24 Miguel de Icaza <miguel@ximian.com>
13920 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
13921 comparing 0 vs Byte.MinValue, not the value
13923 (ImplicitConversionRequired): When reporting a conversion error,
13924 use error 31 to print out the constant error instead of the
13927 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
13928 which fixes bug 51347.
13930 2003-11-22 Miguel de Icaza <miguel@ximian.com>
13932 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
13933 which fixes the -warnaserror command line option.
13935 2003-11-21 Miguel de Icaza <miguel@ximian.com>
13937 * cfold.cs (DoNumericPromotions): During constant folding of
13938 additions on UIntConstant, special case intconstants with
13939 IntConstants like we do on the expression binary operator.
13941 2003-11-12 Miguel de Icaza <miguel@ximian.com>
13943 * convert.cs (ImplicitReferenceConversion): We were missing a case
13944 (System.Enum are not value types or class types, so we need to
13945 classify them separatedly).
13947 * driver.cs: We do not support error 2007.
13949 2003-11-12 Jackson Harper <jackson@ximian.com>
13951 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
13952 system directory. Also use the full file name so users can
13953 libraries names mscorlib-o-tron.dll in a non system dir.
13955 2003-11-10 Martin Baulig <martin@ximian.com>
13957 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
13958 (TypeManager.InitCoreTypes): Initialize them here, but instead of
13959 calling `ResolveType()' on them, directly assign their `Type'.
13961 2003-11-08 Martin Baulig <martin@ximian.com>
13963 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
13964 return value and the `out parent' parameter.
13965 (TypeContainer.DefineType): Moved the CS0644 check into
13966 GetClassBases(). Don't pass the interface types to the
13967 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
13968 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
13970 * ecore.cs (TypeExpr.IsAttribute): New property.
13971 (TypeExpr.GetInterfaces): New method.
13973 * interface.cs (Interface.GetInterfaceTypeByName): Return a
13974 TypeExpr instead of a Type.
13975 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
13976 (Interface.DefineType): Don't pass the interface types to the
13977 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
13978 them later and then call `TypeBulider.AddInterfaceImplementation()'.
13980 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
13981 instead of a `Type[]'.
13982 (TypeManager.RegisterBuilder): Likewise.
13983 (TypeManager.AddUserInterface): Likewise.
13984 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
13985 `Type[]' and also return a `TypeExpr[]'.
13986 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
13988 2003-11-08 Martin Baulig <martin@ximian.com>
13990 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
13993 2003-11-08 Martin Baulig <martin@ximian.com>
13995 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
13996 TypeManager.ResolveExpressionTypes().
13998 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
13999 instead of an Expression.
14000 (TypeExpr): This is now an abstract base class for `TypeExpression'.
14001 (TypeExpression): New public class; formerly known as `TypeExpr'.
14003 * expression.cs (ComposedCast): Derive from TypeExpr.
14005 * typemanager.cs (TypeManager.system_*_expr): These are now
14006 TypExpr's instead of Expression's.
14007 (TypeManager.ResolveExpressionTypes): New public static function;
14008 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
14011 2003-11-06 Miguel de Icaza <miguel@ximian.com>
14013 * expression.cs (New.DoResolve): Do not dereference value that
14014 might be a null return.
14016 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
14017 sure that the constant value has the right type. Fixes an
14018 unreported bug, similar to 50425.
14020 * const.cs (Const.LookupConstantValue): Call
14021 ImplicitStandardConversionExists before doing a conversion to
14022 avoid havng the TypeManager.ChangeType do conversions.
14024 Reduced the number of casts used
14026 (Const.ChangeType): New routine to enable reuse of the constant
14027 type changing code from statement.
14029 * typemanager.cs (ChangeType): Move common initialization to
14030 static global variables.
14034 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
14035 every value type to go through, even if it was void. Fix that.
14037 * cs-tokenizer.cs: Use is_identifier_start_character on the start
14038 character of the define, and the is_identifier_part_character for
14039 the rest of the string.
14041 2003-11-05 Miguel de Icaza <miguel@ximian.com>
14043 * expression.cs (UnaryMutator.EmitCode): When I updated
14044 LocalVariableReference.DoResolve, I overdid it, and dropped an
14045 optimization done on local variable references.
14047 2003-11-04 Miguel de Icaza <miguel@ximian.com>
14049 * ecore.cs: Convert the return from Ldlen into an int.
14051 2003-10-20 Miguel de Icaza <miguel@ximian.com>
14053 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
14054 the accessibility, this is a special case for toplevel non-public
14055 classes (internal for instance).
14057 2003-10-20 Nick Drochak <ndrochak@gol.com>
14059 * ecore.cs: Fix typo and build. Needed another right paren.
14061 2003-10-19 Miguel de Icaza <miguel@ximian.com>
14063 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
14064 `internal' case regular and protected, but not allowing protected
14065 to be evaluated later. Bug 49840
14067 2003-10-15 Miguel de Icaza <miguel@ximian.com>
14069 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
14070 to kb.Nlast, and not the kb.nFirst to isolate the switch
14073 Extract the underlying type, so enumerations of long/ulong are
14074 treated like long/ulong.
14076 2003-10-14 Miguel de Icaza <miguel@ximian.com>
14078 * expression.cs (New): Overload the meaning of RequestedType to
14079 track the possible creation of the NewDelegate type, since
14080 DoResolve is invoked more than once for new constructors on field
14083 See bugs: #48800 and #37014
14085 * cs-parser.jay (declare_local_constants): Take an arraylist
14086 instead of a single constant.
14088 (local_constant_declaration): It should take a
14089 constant_declarators, not a constant_declarator. Fixes 49487
14091 * convert.cs: Fix error report.
14093 2003-10-13 Jackson Harper <jackson@ximian.com>
14095 * typemanager.cs (TypeToCoreType): Add float and double this fixes
14098 2003-10-09 Martin Baulig <martin@ximian.com>
14100 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
14102 (MethodCore.DoDefineParameters): Removed the TypeContainer
14103 argument; use the DeclSpace which was passed to the .ctor instead.
14104 (MethodCore.CheckParameter): Take a DeclSpace instead of a
14105 TypeContainer; we only need a DeclSpace here.
14107 2003-10-09 Martin Baulig <martin@ximian.com>
14109 * class.cs (MethodData): Added additional `DeclSpace ds' argument
14111 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
14112 EmitContext's .ctor.
14114 2003-10-09 Martin Baulig <martin@ximian.com>
14116 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
14117 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
14118 AsAccessible(), moved them as well.
14120 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
14122 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
14124 * cs-parser.jay : Renamed yyName to yyNames related to jay.
14126 2003-10-07 Miguel de Icaza <miguel@ximian.com>
14128 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
14129 generation for >=, as spotted by Paolo, bug 48679.
14130 Patch from David Waite.
14132 * cs-tokenizer.cs: Add handling for #pragma.
14134 * cs-parser.jay: Allow for both yield and yield return in the
14135 syntax. The anti-cobolization of C# fight will go on!
14137 * class.cs (TypeBuilder.DefineType): Catch error condition here
14138 (Parent.DefineType erroring out and returning null).
14140 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
14141 coping with enumerations variables, we were mistakenly processing
14142 them as a regular value type instead of built-in types. Fixes the
14145 * typemanager.cs (IsBuiltinOrEnum): New method.
14147 2003-09-30 Miguel de Icaza <miguel@ximian.com>
14149 * cs-parser.jay: Upgrade: yield now needs the return clause.
14151 2003-09-19 Martin Baulig <martin@ximian.com>
14153 * decl.cs (MemberCache.SetupCacheForInterface): Take a
14154 `MemberCache parent' argument. Normally, an interface doesn't
14155 have a parent type except System.Object, but we use this in gmcs
14156 for generic type parameters.
14158 2003-09-18 Martin Baulig <martin@ximian.com>
14160 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
14161 on `type.IsInterface'; don't check whether the type has a parent
14162 to determine whether it's an interface.
14164 2003-09-15 Martin Baulig <martin@ximian.com>
14166 * class.cs (TypeContainer.DefineType): Added an error flag to
14167 avoid reporting duplicate CS0146's ("class definition is
14170 * driver.cs (Driver.MainDriver): Abort if
14171 RootContext.ResolveTree() reported any errors.
14173 2003-09-07 Martin Baulig <martin@ximian.com>
14175 * report.cs (Error, Warning): Added overloaded versions which take
14176 a `params object[] args' and call String.Format().
14178 2003-09-07 Martin Baulig <martin@ximian.com>
14180 * decl.cs (DeclSpace..ctor): Don't call
14181 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
14182 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
14183 (DeclSpace.RecordDecl): New method.
14185 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
14187 2003-09-02 Ravi Pratap <ravi@ximian.com>
14189 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
14190 value attributes to be applied to ParameterBuilders.
14192 * class.cs (MethodCore.LabelParameters): Make static and more
14193 generic so that it can be used from other places - like interface
14194 methods, for instance.
14196 * interface.cs (Interface.Emit): Call LabelParameters before
14197 emitting attributes on the InterfaceMethod.
14199 2003-08-26 Martin Baulig <martin@ximian.com>
14201 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
14202 resolving aliases; fixes #47927.
14204 2003-08-26 Martin Baulig <martin@ximian.com>
14206 * statement.cs (Using.DoResolve): This is internally emitting a
14207 try/finally clause, so we need to set ec.NeedExplicitReturn if we
14208 do not always return. Fixes #47681.
14210 2003-08-26 Martin Baulig <martin@ximian.com>
14212 * decl.cs (MemberCore): Moved WarningNotHiding(),
14213 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
14215 (AdditionResult): Make this nested in DeclSpace.
14216 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
14217 argument; call NamespaceEntry.Define() unless we're nested in a
14220 * namespace.cs (Namespace.DefineName): New public function. This
14221 is called from DeclSpace's .ctor to add
14222 (Namespace.Lookup): Include DeclSpaces in the lookup.
14224 * class.cs (Operator): Derive from MemberBase, not MemberCore.
14226 * const.cs (Const): Derive from MemberBase, not MemberCore.
14228 2003-08-25 Martin Baulig <martin@ximian.com>
14230 * convert.cs (Convert.ExplicitReferenceConversion): When
14231 converting from an interface type to a class, unbox if the target
14232 type is a struct type. Fixes #47822.
14234 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14236 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
14239 2003-08-22 Martin Baulig <martin@ximian.com>
14241 * class.cs (TypeManager.DefineType): When defining a nested type,
14242 call DefineType() on our parent; fixes #47801.
14244 2003-08-22 Martin Baulig <martin@ximian.com>
14246 * class.cs (MethodData.Define): While checking if a method is an
14247 interface implementation, improve the test a bit more to fix #47654.
14249 2003-08-22 Martin Baulig <martin@ximian.com>
14251 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
14252 correctly; fixes #47722.
14254 2003-08-22 Martin Baulig <martin@ximian.com>
14256 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
14257 LocalVariableReference, ensure it's not read-only. Fixes #47536.
14259 * statement.cs (Fixed.DoResolve): Make all variables read-only.
14261 2003-08-22 Martin Baulig <martin@ximian.com>
14263 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
14264 can only be assigned in static constructors. Fixes #47161.
14266 2003-08-22 Martin Baulig <martin@ximian.com>
14268 Rewrote and improved the flow analysis code.
14270 * flowbranching.cs (FlowBranching): Make this class abstract.
14271 (FlowBranching.CreateBranching): New static function to create a
14272 new flow branching.
14273 (FlowBranchingBlock, FlowBranchingException): New classes.
14274 (FlowBranching.UsageVector.Type): New public readonly field.
14275 (FlowBranching.UsageVector.Breaks): Removed the setter.
14276 (FlowBranching.UsageVector.Returns): Removed the setter.
14277 (FlowBranching.UsageVector): Added Break(), Return(),
14278 NeverReachable() and Throw() methods to modify the reachability.
14279 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
14280 done by FlowBranching.Merge().
14281 (FlowBranching.UsageVector.MergeChild): New method; merges the
14282 merge result into the current vector.
14283 (FlowBranching.Merge): New abstract method to merge a branching.
14285 2003-08-12 Martin Baulig <martin@ximian.com>
14287 * expression.cs (Indirection.CacheTemporaries): Create the
14288 LocalTemporary with the pointer type, not its element type.
14290 2003-08-10 Miguel de Icaza <miguel@ximian.com>
14292 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
14293 token was a keyword or not.
14295 Add `error' options where an IDENTIFIER was expected; Provide
14296 CheckToken and CheckIdentifierToken convenience error reporting
14299 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
14301 * decl.cs: Rename `NamespaceEntry Namespace' public field into
14302 NameSpaceEntry NameSpaceEntry.
14304 (LookupInterfaceOrClass): Avoid creating a full qualified name
14305 from namespace and name: avoid doing lookups when we know the
14306 namespace is non-existant. Use new Tree.LookupByNamespace which
14307 looks up DeclSpaces based on their namespace, name pair.
14309 * driver.cs: Provide a new `parser verbose' to display the
14310 exception thrown during parsing. This is turned off by default
14311 now, so the output of a failure from mcs is more graceful.
14313 * namespace.cs: Track all the namespaces defined in a hashtable
14316 (IsNamespace): New method
14318 2003-08-09 Miguel de Icaza <miguel@ximian.com>
14320 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
14321 we know that we need to concatenate (full typename can never be
14326 * statement.cs: Use a bitfield; Do not initialize to null things
14327 which are done by the constructor by default.
14329 * cs-parser.jay: bug fix, parameter was 4, not 3.
14331 * expression.cs: Just use the property;
14333 * statement.cs: No need for GetVariableInfo method.
14335 2003-08-08 Martin Baulig <martin@ximian.com>
14337 * flowanalysis.cs (FlowReturns): This is now nested in the
14338 `FlowBranching' class.
14339 (MyBitVector): Moved this here from statement.cs.
14340 (FlowBranching.SiblingType): New enum type.
14341 (FlowBranching.CreateSibling): Added `SiblingType' argument.
14343 2003-08-07 Martin Baulig <martin@ximian.com>
14345 * flowanalysis.cs (FlowBranchingType): This is now nested in the
14346 `FlowBranching' class and called `BranchingType'.
14348 2003-08-07 Martin Baulig <martin@ximian.com>
14350 * flowanalysis.cs: Moved all the control flow analysis code into
14353 2003-08-07 Martin Baulig <martin@ximian.com>
14355 * assign.cs (Assign.DoResolve): `target' must either be an
14356 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
14359 2003-08-07 Miguel de Icaza <miguel@ximian.com>
14361 * expression.cs (BinaryMethod): This kind of expression is created by the
14362 Binary class if it determines that the operator has to be handled
14365 (BinaryDelegate): This kind of expression is created if we are
14366 dealing with a + or - operator on delegates.
14368 (Binary): remove method, argumetns, and DelegateOperator: when
14369 dealing with methods,
14371 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
14373 * statement.cs (Block): use bitfields for the three extra booleans
14374 we had in use. Remove unused topblock parameter.
14376 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
14378 * assign.cs: Drop extra unneeded tests.
14380 2003-08-06 Miguel de Icaza <miguel@ximian.com>
14382 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
14384 * statement.cs (Foreach): Use VariableStorage instead of
14387 * codegen.cs (VariableStorage): New class used by clients that
14388 require a variable stored: locals or fields for variables that
14389 need to live across yield.
14391 Maybe provide a convenience api for EmitThis+EmitLoad?
14393 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
14396 2003-08-05 Miguel de Icaza <miguel@ximian.com>
14398 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
14399 RemapParameterLValue): New methods that are used to turn a
14400 precomputed FieldInfo into an expression like this:
14404 The idea is to use this instead of making LocalVariableReference
14405 have more than one meaning.
14407 * cs-parser.jay: Add error production to BASE.
14409 * ecore.cs: Deal with TypeManager.GetField returning null, which
14410 is now a valid return value.
14412 (FieldExprNoAddress): New expression for Fields whose address can
14415 * expression.cs (LocalVariableReference): During the resolve
14416 phases, create new expressions if we are in a remapping context.
14417 Remove code that dealt with remapping here.
14419 (ParameterReference): same.
14421 (ProxyInstance): New expression, like the `This' expression, but
14422 it is born fully resolved. We know what we are doing, so remove
14423 the errors that are targeted to user-provided uses of `this'.
14425 * statement.cs (Foreach): our variable is now stored as an
14426 Expression; During resolution, follow the protocol, dont just
14427 assume it will return this.
14429 2003-08-06 Martin Baulig <martin@ximian.com>
14431 * support.cs (SeekableStreamReader.cs): New public class.
14433 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
14434 SeekableStreamReader instead of the normal StreamReader.
14436 2003-08-04 Martin Baulig <martin@ximian.com>
14438 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
14439 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
14440 deambiguate casts and delegate invocations.
14441 (parenthesized_expression): Use the new tokens to ensure this is
14442 not a cast of method invocation.
14444 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
14445 when reading a `)' and Deambiguate_CloseParens () was previously
14448 * expression.cs (ParenthesizedExpression): New class. This is
14449 just used for the CS0075 test.
14450 (Binary.DoResolve): Check for CS0075.
14452 2003-07-29 Ravi Pratap <ravi@ximian.com>
14454 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
14455 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
14456 reference comparison.
14458 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
14459 examine the ReturnType for equality - this is necessary in the
14460 cases of implicit and explicit operators whose signature also
14461 includes the return type.
14463 2003-07-26 Miguel de Icaza <miguel@ximian.com>
14465 * namespace.cs: Cache the result of the namespace computation,
14466 instead of computing it every time.
14468 2003-07-24 Miguel de Icaza <miguel@ximian.com>
14470 * decl.cs: Use a global arraylist that we reuse over invocations
14471 to avoid excesive memory consumption. Reduces memory usage on an
14472 mcs compile by one meg (45 average).
14474 * typemanager.cs (LookupTypeReflection): In .NET pointers are
14475 private, work around that.
14477 2003-07-23 Miguel de Icaza <miguel@ximian.com>
14479 * literal.cs (IntLiteral): Define Zero and One static literals.
14481 * cs-parser.jay (integer_literal): use static literals to reduce
14482 memory usage for the most used literals (0, 1 and -1). 211kb
14483 reduced in memory usage.
14485 Replace all calls to `new ArrayList' with `new
14486 ArrayList(4)' which is a good average number for most allocations,
14487 and also requires only 16 bytes of memory for its buffer by
14490 This reduced MCS memory usage in seven megabytes for the RSS after
14493 2003-07-28 Ravi Pratap <ravi@ximian.com>
14495 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
14496 handle params methods the correct way by forming only one
14497 applicable set with params and normal methods in them. Earlier we
14498 were looking at params methods only if we found no normal methods
14499 which was not the correct thing to do.
14501 (Invocation.BetterFunction): Take separate arguments indicating
14502 when candidate and the best method are params methods in their
14505 This fixes bugs #43367 and #46199.
14507 * attribute.cs: Documentation updates.
14509 (CheckAttribute): Rename to CheckAttributeTarget.
14510 (GetValidPlaces): Rename to GetValidTargets.
14512 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
14513 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
14517 2003-07-28 Martin Baulig <martin@ximian.com>
14519 * class.cs (TypeContainer.DefineMembers): Use the base type's full
14520 name when looking up the base class of a nested class. Fixes #46977.
14522 2003-07-26 Martin Baulig <martin@ximian.com>
14524 * expression.cs (Indexers.Indexer): New nested struct; contains
14525 getter, setter and the indexer's type.
14526 (Indexers.Properties): This is now an ArrayList of
14527 Indexers.Indexer's.
14528 (IndexerAccess.DoResolveLValue): Correctly set the type if the
14529 indexer doesn't have any getters.
14531 * assign.cs (Assign.DoResolve): Also do the implicit conversions
14532 for embedded property and indexer assignments.
14534 2003-07-26 Martin Baulig <martin@ximian.com>
14536 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
14537 preprocessor directive is not the first non-whitespace character
14540 2003-07-26 Martin Baulig <martin@ximian.com>
14542 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
14543 namespace parsing, follow the spec more closely.
14545 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
14546 NamespaceEntry.Lookup().
14548 2003-07-25 Martin Baulig <martin@ximian.com>
14550 * MethodCore.cs (OverridesSomething): New public field; it's set
14551 from TypeContainer.DefineMembers if this method overrides
14552 something (which doesn't need to be a method). Fix #39462.
14554 2003-07-25 Ravi Pratap <ravi@ximian.com>
14556 * typemanager.cs (GetMembers): Ensure that the list of members is
14557 reversed. This keeps things in sync.
14559 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
14560 find an AttributeUsage attribute.
14562 * expression.cs (Invocation.OverloadResolve): Perform the check
14563 which disallows Invoke to be directly called on a Delegate.
14565 (Error_InvokeOnDelegate): Report error cs1533.
14567 2003-07-25 Martin Baulig <martin@ximian.com>
14569 * expression.cs (Indexers.GetIndexersForType): Only look in the
14570 interface hierarchy if the requested type is already an
14571 interface. Fixes #46788 while keeping #46502 fixed.
14573 2003-07-25 Martin Baulig <martin@ximian.com>
14575 * class.cs (TypeContainer.DefineMembers): Check whether all
14576 readonly fields have been assigned and report warning CS0649 if
14579 * statement.cs (LocalInfo.IsFixed): Always return true if this is
14582 2003-07-24 Ravi Pratap <ravi@ximian.com>
14584 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
14585 returned from GetMethods to make things consistent with the
14586 assumptions MCS makes about ordering of methods.
14588 This should comprehensively fix bug #45127 and it does :-)
14590 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
14591 ordering is actually reverse.
14593 * Clean up some debug messages I left lying around.
14595 * interface.cs (Populate*): Get rid of code which emits attributes
14596 since the stage in which we emit attributes is the 'Emit' stage,
14597 not the define stage.
14599 (Emit): Move attribute emission for interface members here.
14601 2003-07-22 Ravi Pratap <ravi@ximian.com>
14603 * expression.cs (Invocation.OverloadResolve): Follow the spec more
14604 closely: we eliminate methods in base types when we have an
14605 applicable method in a top-level type.
14607 Please see section 14.5.5.1 for an exact description of what goes
14610 This fixes bug #45127 and a host of other related to corlib compilation.
14612 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
14613 array is the method corresponding to the top-level type (this is
14614 because of the changes made to icall.c) so we change this
14617 (MethodGroupExpr.Name): This too.
14619 * typemanager.cs (GetElementType): New method which does the right
14620 thing when compiling corlib.
14622 * everywhere: Make use of the above in the relevant places.
14624 2003-07-22 Martin Baulig <martin@ximian.com>
14626 * cs-parser.jay (invocation_expression): Moved
14627 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
14628 `cast_expression', but create a InvocationOrCast which later
14629 resolves to either an Invocation or a Cast.
14631 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
14632 method; call this before EmitStatement() to make sure that this
14633 expression can be used as a statement.
14635 * expression.cs (InvocationOrCast): New class; resolves to either
14636 an Invocation or a Cast.
14638 * statement.cs (StatementExpression): Call ResolveStatement() on
14639 the ExpressionStatement before emitting it.
14641 2003-07-21 Martin Baulig <martin@ximian.com>
14643 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
14644 `ref' and `out' attributes match; fixes #46220.
14645 (MemberAccess.ResolveMemberAccess): You can't reference a type
14646 through an expression; fixes #33180.
14647 (Indexers.GetIndexersForType): Don't return the indexers from
14648 interfaces the class implements; fixes #46502.
14650 2003-07-21 Martin Baulig <martin@ximian.com>
14652 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
14653 CS0661 checks; fixes bug #30442.
14655 2003-07-21 Martin Baulig <martin@ximian.com>
14657 * decl.cs (AdditionResult): Added `Error'.
14659 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
14661 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
14662 makes cs0031.cs actually work.
14664 2003-07-20 Martin Baulig <martin@ximian.com>
14666 * namespace.cs: Fixed that bug which caused a crash when compiling
14667 the debugger's GUI.
14669 2003-07-20 Miguel de Icaza <miguel@ximian.com>
14671 * typemanager.cs (LookupTypeReflection): Never expose types which
14672 are NotPublic, NestedPrivate, NestedAssembly, or
14673 NestedFamANDAssem. We used to return these, and later do a check
14674 that would report a meaningful error, but the problem is that we
14675 would not get the real match, if there was a name override.
14677 2003-07-18 Miguel de Icaza <miguel@ximian.com>
14679 * namespace.cs (Namespace, Name): Do not compute the namespace
14680 name dynamically, compute it in the constructor. This reduced
14681 memory usage by 1697 KB.
14683 * driver.cs: Use --pause to pause at the end.
14685 2003-07-17 Peter Williams <peter@newton.cx>
14687 * Makefile: Change the name of the test target so that it doesn't
14688 conflict with the recursive test target.
14690 2003-07-17 Miguel de Icaza <miguel@ximian.com>
14692 * expression.cs (LocalVariableReference.Emit, EmitAssign,
14693 AddressOf): Do not use EmitThis, that was wrong, use the actual
14696 2003-07-15 Miguel de Icaza <miguel@ximian.com>
14698 * class.cs (MethodData.Define): While checking if a method is an
14699 interface implementation, improve the test: If we are not public
14700 (use new test here: use the computed MethodAttributes directly,
14701 instead of the parsed modifier flags) check if the `implementing'
14702 method comes from an interface or not.
14704 * pending.cs (VerifyPendingMethods): Slightly better error
14707 * makefile: add test target that does the mcs bootstrap.
14709 2003-07-16 Ravi Pratap <ravi@ximian.com>
14711 * interface.cs (Define): Do nothing here since there are no
14712 members to populate etc. Move the attribute emission out of here
14713 since this was just totally the wrong place to put it. Attribute
14714 application happens during the 'Emit' phase, not in the 'Define'
14717 (Emit): Add this method and move the attribute emission here
14719 * rootcontext.cs (EmitCode): Call the Emit method on interface
14722 2003-07-14 Ravi Pratap M <ravi@ximian.com>
14724 * expression.cs (OverloadResolve): Report error only if Location
14725 is not 'Null' which means that there was a probe going on.
14727 2003-07-14 Martin Baulig <martin@ximian.com>
14729 * expression.cs (ConditionalLogicalOperator): New public class to
14730 implement user defined conditional logical operators.
14731 This is section 14.11.2 in the spec and bug #40505.
14733 2003-07-14 Martin Baulig <martin@ximian.com>
14735 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
14737 2003-07-14 Martin Baulig <martin@ximian.com>
14739 * codegen.cs (EmitContext.InFixedInitializer): New public field.
14741 * ecore.cs (IVariable.VerifyFixed): New interface method.
14743 * expression.cs (Unary.ResolveOperator): When resolving the `&'
14744 operator, check whether the variable is actually fixed. Fixes bug
14745 #36055. Set a variable definitely assigned when taking its
14746 address as required by the spec.
14748 * statement.cs (LocalInfo.IsFixed): New field.
14749 (LocalInfo.MakePinned): Set `IsFixed' to true.
14751 2003-07-14 Ravi Pratap M <ravi@ximian.com>
14753 * attribute.cs (Attribute.Resolve): While doing a Member lookup
14754 for .ctors, ensure that we only ask for members declared in the
14755 attribute type (BindingFlags.DeclaredOnly).
14759 * expression.cs (Error_WrongNumArguments): Report error 1501
14760 correctly the way CSC does.
14762 2003-07-13 Martin Baulig <martin@ximian.com>
14764 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
14765 lookup on the fully qualified name, to make things like "X.X" work
14766 where "X.X" is a fully qualified type name, but we also have a
14767 namespace "X" in the using list. Fixes #41975.
14769 2003-07-13 Martin Baulig <martin@ximian.com>
14771 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
14772 function. If we're a CompoundAssign, we need to create an embedded
14773 CompoundAssign, not an embedded Assign.
14774 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
14777 2003-07-13 Martin Baulig <martin@ximian.com>
14779 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
14780 work to fix bug #46088.
14782 2003-07-13 Ravi Pratap <ravi@ximian.com>
14784 * class.cs (Operator.Emit): Do not emit attributes here - it is
14785 taken care of by the Method class that we delegate too. This takes
14786 care of bug #45876.
14788 2003-07-10 Martin Baulig <martin@ximian.com>
14790 * expression.cs (TypeOfVoid): New class.
14791 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
14793 2003-07-10 Martin Baulig <martin@ximian.com>
14795 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
14798 2003-07-10 Martin Baulig <martin@ximian.com>
14800 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
14801 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
14803 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
14805 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
14807 2003-07-10 Martin Baulig <martin@ximian.com>
14809 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
14810 of decimal. Fixes #42850.
14812 NOTE: I also fixed the created byte blob, but this doesn't work on
14813 the MS runtime and csc never produces any byte blobs for decimal
14816 2003-07-10 Martin Baulig <martin@ximian.com>
14818 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
14819 structs; fixes #32068.
14820 (Block.AddChildVariableNames): Fixed #44302.
14822 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14824 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
14826 2003-07-07 Miguel de Icaza <miguel@ximian.com>
14828 * attribute.cs: And this test is onger needed.
14830 2003-07-08 Martin Baulig <martin@ximian.com>
14832 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
14833 inaccessible types. Fixes #36313.
14835 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
14837 * namespace.cs (NamespaceEntry): Create implicit entries for all
14838 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
14839 implicit entries for N1.N2 and N1.
14841 2003-07-08 Martin Baulig <martin@ximian.com>
14843 Rewrote the handling of namespaces to fix a lot of the issues
14844 wrt. `using' aliases etc.
14846 * namespace.cs (Namespace): Splitted this class into a
14847 per-assembly `Namespace' and a per-file `NamespaceEntry'.
14849 * typemanager.cs (TypeManager.IsNamespace): Removed.
14850 (TypeManager.ComputeNamespaces): Only compute namespaces from
14851 loaded assemblies here, not the namespaces from the assembly we're
14852 currently compiling.
14854 2003-07-08 Martin Baulig <martin@ximian.com>
14856 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
14858 2003-07-07 Miguel de Icaza <miguel@ximian.com>
14860 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
14863 I thought about the memory savings here, but LookupTypeReflection
14864 is used under already very constrained scenarios. Compiling
14865 corlib or mcs only exposes one hit, so it would not really reduce
14866 any memory consumption.
14868 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14870 * typemanager.cs: fixes bug #45889 by only adding public types from
14871 other assemblies to the list of known types.
14873 2003-07-07 Miguel de Icaza <miguel@ximian.com>
14875 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
14876 on the type we resolved.
14878 2003-07-05 Martin Baulig <martin@ximian.com>
14880 * pending.cs (PendingImplementation.ParentImplements): Don't
14881 create the proxy if the parent is abstract.
14883 * class.cs (TypeContainer.DefineIndexers): Process explicit
14884 interface implementations first. Fixes #37714.
14886 2003-07-04 Miguel de Icaza <miguel@ximian.com>
14888 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
14889 defined recursively; but since we modify the input parameters
14890 (left is set to `this' temporarily), we reset this value if the
14891 left_is_explicit is false, which gives the original semantics to
14894 * literal.cs (NullPointer): new class used to represent a null
14895 literal in a pointer context.
14897 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
14898 type is a pointer, use a NullPointer object instead of a
14899 NullLiteral. Closes 43687
14901 (ExplicitConversion): Convert pointer values using
14902 the conv opcode to the proper type.
14904 * ecore.cs (New): change ValueTypeVariable property into a method,
14905 that returns whether the valuetype is suitable for being used.
14907 * expression.cs (Binary.DoNumericPromotions): Only return if we
14908 the int constant was a valid uint, and we can return both left and
14909 right as uints. If not, we continue processing, to trigger the
14910 type conversion. This fixes 39018.
14912 * statement.cs (Block.EmitMeta): During constant resolution, set
14913 the CurrentBlock property on the emitcontext, so that we resolve
14914 constants propertly.
14916 2003-07-02 Martin Baulig <martin@ximian.com>
14918 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
14919 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
14921 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
14922 than emitting it here.
14924 * statement.cs: Fixed some more flow analysis bugs.
14926 2003-07-02 Martin Baulig <martin@ximian.com>
14928 * class.cs (MethodData.Define): When implementing interface
14929 methods, set Final unless we're Virtual.
14931 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
14932 check work for interface methods.
14934 2003-07-01 Martin Baulig <martin@ximian.com>
14936 * ecore.cs (EmitContext.This): Replaced this property with a
14937 GetThis() method which takes a Location argument. This ensures
14938 that we get the correct error location for a CS0188.
14940 2003-07-01 Miguel de Icaza <miguel@ximian.com>
14942 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
14943 ImplicitStandardConversion.
14945 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
14947 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
14949 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
14952 2003-06-30 Miguel de Icaza <miguel@ximian.com>
14954 * class.cs (Constructor.Define): Turn off initlocals for unsafe
14957 (MethodData.Define): Turn off initlocals for unsafe methods.
14959 2003-06-29 Miguel de Icaza <miguel@ximian.com>
14961 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
14962 complete; Fixes #37521.
14964 * delegate.cs: Use Modifiers.TypeAttr to compute the
14965 TypeAttributes, instead of rolling our own. This makes the flags
14966 correct for the delegates.
14968 2003-06-28 Miguel de Icaza <miguel@ximian.com>
14970 * class.cs (Constructor.Define): Set the private flag for static
14971 constructors as well.
14973 * cs-parser.jay (statement_expression): Set the return value to
14974 null, to avoid a crash when we catch an error.
14976 2003-06-24 Miguel de Icaza <miguel@ximian.com>
14978 * cs-parser.jay: Applied patch from Jackson that adds support for
14979 extern and unsafe modifiers to destructor declarations.
14981 * expression.cs: Report error 21 if the user is trying to index a
14984 * driver.cs: Add an error message, suggested by the bug report.
14986 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
14987 if we do not have a ": this ()" constructor initializer. Fixes 45149
14989 2003-06-14 Miguel de Icaza <miguel@ximian.com>
14991 * namespace.cs: Add some information to reduce FAQs.
14993 2003-06-13 Miguel de Icaza <miguel@ximian.com>
14995 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
14996 underlying enumeration types. Fixes #43915.
14998 * expression.cs: Treat ushort/short as legal values to be used in
14999 bitwise operations.
15001 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
15003 * delegate.cs: transfer custom attributes for paramenters from
15004 the delegate declaration to Invoke and BeginInvoke.
15006 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
15008 * attribute.cs: handle custom marshalers and emit marshal info
15011 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
15013 * makefile.gnu: Added anonymous.cs to the compiler sources.
15015 2003-05-28 Miguel de Icaza <miguel@ximian.com>
15017 * iterators.cs: Change the name of the proxy class to include two
15020 * cs-parser.jay: Update grammar to include anonymous methods.
15022 * anonymous.cs: new file.
15024 2003-05-27 Miguel de Icaza <miguel@ximian.com>
15026 * class.cs (Field.Define): Add missing test for pointers and
15029 2003-05-27 Ravi Pratap <ravi@ximian.com>
15031 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
15032 we use the stobj opcode.
15034 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
15035 since it wasn't the correct fix.
15037 It still is puzzling that we are required to use stobj for IntPtr
15038 which seems to be a ValueType.
15040 2003-05-26 Miguel de Icaza <miguel@ximian.com>
15042 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
15043 during regular simple name resolution. Now, the trick is that
15044 instead of returning for processing the simplename, we do a
15045 TypeManager.LookupType (ie, a rooted lookup as opposed to a
15046 contextual lookup type). If a match is found, return that, if
15047 not, return for further composition.
15049 This fixes long-standing 30485.
15051 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
15052 using the address to initialize an object, do an Stobj instead of
15053 using the regular Stelem.
15055 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
15056 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
15057 Because if we are a BaseIndexerAccess that value will be true.
15060 * statement.cs (GotoCase.Resolve): Return after reporting an
15061 error, do not attempt to continue.
15063 * expression.cs (PointerArithmetic.Emit): If our operand is a
15064 long, convert our constants to match the operand before
15065 multiplying. Convert to I type before adding. Fixes 43670.
15067 2003-05-14 Ravi Pratap <ravi@ximian.com>
15069 * enum.cs (ImplicitConversionExists) : Rename to
15070 ImplicitEnumConversionExists to remove ambiguity.
15072 * ecore.cs (NullCast): New type of cast expression class which
15073 basically is very similar to EmptyCast with the difference being
15074 it still is a constant since it is used only to cast a null to
15076 (eg. (string) null)
15078 * convert.cs (ImplicitReferenceConversion): When casting a null
15079 literal, we return a NullCast.
15081 * literal.cs (NullLiteralTyped): Remove - I don't see why this
15082 should be around anymore.
15084 The renaming (reported was slightly wrong). Corrections:
15086 ConvertImplicitStandard -> ImplicitConversionStandard
15087 ConvertExplicitStandard -> ExplicitConversionStandard
15089 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
15090 before passing them in !
15092 * convert.cs (ImplicitConversionStandard): When comparing for
15093 equal expr and target types, ensure that expr is not a
15096 In general, we must not be checking (expr_type ==
15097 target_type) in the top level conversion methods
15098 (ImplicitConversion, ExplicitConversion etc). This checking is
15099 done in the methods that they delegate to.
15101 2003-05-20 Miguel de Icaza <miguel@ximian.com>
15103 * convert.cs: Move Error_CannotConvertType,
15104 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
15105 ImplicitNumericConversion, ImplicitConversionExists,
15106 ImplicitUserConversionExists, StandardConversionExists,
15107 FindMostEncompassedType, FindMostSpecificSource,
15108 FindMostSpecificTarget, ImplicitUserConversion,
15109 ExplicitUserConversion, GetConversionOperators,
15110 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
15111 TryImplicitIntConversion, Error_CannotConvertImplicit,
15112 ConvertImplicitRequired, ConvertNumericExplicit,
15113 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
15114 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
15117 Perform the following renames:
15119 StandardConversionExists -> ImplicitStandardConversionExists
15120 ConvertImplicit -> ImplicitConversion
15121 ConvertImplicitStandard -> ImplicitStandardConversion
15122 TryImplicitIntConversion -> ImplicitIntConversion
15123 ConvertImplicitRequired -> ImplicitConversionRequired
15124 ConvertNumericExplicit -> ExplicitNumericConversion
15125 ConvertReferenceExplicit -> ExplicitReferenceConversion
15126 ConvertExplicit -> ExplicitConversion
15127 ConvertExplicitStandard -> ExplicitStandardConversion
15129 2003-05-19 Martin Baulig <martin@ximian.com>
15131 * statement.cs (TypeInfo.StructInfo): Made this type protected.
15132 (TypeInfo): Added support for structs having structs as fields.
15134 * ecore.cs (FieldExpr): Implement IVariable.
15135 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
15136 VariableInfo for the field.
15138 2003-05-18 Martin Baulig <martin@ximian.com>
15140 * expression.cs (This.DoResolve): Report a CS0027 if we're
15141 emitting a field initializer.
15143 2003-05-18 Martin Baulig <martin@ximian.com>
15145 * expression.cs (This.ResolveBase): New public function.
15146 (This.DoResolve): Check for CS0188.
15148 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
15151 * ecore.cs (MethodGroupExpr.DoResolve): Set the
15152 `instance_expression' to null if we don't have any non-static
15155 2003-05-18 Martin Baulig <martin@ximian.com>
15157 Reworked the way how local variables and parameters are handled by
15158 the flow analysis code.
15160 * statement.cs (TypeInfo, VariableMap): New public classes.
15161 (VariableInfo): New public class. This is now responsible for
15162 checking whether a variable has been assigned. It is used for
15163 parameters and local variables.
15164 (Block.EmitMeta): Take the InternalParameters as argument; compute
15165 the layout of the flow vectors here.
15166 (Block.LocalMap, Block.ParameterMap): New public properties.
15167 (FlowBranching): The .ctor doesn't get the InternalParameters
15168 anymore since Block.EmitMeta() now computes the layout of the flow
15170 (MyStructInfo): This class is now known as `StructInfo' and nested
15171 in `TypeInfo'; we don't access this directly anymore.
15173 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
15174 property and removed IsAssigned(), IsFieldAssigned(),
15175 SetAssigned() and SetFieldAssigned(); we now call them on the
15176 VariableInfo so we don't need to duplicate this code everywhere.
15178 * expression.cs (ParameterReference): Added `Block block' argument
15180 (LocalVariableReference, ParameterReference, This): The new
15181 VariableInfo class is now responsible for all the definite
15184 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
15185 IsParameterAssigned, SetParameterAssigned): Removed.
15187 2003-05-18 Martin Baulig <martin@ximian.com>
15189 * typemanager.cs (InitCoreTypes): Try calling
15190 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
15191 the 3-args-version. Corlib now also needs our `void_type'.
15192 (GetMethod): Added overloaded version which takes an optional
15193 `bool report_errors' to allow lookups of optional methods.
15195 2003-05-12 Martin Baulig <martin@ximian.com>
15197 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
15198 only used for locals and not for parameters.
15200 2003-05-12 Miguel de Icaza <miguel@ximian.com>
15202 * support.cs (InternalParameters.ParameterType): Return the
15203 ExternalType of the parameter.
15205 * parameter.cs (Parameter.ExternalType): drop the two arguments,
15208 2003-05-11 Miguel de Icaza <miguel@ximian.com>
15210 * class.cs (MethodData.Define): Do not set the `newslot' on
15211 interface members, if they are also flagged as "override".
15213 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
15214 better code for ++i and i++. This only works for static fields
15215 and local variables.
15217 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
15218 want to pull the DeclSpace out of the builder_to_declspace instead
15219 of the TypeBuilder (like in TypeContainer.FindMembers).
15221 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
15222 instead of LookupTypeContainer. Fixes the crash on .NET for
15223 looking up interface members.
15225 * const.cs: Create our own emit context during the Definition
15226 stage, so that constants are evaluated in the proper context, when
15227 a recursive definition happens.
15229 2003-05-11 Martin Baulig <martin@ximian.com>
15231 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
15232 new block for a switch section.
15233 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
15234 the adding/lookup in the switch block. Fixes #39828.
15236 2003-05-09 Miguel de Icaza <miguel@ximian.com>
15238 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
15239 functionality: I needed to convert the data after I had performed
15240 the add/sub operation into the operands type size.
15242 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
15243 pass the type for the box operation, otherwise the resulting
15244 object would have been of type object.
15246 (BoxedCast): Add constructor to specify the type to box as.
15248 2003-05-07 Miguel de Icaza <miguel@ximian.com>
15250 * iterators.cs: I was reusing the `count' variable inadvertently,
15251 take steps to not allow this to happen.
15253 2003-05-06 Miguel de Icaza <miguel@ximian.com>
15255 * attribute.cs (Attribute.Resolve): Params attributes are encoded
15256 by creating an array at the point where the params starts and
15257 putting all those arguments there, then adjusting the size of the
15260 2003-05-05 Miguel de Icaza <miguel@ximian.com>
15262 * expression.cs (New.AddressOf): Implement interface
15263 IMemoryLocation. This is used when the `new' operator is used in
15264 the context of an invocation to a method on a value type.
15266 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
15269 * namespace.cs: Also check the using aliases here.
15271 * driver.cs: Move the test for using validity after the types have
15272 been entered, so we do a single pass that also includes the using
15275 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
15276 in the regular case. CreateSiblingForFinally is doing extra
15279 * attribute.cs (GetAttributeArgumentExpression): Store the result
15280 on an out value, and use the return value to indicate failure
15281 instead of using null (which is a valid return for Constant.GetValue).
15283 * statement.cs: Perform the analysis flow for the increment
15284 portion after the statement, because this will be the real flow of
15285 execution. Fixes #42385
15287 * codegen.cs (EmitContext.EmitArgument,
15288 EmitContext.EmitStoreArgument): New helper functions when the
15289 RemapToProxy flag is set.
15291 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
15294 Add support for remapping parameters.
15296 * iterators.cs: Propagate parameter values; Store parameter
15297 values in the proxy classes.
15299 2003-05-04 Miguel de Icaza <miguel@ximian.com>
15301 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
15302 need a proxy reference; I do not know what I was thinking
15304 * cs-parser.jay (constructor_initializer): catch another error,
15305 and display nice message.
15307 (field_declaration): catch void field declaration
15308 to flag a better error.
15310 * class.cs (MemberBase.CheckBase): Report an error instead of a
15311 warning if a new protected member is declared in a struct.
15312 (Field.Define): catch the error of readonly/volatile.
15314 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
15316 (FieldExpr.AddressOf): ditto. Catch error where the address of a
15317 volatile variable is taken
15319 2003-05-02 Miguel de Icaza <miguel@ximian.com>
15321 * statement.cs (Fixed.Resolve): Report an error if we are not in
15324 2003-05-01 Miguel de Icaza <miguel@ximian.com>
15326 * typemanager.cs: reuse the code that handles type clashes for
15327 delegates and enumerations.
15329 * class.cs (Report28): Always report.
15331 * expression.cs (EncodeAsAttribute): Allow nulls here.
15333 2003-04-28 Miguel de Icaza <miguel@ximian.com>
15335 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
15336 the functionality for testing whether an expression is valid for
15337 an attribute here. Also handle the case of arrays of elements
15340 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
15341 encoding a linear array into an array of objects that are suitable
15342 to be passed to an CustomAttributeBuilder.
15344 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
15346 * ecore.cs: (FieldExpr): Handle field remapping here.
15348 * iteratators.cs: Pass the instance variable (if the method is an
15349 instance method) to the constructors, so we can access the field
15350 variables on the class.
15352 TODO: Test this with structs. I think the THIS variable on
15353 structs might have to be a pointer, and not a refenrece
15355 2003-04-27 Miguel de Icaza <miguel@ximian.com>
15357 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
15358 local variables to fields in a proxy class.
15360 * iterators.cs (PopulateProxy): Rename our internal fields to
15362 Create a <THIS> field if we are an instance method, so we can
15363 reference our parent container variables.
15364 (MapVariable): Called back from the EmitContext code to enter a
15365 new variable to field mapping into the proxy class (we just create
15369 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
15370 for using the remapped locals to fields.
15372 I placed the code here, because that gives the same semantics to
15373 local variables, and only changes the Emit code.
15375 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
15376 statements inside iterators.
15377 (VariableInfo): Add a FieldBuilder for the cases when we are
15378 remapping local variables to fields in a proxy class
15380 * ecore.cs (SimpleNameResolve): Avoid testing two times for
15381 current_block != null.
15383 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
15384 not cope with strings, as it has been moved to the
15385 TableSwitchEmit. Fixed bug in switch generation.
15387 * expression.cs (New.DoResolve): Provide more context for the user
15388 when reporting an error.
15390 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
15393 * expression.cs (MemberAccess.DoResolve): When we get a type back,
15394 check the permissions for it. Note than in a type-resolution
15395 context the check was already present in DeclSpace.ResolveType,
15396 but was missing from the MemberAccess.
15398 (ArrayCreation.CheckIndices): warn if the user has
15399 more nested levels of expressions, but there are no more
15400 dimensions specified. Avoids crash on bug 41906.
15402 2003-04-26 Miguel de Icaza <miguel@ximian.com>
15404 * statement.cs (Block): replace Implicit bool, for a generic
15406 New flag: `Unchecked'. This is used during the EmitMeta phase
15407 (which is out-of-line with the regular Resolve/Emit process for a
15408 statement, as this is done ahead of time, but still gets a chance
15409 to call constant resolve).
15411 (Block.Flags): new enum for adding a new flag.
15413 (Block.EmitMeta): track the state of unchecked.
15415 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
15416 to enable constant resolution to work there as well.
15418 2003-04-22 Miguel de Icaza <miguel@ximian.com>
15420 * typemanager.cs (ienumerable_type): Also look up
15421 System.Collections.IEnumerable.
15423 2003-04-21 Miguel de Icaza <miguel@ximian.com>
15425 TODO: Test more than one conditional per method.
15427 * class.cs (Indexer.Define): Report the location where the user is
15428 referencing the unsupported feature.
15430 (MethodData): Overload the use of `conditionals' to
15431 minimize the creation of needless ArrayLists. This saves roughly
15432 212kb on my machine.
15434 (Method): Implement the new IIteratorContainer interface.
15435 (Method.SetYields): Implement the method by setting the ModFlags
15436 to contain METHOD_YIELDS.
15438 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
15439 which just got set to null.
15441 * iterators.cs: New file.
15443 (Yield, YieldBreak): New statements.
15445 * statement.cs (Return.Resolve): Flag an error if we are used in
15446 an iterator method.
15448 * codegen.cs (InIterator): New flag set if the code is being
15449 compiled in an iterator method.
15451 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
15452 internal modifier, and we just use it to avoid adding extra
15453 fields, as this is seldom used.
15455 * cs-parser.jay: Add yield_statement (yield and yield break).
15457 * driver.cs: New flag -v2 to turn on version 2 features.
15459 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
15460 hashtable when v2 is enabled.
15462 2003-04-20 Miguel de Icaza <miguel@ximian.com>
15464 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
15465 there is already a namespace defined with this name.
15467 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
15468 people upgraded their corlibs.
15470 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
15471 always use fully qualified types, no need to use the compiler
15474 (TypeManager.IsNamespace): Use binarysearch.
15476 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
15477 AddDelegate): I did not quite use the new IsValid API properly: I
15478 have to pass the short-name and the fullname. I was passing only
15479 the basename instead of the fullname sometimes.
15481 (TypeContainer.DefineType): call NamespaceClash.
15483 * interface.cs (Interface.DefineType): use NamespaceClash before
15486 * delegate.cs (Delegate.DefineType): use NamespaceClash before
15489 * enum.cs: (Enum.DefineType): use NamespaceClash before
15492 * typemanager.cs (: 3-line patch that gives us some tasty 11%
15493 speed increase. First, use the negative_hits cache when we get a
15494 negative. Second, add the type with its full original name
15495 instead of the new . and + encoded name (reflection uses + to
15496 separate type from a nested type). Use LookupTypeReflection
15497 directly which bypasses the type->name hashtable (that we already
15498 know does not contain the type.
15500 * decl.cs (DeclSpace.ResolveTypeExpr): track the
15501 location/container type.
15503 * driver.cs: When passing utf8, use directly the UTF8Encoding.
15505 2003-04-19 Miguel de Icaza <miguel@ximian.com>
15507 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
15509 * delegate.cs (NewDelegate.Resolve): Test whether an instance
15510 method is being referenced in the method group from a static
15511 context, and report error 120 if so.
15513 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
15516 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
15517 is created, we create the A namespace).
15519 * cs-parser.jay: A namespace also introduces a DeclarationFound.
15522 2003-04-18 Miguel de Icaza <miguel@ximian.com>
15524 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
15525 invocation to ModuleBuilder.GetType with the same values will
15526 return a new type instance, so we need to cache its return
15529 * expression.cs (Binary.ResolveOperator): Only allow the compare
15530 operators on enums if they are of the same type.
15532 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
15533 types of ValueType on their own case. Before we were giving them
15534 the same treatment as objects.
15536 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
15537 fullname. Short name is used to compare against container name.
15538 Fullname is used to check against defined namespace names.
15540 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
15541 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
15543 (Method.CheckBase): Call parent.
15544 (MemberBase.CheckBase): Check for protected members on sealed
15546 (PropertyBase.CheckBase): Call parent.
15547 (Field.Define): Call parent.
15549 * report.cs: Negative error codes are now mapped to 8000 - code,
15550 so that the display is render more nicely.
15552 * typemanager.cs: Do not use try/catch, instead report a regular
15555 (GetPointerType, GetReferenceType): These methods provide
15556 mechanisms to obtain the T* and T& from a T. We had the code
15557 previously scattered around the code base, and it also used
15558 TypeManager.LookupType that would go through plenty of caches.
15559 This one goes directly to the type source.
15561 In some places we did the Type.GetType followed by
15562 ModuleBuilder.GetType, but not in others, so this unifies the
15563 processing as well.
15565 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
15566 statements now that we have namespace information.
15568 * typemanager.cs (IsNamespace): New method, returns whether the
15569 string presented is a namespace or not.
15571 (ComputeNamespaces): New public entry point, computes the list of
15572 available namespaces, using the GetNamespaces API call in Mono, or
15573 the slower version in MS.NET.
15575 Now before we start the semantic analysis phase, we have a
15576 complete list of namespaces including everything that the user has
15579 Deleted old code to cache namespaces in .nsc files.
15581 2003-04-17 Miguel de Icaza <miguel@ximian.com>
15583 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
15584 class/struct location definition Location for the implicit
15585 constructor location.
15587 (Operator.Define): Use the location of the operator for the
15588 implicit Method definition.
15590 (Constructor.Emit): use the constructor location for the implicit
15591 base initializer constructor.
15593 * ecore.cs: Remove ITypeExpression. This interface is now gone,
15594 and the Expression class now contains two new methods:
15596 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
15597 isolate type lookup from the rest of the resolution process.
15599 Since we use Expressions to hold type definitions due to the way
15600 we parse the input we have historically overloaded Resolve to
15601 perform the Type lookups if a special flag is passed. Now this is
15602 eliminated and two methods take their place.
15604 The differences in the two methods between xStep and xTerminal is
15605 that xStep is involved in our current lookup system that uses
15606 SimpleNames to compose a name, while xTerminal is used just to
15607 catch the case where the simplename lookup failed.
15609 2003-04-16 Miguel de Icaza <miguel@ximian.com>
15611 * expression.cs (ResolveMemberAccess): Remove redundant code.
15612 TypeExpr expressions are always born fully resolved.
15614 * interface.cs (PopulateMethod): Do not lookup the types twice.
15615 We were doing it once during SemanticAnalysis and once during
15618 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
15619 in local variable type definitions, were being returned as a
15620 SimpleName (we decomposed everything into a string), that is
15621 because primary_expression was being used instead of a type in the
15622 grammar (reduce/reduce conflicts).
15624 The part that was wrong is that we converted the expression into a
15625 string (an oversimplification in one hand, compounded with primary
15626 expressions doing string concatenation).
15632 Would return "A.B.C[]" as a SimpleName. This stopped things like
15633 using clauses from working on this particular context. And a type
15634 was being matched directly against "A.B.C[]".
15636 We now use the correct approach, and allow for ComposedCast to be
15637 part of the unary expression. So the "A.B.C []" become a composed
15638 cast of "A.B.C" (as a nested group of MemberAccess with a
15639 SimpleName at the end) plus the rank composition "[]".
15643 2003-04-10 Miguel de Icaza <miguel@ximian.com>
15645 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
15646 for the access level checking.
15648 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
15649 `TypeContainer container', because I kept getting confused when I
15650 was debugging this code.
15652 * expression.cs (Indexers): Instead of tracking getters/setters,
15653 we now track them in parallel. We create one arraylist less, but
15654 most importantly it is possible now for the LValue code to find a
15655 matching get for a set.
15657 (IndexerAccess.DoResolveLValue): Update the code.
15658 GetIndexersForType has been modified already to extract all the
15659 indexers from a type. The code assumed it did not.
15661 Also make the code set the correct return type for the indexer.
15662 This was fixed a long time ago for properties, but was missing for
15663 indexers. It used to be void_type.
15665 (Binary.Emit): Test first for doubles instead of
15666 floats, as they are more common.
15668 (Binary.EmitBranchable): Use the .un version of the branch opcodes
15669 when dealing with floats and the <=, >= operators. This fixes bug
15672 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
15673 to load the array value by emitting a load on the foreach variable
15674 type. This was incorrect.
15676 We now emit the code to load an element using the the array
15677 variable type, and then we emit the conversion operator.
15681 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
15683 * attribute.cs: Avoid allocation of ArrayLists in the common case.
15685 2003-04-09 Miguel de Icaza <miguel@ximian.com>
15687 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
15688 test for protection before we test for signatures.
15690 (MethodSignature.ToString): implement.
15692 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
15693 to the case where we reduced into a LongConstant.
15695 * decl.cs (CheckAccessLevel): If the type is an array, we can not
15696 depend on whether the information is acurrate, because the
15697 Microsoft runtime will always claim that the array type is public,
15698 regardless of the real state.
15700 If the type is a pointer, another problem happens: the type is
15701 reported as non-public in Microsoft.
15703 In both cases we have to call CheckAccessLevel recursively with
15704 the underlying type as the argument to be tested.
15706 2003-04-08 Miguel de Icaza <miguel@ximian.com>
15708 * assign.cs (Assign.Emit): If we are dealing with a compound
15709 assignment expression, we should use the code path that stores the
15710 intermediate result in a temporary value. This fixes #40903.
15712 *expression.cs (Indirection.ToString): Provide ToString method for
15715 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
15717 * class.cs: Null out fields holding references to Block objects so
15718 they can be garbage collected.
15720 * expression.cs (OverloadResolve): Remove unused local.
15722 2003-04-07 Martin Baulig <martin@ximian.com>
15724 * codegen.cs (EmitContext.CurrentFile): New public field.
15725 (EmitContext.Mark): Use the CurrentFile to check whether the
15726 location is in the correct file.
15727 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
15729 2003-04-07 Martin Baulig <martin@ximian.com>
15731 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
15733 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
15734 location. [FIXME: The location argument which gets passed to this
15735 method is sometimes wrong!]
15737 2003-04-07 Nick Drochak <ndrochak@gol.com>
15739 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
15741 2003-04-07 Miguel de Icaza <miguel@ximian.com>
15743 * expression.cs (Indirection.EmitAssign): We were using the
15744 temporary, but returning immediately instead of continuing the
15747 2003-04-06 Martin Baulig <martin@ximian.com>
15749 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
15750 if it's a nested child, but also deriving from the outer class.
15753 * typemanager.cs (IsNestedChildOf): Make this work if it's a
15754 nested child, but also deriving from the outer class. See
15756 (FilterWithClosure): We may access private members of the outer
15757 class if we're a nested child and deriving from the outer class.
15758 (RealMemberLookup): Only set `closure_private_ok' if the
15759 `original_bf' contained BindingFlags.NonPublic.
15761 2003-04-05 Martin Baulig <martin@ximian.com>
15763 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
15765 2003-04-02 Miguel de Icaza <miguel@ximian.com>
15767 * class.cs (Event.Define): Do not allow abstract events to have
15770 2003-04-01 Miguel de Icaza <miguel@ximian.com>
15772 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
15773 block in event declarations.
15775 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
15776 value type, get its address.
15778 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
15779 leaving a class on the stack instead of a boolean value (int
15780 0/1). Change the code so we compare against null, and then the
15781 result against zero.
15783 * class.cs (TypeContainer.GetClassBases): We were checking for the
15784 parent class being sealed too late.
15786 * expression.cs (Binary.Emit): For <= and >= when dealing with
15787 floating point values, use cgt.un and clt.un instead of cgt and
15790 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
15792 * statement.cs: Apply the same optimization as MS: skip the
15793 GetEnumerator returning an IEnumerator, and use the one returning a
15794 CharEnumerator instead. This allows us to avoid the try-finally block
15797 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
15799 * cs-parser.jay: Attributes cannot be applied to
15800 namespaces. Fixes #40473
15802 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15805 (Add*): check if the name is valid using the full name for constants,
15806 fields, properties and events.
15808 2003-03-28 Miguel de Icaza <miguel@ximian.com>
15810 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
15811 char constants to be part of the enumeration.
15813 * expression.cs (Conditional.DoResolve): Add support for operator
15814 true. Implements the missing functionality from 14.12
15816 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
15817 operator true/false as required by the spec.
15819 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
15820 implicit conversion to boolean.
15822 * statement.cs (Statement.ResolveBoolean): A boolean expression is
15823 also one where the type implements `operator true'.
15825 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
15826 get an expression that will invoke operator true based on an
15829 (GetConversionOperators): Removed the hack that called op_True
15832 (Expression.ResolveBoolean): Move this from Statement.
15834 2003-03-17 Miguel de Icaza <miguel@ximian.com>
15836 * ecore.cs (FieldExpr): do not allow initialization of initonly
15837 fields on derived classes
15839 2003-03-13 Martin Baulig <martin@ximian.com>
15841 * statement.cs (Block.Emit): Call ig.BeginScope() and
15842 ig.EndScope() when compiling with debugging info; call
15843 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
15845 2003-03-08 Miguel de Icaza <miguel@ximian.com>
15847 * expression.cs (Indexers): Do not construct immediately, allow
15848 for new members to be appended as we go. Fixes 38143
15850 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15852 * expression.cs: save/restore context when resolving an unchecked
15855 2003-03-05 Miguel de Icaza <miguel@ximian.com>
15857 * cfold.cs: Catch division by zero in modulus operator during
15860 2003-03-03 Miguel de Icaza <miguel@ximian.com>
15862 * interface.cs (Interface.DefineMembers): Avoid defining members
15865 2003-02-27 Miguel de Icaza <miguel@ximian.com>
15867 * driver.cs: handle the +/- options for -noconfig
15869 * statement.cs (Unckeched.Resolve): Also track the state of
15870 unchecked in the Resolve phase.
15872 2003-02-27 Martin Baulig <martin@ximian.com>
15874 * ecore.cs (Expression.MemberLookup): Don't create a
15875 MethodGroupExpr for something which is not a method. Fixes #38291.
15877 2003-02-25 Miguel de Icaza <miguel@ximian.com>
15879 * class.cs (MemberBase.CheckParameters): Also check that the type
15880 is unmanaged if it is a pointer.
15882 * expression.cs (SizeOf.Resolve): Add location information.
15884 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
15885 a managed type is declared.
15887 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
15888 parameter modifiers as well. Fixes bug 38606
15890 * class.cs: Very sad. Am backing out the speed up changes
15891 introduced by the ArrayList -> Array in the TypeContainer, as they
15892 were not actually that much faster, and introduced a bug (no error
15893 reports on duplicated methods).
15895 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
15896 source first, this will guarantee that we have a valid expression
15897 before calling in lower levels functions that will require a
15898 resolved object. Then use this original_source in the
15899 target.ResolveLValue instead of the original source that was
15902 Another change. Use target.Resolve instead of LValueResolve.
15903 Although we are resolving for LValues, we will let the Assign code
15904 take care of that (it will be called again from Resolve). This
15905 basically allows code like this:
15907 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
15908 class Y { void A (X x) { x [0] += o; }
15910 The problem was that the indexer was trying to resolve for
15911 set_Item (idx, object o) and never finding one. The real set_Item
15912 was set_Item (idx, X). By delaying the process we get the right
15917 2003-02-23 Martin Baulig <martin@ximian.com>
15919 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
15920 while calling DoEmit ().
15922 * codegen.cs (EmitContext.Mark): Don't mark locations in other
15923 source files; if you use the #line directive inside a method, the
15924 compiler stops emitting line numbers for the debugger until it
15925 reaches the end of the method or another #line directive which
15926 restores the original file.
15928 2003-02-23 Martin Baulig <martin@ximian.com>
15930 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
15932 2003-02-23 Martin Baulig <martin@ximian.com>
15934 * statement.cs (Block.AddChildVariableNames): We need to call this
15935 recursively, not just for our immediate children.
15937 2003-02-23 Martin Baulig <martin@ximian.com>
15939 * class.cs (Event.Define): Always make the field private, like csc does.
15941 * typemanager.cs (TypeManager.RealMemberLookup): Make events
15942 actually work, fixes bug #37521.
15944 2003-02-23 Miguel de Icaza <miguel@ximian.com>
15946 * delegate.cs: When creating the various temporary "Parameters"
15947 classes, make sure that we call the ComputeAndDefineParameterTypes
15948 on those new parameters (just like we do with the formal ones), to
15949 allow them to be resolved in the context of the DeclSpace.
15951 This fixes the bug that Dick observed in Bugzilla #38530.
15953 2003-02-22 Miguel de Icaza <miguel@ximian.com>
15955 * expression.cs (ResolveMemberAccess): When resolving a constant,
15956 do not attempt to pull a constant if the value was not able to
15957 generate a valid constant.
15959 * const.cs (LookupConstantValue): Do not report more errors than required.
15961 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15963 * expression.cs: fixes bug #38328.
15965 2003-02-18 Miguel de Icaza <miguel@ximian.com>
15967 * class.cs: Changed all the various members that can be part of a
15968 class from being an ArrayList to be an Array of the right type.
15969 During the DefineType type_list, interface_list, delegate_list and
15970 enum_list are turned into types, interfaces, delegates and enums
15973 And during the member population, indexer_list, event_list,
15974 constant_list, field_list, instance_constructor_list, method_list,
15975 operator_list and property_list are turned into their real arrays.
15977 Although we could probably perform this operation earlier, for
15978 good error reporting we need to keep the lists and remove the
15979 lists for longer than required.
15981 This optimization was triggered by Paolo profiling the compiler
15982 speed on the output of `gen-sample-program.pl' perl script.
15984 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
15985 not crash in methods like MemberLookupFailed that use this field.
15987 This problem arises when the compiler fails to resolve a type
15988 during interface type definition for example.
15990 2003-02-18 Miguel de Icaza <miguel@ximian.com>
15992 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
15993 inherit from System.Object, so we have to stop at null, not only
15994 when reaching System.Object.
15996 2003-02-17 Miguel de Icaza <miguel@ximian.com>
15998 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
15999 DeclaredOnly because the parent indexer might have had a different
16000 name, but did not loop until the top of the hierarchy was reached.
16002 The problem this one fixes is 35492: when a class implemented an
16003 indexer from an interface, we were getting the interface method
16004 (which was abstract) and we were flagging an error (can not invoke
16007 This also keeps bug 33089 functioning, and test-148 functioning.
16009 * typemanager.cs (IsSpecialMethod): The correct way of figuring
16010 out if a method is special is to see if it is declared in a
16011 property or event, or whether it is one of the predefined operator
16012 names. This should fix correctly #36804.
16014 2003-02-15 Miguel de Icaza <miguel@ximian.com>
16016 The goal here is to remove the dependency on EmptyCast.Peel ().
16017 Killing it completely.
16019 The problem is that currently in a number of places where
16020 constants are expected, we have to "probe" for an EmptyCast, and
16021 Peel, which is not the correct thing to do, as this will be
16022 repetitive and will likely lead to errors.
16024 The idea is to remove any EmptyCasts that are used in casts that
16025 can be reduced to constants, so we only have to cope with
16028 This bug hunt was triggered by Bug 37363 and the desire to remove
16029 the duplicate pattern where we were "peeling" emptycasts to check
16030 whether they were constants. Now constants will always be
16033 * ecore.cs: Use an enumconstant here instead of wrapping with
16036 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
16037 throwing me off. By handling this we can get rid of a few hacks.
16039 * statement.cs (Switch): Removed Peel() code.
16041 2003-02-14 Miguel de Icaza <miguel@ximian.com>
16043 * class.cs: Location information for error 508
16045 * expression.cs (New.DoResolve): Add a guard against double
16046 resolution of an expression.
16048 The New DoResolve might be called twice when initializing field
16049 expressions (see EmitFieldInitializers, the call to
16050 GetInitializerExpression will perform a resolve on the expression,
16051 and later the assign will trigger another resolution
16053 This leads to bugs (#37014)
16055 * delegate.cs: The signature for EndInvoke should contain any ref
16056 or out parameters as well. We were not doing this in the past.
16058 * class.cs (Field.Define): Do not overwrite the type definition
16059 inside the `volatile' group. Turns out that volatile enumerations
16060 were changing the type here to perform a validity test, which
16063 2003-02-12 Miguel de Icaza <miguel@ximian.com>
16065 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
16066 and structs, we do not want to load the instance variable
16068 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
16069 enum_type has to be handled like an object reference (implicit
16070 conversions exists from this to object), but the regular IsClass
16071 and IsValueType tests will never return true for this one.
16073 Also we use TypeManager.IsValueType instead of type.IsValueType,
16074 just for consistency with the rest of the code (this is only
16075 needed if we ever use the construct exposed by test-180.cs inside
16076 corlib, which we dont today).
16078 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
16080 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
16083 2003-02-09 Martin Baulig <martin@ximian.com>
16085 * namespace.cs (Namespace..ctor): Added SourceFile argument.
16086 (Namespace.DefineNamespaces): New static public method; this is
16087 called when we're compiling with debugging to add all namespaces
16088 to the symbol file.
16090 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
16091 pass it to the Namespace's .ctor.
16093 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
16094 and MethodBase arguments; pass the namespace ID to the symwriter;
16095 pass the MethodBase instead of the token to the symwriter.
16096 (SymbolWriter.DefineNamespace): New method to add a namespace to
16099 2003-02-09 Martin Baulig <martin@ximian.com>
16101 * symbolwriter.cs: New file. This is a wrapper around
16102 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
16103 methods here in near future.
16105 2003-02-09 Martin Baulig <martin@ximian.com>
16107 * codegen.cs (EmitContext.Mark): Just pass the arguments to
16108 ILGenerator.MarkSequencePoint() which are actually used by the
16111 2003-02-09 Martin Baulig <martin@ximian.com>
16113 * location.cs (SourceFile): New public sealed class. This
16114 contains the name and an index which is used in the location's token.
16115 (Location): Reserve an appropriate number of bits in the token for
16116 the source file instead of walking over that list, this gives us a
16117 really huge performance improvement when compiling with debugging.
16119 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
16120 `SourceFile' argument instead of a string.
16121 (Driver.ProcessFile): Add all the files via Location.AddFile(),
16122 but don't parse/tokenize here, we need to generate the list of all
16123 source files before we do that.
16124 (Driver.ProcessFiles): New static function. Parses/tokenizes all
16127 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
16128 instead of a string.
16130 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
16133 2003-02-09 Martin Baulig <martin@ximian.com>
16135 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
16136 filename on `#line default'.
16138 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
16140 * statement.cs: don't clear the pinned var when the fixed statement
16141 returns from the method (fixes bug#37752).
16143 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
16145 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
16148 2003-02-07 Martin Baulig <martin@ximian.com>
16150 * driver.cs: Removed the `--debug-args' command line argument.
16152 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
16153 automatically by the AsssemblyBuilder.
16154 (CodeGen.InitializeSymbolWriter): We don't need to call any
16155 initialization function on the symbol writer anymore. This method
16156 doesn't take any arguments.
16158 2003-02-03 Miguel de Icaza <miguel@ximian.com>
16160 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
16161 from referenced assemblies as well.
16163 2003-02-02 Martin Baulig <martin@ximian.com>
16165 * class.cs (MethodData.Emit): Generate debugging info for external methods.
16167 2003-02-02 Martin Baulig <martin@ximian.com>
16169 * class.cs (Constructor.Emit): Open the symbol writer before
16170 emitting the constructor initializer.
16171 (ConstructorInitializer.Emit): Call ec.Mark() to allow
16172 single-stepping through constructor initializers.
16174 2003-01-30 Miguel de Icaza <miguel@ximian.com>
16176 * class.cs: Handle error 549: do not allow virtual methods in
16179 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
16181 * decl.cs: Check access levels when resolving types
16183 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
16185 * statement.cs: Add parameters and locals set in catch blocks that might
16186 return to set vector
16188 2003-01-29 Miguel de Icaza <miguel@ximian.com>
16190 * class.cs (Operator): Set the SpecialName flags for operators.
16192 * expression.cs (Invocation.DoResolve): Only block calls to
16193 accessors and operators on SpecialName methods.
16195 (Cast.TryReduce): Handle conversions from char constants.
16198 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
16200 * statement.cs: small memory and time optimization in FlowBranching.
16202 2003-01-28 Pedro Mart <yoros@wanadoo.es>
16204 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
16205 problem that the last fix but in the other sid (Set).
16207 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
16208 access when there is no indexer in the hierarchy.
16210 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
16212 * class.cs: Combine some if statements.
16214 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16216 * driver.cs: fixed bug #37187.
16218 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
16220 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
16221 any indexer, it's needed to build a list with all the indexers in the
16222 hierarchy (AllGetters), else we have problems. Fixes #35653.
16224 2003-01-23 Miguel de Icaza <miguel@ximian.com>
16226 * class.cs (MethodData.Define): It is wrong for an interface
16227 implementation to be static in both cases: explicit and implicit.
16228 We were only handling this in one case.
16230 Improve the if situation there to not have negations.
16232 * class.cs (Field.Define): Turns out that we do not need to check
16233 the unsafe bit on field definition, only on usage. Remove the test.
16235 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16237 * driver.cs: use assembly.Location instead of Codebase (the latest
16238 patch made mcs fail when using MS assemblies).
16240 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
16242 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
16243 get the path to *corlib.dll.
16245 2003-01-21 Nick Drochak <ndrochak@gol.com>
16249 * typemanager.cs: Remove compiler warnings
16251 2003-01-20 Duncan Mak <duncan@ximian.com>
16253 * AssemblyInfo.cs: Bump the version number to 0.19.
16255 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16257 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
16259 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
16261 * class.cs (Constructor::Emit): Emit debugging info for constructors.
16263 2003-01-17 Miguel de Icaza <miguel@ximian.com>
16265 * cs-parser.jay: Small fix: we were not comparing the constructor
16266 name correctly. Thanks to Zoltan for the initial pointer.
16268 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
16270 * cs-tokenizer.cs: Set file name when specified with #line
16272 2003-01-15 Miguel de Icaza <miguel@ximian.com>
16274 * cs-parser.jay: Only perform the constructor checks here if we
16275 are named like the class; This will help provider a better
16276 error. The constructor path is taken when a type definition is
16277 not found, but most likely the user forgot to add the type, so
16278 report that rather than the constructor error.
16280 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
16282 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
16285 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
16287 * cs-parser.jay: Add cleanup call.
16289 2003-01-13 Duncan Mak <duncan@ximian.com>
16291 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
16292 consistent with other methods.
16294 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
16296 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
16298 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
16300 * attribute.cs: only set GuidAttr to true when we have a
16303 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16307 * typemanager.cs: fixes to allow mcs compile corlib with the new
16308 Type.IsSubclassOf fix.
16310 2003-01-08 Miguel de Icaza <miguel@ximian.com>
16312 * expression.cs (LocalVariableReference.DoResolve): Classify a
16313 constant as a value, not as a variable. Also, set the type for
16316 * cs-parser.jay (fixed_statement): take a type instead of a
16317 pointer_type, so we can produce a better error message later.
16319 * statement.cs (Fixed.Resolve): Flag types that are not pointers
16322 (For.DoEmit): Make inifinite loops have a
16323 non-conditional branch back.
16325 (Fixed.DoEmit): First populate the pinned variables, then emit the
16326 statement, then clear the variables. Before I was emitting the
16327 code once for each fixed piece.
16330 2003-01-08 Martin Baulig <martin@ximian.com>
16332 * statement.cs (FlowBranching.MergeChild): A break in a
16333 SWITCH_SECTION does not leave a loop. Fixes #36155.
16335 2003-01-08 Martin Baulig <martin@ximian.com>
16337 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
16338 lives in the same number space than `param_map'. Fixes #36154.
16340 2003-01-07 Miguel de Icaza <miguel@ximian.com>
16342 * cs-parser.jay (constructor_declaration): Set the
16343 Constructor.ModFlags before probing for it. This makes the
16344 compiler report 514, 515 and 132 (the code was there, but got
16347 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
16348 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
16349 (GotoCase.Resolve): Set `Returns' to ALWAYS.
16351 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
16353 * enum.cs: create the enum static fields using the enum type.
16355 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
16357 * class.cs: don't try to create the ParamBuilder for the return
16358 type if it's not needed (and handle it breaking for the ms runtime
16361 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
16363 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
16365 2002-12-29 Miguel de Icaza <miguel@ximian.com>
16367 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
16368 the command. This showed up while compiling the JANET source
16369 code, which used \r as its only newline separator.
16371 2002-12-28 Miguel de Icaza <miguel@ximian.com>
16373 * class.cs (Method.Define): If we are an operator (because it
16374 reuses our code), then set the SpecialName and HideBySig. #36128
16376 2002-12-22 Miguel de Icaza <miguel@ximian.com>
16378 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
16379 exception, report error 120 `object reference required'.
16381 * driver.cs: Add --pause option, used during to measure the size
16382 of the process as it goes with --timestamp.
16384 * expression.cs (Invocation.DoResolve): Do not allow methods with
16385 SpecialName to be invoked.
16387 2002-12-21 Miguel de Icaza <miguel@ximian.com>
16389 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
16390 number before adding it.
16392 2002-12-21 Ravi Pratap <ravi@ximian.com>
16394 * ecore.cs (StandardImplicitConversion): When in an unsafe
16395 context, we allow conversion between void * to any other pointer
16396 type. This fixes bug #35973.
16398 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
16400 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
16401 is not thrown when extensionless outputs are used
16403 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16405 * rootcontext.cs: fixed compilation of corlib.
16407 2002-12-19 Miguel de Icaza <miguel@ximian.com>
16409 * attribute.cs (Attributes.Contains): Add new method.
16411 * class.cs (MethodCore.LabelParameters): if the parameter is an
16412 `out' parameter, check that no attribute `[In]' has been passed.
16414 * enum.cs: Handle the `value__' name in an enumeration.
16416 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
16418 * decl.cs: Added special case to allow overrides on "protected
16421 2002-12-18 Ravi Pratap <ravi@ximian.com>
16423 * attribute.cs (Attributes.AddAttributeSection): Rename to this
16424 since it makes much more sense.
16426 (Attributes.ctor): Don't require a Location parameter.
16428 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
16430 * attribute.cs (ApplyAttributes): Remove extra Location parameters
16431 since we already have that information per attribute.
16433 * everywhere : make appropriate changes.
16435 * class.cs (LabelParameters): Write the code which actually
16436 applies attributes to the return type. We can't do this on the MS
16437 .NET runtime so we flag a warning in the case an exception is
16440 2002-12-18 Miguel de Icaza <miguel@ximian.com>
16442 * const.cs: Handle implicit null conversions here too.
16444 2002-12-17 Ravi Pratap <ravi@ximian.com>
16446 * class.cs (MethodCore.LabelParameters): Remove the extra
16447 Type [] parameter since it is completely unnecessary. Instead
16448 pass in the method's attributes so that we can extract
16449 the "return" attribute.
16451 2002-12-17 Miguel de Icaza <miguel@ximian.com>
16453 * cs-parser.jay (parse): Use Report.Error to flag errors instead
16454 of ignoring it and letting the compile continue.
16456 * typemanager.cs (ChangeType): use an extra argument to return an
16457 error condition instead of throwing an exception.
16459 2002-12-15 Miguel de Icaza <miguel@ximian.com>
16461 * expression.cs (Unary.TryReduce): mimic the code for the regular
16462 code path. Perform an implicit cast in the cases where we can
16463 implicitly convert to one of the integral types, and then reduce
16464 based on that constant. This fixes bug #35483.
16466 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16468 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
16470 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16472 * namespace.cs: fixed bug #35489.
16474 2002-12-12 Miguel de Icaza <miguel@ximian.com>
16476 * class.cs: Remove some dead code.
16478 * cs-parser.jay: Estimate the number of methods needed
16479 (RootContext.MethodCount);
16481 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
16482 numbers instead of StringBuilders.
16484 * support.cs (PtrHashtable): Add constructor with initial size;
16485 We can now reduce reallocations of the method table.
16487 2002-12-10 Ravi Pratap <ravi@ximian.com>
16489 * attribute.cs (ApplyAttributes): Keep track of the emitted
16490 attributes on a per-target basis. This fixes bug #35413.
16492 2002-12-10 Miguel de Icaza <miguel@ximian.com>
16494 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
16495 default to the Windows 1252 encoding.
16497 (UnixParseOption): Support version, thanks to Alp for the missing
16500 * AssemblyInfo.cs: Add nice assembly information.
16502 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
16505 * cs-parser.jay: Allow a trailing comma before the close bracked
16506 in the attribute_section production.
16508 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
16509 address of the instance was being taken, I will take this out,
16510 because we take the address of the object immediately here.
16512 2002-12-09 Ravi Pratap <ravi@ximian.com>
16514 * typemanager.cs (AreMultipleAllowed): Take care of the most
16515 obvious case where attribute type is not in the current assembly -
16518 2002-12-08 Miguel de Icaza <miguel@ximian.com>
16520 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
16521 definitions, instead of doing that afterwards.
16523 Also we use a nice little hack, depending on the constructor, we
16524 know if we are a "composed" name or a simple name. Hence, we
16525 avoid the IndexOf test, and we avoid
16527 * codegen.cs: Add code to assist in a bug reporter to track down
16528 the source of a compiler crash.
16530 2002-12-07 Ravi Pratap <ravi@ximian.com>
16532 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
16533 types have been emitted for a given element and flag an error
16534 if something which does not have AllowMultiple set is used more
16537 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
16538 attribute types and their corresponding AllowMultiple properties
16540 (AreMultipleAllowed): Check the property for a given type.
16542 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
16543 property in the case we have a TypeContainer.
16545 (Attributes.AddAttribute): Detect duplicates and just skip on
16546 adding them. This trivial fix catches a pretty gross error in our
16547 attribute emission - global attributes were being emitted twice!
16549 Bugzilla bug #33187 is now fixed.
16551 2002-12-06 Miguel de Icaza <miguel@ximian.com>
16553 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
16554 instead of pp_and).
16556 * expression.cs (Binary.ResolveOperator): I can only use the
16557 Concat (string, string, string) and Concat (string, string,
16558 string, string) if the child is actually a concatenation of
16561 2002-12-04 Miguel de Icaza <miguel@ximian.com>
16563 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
16564 context where we need a 2-character lookahead.
16566 * pending.cs (PendingImplementation): Rework so we can keep track
16567 of interface types all the time, and flag those which were
16568 implemented by parents as optional.
16570 2002-12-03 Miguel de Icaza <miguel@ximian.com>
16572 * expression.cs (Binary.ResolveOperator): Use
16573 String.Concat(string,string,string) or
16574 String.Concat(string,string,string,string) when possible.
16576 * typemanager: More helper methods.
16579 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
16581 * pending.cs: remove the bogus return from GetMissingInterfaces()
16582 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
16584 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16586 * namespace.cs: avoid duplicated 'using xxx' being added to
16587 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
16588 when we get more than one 'using' statement for the same namespace.
16589 Report a CS0105 warning for it.
16591 2002-11-30 Miguel de Icaza <miguel@ximian.com>
16593 * cs-tokenizer.cs (consume_identifier): use read directly, instead
16594 of calling getChar/putback, uses internal knowledge of it.
16596 (xtoken): Reorder tokenizer so most common patterns are checked
16597 first. This reduces the compilation time in another 5% (from 8.11s
16598 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
16600 The parsing time is 22% of the compilation in mcs, and from that
16601 64% is spent on the tokenization process.
16603 I tried using a binary search for keywords, but this is slower
16604 than the hashtable. Another option would be to do a couple of
16607 * Not use a StringBuilder, instead use an array of chars,
16608 with a set value. Notice that this way we could catch
16609 the 645 error without having to do it *afterwards*.
16611 * We could write a hand-parser to avoid the hashtable
16612 compares altogether.
16614 The identifier consumption process takes 37% of the tokenization
16615 time. Another 15% is spent on is_number. 56% of the time spent
16616 on is_number is spent on Int64.Parse:
16618 * We could probably choose based on the string length to
16619 use Int32.Parse or Int64.Parse and avoid all the 64-bit
16622 Another 3% is spend on wrapping `xtoken' in the `token' function.
16624 Handle 0xa0 as whitespace (#34752)
16626 2002-11-26 Miguel de Icaza <miguel@ximian.com>
16628 * typemanager.cs (IsCLRType): New routine to tell whether a type
16629 is one of the builtin types.
16631 Maybe it needs to use TypeCodes to be faster. Maybe we could use
16632 typecode in more places instead of doing pointer comparissions.
16633 We could leverage some knowledge about the way the typecodes are
16636 New code to cache namespaces in assemblies, it is currently not
16637 invoked, to be used soon.
16639 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
16641 * expression.cs (Binary.ResolveOperator): specially handle
16642 strings, and do not perform user-defined operator overloading for
16645 2002-11-24 Miguel de Icaza <miguel@ximian.com>
16647 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
16648 internalcall as it is a pretty simple operation; Avoid whenever
16649 possible to call Char.IsLetter.
16651 (consume_identifier): Cut by half the number of
16652 hashtable calls by merging the is_keyword and GetKeyword behavior.
16654 Do not short-circuit, because if we do, we
16655 report errors (ie, #if false && true would produce an invalid
16659 2002-11-24 Martin Baulig <martin@ximian.com>
16661 * expression.cs (Cast.TryReduce): If we're in checked syntax,
16662 check constant ranges and report a CS0221. Fixes #33186.
16664 2002-11-24 Martin Baulig <martin@ximian.com>
16666 * cs-parser.jay: Make this work for uninitialized variable
16667 declarations in the `for' initializer. Fixes #32416.
16669 2002-11-24 Martin Baulig <martin@ximian.com>
16671 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
16672 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
16674 2002-11-24 Martin Baulig <martin@ximian.com>
16676 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
16677 argument; if true, we also check for user-defined conversions.
16678 This is only needed if both arguments are of a user-defined type.
16679 Fixes #30443, added test-175.cs.
16680 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
16682 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
16684 2002-11-24 Martin Baulig <martin@ximian.com>
16686 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
16687 function to get the store opcode.
16688 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
16689 only emit the Ldelema if the store opcode is Stobj. You must run
16690 both test-34 and test-167 to test this. Fixes #34529.
16692 2002-11-23 Martin Baulig <martin@ximian.com>
16694 * ecore.cs (Expression.MemberLookup): Added additional
16695 `qualifier_type' argument which is used when we're being called
16696 from MemberAccess.DoResolve() and null if we're called from a
16698 (Expression.MemberLookupFailed): New method to report errors; this
16699 does the CS1540 check and reports the correct error message.
16701 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
16702 argument for the CS1540 check and redone the way how we're dealing
16703 with private members. See the comment in the source code for details.
16704 (FilterWithClosure): Reverted this back to revision 1.197; renamed
16705 `closure_start_type' to `closure_qualifier_type' and check whether
16706 it's not null. It was not this filter being broken, it was just
16707 being called with the wrong arguments.
16709 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
16710 and pass it the correct `qualifier_type'; this also does the error
16713 2002-11-22 Miguel de Icaza <miguel@ximian.com>
16715 * expression.cs (Invocation.EmitParams): If the we are dealing
16716 with a non-built-in value type, load its address as well.
16718 (ArrayCreation): Use a a pretty constant instead
16719 of the hardcoded value 2. Use 6 instead of 2 for the number of
16720 static initializers.
16722 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
16723 because they are not really value types, just glorified integers.
16725 * driver.cs: Do not append .exe, the CSC compiler does not do it.
16727 * ecore.cs: Remove redundant code for enumerations, make them use
16728 the same code path as everything else, fixes the casting issue
16729 with enumerations in Windows.Forms.
16731 * attribute.cs: Do only cast to string if it is a string, the
16732 validation happens later.
16734 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
16735 people upgrade their corlibs.
16737 * ecore.cs: Oops, enumerations were not following the entire code path
16739 2002-11-21 Miguel de Icaza <miguel@ximian.com>
16741 * typemanager.cs (FilterWithClosure): Commented out the test for
16742 1540 in typemanager.cs, as it has problems when accessing
16743 protected methods from a parent class (see test-174.cs).
16745 * attribute.cs (Attribute.ValidateGuid): new method.
16746 (Attribute.Resolve): Use above.
16748 2002-11-19 Miguel de Icaza <miguel@ximian.com>
16750 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
16752 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
16753 handling for enumerations, as we only needed the TypeContainer
16754 functionality to begin with (this is required for the fix below to
16755 work for enums that reference constants in a container class for
16758 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
16760 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
16761 a valid TypeBuilder to perform lookups on.o
16763 * class.cs (InheritableMemberSignatureCompare): Use true in the
16764 call to GetGetMethod and GetSetMethod, because we are comparing
16765 the signature, and we need to get the methods *even* if they are
16768 (PropertyBase.CheckBase): ditto.
16770 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
16771 GotoCase.Resolve): Use Peel on EmpytCasts.
16773 * ecore.cs (EmptyCast): drop child, add Peel method.
16775 2002-11-17 Martin Baulig <martin@ximian.com>
16777 * ecore.cs (EmptyCast.Child): New public property.
16779 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
16780 label resolved to an EmptyCast. Fixes #34162.
16781 (GotoCase.Resolve): Likewise.
16782 (Block.EmitMeta): Likewise.
16784 2002-11-17 Martin Baulig <martin@ximian.com>
16786 * expression.cs (Invocation.BetterConversion): Prefer int over
16787 uint; short over ushort; long over ulong for integer literals.
16788 Use ImplicitConversionExists instead of StandardConversionExists
16789 since we also need to check for user-defined implicit conversions.
16790 Fixes #34165. Added test-173.cs.
16792 2002-11-16 Martin Baulig <martin@ximian.com>
16794 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
16795 with the `true' and `false' literals. Fixes #33151.
16797 2002-11-16 Martin Baulig <martin@ximian.com>
16799 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
16800 October 22nd; don't do the cs1540 check for static members.
16802 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
16803 now using our own filter here and doing the cs1540 check again.
16805 2002-11-16 Martin Baulig <martin@ximian.com>
16807 * support.cs (InternalParameters): Don't crash if we don't have
16808 any fixed parameters. Fixes #33532.
16810 2002-11-16 Martin Baulig <martin@ximian.com>
16812 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
16813 when looking up static methods to make this work on Windows.
16816 2002-11-16 Martin Baulig <martin@ximian.com>
16818 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
16819 a setter rather than using PropertyInfo.CanWrite.
16821 2002-11-15 Nick Drochak <ndrochak@gol.com>
16823 * class.cs: Allow acces to block member by subclasses. Fixes build
16826 2002-11-14 Martin Baulig <martin@ximian.com>
16828 * class.cs (Constructor.Emit): Added the extern/block check.
16831 2002-11-14 Martin Baulig <martin@ximian.com>
16833 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
16834 iteration while looking for indexers, this is needed because the
16835 indexer may have a different name in our base classes. Fixed the
16836 error reporting (no indexers at all, not get accessor, no
16837 overloaded match). Fixes bug #33089.
16838 (IndexerAccess.DoResolveLValue): Likewise.
16840 2002-11-14 Martin Baulig <martin@ximian.com>
16842 * class.cs (PropertyBase.CheckBase): Make this work for multiple
16843 indexers. Fixes the first part of bug #33089.
16844 (MethodSignature.InheritableMemberSignatureCompare): Added support
16847 2002-11-13 Ravi Pratap <ravi@ximian.com>
16849 * attribute.cs (Attribute.Resolve): Catch the
16850 NullReferenceException and report it since it isn't supposed to
16853 2002-11-12 Miguel de Icaza <miguel@ximian.com>
16855 * expression.cs (Binary.EmitBranchable): Also handle the cases for
16856 LogicalOr and LogicalAnd that can benefit from recursively
16857 handling EmitBranchable. The code now should be nice for Paolo.
16859 2002-11-08 Miguel de Icaza <miguel@ximian.com>
16861 * typemanager.cs (LookupType): Added a negative-hit hashtable for
16862 the Type lookups, as we perform quite a number of lookups on
16863 non-Types. This can be removed once we can deterministically tell
16864 whether we have a type or a namespace in advance.
16866 But this might require special hacks from our corlib.
16870 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
16871 and double which avoids a conversion from an integer to a double.
16873 * expression.cs: tiny optimization, avoid calling IsConstant,
16874 because it effectively performs the lookup twice.
16876 2002-11-06 Miguel de Icaza <miguel@ximian.com>
16878 But a bogus return here to keep the semantics of the old code
16879 until the Mono runtime is fixed.
16881 * pending.cs (GetMissingInterfaces): New method used to remove all
16882 the interfaces that are already implemented by our parent
16883 classes from the list of pending methods.
16885 * interface.cs: Add checks for calls after ResolveTypeExpr.
16887 2002-11-05 Miguel de Icaza <miguel@ximian.com>
16889 * class.cs (Class.Emit): Report warning 67: event not used if the
16890 warning level is beyond 3.
16892 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
16893 being a NullLiteral.
16895 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
16898 * class.cs (TypeContainer.GetClassBases): Cover a missing code
16899 path that might fail if a type can not be resolved.
16901 * expression.cs (Binary.Emit): Emit unsigned versions of the
16904 * driver.cs: use error 5.
16906 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
16908 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
16910 2002-11-01 Miguel de Icaza <miguel@ximian.com>
16912 * cs-parser.jay (switch_section): A beautiful patch from Martin
16913 Baulig that fixed 33094.
16915 2002-10-31 Miguel de Icaza <miguel@ximian.com>
16917 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
16918 Check whether the base is abstract and report an error if so.
16920 * expression.cs (IndexerAccess.DoResolveLValue,
16921 IndexerAccess.DoResolve): ditto.
16923 (Invocation.DoResolve): ditto.
16925 (Invocation.FullMethodDesc): Improve the report string.
16927 * statement.cs (Block): Eliminate IsVariableDefined as it is
16928 basically just a wrapper for GetVariableInfo.
16930 * ecore.cs (SimpleName): Use new
16932 * support.cs (ReflectionParamter.ParameterType): We unwrap the
16933 type, as we return the actual parameter ref/unref state on a
16936 2002-10-30 Miguel de Icaza <miguel@ximian.com>
16938 * support.cs: Return proper flags REF/OUT fixing the previous
16941 * expression.cs: Reverted last patch, that was wrong. Is_ref is
16942 not used to mean `ref' but `ref or out' in ParameterReference
16944 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
16945 full type signature instead of calling TypeManger.CSharpName
16948 * support.cs (InternalParameters.ParameterDesc): Do not compare
16949 directly to the modflags, because REF/OUT will actually be bitsets
16952 * delegate.cs (VerifyMethod): Check also the modifiers.
16954 * cs-tokenizer.cs: Fix bug where floating point values with an
16955 exponent where a sign was missing was ignored.
16957 * driver.cs: Allow multiple assemblies to be specified in a single
16960 2002-10-28 Miguel de Icaza <miguel@ximian.com>
16962 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
16963 because identifiers after a parenthesis would end up in this kind
16964 of production, and we needed to desamiguate it for having casts
16967 (UserDefinedType *) xxx
16969 2002-10-24 Miguel de Icaza <miguel@ximian.com>
16971 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
16972 we should set on the Bindingflags.NonPublic, but not turn on
16973 private_ok. private_ok controls whether a Private member is
16974 returned (this is chekced on the filter routine), while the
16975 BindingFlags.NonPublic just controls whether private/protected
16976 will be allowed. This fixes the problem part of the problem of
16977 private properties being allowed to be used in derived classes.
16979 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
16980 so we can call the children DoResolveLValue method (this will
16981 properly signal errors on lvalue assignments to base properties)
16983 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
16984 getter are null, and we have a property info, we know that this
16985 happened because the lookup failed, so we report an error 122 for
16986 protection level violation.
16988 We also silently return if setter and getter are null in the
16989 resolve functions, this condition only happens if we have flagged
16990 the error before. This is the other half of the problem.
16992 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
16993 not have accessibility information, that is why we were returning
16994 true in the filter function in typemanager.cs.
16996 To properly report 122 (property is inaccessible because of its
16997 protection level) correctly, we report this error in ResolveAccess
16998 by failing if both the setter and the getter are lacking (ie, the
17001 DoResolve and DoLResolve have been modified to check for both
17002 setter/getter being null and returning silently, the reason being
17003 that I did not want to put the knowledge about this error in upper
17006 int old = Report.Errors;
17007 x = new PropertyExpr (...);
17008 if (old != Report.Errors)
17013 So the property expr is returned, but it is invalid, so the error
17014 will be flagged during the resolve process.
17016 * class.cs: Remove InheritablePropertySignatureCompare from the
17017 class, as we no longer depend on the property signature to compute
17018 whether it is possible to implement a method or not.
17020 The reason is that calling PropertyInfo.GetGetMethod will return
17021 null (in .NET, in Mono it works, and we should change this), in
17022 cases where the Get Method does not exist in that particular
17027 class X { public virtual int A { get { return 1; } } }
17029 class Z : Y { public override int A { get { return 2; } } }
17031 Would fail in Z because the parent (Y) would not have the property
17032 defined. So we avoid this completely now (because the alternative
17033 fix was ugly and slow), and we now depend exclusively on the
17036 (PropertyBase.CheckBase): Use a method-base mechanism to find our
17037 reference method, instead of using the property.
17039 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
17040 routines are gone now.
17042 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
17043 names, they were incorrectly named.
17045 * cs-tokenizer.cs: Return are more gentle token on failure.
17047 * pending.cs (PendingImplementation.InterfaceMethod): This routine
17048 had an out-of-sync index variable, which caused it to remove from
17049 the list of pending methods the wrong method sometimes.
17051 2002-10-22 Miguel de Icaza <miguel@ximian.com>
17053 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
17054 CanWrite, because those refer to this particular instance of the
17055 property, and do not take into account the fact that we can
17056 override single members of a property.
17058 Constructor requires an EmitContext. The resolution process does
17059 not happen here, but we need to compute the accessors before,
17060 because the resolution does not always happen for properties.
17062 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
17063 subclass, before we did not update this flag, but we did update
17066 (GetAccessors): Drop this routine, as it did not work in the
17067 presence of partially overwritten set/get methods.
17069 Notice that this broke the cs1540 detection, but that will require
17072 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17076 * driver.cs: issue a warning instead of an error if we don't support
17077 debugging for the platform. Also ignore a couple of errors that may
17078 arise when trying to write the symbols. Undo my previous patch.
17080 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17082 * driver.cs: ignore /debug switch except for Unix platforms.
17084 2002-10-23 Nick Drochak <ndrochak@gol.com>
17086 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
17088 2002-10-21 Miguel de Icaza <miguel@ximian.com>
17090 * driver.cs: Do not make mcs-debug conditional, so we do not break
17091 builds that use it.
17093 * statement.cs (UsageVector.MergeChildren): I would like Martin to
17094 review this patch. But basically after all the children variables
17095 have been merged, the value of "Breaks" was not being set to
17096 new_breaks for Switch blocks. I think that it should be set after
17097 it has executed. Currently I set this to the value of new_breaks,
17098 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
17099 conservative, but I do not understand this code very well.
17101 I did not break anything in the build, so that is good ;-)
17103 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
17105 2002-10-20 Mark Crichton <crichton@gimp.org>
17107 * cfold.cs: Fixed compile blocker. Really fixed it this time.
17109 2002-10-20 Nick Drochak <ndrochak@gol.com>
17111 * cfold.cs: Fixed compile blocker.
17113 2002-10-20 Miguel de Icaza <miguel@ximian.com>
17115 * driver.cs: I was chekcing the key, not the file.
17117 2002-10-19 Ravi Pratap <ravi@ximian.com>
17119 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
17120 message that we were generating - we just need to silently return
17123 2002-10-19 Miguel de Icaza <miguel@ximian.com>
17125 * class.cs (Event.Define): Change my previous commit, as this
17126 breaks the debugger. This is a temporary hack, as it seems like
17127 the compiler is generating events incorrectly to begin with.
17129 * expression.cs (Binary.ResolveOperator): Added support for
17130 "U operator - (E x, E y)"
17132 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
17135 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
17136 init-only variables, but this path did not take into account that
17137 there might be also instance readonly variables. Correct this
17140 This fixes bug 32253
17142 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
17145 * driver.cs: Change the extension for modules to `netmodule'
17147 * cs-parser.jay: Improved slightly the location tracking for
17148 the debugger symbols.
17150 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
17151 modifiers that were specified instead of the hardcoded value
17152 (FamAndAssem). This was basically ignoring the static modifier,
17153 and others. Fixes 32429.
17155 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
17156 fixed a bug in the process (32476)
17158 * expression.cs (ArrayAccess.EmitAssign): Patch from
17159 hwang_rob@yahoo.ca that fixes bug 31834.3
17161 2002-10-18 Miguel de Icaza <miguel@ximian.com>
17163 * driver.cs: Make the module extension .netmodule.
17165 2002-10-16 Miguel de Icaza <miguel@ximian.com>
17167 * driver.cs: Report an error if the resource file is not found
17168 instead of crashing.
17170 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
17171 false, like Emit does.
17173 2002-10-16 Nick Drochak <ndrochak@gol.com>
17175 * typemanager.cs: Remove unused private member. Also reported mcs
17176 bug to report this as a warning like csc.
17178 2002-10-15 Martin Baulig <martin@gnome.org>
17180 * statement.cs (Statement.Emit): Made this a virtual method; emits
17181 the line number info and calls DoEmit().
17182 (Statement.DoEmit): New protected abstract method, formerly knows
17183 as Statement.Emit().
17185 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
17187 2002-10-11 Miguel de Icaza <miguel@ximian.com>
17189 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
17190 have fixed a remaining problem: not every AddXXXX was adding a
17191 fully qualified name.
17193 Now everyone registers a fully qualified name in the DeclSpace as
17194 being defined instead of the partial name.
17196 Downsides: we are slower than we need to be due to the excess
17197 copies and the names being registered this way.
17199 The reason for this is that we currently depend (on the corlib
17200 bootstrap for instance) that types are fully qualified, because
17201 we dump all the types in the namespace, and we should really have
17202 types inserted into the proper namespace, so we can only store the
17203 basenames in the defined_names array.
17205 2002-10-10 Martin Baulig <martin@gnome.org>
17207 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
17208 from bug #31834, see the bug report for a testcase which is
17211 2002-10-10 Martin Baulig <martin@gnome.org>
17213 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
17214 flow analysis code for this.
17216 * statement.cs (Do, While, For): Tell the flow analysis code about
17218 (FlowBranching.UsageVector): Added support for infinite loops.
17219 (Block.Resolve): Moved the dead code elimination here and use flow
17222 2002-10-09 Miguel de Icaza <miguel@ximian.com>
17224 * class.cs (Field.Define): Catch cycles on struct type
17227 * typemanager.cs (IsUnmanagedtype): Do not recursively check
17228 fields if the fields are static. We only need to check instance
17231 * expression.cs (As.DoResolve): Test for reference type.
17233 * statement.cs (Using.ResolveExpression): Use
17234 ConvertImplicitRequired, not ConvertImplicit which reports an
17236 (Using.ResolveLocalVariableDecls): ditto.
17238 * expression.cs (Binary.ResolveOperator): Report errors in a few
17239 places where we had to.
17241 * typemanager.cs (IsUnmanagedtype): Finish implementation.
17243 2002-10-08 Miguel de Icaza <miguel@ximian.com>
17245 * expression.cs: Use StoreFromPtr instead of extracting the type
17246 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
17248 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
17249 an enumeration value to a System.Enum, but System.Enum is not a
17250 value type, but an class type, so we need to box.
17252 (Expression.ConvertExplicit): One codepath could return
17253 errors but not flag them. Fix this. Fixes #31853
17255 * parameter.cs (Resolve): Do not allow void as a parameter type.
17257 2002-10-06 Martin Baulig <martin@gnome.org>
17259 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
17260 if it's a class type and not a struct. Fixes #31815.
17262 2002-10-06 Martin Baulig <martin@gnome.org>
17264 * statement.cs: Reworked the flow analysis code a bit to make it
17265 usable for dead code elimination.
17267 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17269 * cs-parser.jay: allow empty source files. Fixes bug #31781.
17271 2002-10-04 Miguel de Icaza <miguel@ximian.com>
17273 * expression.cs (ComposedCast.DoResolveType): A quick workaround
17274 to fix the test 165, will investigate deeper.
17276 2002-10-04 Martin Baulig <martin@gnome.org>
17278 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
17279 finally blocks actually work.
17280 (Try.Resolve): We don't need to create a sibling for `finally' if
17281 there is no finally block.
17283 2002-10-04 Martin Baulig <martin@gnome.org>
17285 * class.cs (Constructor.Define): The default accessibility for a
17286 non-default constructor is private, not public.
17288 2002-10-04 Miguel de Icaza <miguel@ximian.com>
17290 * class.cs (Constructor): Make AllowedModifiers public, add
17293 * cs-parser.jay: Perform the modifiers test here, as the
17294 constructor for the Constructor class usually receives a zero
17295 because of the way we create it (first we create, later we
17296 customize, and we were never checking the modifiers).
17298 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
17299 is a version of LookupTypeReflection that includes the type-name
17300 cache. This can be used as a fast path for functions that know
17301 the fully qualified name and are only calling into *.GetType() to
17302 obtain a composed type.
17304 This is also used by TypeManager.LookupType during its type
17307 (LookupType): We now also track the real type name, as sometimes
17308 we can get a quey for the real type name from things like
17309 ComposedCast. This fixes bug 31422.
17311 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
17312 complete type fullname, it does not have to go through the type
17313 resolution system to obtain the composed version of the type (for
17314 obtaining arrays or pointers).
17316 (Conditional.Emit): Use the EmitBoolExpression to
17317 generate nicer code, as requested by Paolo.
17319 (ArrayCreation.CheckIndices): Use the patch from
17320 hwang_rob@yahoo.ca to validate the array initializers.
17322 2002-10-03 Miguel de Icaza <miguel@ximian.com>
17324 * class.cs (ConstructorInitializer.Emit): simplify code by using
17325 Invocation.EmitCall, and at the same time, fix the bugs in calling
17326 parent constructors that took variable arguments.
17328 * ecore.cs (Expression.ConvertNumericExplicit,
17329 Expression.ImplicitNumericConversion): Remove the code that
17330 manually wrapped decimal (InternalTypeConstructor call is now gone
17333 * expression.cs (Cast.TryReduce): Also handle decimal types when
17334 trying to perform a constant fold on the type.
17336 * typemanager.cs (IsUnmanagedtype): Partially implemented.
17338 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
17339 that only turned off an error report, and did nothing else.
17341 2002-10-02 Miguel de Icaza <miguel@ximian.com>
17343 * driver.cs: Handle and ignore /fullpaths
17345 2002-10-01 Miguel de Icaza <miguel@ximian.com>
17347 * expression.cs (Binary.ResolveOperator): Catch the case where
17348 DoNumericPromotions returns true,
17350 (Binary.DoNumericPromotions): Simplify the code, and the tests.
17352 2002-09-27 Miguel de Icaza <miguel@ximian.com>
17354 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
17357 2002-09-26 Miguel de Icaza <miguel@ximian.com>
17359 * ecore.cs (ConvertNumericExplicit): It is not enough that the
17360 conversion exists, but it is also required that the conversion be
17361 performed. This manifested in "(Type64Enum) 2".
17363 * class.cs (TypeManager.AddMethod): The fix is not to change
17364 AddEnum, because that one was using a fully qualified name (every
17365 DeclSpace derivative does), but to change the AddMethod routine
17366 that was using an un-namespaced name. This now correctly reports
17367 the duplicated name.
17369 Revert patch until I can properly fix it. The issue
17370 is that we have a shared Type space across all namespaces
17371 currently, which is wrong.
17373 Options include making the Namespace a DeclSpace, and merge
17374 current_namespace/current_container in the parser.
17376 2002-09-25 Miguel de Icaza <miguel@ximian.com>
17378 * cs-parser.jay: Improve error reporting when we get a different
17379 kind of expression in local_variable_type and
17380 local_variable_pointer_type.
17382 Propagate this to avoid missleading errors being reported.
17384 * ecore.cs (ImplicitReferenceConversion): treat
17385 TypeManager.value_type as a target just like object_type. As
17390 Is valid, and needs to result in the int 1 being boxed before it
17391 is assigned to the value type v.
17393 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
17394 to validate the enumeration name.
17396 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
17397 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
17398 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
17400 * ecore.cs (TryImplicitIntConversion): When doing an
17401 implicit-enumeration-conversion, check if the type is 64-bits and
17402 perform a conversion before passing to EnumConstant.
17404 2002-09-23 Miguel de Icaza <miguel@ximian.com>
17406 * decl.cs (Error_AmbiguousTypeReference); New routine used to
17407 report ambiguous type references. Unlike the MS version, we
17408 report what the ambiguity is. Innovation at work ;-)
17410 (DeclSpace.FindType): Require a location argument to
17411 display when we display an ambiguous error.
17413 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
17415 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
17417 * expression.cs (EmitDynamicInitializers): Apply patch from
17418 hwang_rob@yahoo.ca that fixes the order in which we emit our
17421 2002-09-21 Martin Baulig <martin@gnome.org>
17423 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
17424 delegate takes no arguments.
17426 2002-09-20 Miguel de Icaza <miguel@ximian.com>
17428 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
17431 * expression.cs: Extract the underlying type.
17433 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
17435 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
17437 2002-09-19 Miguel de Icaza <miguel@ximian.com>
17439 * class.cs (TypeContainer.DefineType): We can not use the nice
17440 PackingSize with the size set to 1 DefineType method, because it
17441 will not allow us to define the interfaces that the struct
17444 This completes the fixing of bug 27287
17446 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
17447 means also structs. This fixes part of the problem.
17448 (Expresion.ImplicitReferenceConversionExists): ditto.
17450 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
17451 error if there were no errors reported during the type lookup
17452 process, to avoid duplicates or redundant errors. Without this
17453 you would get an ambiguous errors plus a type not found. We have
17454 beaten the user enough with the first error.
17456 (DeclSparce.FindType): Emit a warning if we have an ambiguous
17459 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
17460 during the resolution process, stop the lookup, this avoids
17461 repeated error reports (same error twice).
17463 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
17465 * typemanager.cs (LookupType): Redo the type lookup code to match
17466 the needs of System.Reflection.
17468 The issue is that System.Reflection requires references to nested
17469 types to begin with a "+" sign instead of a dot. So toplevel
17470 types look like: "NameSpace.TopLevelClass", and nested ones look
17471 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
17474 2002-09-19 Martin Baulig <martin@gnome.org>
17476 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
17477 says that a method always returns or always throws an exception,
17478 don't report the CS0161.
17480 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
17481 set `Returns = new_returns'.
17483 2002-09-19 Martin Baulig <martin@gnome.org>
17485 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
17486 to an enum constant, check for a CS0176.
17488 2002-09-18 Miguel de Icaza <miguel@ximian.com>
17490 * class.cs (TypeContainer.CheckPairedOperators): Now we check
17491 for operators that must be in pairs and report errors.
17493 * ecore.cs (SimpleName.DoResolveType): During the initial type
17494 resolution process, when we define types recursively, we must
17495 check first for types in our current scope before we perform
17496 lookups in the enclosing scopes.
17498 * expression.cs (MakeByteBlob): Handle Decimal blobs.
17500 (Invocation.VerifyArgumentsCompat): Call
17501 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
17502 I thought we were supposed to always call this, but there are a
17503 few places in the code where we dont do it.
17505 2002-09-17 Miguel de Icaza <miguel@ximian.com>
17507 * driver.cs: Add support in -linkres and -resource to specify the
17508 name of the identifier.
17510 2002-09-16 Miguel de Icaza <miguel@ximian.com>
17512 * ecore.cs (StandardConversionExists): Sync with the conversion
17513 code: allow anything-* to void* conversions.
17515 (FindMostSpecificSource): Use an Expression argument
17516 instead of a Type, because we might be handed over a Literal which
17517 gets a few more implicit conversions that plain types do not. So
17518 this information was being lost.
17520 Also, we drop the temporary type-holder expression when not
17523 2002-09-17 Martin Baulig <martin@gnome.org>
17525 * class.cs (PropertyBase.CheckBase): Don't check the base class if
17526 this is an explicit interface implementation.
17528 2002-09-17 Martin Baulig <martin@gnome.org>
17530 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
17531 different `IndexerName' attributes.
17533 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
17534 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
17535 virtual CommonResolve().
17537 2002-09-16 Miguel de Icaza <miguel@ximian.com>
17539 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
17540 and convert that to the UnderlyingType.
17542 * statement.cs (Foreach.Resolve): Indexers are just like variables
17543 or PropertyAccesses.
17545 * cs-tokenizer.cs (consume_string): Track line numbers and columns
17546 inside quoted strings, we were not doing this before.
17548 2002-09-16 Martin Baulig <martin@gnome.org>
17550 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
17551 resolve it. This is needed for the definite assignment check of the
17552 instance expression, fixes bug #29846.
17553 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
17555 2002-09-16 Nick Drochak <ndrochak@gol.com>
17557 * parameter.cs: Fix compile error. Cannot reference static member
17558 from an instance object. Is this an mcs bug?
17560 2002-09-14 Martin Baulig <martin@gnome.org>
17562 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
17563 multiple times. Fixes bug #30295, added test-166.cs.
17565 2002-09-14 Martin Baulig <martin@gnome.org>
17567 * statement.cs (Block.Emit): Don't emit unreachable code.
17568 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
17569 `break' statements.
17570 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
17572 2002-09-14 Martin Baulig <martin@gnome.org>
17574 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
17577 2002-09-14 Martin Baulig <martin@gnome.org>
17579 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
17580 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
17581 be false on the ms runtime.
17583 2002-09-13 Martin Baulig <martin@gnome.org>
17585 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
17586 the CS0038 error message.
17588 2002-09-12 Miguel de Icaza <miguel@ximian.com>
17590 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
17591 constant inside, return it.
17593 2002-09-12 Martin Baulig <martin@gnome.org>
17595 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
17596 implicit conversion can be done between enum types.
17598 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
17599 check whether an implicit conversion to the current enum's UnderlyingType
17600 exists and report an error if not.
17602 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
17603 without debugging support.
17605 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
17606 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
17608 2002-09-12 Martin Baulig <martin@gnome.org>
17610 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
17612 * ecore.cs (IMemberExpr.DeclaringType): New property.
17613 (SimpleName.SimpleNameResolve): Check whether we're accessing a
17614 nonstatic member of an outer type (CS0038).
17616 2002-09-11 Miguel de Icaza <miguel@ximian.com>
17618 * driver.cs: Activate the using-error detector at warning level
17619 4 (at least for MS-compatible APIs).
17621 * namespace.cs (VerifyUsing): Small buglett fix.
17623 * pending.cs (PendingImplementation): pass the container pointer.
17625 * interface.cs (GetMethods): Allow for recursive definition. Long
17626 term, I would like to move every type to support recursive
17627 definitions, not the current ordering mechanism that we have right
17630 The situation is this: Attributes are handled before interfaces,
17631 so we can apply attributes to interfaces. But some attributes
17632 implement interfaces, we will now handle the simple cases
17633 (recursive definitions will just get an error).
17635 * parameter.cs: Only invalidate types at the end if we fail to
17638 2002-09-09 Martin Baulig <martin@gnome.org>
17640 * ecore.cs (PropertyExpr.Emit): Also check for
17641 TypeManager.system_int_array_get_length so this'll also work when
17642 compiling corlib. Fixes #30003.
17644 2002-09-09 Martin Baulig <martin@gnome.org>
17646 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
17647 and throw an exception if we can't get the type's size. Fixed #30040,
17650 2002-09-09 Martin Baulig <martin@gnome.org>
17652 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
17654 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
17655 context. Fixes bug #30027.
17657 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
17658 virtual functions. Fixes bug #30043, added test-164.cs.
17660 2002-09-08 Ravi Pratap <ravi@ximian.com>
17662 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
17664 2002-09-08 Nick Drochak <ndrochak@gol.com>
17666 * driver.cs: Use an object to get the windows codepage since it's not a
17669 2002-09-08 Miguel de Icaza <miguel@ximian.com>
17671 * statement.cs (For.Emit): for infinite loops (test == null)
17672 return whether there is a break inside, not always "true".
17674 * namespace.cs (UsingEntry): New struct to hold the name of the
17675 using definition, the location where it is defined, and whether it
17676 has been used in a successful type lookup.
17678 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
17683 2002-09-06 Ravi Pratap <ravi@ximian.com>
17685 * attribute.cs : Fix incorrect code which relied on catching
17686 a NullReferenceException to detect a null being passed in
17687 where an object was expected.
17689 2002-09-06 Miguel de Icaza <miguel@ximian.com>
17691 * statement.cs (Try): flag the catch variable as assigned
17693 * expression.cs (Cast): Simplified by using ResolveType instead of
17694 manually resolving.
17696 * statement.cs (Catch): Fix bug by using ResolveType.
17698 2002-09-06 Ravi Pratap <ravi@ximian.com>
17700 * expression.cs (BetterConversion): Special case for when we have
17701 a NullLiteral as the argument and we have to choose between string
17702 and object types - we choose string the way csc does.
17704 * attribute.cs (Attribute.Resolve): Catch the
17705 NullReferenceException and report error #182 since the Mono
17706 runtime no more has the bug and having this exception raised means
17707 we tried to select a constructor which takes an object and is
17710 2002-09-05 Ravi Pratap <ravi@ximian.com>
17712 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
17713 message (1502, 1503) when we can't locate a method after overload
17714 resolution. This is much more informative and closes the bug
17717 * interface.cs (PopulateMethod): Return if there are no argument
17718 types. Fixes a NullReferenceException bug.
17720 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
17721 expressions too. Previously we were checking only in one place for
17722 positional arguments leaving out named arguments.
17724 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
17725 type to the enum type is not allowed. Remove code corresponding to
17728 (ConvertNumericExplicit): Allow explicit conversions from
17729 the underlying type to enum type. This precisely follows the spec
17730 and closes a bug filed by Gonzalo.
17732 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17735 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
17737 2002-09-03 Miguel de Icaza <miguel@ximian.com>
17739 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
17740 it was important that we stored the right value after the
17741 reduction in `converted'.
17743 2002-09-04 Martin Baulig <martin@gnome.org>
17745 * location.cs (Location.SymbolDocument): Use full pathnames for the
17748 2002-08-30 Miguel de Icaza <miguel@ximian.com>
17750 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
17751 of the expression resolve mechanism, because that will catch the
17752 SimpleName error failures.
17754 (Conditional): If we can not resolve the
17755 expression, return, do not crash.
17757 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17760 (location): display token name instead of its number.
17762 2002-08-28 Martin Baulig <martin@gnome.org>
17764 * expression.cs (Binary.ResolveOperator): Don't silently return
17765 but return an error if an operator cannot be applied between two
17768 2002-08-28 Martin Baulig <martin@gnome.org>
17770 * class.cs (Constructor.Define): Set the permission attributes
17771 correctly instead of making all constructors public.
17773 2002-08-28 Martin Baulig <martin@gnome.org>
17775 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
17776 for private members before reporting a CS0103; if we find anything,
17779 2002-08-28 Martin Baulig <martin@gnome.org>
17781 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
17782 to check whether `closure_start_type == closure_invocation_type',
17783 we also need to check whether `m.DeclaringType == closure_invocation_type'
17784 before bypassing the permission checks. We might be accessing
17785 protected/private members from the base class.
17786 (TypeManager.RealMemberLookup): Only set private_ok if private
17787 members were requested via BindingFlags.NonPublic.
17789 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
17791 * expression.cs (MemberAccess.ResolveMemberAccess): Set
17792 MethodGroupExpr.IsExplicitImpl if appropriate.
17793 (Invocation.DoResolve): Don't report the CS0120 for explicit
17794 interface implementations.
17796 2002-08-27 Martin Baulig <martin@gnome.org>
17798 * expression.cs (Invocation.DoResolve): If this is a static
17799 method and we don't have an InstanceExpression, we must report
17802 2002-08-25 Martin Baulig <martin@gnome.org>
17804 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
17805 `==' between a valuetype and an object.
17807 2002-08-25 Miguel de Icaza <miguel@ximian.com>
17809 * ecore.cs (TypeExpr): Provide a ToString method.
17811 2002-08-24 Martin Baulig <martin@gnome.org>
17813 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
17814 now called proggie.dbg and it's a binary file.
17816 2002-08-23 Martin Baulig <martin@gnome.org>
17818 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
17820 2002-08-23 Martin Baulig <martin@gnome.org>
17822 * struct.cs (MyStructInfo.ctor): Make this work with empty
17823 structs; it's not allowed to use foreach() on null.
17825 2002-08-23 Martin Baulig <martin@gnome.org>
17827 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
17828 writer the full pathname of the generated assembly.
17830 2002-08-23 Martin Baulig <martin@gnome.org>
17832 * statements.cs (FlowBranching.UsageVector.MergeChildren):
17833 A `finally' block never returns or breaks; improved handling of
17836 2002-08-23 Martin Baulig <martin@gnome.org>
17838 * statement.cs (Throw.Resolve): Allow `throw null'.
17840 2002-08-23 Martin Baulig <martin@gnome.org>
17842 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
17843 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
17844 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
17845 MemberLookup would return a wrong event if this is an explicit
17846 interface implementation and the class has an event with the same
17849 2002-08-23 Martin Baulig <martin@gnome.org>
17851 * statement.cs (Block.AddChildVariableNames): New public method.
17852 (Block.AddChildVariableName): Likewise.
17853 (Block.IsVariableNameUsedInChildBlock): Likewise.
17854 (Block.AddVariable): Check whether a variable name has already
17855 been used in a child block.
17857 * cs-parser.jay (declare_local_variables): Mark all variable names
17858 from the current block as being used in a child block in the
17861 2002-08-23 Martin Baulig <martin@gnome.org>
17863 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
17864 find the symbol writer.
17866 * driver.cs: csc also allows the arguments to /define being
17867 separated by commas, not only by semicolons.
17869 2002-08-23 Martin Baulig <martin@gnome.org>
17871 * interface.cs (Interface.GetMembers): Added static check for events.
17873 2002-08-15 Martin Baulig <martin@gnome.org>
17875 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
17876 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
17878 * ecore.cs (Expression.MemberLookup): Added documentation and explained
17879 why the MethodData.EmitDestructor() change was necessary.
17881 2002-08-20 Martin Baulig <martin@gnome.org>
17883 * class.cs (TypeContainer.FindMembers): Added static check for events.
17885 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
17887 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
17888 use Type.GetEvents(), not Type.FindMembers().
17890 2002-08-20 Martin Baulig <martin@gnome.org>
17892 * decl.cs (MemberCache): Added a special method cache which will
17893 be used for method-only searched. This ensures that a method
17894 search will return a MethodInfo with the correct ReflectedType for
17897 2002-08-20 Martin Baulig <martin@gnome.org>
17899 * decl.cs (DeclSpace.FindMembers): Made this public.
17901 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17903 * delegate.cs: fixed build on windows.
17904 [FIXME: Filed as bug #29150: MCS must report these errors.]
17906 2002-08-19 Ravi Pratap <ravi@ximian.com>
17908 * ecore.cs (StandardConversionExists): Return a false
17909 if we are trying to convert the void type to anything else
17910 since that is not allowed.
17912 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
17913 we flag error 70 in the event an event is trying to be accessed
17914 directly from outside the declaring type.
17916 2002-08-20 Martin Baulig <martin@gnome.org>
17918 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
17919 MemberCache from typemanager.cs to decl.cs.
17921 2002-08-19 Martin Baulig <martin@gnome.org>
17923 * class.cs (TypeContainer): Implement IMemberContainer.
17924 (TypeContainer.DefineMembers): Create the MemberCache.
17925 (TypeContainer.FindMembers): Do better BindingFlags checking; only
17926 return public members if BindingFlags.Public was given, check
17927 whether members are static.
17929 2002-08-16 Martin Baulig <martin@gnome.org>
17931 * decl.cs (DeclSpace.Define): Splitted this in Define and
17932 DefineMembers. DefineMembers is called first and initializes the
17935 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
17936 DefineMembers() on all our DeclSpaces.
17938 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
17939 but call DefineMembers() on all nested interfaces. We call their
17940 Define() in our new Define() function.
17942 * interface.cs (Interface): Implement IMemberContainer.
17943 (Interface.Define): Moved all code except the attribute stuf to
17945 (Interface.DefineMembers): Initialize the member cache.
17947 * typemanager.cs (IMemberFinder): Removed this interface, we don't
17948 need this anymore since we can use MemberCache.FindMembers directly.
17950 2002-08-19 Martin Baulig <martin@gnome.org>
17952 * typemanager.cs (MemberCache): When creating the cache for an
17953 interface type, add all inherited members.
17954 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
17955 to `out bool used_cache' and documented it.
17956 (TypeManager.MemberLookup): If we already used the cache in the first
17957 iteration, we don't need to do the interfaces check.
17959 2002-08-19 Martin Baulig <martin@gnome.org>
17961 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
17962 here from IMemberFinder and don't implement this interface anymore.
17963 (DeclSpace.MemberCache): Moved here from IMemberFinder.
17965 * typemanager.cs (IMemberFinder): This interface is now only used by
17966 classes which actually support the member cache.
17967 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
17968 since we only put DeclSpaces into this Hashtable.
17969 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
17970 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
17972 2002-08-16 Martin Baulig <martin@gnome.org>
17974 * typemanager.cs (ICachingMemberFinder): Removed.
17975 (IMemberFinder.MemberCache): New property.
17976 (TypeManager.FindMembers): Merged this with RealFindMembers().
17977 This function will never be called from TypeManager.MemberLookup()
17978 so we can't use the cache here, just the IMemberFinder.
17979 (TypeManager.MemberLookup_FindMembers): Check whether the
17980 IMemberFinder has a MemberCache and call the cache's FindMembers
17982 (MemberCache): Rewrote larger parts of this yet another time and
17983 cleaned it up a bit.
17985 2002-08-15 Miguel de Icaza <miguel@ximian.com>
17987 * driver.cs (LoadArgs): Support quoting.
17989 (Usage): Show the CSC-like command line arguments.
17991 Improved a few error messages.
17993 2002-08-15 Martin Baulig <martin@gnome.org>
17995 * typemanager.cs (IMemberContainer.Type): New property.
17996 (IMemberContainer.IsInterface): New property.
17998 The following changes are conditional to BROKEN_RUNTIME, which is
17999 defined at the top of the file.
18001 * typemanager.cs (MemberCache.MemberCache): Don't add the base
18002 class'es members, but add all members from TypeHandle.ObjectType
18003 if we're an interface.
18004 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
18005 is the current type.
18006 (MemberCache.CacheEntry.Container): Removed this field.
18007 (TypeHandle.GetMembers): Include inherited members.
18009 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18011 * typemanager.cs: fixed compilation and added a comment on a field that
18014 2002-08-15 Martin Baulig <martin@gnome.org>
18016 * class.cs (ConstructorInitializer.Resolve): In the
18017 Expression.MemberLookup call, use the queried_type as
18020 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
18021 declared' attribute, it's always true.
18022 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
18023 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
18024 temporary wrapper for FindMembers which tells MemberLookup whether
18025 members from the base classes are included in the return value.
18026 This will go away soon.
18027 (TypeManager.MemberLookup): Use this temporary hack here; once the
18028 new MemberCache is completed, we don't need to do the DeclaredOnly
18029 looping here anymore since the MemberCache will take care of this.
18030 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
18031 (MemberCache): When creating the MemberCache for a class, get
18032 members from the current class and all its base classes.
18033 (MemberCache.CacheEntry.Container): New field. This is a
18034 temporary hack until the Mono runtime is fixed to distinguish
18035 between ReflectedType and DeclaringType. It allows us to use MCS
18036 with both the MS runtime and the unfixed Mono runtime without
18037 problems and without accecting performance.
18038 (MemberCache.SearchMembers): The DeclaredOnly looping from
18039 TypeManager.MemberLookup is now done here.
18041 2002-08-14 Martin Baulig <martin@gnome.org>
18043 * statement.cs (MyStructInfo.MyStructInfo): Don't call
18044 Type.GetFields on dynamic types but get the fields from the
18045 corresponding TypeContainer.
18046 (MyStructInfo.GetStructInfo): Added check for enum types.
18048 * typemanager.cs (MemberList.IsSynchronized): Implemented.
18049 (MemberList.SyncRoot): Implemented.
18050 (TypeManager.FilterWithClosure): No need to check permissions if
18051 closure_start_type == closure_invocation_type, don't crash if
18052 closure_invocation_type is null.
18054 2002-08-13 Martin Baulig <martin@gnome.org>
18056 Rewrote TypeContainer.FindMembers to use a member cache. This
18057 gives us a speed increase of about 35% for the self-hosting MCS
18058 build and of about 15-20% for the class libs (both on GNU/Linux).
18060 * report.cs (Timer): New class to get enhanced profiling. This
18061 whole class is "TIMER" conditional since it remarkably slows down
18064 * class.cs (MemberList): New class. This is an IList wrapper
18065 which we're now using instead of passing MemberInfo[]'s around to
18066 avoid copying this array unnecessarily.
18067 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
18068 (ICachingMemberFinder, IMemberContainer): New interface.
18069 (TypeManager.FilterWithClosure): If `criteria' is null, the name
18070 has already been checked, otherwise use it for the name comparision.
18071 (TypeManager.FindMembers): Renamed to RealMemberFinder and
18072 provided wrapper which tries to use ICachingMemberFinder.FindMembers
18073 if possible. Returns a MemberList, not a MemberInfo [].
18074 (TypeHandle): New class, implements IMemberContainer. We create
18075 one instance of this class per type, it contains a MemberCache
18076 which is used to do the member lookups.
18077 (MemberCache): New class. Each instance of this class contains
18078 all members of a type and a name-based hash table.
18079 (MemberCache.FindMembers): This is our new member lookup
18080 function. First, it looks up all members of the requested name in
18081 the hash table. Then, it walks this list and sorts out all
18082 applicable members and returns them.
18084 2002-08-13 Martin Baulig <martin@gnome.org>
18086 In addition to a nice code cleanup, this gives us a performance
18087 increase of about 1.4% on GNU/Linux - not much, but it's already
18088 half a second for the self-hosting MCS compilation.
18090 * typemanager.cs (IMemberFinder): New interface. It is used by
18091 TypeManager.FindMembers to call FindMembers on a TypeContainer,
18092 Enum, Delegate or Interface.
18093 (TypeManager.finder_to_member_finder): New PtrHashtable.
18094 (TypeManager.finder_to_container): Removed.
18095 (TypeManager.finder_to_delegate): Removed.
18096 (TypeManager.finder_to_interface): Removed.
18097 (TypeManager.finder_to_enum): Removed.
18099 * interface.cs (Interface): Implement IMemberFinder.
18101 * delegate.cs (Delegate): Implement IMemberFinder.
18103 * enum.cs (Enum): Implement IMemberFinder.
18105 * class.cs (TypeContainer): Implement IMemberFinder.
18107 2002-08-12 Martin Baulig <martin@gnome.org>
18109 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
18111 2002-08-12 Martin Baulig <martin@gnome.org>
18113 * ecore.cs (ITypeExpression): New interface for expressions which
18115 (TypeExpression): Renamed to TypeLookupExpression.
18116 (Expression.DoResolve): If we're doing a types-only lookup, the
18117 expression must implement the ITypeExpression interface and we
18118 call DoResolveType() on it.
18119 (SimpleName): Implement the new ITypeExpression interface.
18120 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
18121 hack, the situation that we're only looking up types can't happen
18122 anymore when this method is called. Moved the type lookup code to
18123 DoResolveType() and call it.
18124 (SimpleName.DoResolveType): This ITypeExpression interface method
18125 is now doing the types-only lookup.
18126 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
18127 (ResolveFlags): Added MaskExprClass.
18129 * expression.cs (MemberAccess): Implement the ITypeExpression
18131 (MemberAccess.DoResolve): Added support for a types-only lookup
18132 when we're called via ITypeExpression.DoResolveType().
18133 (ComposedCast): Implement the ITypeExpression interface.
18135 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
18136 Expression.Resolve() with ResolveFlags.Type instead.
18138 2002-08-12 Martin Baulig <martin@gnome.org>
18140 * interface.cs (Interface.Define): Apply attributes.
18142 * attribute.cs (Attribute.ApplyAttributes): Added support for
18143 interface attributes.
18145 2002-08-11 Martin Baulig <martin@gnome.org>
18147 * statement.cs (Block.Emit): Only check the "this" variable if we
18148 do not always throw an exception.
18150 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
18151 whether the property has a set accessor.
18153 2002-08-11 Martin Baulig <martin@gnome.org>
18155 Added control flow analysis support for structs.
18157 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
18158 with control flow analysis turned off.
18159 (IVariable): New interface.
18160 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
18161 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
18162 (FieldExpr.DoResolve): Resolve the instance expression with flow
18163 analysis turned off and do the definite assignment check after the
18164 resolving when we know what the expression will resolve to.
18166 * expression.cs (LocalVariableReference, ParameterReference):
18167 Implement the new IVariable interface, only call the flow analysis
18168 code if ec.DoFlowAnalysis is true.
18169 (This): Added constructor which takes a Block argument. Implement
18170 the new IVariable interface.
18171 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
18172 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
18173 This does the definite assignment checks for struct members.
18175 * class.cs (Constructor.Emit): If this is a non-static `struct'
18176 constructor which doesn't have any initializer, call
18177 Block.AddThisVariable() to tell the flow analysis code that all
18178 struct elements must be initialized before control returns from
18181 * statement.cs (MyStructInfo): New public class.
18182 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
18183 argument to this indexer. If non-zero, check an individual struct
18184 member, not the whole struct.
18185 (FlowBranching.CheckOutParameters): Check struct members.
18186 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
18187 overloaded versions of these methods which take an additional
18188 `int field_idx' argument to check struct members.
18189 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
18190 overloaded versions of these methods which take an additional
18191 `string field_name' argument to check struct member.s
18192 (VariableInfo): Implement the IVariable interface.
18193 (VariableInfo.StructInfo): New public property. Returns the
18194 MyStructInfo instance of the variable if it's a struct or null.
18195 (Block.AddThisVariable): New public method. This is called from
18196 Constructor.Emit() for non-static `struct' constructor which do
18197 not have any initializer. It creates a special variable for the
18198 "this" instance variable which will be checked by the flow
18199 analysis code to ensure that all of the struct's fields are
18200 initialized before control returns from the constructor.
18201 (UsageVector): Added support for struct members. If a
18202 variable/parameter is a struct with N members, we reserve a slot
18203 in the usage vector for each member. A struct is considered fully
18204 initialized if either the struct itself (slot 0) or all its
18205 members are initialized.
18207 2002-08-08 Martin Baulig <martin@gnome.org>
18209 * driver.cs (Driver.MainDriver): Only report an error CS5001
18210 if there were no compilation errors.
18212 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
18213 `UnsafeContext' property to determine whether the parent is in
18214 unsafe context rather than checking the parent's ModFlags:
18215 classes nested in an unsafe class are unsafe as well.
18217 2002-08-08 Martin Baulig <martin@gnome.org>
18219 * statement.cs (UsageVector.MergeChildren): Distinguish between
18220 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
18221 we return. Added test17() and test18() to test-154.cs.
18223 2002-08-08 Martin Baulig <martin@gnome.org>
18225 * typemanager.cs (TypeManager.FilterWithClosure): If we have
18226 Family access, make sure the invoking type isn't a subclass of the
18227 queried type (that'd be a CS1540).
18229 * ecore.cs (Expression.MemberLookup): Added overloaded version of
18230 this method which takes an additional `Type invocation_type'.
18232 * expression.cs (BaseAccess.DoResolve): Use the base type as
18233 invocation and query type.
18234 (MemberAccess.DoResolve): If the lookup failed and we're about to
18235 report a CS0122, try a lookup with the ec.ContainerType - if this
18236 succeeds, we must report a CS1540.
18238 2002-08-08 Martin Baulig <martin@gnome.org>
18240 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
18241 (MethodGroupExpr): Implement the IMemberExpr interface.
18243 * expression (MemberAccess.ResolveMemberAccess): No need to have
18244 any special code for MethodGroupExprs anymore, they're now
18247 2002-08-08 Martin Baulig <martin@gnome.org>
18249 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
18250 Family, FamANDAssem and FamORAssem permissions.
18251 (TypeManager.IsSubclassOrNestedChildOf): New public method.
18253 2002-08-08 Martin Baulig <martin@gnome.org>
18255 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
18256 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
18259 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
18261 * driver.cs: implemented /resource option to embed managed resources.
18263 2002-08-07 Martin Baulig <martin@gnome.org>
18265 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
18266 (FieldBase.HasFieldInitializer): New public property.
18267 (FieldBase.GetInitializerExpression): New public method. Resolves and
18268 returns the field initializer and makes sure it is only resolved once.
18269 (TypeContainer.EmitFieldInitializers): Call
18270 FieldBase.GetInitializerExpression to get the initializer, this ensures
18271 that it isn't resolved multiple times.
18273 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
18274 the resolving process (SimpleName/MemberLookup) that we're currently
18275 emitting a field initializer (which must not access any instance members,
18276 this is an error CS0236).
18278 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
18279 argument, if the `IsFieldInitializer' flag is set, we must report and
18280 error CS0236 and not an error CS0120.
18282 2002-08-07 Martin Baulig <martin@gnome.org>
18284 * ecore.cs (IMemberExpr): New public interface.
18285 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
18286 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
18287 if the expression is an IMemberExpr.
18289 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
18290 to be null, implicitly default to `this' if we're non-static in
18291 this case. Simplified the code a lot by using the new IMemberExpr
18292 interface. Also fixed bug #28176 here.
18294 2002-08-06 Martin Baulig <martin@gnome.org>
18296 * cs-parser.jay (SimpleLookup): Removed. We need to create
18297 ParameterReferences during semantic analysis so that we can do a
18298 type-only search when resolving Cast, TypeOf and SizeOf.
18299 (block): Pass the `current_local_parameters' to the Block's
18302 * class.cs (ConstructorInitializer): Added `Parameters parameters'
18303 argument to the constructor.
18304 (ConstructorInitializer.Resolve): Create a temporary implicit
18305 block with the parameters.
18307 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
18308 references here if we aren't doing a type-only search.
18310 * statement.cs (Block): Added constructor which takes a
18311 `Parameters parameters' argument.
18312 (Block.Parameters): New public property.
18314 * support.cs (InternalParameters.Parameters): Renamed `parameters'
18315 to `Parameters' and made it public readonly.
18317 2002-08-06 Martin Baulig <martin@gnome.org>
18319 * ecore.cs (Expression.Warning): Made this public as well.
18321 * report.cs (Report.Debug): Print the contents of collections.
18323 2002-08-06 Martin Baulig <martin@gnome.org>
18325 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
18326 used to tell Resolve() which kinds of expressions it may return.
18327 (Expression.Resolve): Added overloaded version of this method which
18328 takes a `ResolveFlags flags' argument. This can be used to tell
18329 Resolve() which kinds of expressions it may return. Reports a
18331 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
18332 ResolveFlags.SimpleName.
18333 (Expression.Error118): Added overloaded version of this method which
18334 takes a `ResolveFlags flags' argument. It uses the flags to determine
18335 which kinds of expressions are allowed.
18337 * expression.cs (Argument.ResolveMethodGroup): New public method.
18338 Resolves an argument, but allows a MethodGroup to be returned.
18339 This is used when invoking a delegate.
18341 * TODO: Updated a bit.
18343 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18345 Fixed compilation with csc.
18347 * ecore.cs: Expression.Error made public. Is this correct? Should
18348 Warning be made public too?
18350 * expression.cs: use ea.Location instead of ea.loc.
18351 [FIXME: Filed as bug #28607: MCS must report these errors.]
18353 2002-08-06 Martin Baulig <martin@gnome.org>
18355 * ecore.cs (Expression.loc): Moved the location here instead of
18356 duplicating it in all derived classes.
18357 (Expression.Location): New public property.
18358 (Expression.Error, Expression.Warning): Made them non-static and
18359 removed the location argument.
18360 (Expression.Warning): Added overloaded version which takes an
18361 `int level' argument.
18362 (Expression.Error118): Make this non-static and removed the
18363 expression and location arguments.
18364 (TypeExpr): Added location argument to the constructor.
18366 * expression.cs (StaticCallExpr): Added location argument to
18368 (Indirection, PointerArithmetic): Likewise.
18369 (CheckedExpr, UnCheckedExpr): Likewise.
18370 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
18371 (StringPtr): Likewise.
18374 2002-08-05 Martin Baulig <martin@gnome.org>
18376 * expression.cs (BaseAccess.DoResolve): Actually report errors.
18378 * assign.cs (Assign.DoResolve): Check whether the source
18379 expression is a value or variable.
18381 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
18382 while resolving the corresponding blocks.
18384 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
18385 an error, don't silently return null.
18387 * statement.cs (Block.AddVariable): Do the error reporting here
18388 and distinguish between CS0128 and CS0136.
18389 (Block.DoResolve): Report all unused labels (warning CS0164).
18390 (LabeledStatement): Pass the location to the constructor.
18391 (LabeledStatement.HasBeenReferenced): New property.
18392 (LabeledStatement.Resolve): Set it to true here.
18394 * statement.cs (Return.Emit): Return success even after reporting
18395 a type mismatch error (CS0126 or CS0127), this is what csc does and
18396 it avoids confusing the users with any consecutive errors.
18398 2002-08-05 Martin Baulig <martin@gnome.org>
18400 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
18402 * const.cs (Const.LookupConstantValue): Catch circular definitions.
18404 * expression.cs (MemberAccess.DoResolve): Silently return if an
18405 error has already been reported.
18407 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
18408 error has already been reported.
18410 2002-08-05 Martin Baulig <martin@gnome.org>
18412 * statement.cs (UsageVector): Only initialize the `parameters'
18413 vector if we actually have any "out" parameters.
18415 2002-08-05 Martin Baulig <martin@gnome.org>
18417 * expression.cs (Binary.ResolveOperator): When combining delegates,
18418 they must have the same type.
18420 2002-08-05 Martin Baulig <martin@gnome.org>
18422 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
18423 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
18424 work with the ms runtime and we also don't need it: if we're a
18425 PropertyBuilder and not in the `indexer_arguments' hash, then we
18426 are a property and not an indexer.
18428 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
18429 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
18430 since the latter one doesn't work with the ms runtime.
18432 2002-08-03 Martin Baulig <martin@gnome.org>
18434 Fixed bugs #27998 and #22735.
18436 * class.cs (Method.IsOperator): New public field.
18437 (Method.CheckBase): Report CS0111 if there's already a method
18438 with the same parameters in the current class. Report CS0508 when
18439 attempting to change the return type of an inherited method.
18440 (MethodData.Emit): Report CS0179 if a method doesn't have a body
18441 and it's not marked abstract or extern.
18442 (PropertyBase): New abstract base class for Property and Indexer.
18443 (PropertyBase.CheckBase): Moved here from Property and made it work
18445 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
18446 the same so we can reuse it there.
18447 (Property, Indexer): Derive from PropertyBase.
18448 (MethodSignature.inheritable_property_signature_filter): New delegate
18449 to find properties and indexers.
18451 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
18452 argument and improved error reporting.
18454 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
18455 EmptyReadOnlyParameters and made it a property.
18457 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
18458 version of this method which takes a `PropertyInfo indexer'.
18459 (TypeManager.RegisterIndexer): New method.
18461 * class.cs: Added myself as author of this file :-)
18463 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18465 * class.cs: fixed compilation on windoze.
18467 2002-08-03 Martin Baulig <martin@gnome.org>
18469 * interface.cs (Interface.GetInterfaceBases): Check whether all
18470 base interfaces are at least as accessible than the current one.
18472 * class.cs (TypeContainer.GetClassBases): Check whether base types
18473 are at least as accessible than the current type.
18474 (TypeContainer.AsAccessible): Implemented and made non-static.
18475 (MemberBase.CheckParameters): Report errors if the accessibility
18478 * delegate.cs (Delegate.Delegate): The default visibility is
18479 internal for top-level types and private for nested types.
18480 (Delegate.Define): Report errors if the accessibility checks fail.
18482 * enum.cs (Enum.Enum): The default visibility is internal for
18483 top-level types and private for nested types.
18484 (Enum.DefineType): Compute the correct visibility.
18486 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
18487 function which takes a `bool is_toplevel' instead of a TypeContainer.
18489 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
18492 2002-08-02 Martin Baulig <martin@gnome.org>
18494 * expression.cs (LocalVariableReferenc): Added constructor which
18495 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
18496 (LocalVariableReference.IsReadOnly): New property.
18497 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
18498 variable is readonly, use our own readonly flag to do this; you can
18499 use the new constructor to get a writable reference to a read-only
18502 * cs-parser.jay (foreach_statement, using_statement): Get a writable
18503 reference to the local variable.
18505 2002-08-01 Miguel de Icaza <miguel@ximian.com>
18507 * rootcontext.cs (ResolveCore): Also include System.Exception
18509 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
18510 we reach an EmptyStatement.
18512 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
18515 * expression.cs (Binary.ResolveOperator): Check error result in
18518 use brtrue/brfalse directly and avoid compares to null.
18520 2002-08-02 Martin Baulig <martin@gnome.org>
18522 * class.cs (TypeContainer.Define): Define all nested interfaces here.
18523 Fixes bug #28407, added test-155.cs.
18525 2002-08-01 Martin Baulig <martin@gnome.org>
18527 * class.cs (Event.EmitDefaultMethod): Make this work with static
18528 events. Fixes #28311, added verify-3.cs.
18530 2002-08-01 Martin Baulig <martin@gnome.org>
18532 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
18533 `is_disposable' fields.
18534 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
18535 `hm.is_disposable' if we're using the collection pattern.
18536 (Foreach.EmitCollectionForeach): Use the correct type for the
18537 enumerator's local variable, only emit the try/finally block if
18538 necessary (fixes #27713).
18540 2002-08-01 Martin Baulig <martin@gnome.org>
18542 * ecore.cs (Expression.report118): Renamed to Error118 and made
18545 * statement.cs (Throw.Resolve): Check whether the expression is of
18546 the correct type (CS0118) and whether the type derives from
18547 System.Exception (CS0155).
18548 (Catch.Resolve): New method. Do the type lookup here and check
18549 whether it derives from System.Exception (CS0155).
18550 (Catch.CatchType, Catch.IsGeneral): New public properties.
18552 * typemanager.cs (TypeManager.exception_type): Added.
18554 2002-07-31 Miguel de Icaza <miguel@ximian.com>
18556 * driver.cs: Updated About function.
18558 2002-07-31 Martin Baulig <martin@gnome.org>
18560 Implemented Control Flow Analysis.
18562 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
18563 (EmitContext.CurrentBranching): Added.
18564 (EmitContext.StartFlowBranching): Added.
18565 (EmitContext.EndFlowBranching): Added.
18566 (EmitContext.KillFlowBranching): Added.
18567 (EmitContext.IsVariableAssigned): Added.
18568 (EmitContext.SetVariableAssigned): Added.
18569 (EmitContext.IsParameterAssigned): Added.
18570 (EmitContext.SetParameterAssigned): Added.
18571 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
18572 Added control flow analysis stuff here.
18574 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
18575 resolve the expression as lvalue.
18576 (LocalVariableReference.DoResolve): Check whether the variable has
18577 already been assigned.
18578 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
18579 the parameter as assigned here.
18580 (ParameterReference.DoResolve): Check whether the parameter has already
18582 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
18583 expression as lvalue.
18585 * statement.cs (FlowBranching): New class for the flow analysis code.
18586 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
18587 (LabeledStatement.IsDefined): New public property.
18588 (LabeledStatement.AddUsageVector): New public method to tell flow
18589 analyis that the label may be reached via a forward jump.
18590 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
18592 (VariableInfo.Number): New public field. This is used by flow analysis
18593 to number all locals of a block.
18594 (Block.CountVariables): New public property. This is the number of
18595 local variables in this block (including the locals from all parent
18597 (Block.EmitMeta): Number all the variables.
18599 * statement.cs: Added flow analysis support to all classes.
18601 2002-07-31 Martin Baulig <martin@gnome.org>
18603 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
18604 To get debugging messages, compile mcs with /define:MCS_DEBUG and
18605 then use this argument.
18607 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
18609 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
18610 use this to specify /define options.
18612 2002-07-29 Martin Baulig <martin@gnome.org>
18614 * statement.cs (Fixed): Moved all code that does variable lookups
18615 and resolvings from Emit to Resolve.
18617 * statement.cs (For): Moved all code that does variable lookups
18618 and resolvings from Emit to Resolve.
18620 * statement.cs (Using): Moved all code that does variable lookups
18621 and resolvings from Emit to Resolve.
18623 2002-07-29 Martin Baulig <martin@gnome.org>
18625 * attribute.cs (Attribute.Resolve): Explicitly catch a
18626 System.NullReferenceException when creating the
18627 CustromAttributeBuilder and report a different warning message.
18629 2002-07-29 Martin Baulig <martin@gnome.org>
18631 * support.cs (ParameterData.ParameterName): Added method to
18632 get the name of a parameter.
18634 * typemanager.cs (TypeManager.IsValueType): New public method.
18636 2002-07-29 Martin Baulig <martin@gnome.org>
18638 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
18639 is a flag which specifies that it's either ref or out.
18640 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
18641 the out parameter to `out Parameter.Modifier mod', also set the
18642 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
18644 * support.cs (InternalParameters.ParameterModifier): Distinguish
18645 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
18646 Parameter.Modifier.ISBYREF flag if it's either ref or out.
18648 * expression.cs (Argument.GetParameterModifier): Distinguish
18649 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
18650 Parameter.Modifier.ISBYREF flag if it's either ref or out.
18652 2002-07-29 Martin Baulig <martin@gnome.org>
18654 * expression.cs (ParameterReference.ParameterReference): Added
18655 `Location loc' argument to the constructor.
18657 * cs-parser.jay: Pass location to ParameterReference.
18659 2002-07-28 Miguel de Icaza <miguel@ximian.com>
18661 * statement.cs (Try): Initialize the location.
18663 * cs-parser.jay: pass location to Try.
18665 * expression.cs (Unary.Reduce): Change the prototype to return
18666 whether a constant fold could be performed or not. The result is
18667 returned in an out parameters. In the case of Indirection and
18668 AddressOf, we want to perform the full tests.
18670 2002-07-26 Miguel de Icaza <miguel@ximian.com>
18672 * statement.cs (Statement.Emit): Flag dead code.
18674 2002-07-27 Andrew Birkett <andy@nobugs.org>
18676 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
18678 2002-07-27 Martin Baulig <martin@gnome.org>
18680 * class.cs (MethodData.Define): Put back call to
18681 TypeManager.AddMethod(), accidentally commented this out.
18683 * report.cs (Debug): New public method to print debugging information,
18684 this is `[Conditional ("DEBUG")]'.
18686 2002-07-26 Martin Baulig <martin@gnome.org>
18688 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
18689 (switch_statement): Push the current_block to the switch_stack and
18690 pop it again when we're done with the switch.
18691 (switch_section): The new block is a child of the current_block.
18692 Fixes bug #24007, added test-152.cs.
18694 2002-07-27 Martin Baulig <martin@gnome.org>
18696 * expression.cs (Invocation.EmitArguments): When calling a varargs
18697 function with only its fixed arguments, we need to pass an empty
18700 2002-07-27 Martin Baulig <martin@gnome.org>
18702 Mono 0.13 has been released.
18704 2002-07-25 Miguel de Icaza <miguel@ximian.com>
18706 * driver.cs: Rename --resource to --linkres, because that is what
18707 we do currently, we dont support --resource yet.
18709 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
18711 2002-07-25 Martin Baulig <martin@gnome.org>
18713 * class.cs (MethodData): New public class. This is a `method builder'
18714 class for a method or one accessor of a Property/Indexer/Event.
18715 (MethodData.GetMethodFlags): Moved here from MemberBase.
18716 (MethodData.ApplyAttributes): Likewise.
18717 (MethodData.ApplyObsoleteAttribute): Likewise.
18718 (MethodData.ApplyConditionalAttribute): Likewise.
18719 (MethodData.ApplyDllImportAttribute): Likewise.
18720 (MethodData.CheckAbstractAndExternal): Likewise.
18721 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
18722 (MethodData.Emit): Formerly known as Method.Emit().
18723 (MemberBase): Moved everything which was specific to a single
18724 accessor/method to MethodData.
18725 (Method): Create a new MethodData and call Define() and Emit() on it.
18726 (Property, Indexer, Event): Create a new MethodData objects for each
18727 accessor and call Define() and Emit() on them.
18729 2002-07-25 Martin Baulig <martin@gnome.org>
18731 Made MethodCore derive from MemberBase to reuse the code from there.
18732 MemberBase now also checks for attributes.
18734 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
18735 (MemberBase.GetMethodFlags): Moved here from class Method and marked
18737 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
18738 `CallingConventions cc' and `Attributes opt_attrs' arguments.
18739 (MemberBase.ApplyAttributes): New virtual method; applies the
18740 attributes to a method or accessor.
18741 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
18742 (MemberBase.ApplyConditionalAttribute): Likewise.
18743 (MemberBase.ApplyDllImportAttribute): Likewise.
18744 (MemberBase.CheckAbstractAndExternal): Likewise.
18745 (MethodCore.ParameterTypes): This is now a property instead of a
18746 method, it's initialized from DoDefineParameters().
18747 (MethodCore.ParameterInfo): Removed the set accessor.
18748 (MethodCore.DoDefineParameters): New protected virtual method to
18749 initialize ParameterTypes and ParameterInfo.
18750 (Method.GetReturnType): We can now simply return the MemberType.
18751 (Method.GetMethodFlags): Override the MemberBase version and add
18752 the conditional flags.
18753 (Method.CheckBase): Moved some code from Define() here, call
18754 DoDefineParameters() here.
18755 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
18756 here to avoid some larger code duplication.
18757 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
18758 ensure that abstract and external accessors don't declare a body.
18760 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
18761 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
18762 lookup in the attribute's parent classes, so we need to abort as soon
18763 as we found the first match.
18764 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
18765 the attribute has no arguments.
18767 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
18770 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18772 * cs-parser.jay: reverted previous patch.
18774 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18776 * cs-parser.jay: fixed bug #22119.
18778 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18780 * attribute.cs: fixed compilation. The error was:
18781 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
18782 be assigned to before control leaves the current method."
18783 [FIXME: Filed as bug #28186: MCS must report this error.]
18785 2002-07-25 Martin Baulig <martin@gnome.org>
18787 * attribute.cs (Attribute.Conditional_GetConditionName): New static
18788 method to pull the condition name ouf of a Conditional attribute.
18789 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
18790 the obsolete message and error flag out of an Obsolete attribute.
18792 * class.cs (Method.GetMethodFlags): New public method to get the
18793 TypeManager.MethodFlags for this method.
18794 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
18796 (Method.Define): Get and apply the Obsolete and Conditional attributes;
18797 if we're overriding a virtual function, set the new private variable
18798 `parent_method'; call the new TypeManager.AddMethod().
18800 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
18801 the MethodBuilder and the Method in a PtrHashtable.
18802 (TypeManager.builder_to_method): Added for this purpose.
18803 (TypeManager.MethodFlags): Added IsObsoleteError.
18804 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
18805 Obsolete and Conditional arguments in MethodBuilders. If we discover
18806 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
18807 the message from the attribute.
18809 2002-07-24 Martin Baulig <martin@gnome.org>
18811 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
18812 preprocessor directives, ensure that the argument to #define/#undef is
18813 exactly one identifier and that it's actually an identifier.
18815 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
18818 2002-07-24 Martin Baulig <martin@gnome.org>
18820 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
18821 initialize it to TypeManager.object_type in the constructor.
18822 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
18823 of the `hm.get_current' method if we're using the collection pattern.
18824 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
18825 for the explicit conversion to make it work when we're using the collection
18826 pattern and the `Current' property has a different return type than `object'.
18829 2002-07-24 Martin Baulig <martin@gnome.org>
18831 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
18832 does not match, but don't report any errors. This method is called in
18833 order for all methods in a MethodGroupExpr until a matching method is
18834 found, so we don't want to bail out if the first method doesn't match.
18835 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
18836 matches, report the 123. Fixes #28070.
18838 2002-07-24 Martin Baulig <martin@gnome.org>
18840 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
18841 TypeManager.TypeToCoreType() to the top of the method so the
18842 following equality checks will work. Fixes #28107.
18844 2002-07-24 Martin Baulig <martin@gnome.org>
18846 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
18847 operand is of type uint, and the other operand is of type sbyte,
18848 short or int, the operands are converted to type long." -
18849 Actually do what this comment already told us. Fixes bug #28106,
18852 2002-07-24 Martin Baulig <martin@gnome.org>
18854 * class.cs (MethodBase): New abstract class. This is now a base
18855 class for Property, Indexer and Event to avoid some code duplication
18856 in their Define() and DefineMethods() methods.
18857 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
18858 generic methods for Define() and DefineMethods().
18859 (FieldBase): Derive from MemberBase, not MemberCore.
18860 (Property): Derive from MemberBase, not MemberCore.
18861 (Property.DefineMethod): Moved all the code from this method to the
18862 new MethodBase.DefineAccessor(), just call it with appropriate
18864 (Property.Define): Call the new Property.DoDefine(), this does some
18865 sanity checks and we don't need to duplicate the code everywhere.
18866 (Event): Derive from MemberBase, not MemberCore.
18867 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
18868 accessors, this will also make them work with interface events.
18869 (Indexer): Derive from MemberBase, not MemberCore.
18870 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
18871 (Indexer.Define): Use the new MethodBase functions.
18873 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
18874 argument to the constructor.
18875 (Interface.FindMembers): Added support for interface events.
18876 (Interface.PopluateEvent): Implemented.
18878 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
18880 2002-07-22 Miguel de Icaza <miguel@ximian.com>
18882 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
18883 but this is required to check for a method name being the same as
18884 the containing class.
18888 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18890 * interface.cs: initialize variable.
18892 2002-07-23 Martin Baulig <martin@gnome.org>
18894 Implemented the IndexerName attribute in interfaces.
18896 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
18897 name if this is an explicit interface implementation.
18898 (Indexer.InterfaceIndexerName): New public variable. If we're
18899 implementing an interface indexer, this is the IndexerName in that
18900 interface. Otherwise, it's the IndexerName.
18901 (Indexer.DefineMethod): If we're implementing interface indexer,
18902 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
18903 and Pending.ImplementIndexer methods.
18904 (Indexer.Define): Also define the PropertyBuilder if we're
18905 implementing an interface indexer and this is neither an explicit
18906 interface implementation nor do the IndexerName match the one in
18909 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
18910 If a method is defined here, then we always need to create a proxy
18911 for it. This is used when implementing interface indexers.
18912 (Pending.IsInterfaceIndexer): New public method.
18913 (Pending.ImplementIndexer): New public method.
18914 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
18915 This is used when implementing interface indexers to define a proxy
18917 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
18918 define a proxy if necessary.
18920 * interface.cs (Interface.IndexerName): New public variable.
18921 (Interface.PopulateIndexer): Set the IndexerName.
18922 (Interface.DefineIndexers): New private method. Populate all the
18923 indexers and make sure their IndexerNames match.
18925 * typemanager.cs (IndexerPropertyName): Added support for interface
18928 2002-07-22 Martin Baulig <martin@gnome.org>
18930 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
18931 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
18932 ret if HasReturnLabel.
18933 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
18936 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
18937 and set the ec.LoopBeginTryCatchLevel.
18938 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
18939 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
18940 the current ec.TryCatchLevel, the branch goes out of an exception
18941 block. In this case, we need to use Leave and not Br.
18943 2002-07-22 Martin Baulig <martin@gnome.org>
18945 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
18946 block unless the block does not always return or it is contained in
18947 another try { ... } catch { ... } block. Fixes bug #26506.
18948 Added verify-1.cs to the test suite.
18950 2002-07-22 Martin Baulig <martin@gnome.org>
18952 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
18953 then we do not always return. Fixes bug #24985.
18955 2002-07-22 Martin Baulig <martin@gnome.org>
18957 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
18958 lookup on a per-class level; ie. walk up the class hierarchy until we
18959 found at least one applicable method, then choose the best among them.
18960 Fixes bug #24463 and test-29.cs.
18962 2002-07-22 Martin Baulig <martin@gnome.org>
18964 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
18965 return types of the methods. The return type is not part of the
18966 signature and we must not check it to make the `new' modifier work.
18967 Fixes bug #27999, also added test-147.cs.
18968 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
18970 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
18971 on the method's return type.
18973 2002-07-21 Martin Baulig <martin@gnome.org>
18975 * assign.cs: Make this work if the rightmost source is a constant and
18976 we need to do an implicit type conversion. Also adding a few more tests
18977 to test-38.cs which should have caught this.
18979 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
18980 target in the makefile for this. The makefile.gnu is primarily intended
18981 for end-users who don't want to debug the compiler.
18983 2002-07-21 Martin Baulig <martin@gnome.org>
18985 * assign.cs: Improved the Assign class so it can now handle embedded
18986 assignments (X = Y = Z = something). As a side-effect this'll now also
18987 consume less local variables. test-38.cs now passes with MCS, added
18988 a few new test cases to that test.
18990 2002-07-20 Martin Baulig <martin@gnome.org>
18992 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
18993 instructions. Fixes bug #27977, also added test-146.cs.
18995 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18997 * cs-tokenizer.cs: fixed getHex ().
18999 2002-07-19 Martin Baulig <martin@gnome.org>
19001 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
19002 not Type.GetType() to lookup the array type. This is needed when
19003 we're constructing an array of a user-defined type.
19004 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
19005 single-dimensional arrays, but also for single-dimensial arrays of
19008 2002-07-19 Martin Baulig <martin@gnome.org>
19010 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
19011 this function is called, it's not allowed to share LocalBuilders
19012 among ILGenerators.
19014 2002-07-19 Martin Baulig <martin@gnome.org>
19016 * expression.cs (Argument.Resolve): Report an error 118 when trying
19017 to pass a type as argument.
19019 2002-07-18 Martin Baulig <martin@gnome.org>
19021 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
19022 Conv_R_Un for the signed `long' type.
19024 2002-07-15 Miguel de Icaza <miguel@ximian.com>
19026 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
19027 `expr' for the temporary result, as that will fail if we do
19028 multiple resolves on the same expression.
19030 2002-07-05 Miguel de Icaza <miguel@ximian.com>
19032 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
19033 ec.TypeContainer for looking up aliases.
19035 * class.cs (TypeContainer): Remove LookupAlias from here.
19037 * decl.cs (DeclSpace); Move here.
19039 2002-07-01 Miguel de Icaza <miguel@ximian.com>
19041 * class.cs (FindMembers): Only call filter if the constructor
19042 bulider is not null.
19044 Also handle delegates in `NestedTypes' now. Now we will perform
19045 type lookups using the standard resolution process. This also
19048 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
19049 This uses Expressions (the limited kind that can be parsed by the
19050 tree) instead of strings.
19052 * expression.cs (ComposedCast.ToString): Implement, used to flag
19053 errors since now we have to render expressions.
19055 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
19058 * ecore.cs (SimpleName.ToString): ditto.
19060 * cs-parser.jay: Instead of using strings to assemble types, use
19061 Expressions to assemble the type (using SimpleName, ComposedCast,
19062 MemberAccess). This should fix the type lookups in declarations,
19063 because we were using a different code path for this.
19065 * statement.cs (Block.Resolve): Continue processing statements
19066 even when there is an error.
19068 2002-07-17 Miguel de Icaza <miguel@ximian.com>
19070 * class.cs (Event.Define): Also remove the `remove' method from
19071 the list of pending items.
19073 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
19074 generate more compact code.
19076 2002-07-17 Martin Baulig <martin@gnome.org>
19078 * const.cs (Const.LookupConstantValue): Add support for constant
19079 `unchecked' and `checked' expressions.
19080 Also adding test case test-140.cs for this.
19082 2002-07-17 Martin Baulig <martin@gnome.org>
19084 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
19085 check whether mi.ReturnType implements the IEnumerator interface; the
19086 `==' and the IsAssignableFrom() will fail in this situation.
19088 2002-07-16 Ravi Pratap <ravi@ximian.com>
19090 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
19093 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19095 * expression.cs: fixed bug #27811.
19097 2002-07-14 Miguel de Icaza <miguel@ximian.com>
19099 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
19100 Molaro: when we are a ref, the value already contains a pointer
19101 value, do not take the address of it.
19103 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
19104 * removed mb-parser.jay and mb-tokenizer.cs
19106 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
19108 * expression.cs: check against the building corlib void type.
19110 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
19112 * ecore.cs: fix for valuetype static readonly fields: when
19113 initializing them, we need their address, not the address of a copy.
19115 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
19117 * typemanager.cs: register also enum_type in corlib.
19119 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
19121 * class.cs: allow calling this (but not base) initializers in structs.
19123 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
19125 * ecore.cs: make sure we compare against the building base types
19128 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
19130 * typemanager.cs: fix TypeToCoreType() to handle void and object
19131 (corlib gets no more typerefs after this change).
19133 2002-07-12 Miguel de Icaza <miguel@ximian.com>
19135 * expression.cs (ArrayCreation.EmitArrayArguments): use
19136 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
19138 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
19139 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
19140 array indexes, the runtime actually forbids them.
19142 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
19143 for array arguments here.
19145 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
19146 instead of the default for ValueTypes.
19148 (New.DoEmit): Use IsValueType instead of
19149 IsSubclassOf (value_type)
19150 (New.DoResolve): ditto.
19151 (Invocation.EmitCall): ditto.
19153 * assign.cs (Assign): ditto.
19155 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
19156 Statements *are* currently doing part of their resolution during
19159 Expressions do always resolve during resolve, but statements are
19160 only required to propagate resolution to their children.
19162 2002-07-11 Miguel de Icaza <miguel@ximian.com>
19164 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
19166 (LoadAssembly): Do not add the dll if it is already specified
19168 (MainDriver): Add the System directory to the link path at the end,
19169 after all the other -L arguments.
19171 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
19172 wrong opcode for loading bytes and bools (ldelem.i1 instead of
19173 ldelem.u1) and using the opposite for sbytes.
19175 This fixes Digger, and we can finally run it.
19177 * driver.cs (UnixParseOption): Move the option parsing here.
19178 (CSCParseOption): Implement CSC-like parsing of options.
19180 We now support both modes of operation, the old Unix way, and the
19181 new CSC-like way. This should help those who wanted to make cross
19182 platform makefiles.
19184 The only thing broken is that /r:, /reference: and /lib: are not
19185 implemented, because I want to make those have the same semantics
19186 as the CSC compiler has, and kill once and for all the confussion
19187 around this. Will be doing this tomorrow.
19189 * statement.cs (Unsafe.Resolve): The state is checked during
19190 resolve, not emit, so we have to set the flags for IsUnsfe here.
19192 2002-07-10 Miguel de Icaza <miguel@ximian.com>
19194 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
19195 not catch the Error_ObjectRefRequired in SimpleName (as it is
19196 possible to have a class/instance variable name that later gets
19197 deambiguated), we have to check this here.
19199 2002-07-10 Ravi Pratap <ravi@ximian.com>
19201 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
19202 make static and put into Expression.
19204 (Event.Define): Register the private field of the event with the
19205 TypeManager so that GetFieldFromEvent can get at it.
19207 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
19208 keep track of the private field associated with an event which
19211 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
19214 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
19216 2002-07-10 Miguel de Icaza <miguel@ximian.com>
19218 * expression.cs (Binary.EmitBranchable): this routine emits the
19219 Binary expression in a branchable context. This basically means:
19220 we need to branch somewhere, not just get the value on the stack.
19222 This works together with Statement.EmitBoolExpression.
19224 * statement.cs (Statement.EmitBoolExpression): Use
19227 2002-07-09 Miguel de Icaza <miguel@ximian.com>
19229 * statement.cs (For): Reduce the number of jumps in loops.
19231 (For): Implement loop inversion for the For statement.
19233 (Break): We can be breaking out of a Try/Catch controlled section
19234 (foreach might have an implicit try/catch clause), so we need to
19235 use Leave instead of Br.
19237 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
19238 now). If the instace expression supports IMemoryLocation, we use
19239 the AddressOf method from the IMemoryLocation to extract the
19240 address instead of emitting the instance.
19242 This showed up with `This', as we were emitting the instance
19243 always (Emit) instead of the Address of This. Particularly
19244 interesting when This is a value type, as we dont want the Emit
19245 effect (which was to load the object).
19247 2002-07-08 Miguel de Icaza <miguel@ximian.com>
19249 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
19251 * statement.cs (Checked): Set the CheckedState during the resolve
19252 process too, as the ConvCast operations track the checked state on
19253 the resolve process, and not emit.
19255 * cs-parser.jay (namespace_member_declaration): Flag that we have
19256 found a declaration when we do. This is used to flag error 1529
19258 * driver.cs: Report ok when we display the help only.
19260 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
19262 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
19264 2002-07-04 Miguel de Icaza <miguel@ximian.com>
19266 * cs-tokenizer.cs (define): We also have to track locally the
19267 defines. AllDefines is just used for the Conditional Attribute,
19268 but we also need the local defines for the current source code.
19270 2002-07-03 Miguel de Icaza <miguel@ximian.com>
19272 * statement.cs (While, For, Do): These loops can exit through a
19273 Break statement, use this information to tell whether the
19274 statement is the last piece of code.
19276 (Break): Flag that we break.
19278 * codegen.cs (EmitContexts): New `Breaks' state variable.
19280 2002-07-03 Martin Baulig <martin@gnome.org>
19282 * class.cs (TypeContainer.MethodModifiersValid): Allow override
19283 modifiers in method declarations in structs. Otherwise, you won't
19284 be able to override things like Object.Equals().
19286 2002-07-02 Miguel de Icaza <miguel@ximian.com>
19288 * class.cs (Method, Property, Indexer): Do not allow the public
19289 modifier to be used in explicit interface implementations.
19291 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
19292 override modifiers in method declarations in structs
19294 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
19296 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
19297 integer or real overflow, report an error
19299 2002-07-02 Martin Baulig <martin@gnome.org>
19301 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
19302 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
19303 to tell the runtime about our newly created System.Object and
19304 System.ValueType types.
19306 2002-07-02 Miguel de Icaza <miguel@ximian.com>
19308 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
19309 struct instead of Ldarg/Starg.
19311 2002-07-02 Martin Baulig <martin@gnome.org>
19313 * expression.cs (Indirection.Indirection): Call
19314 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
19316 2002-07-02 Martin Baulig <martin@gnome.org>
19318 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
19319 ValueType, call TypeManager.TypeToCoreType() on it.
19320 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
19321 the OpCodes.Newarr argument.
19323 2002-07-02 Martin Baulig <martin@gnome.org>
19325 * expression.cs (Invocation.EmitCall): When compiling corlib,
19326 replace all calls to the system's System.Array type to calls to
19327 the newly created one.
19329 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
19330 System.Array methods.
19331 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
19332 from the system's System.Array type which must be replaced.
19334 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
19336 * typemanager.cs: load unverifiable_code_ctor so we can build
19337 corlib using the correct type. Avoid using GetTypeCode() with
19339 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
19340 TypeManager.object_type to allow building corlib.
19342 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
19344 * ecore.cs: handle System.Enum separately in LoadFromPtr().
19346 2002-07-01 Martin Baulig <martin@gnome.org>
19348 * class.cs: Make the last change actually work, we need to check
19349 whether `ifaces != null' to avoid a crash.
19351 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
19353 * class.cs: when we build structs without fields that implement
19354 interfaces, we need to add the interfaces separately, since there is
19355 no API to both set the size and add the interfaces at type creation
19358 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
19360 * expression.cs: the dimension arguments to the array constructors
19361 need to be converted if they are a long.
19363 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
19365 * class.cs: don't emit ldarg.0 if there is no parent constructor
19366 (fixes showstopper for corlib).
19368 2002-06-29 Martin Baulig <martin@gnome.org>
19370 MCS now compiles corlib on GNU/Linux :-)
19372 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
19373 ie. check for MethodImplOptions.InternalCall.
19375 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
19376 and TypeManager.attribute_type are null, so we must explicitly check
19377 whether parent is not null to find out whether it's an attribute type.
19378 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
19379 and SetBuilder, not only if the property is neither abstract nor external.
19380 This is necessary to set the MethodImplOptions on the accessor methods.
19381 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
19382 SetBuilder, see Property.Emit().
19384 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
19385 populate "System.Object", "System.ValueType" and "System.Attribute" since
19386 they've already been populated from BootCorlib_PopulateCoreTypes().
19388 2002-06-29 Martin Baulig <martin@gnome.org>
19390 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
19391 is the NullLiteral, we also need to make sure that target_type is not
19394 2002-06-29 Martin Baulig <martin@gnome.org>
19396 * rootcontext.cs (RootContext.ResolveCore): We must initialize
19397 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
19398 before calling BootstrapCorlib_ResolveDelegate ().
19400 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19402 * statement.cs: fixed build-breaker. All tests passed ok.
19404 2002-06-27 Martin Baulig <martin@gnome.org>
19406 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
19407 for System.Decimal when compiling corlib.
19409 2002-06-27 Martin Baulig <martin@gnome.org>
19411 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
19412 switch blocks which contain nothing but a default clause.
19414 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
19416 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
19418 2002-06-27 Martin Baulig <martin@gnome.org>
19420 * ecore.cs (PropertyExpr.PropertyExpr): Call
19421 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
19423 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
19424 is already a TypeBuilder.
19426 2002-06-27 Martin Baulig <martin@gnome.org>
19428 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
19429 `target_type == TypeManager.array_type', not IsAssignableFrom() in
19430 the "from an array-type to System.Array" case. This makes it work
19431 when compiling corlib.
19433 2002-06-27 Martin Baulig <martin@gnome.org>
19435 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
19436 non-static PropertyExpr, set its InstanceExpression. This makes
19437 the `ICollection.Count' property work in System/Array.cs.
19439 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
19441 * driver.cs: Made error handling more consistent. Errors now
19442 tracked by Report class, so many methods which used to return int
19443 now return void. Main() now prints success/failure and
19444 errors/warnings message.
19446 Renamed '--probe' compiler argument to '--expect-error'. Removed
19447 the magic number return values (123 and 124). Now, if the
19448 expected error occurs, the compiler exits with success (exit value
19449 0). If the compilation completes without seeing that particular
19450 error, the compiler exits with failure (exit value 1). The
19451 makefile in mcs/errors has been changed to handle the new behaviour.
19453 * report.cs: Made 'expected error' number a property and renamed
19454 it from 'Probe' to 'ExpectedError'.
19456 * genericparser.cs: Removed error handling support, since it is
19457 now all done by Report class.
19459 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
19460 class, so parse() no longer returns an int.
19462 * namespace.cs: Use Report.Error instead of GenericParser.error
19464 2002-06-22 Miguel de Icaza <miguel@ximian.com>
19466 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
19467 TypeContainer.AddOperator): At the front of the list put the
19468 explicit implementations, so they get resolved/defined first.
19470 2002-06-21 Miguel de Icaza <miguel@ximian.com>
19472 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
19473 interface type is implemented by this TypeContainer. Used during
19474 explicit interface implementation.
19476 (Property.Define, Indexer.Define, Method.Define): Validate that
19477 the given interface in the explicit implementation is one of the
19478 base classes for the containing type.
19480 Also if we are explicitly implementing an interface, but there is
19481 no match in the pending implementation table, report an error.
19483 (Property.Define): Only define the property if we are
19484 not explicitly implementing a property from an interface. Use the
19485 correct name also for those properties (the same CSC uses,
19486 although that is really not needed).
19488 (Property.Emit): Do not emit attributes for explicitly implemented
19489 properties, as there is no TypeBuilder.
19491 (Indexer.Emit): ditto.
19493 Hiding then means that we do not really *implement* a pending
19494 implementation, which makes code fail.
19496 2002-06-22 Martin Baulig <martin@gnome.org>
19498 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
19499 the return value of Object.GetType(). [FIXME: we need to do this whenever
19500 we get a type back from the reflection library].
19502 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
19504 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
19506 2002-06-20 Miguel de Icaza <miguel@ximian.com>
19508 * attribute.cs: Return null if we can not look up the type.
19510 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
19511 the interface types found.
19513 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
19514 interface types found.
19516 * typemanager.cs (GetInterfaces): Make this routine returns alll
19517 the interfaces and work around the lame differences between
19518 System.Type and System.Reflection.Emit.TypeBuilder in the results
19519 result for GetInterfaces.
19521 (ExpandInterfaces): Given an array of interface types, expand and
19522 eliminate repeated ocurrences of an interface. This expands in
19523 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
19526 2002-06-21 Martin Baulig <martin@gnome.org>
19528 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
19531 2002-06-21 Martin Baulig <martin@gnome.org>
19533 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
19534 and called with one of the core types, return the corresponding typebuilder for
19537 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
19540 2002-06-21 Martin Baulig <martin@gnome.org>
19542 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
19543 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
19544 (Expression.ConvertReferenceExplicit): Likewise.
19546 * expression.cs (ElementAccess.DoResolve): Likewise.
19547 (ElementAccess.DoResolveLValue): Likewise.
19549 2002-06-10 Martin Baulig <martin@gnome.org>
19551 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
19552 add the "value" parameter to the parameter list.
19554 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
19557 2002-06-19 Miguel de Icaza <miguel@ximian.com>
19559 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
19560 the argument to an int, uint, long or ulong, per the spec. Also
19561 catch negative constants in array creation.
19563 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
19565 * class.cs: do not allow the same interface to appear twice in
19566 the definition list.
19568 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
19570 * ecore.cs: don't use ldlen with System.Array.
19572 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
19574 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
19576 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
19578 * modifiers.cs: produce correct field attributes for protected
19579 internal. Easy fix so miguel can work on ther harder stuff:-)
19581 2002-06-18 Miguel de Icaza <miguel@ximian.com>
19583 * pending.cs: New file. Move the code from class.cs here.
19584 Support clearning the pending flag for all methods (when not doing
19585 explicit interface implementation).
19587 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
19589 * rootcontext.cs: added a couple more types needed to bootstrap.
19591 2002-06-17 Miguel de Icaza <miguel@ximian.com>
19593 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
19594 constructor in the type, instead of any constructor in the type
19595 hierarchy. Thanks to Paolo for finding this bug (it showed up as
19596 a bug in the Mono runtime when applying the params attribute).
19598 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
19599 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
19601 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
19603 * expression.cs (Unary.ResolveOperator): Use TypeManager
19604 to resolve the type.
19606 2002-06-13 Ravi Pratap <ravi@ximian.com>
19608 * cs-parser.jay (enum_member_declaration): Pass in the attributes
19611 * enum.cs (AddEnumMember): Add support to store the attributes associated
19612 with each member too.
19614 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
19615 field builders too - this takes care of the enum member case.
19617 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
19619 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
19620 address-of operator on both value types and pointers.
19622 2002-06-10 Martin Baulig <martin@gnome.org>
19624 * interface.cs (Interface.PopulateIndexer): Add the indexer's
19625 PropertyBuilder to the `property_builders' list.
19627 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
19628 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
19629 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
19630 find any indexers which are inherited from an interface.
19632 2002-06-09 Martin Baulig <martin@gnome.org>
19634 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
19635 the same type as the constant if necessary. There's also a test-130.cs
19638 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
19640 * typemanager.cs (TypeManager.ChangeType): Previously known as
19641 Enum.ChangeEnumType().
19643 2002-06-09 Martin Baulig <martin@gnome.org>
19645 * expression.cs (Cast.TryReduce): Added support for consts.
19647 2002-06-08 Ravi Pratap <ravi@ximian.com>
19649 * class.cs (Accessor): Hold attributes information so we can pass
19652 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
19653 Modify to pass in attributes attached to the methods.
19655 (add_accessor_declaration, remove_accessor_declaration): Ditto.
19657 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
19658 to handle the Accessor kind :-)
19660 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
19662 2002-06-08 Martin Baulig <martin@gnome.org>
19664 * expression.cs (Unary.TryReduceNegative): Added support for
19667 2002-06-08 Martin Baulig <martin@gnome.org>
19669 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
19670 name can't be found in the `defined_names' - the caller will do a
19671 MemberLookup in this case and thus find methods in System.Enum
19672 such as Enum.IsDefined().
19674 2002-06-08 Martin Baulig <martin@gnome.org>
19676 * enum.cs (Enum.ChangeEnumType): This is a custom version of
19677 Convert.ChangeType() which works with TypeBuilder created types.
19678 (Enum.LookupEnumValue, Enum.Define): Use it here.
19680 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
19681 `TypeBuilder.BaseType != null' check.
19682 (TypeContainer.FindMembers): Only lookup parent members if we
19683 actually have a parent.
19684 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
19685 (ConstructorInitializer.Resolve): Likewise.
19687 * interface.cs (Interface.FindMembers): Added
19688 `TypeBuilder.BaseType != null' check.
19690 * rootcontext.cs (RootContext.ResolveCore): Added
19691 "System.Runtime.CompilerServices.IndexerNameAttribute" to
19692 classes_second_stage.
19694 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
19695 debug_type and trace_type when compiling with --nostdlib.
19697 2002-06-07 Martin Baulig <martin@gnome.org>
19699 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
19700 (AddField): Set it to true when adding a non-static field.
19701 (DefineType): Use `have_nonstatic_fields' to find out whether we
19702 have non-static fields, not `Fields != null'.
19704 2002-06-02 Miguel de Icaza <miguel@ximian.com>
19706 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
19707 dereferencing a null on the static-field code path)
19709 2002-05-30 Martin Baulig <martin@gnome.org>
19711 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
19712 to take command line arguments. Use reflection to call the new
19713 custom `Initialize' function on the symbol writer and pass it the
19714 command line arguments.
19716 * driver.cs (--debug-args): New command line argument to pass command
19717 line arguments to the symbol writer.
19719 2002-05-28 Miguel de Icaza <miguel@ximian.com>
19721 * assign.cs (DoResolve): Forgot to do the implicit conversion to
19722 the target type for indexers and properties. Thanks to Joe for
19725 2002-05-27 Miguel de Icaza <miguel@ximian.com>
19727 * typemanager.cs (MethodFlags): returns the method flags
19728 (Obsolete/ShouldIgnore) that control warning emission and whether
19729 the invocation should be made, or ignored.
19731 * expression.cs (Invocation.Emit): Remove previous hack, we should
19732 not do this on matching a base type, we should do this based on an attribute
19734 Only emit calls to System.Diagnostics.Debug and
19735 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
19736 on the command line.
19738 * rootcontext.cs: Global settings for tracing and debugging.
19740 * cs-tokenizer.cs (define): New utility function to track
19741 defines. Set the global settings for TRACE and DEBUG if found.
19743 2002-05-25 Ravi Pratap <ravi@ximian.com>
19745 * interface.cs (Populate*): Pass in the TypeContainer as well as
19746 the DeclSpace as parameters so that we can create EmitContexts and
19747 then use that to apply attributes etc.
19749 (PopulateMethod, PopulateEvent, PopulateProperty)
19750 (PopulateIndexer): Apply attributes everywhere.
19752 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
19755 (ApplyAttributes): Update accordingly.
19757 We now apply interface attributes for all members too.
19759 2002-05-26 Miguel de Icaza <miguel@ximian.com>
19761 * class.cs (Indexer.Define); Correctly check if we are explicit
19762 implementation (instead of checking the Name for a ".", we
19763 directly look up if the InterfaceType was specified).
19765 Delay the creation of the PropertyBuilder.
19767 Only create the PropertyBuilder if we are not an explicit
19768 interface implementation. This means that explicit interface
19769 implementation members do not participate in regular function
19770 lookups, and hence fixes another major ambiguity problem in
19771 overload resolution (that was the visible effect).
19773 (DefineMethod): Return whether we are doing an interface
19776 * typemanager.cs: Temporary hack until we get attributes in
19777 interfaces (Ravi is working on that) and we get IndexerName
19778 support in interfaces.
19780 * interface.cs: Register the indexers as properties.
19782 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
19783 warning, I have verified that this is a bug in the .NET runtime
19784 (JavaScript suffers of the same problem).
19786 * typemanager.cs (MemberLookup): When looking up members for
19787 interfaces, the parent of an interface is the implicit
19788 System.Object (so we succeed in searches of Object methods in an
19789 interface method invocation. Example: IEnumerable x; x.ToString
19792 2002-05-25 Miguel de Icaza <miguel@ximian.com>
19794 * class.cs (Event): Events should also register if they do
19795 implement the methods that an interface requires.
19797 * typemanager.cs (MemberLookup); use the new GetInterfaces
19800 (GetInterfaces): The code used to lookup interfaces for a type is
19801 used in more than one place, factor it here.
19803 * driver.cs: Track the errors at the bottom of the file, we kept
19806 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
19807 instance if the method we are calling is static!
19809 2002-05-24 Miguel de Icaza <miguel@ximian.com>
19811 * attribute.cs (ApplyAttributes): Make this function filter out
19812 the IndexerName attribute (as that attribute in reality is never
19813 applied) and return the string constant for the IndexerName
19816 * class.cs (TypeContainer.Emit): Validate that all the indexers
19817 have the same IndexerName attribute, and if so, set the
19818 DefaultName attribute on the class.
19820 * typemanager.cs: The return value might contain other stuff (not
19821 only methods). For instance, consider a method with an "Item"
19822 property and an Item method.
19824 * class.cs: If there is a problem with the parameter types,
19827 2002-05-24 Ravi Pratap <ravi@ximian.com>
19829 * ecore.cs (ImplicitConversionExists): Wrapper function which also
19830 looks at user defined conversion after making a call to
19831 StandardConversionExists - we need this for overload resolution.
19833 * expression.cs : Update accordingly the various method calls.
19835 This fixes 2 bugs filed against implicit user defined conversions
19837 2002-05-22 Miguel de Icaza <miguel@ximian.com>
19839 * statement.cs: Track the result of the assignment.
19841 2002-05-21 Miguel de Icaza <miguel@ximian.com>
19843 * expression.cs (MemberAccess): Improved error reporting for
19844 inaccessible members.
19846 2002-05-22 Martin Baulig <martin@gnome.org>
19848 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
19849 itself with debugging support.
19851 2002-05-22 Martin Baulig <martin@gnome.org>
19853 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
19854 Removed, this isn't needed anymore.
19856 2002-05-20 Martin Baulig <martin@gnome.org>
19858 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
19859 be underlying type for an enum.
19861 2002-05-20 Miguel de Icaza <miguel@ximian.com>
19863 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
19864 that splits out the loading of just the core types.
19866 * rootcontext.cs (ResolveCore): Split the struct resolution in
19867 two, so we can load the enumeration underlying types before any
19870 * expression.cs (Is): Bandaid until we fix properly Switch (see
19871 bug #24985 for details).
19873 * typemanager.cs (ImplementsInterface): The hashtable will contain
19874 a null if there are no interfaces implemented.
19876 2002-05-18 Miguel de Icaza <miguel@ximian.com>
19878 * cs-parser.jay (indexer_declarator): It is fine to have array
19881 2002-05-17 Miguel de Icaza <miguel@ximian.com>
19883 * typemanager.cs: (RegisterBuilder): New function used to register
19884 TypeBuilders that implement interfaces. Since
19885 TypeBuilder.GetInterfaces (as usual) does not work with lame
19887 (AddUserType): register interfaces.
19889 (ImplementsInterface): Use the builder_to_ifaces hash if we are
19890 dealing with TypeBuilder. Also, arrays are showing up as
19891 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
19892 methods can not be invoked on them!
19894 * ecore.cs (ExplicitReferenceConversionExists): Made public.
19895 (ImplicitReferenceConversionExists): Split out from
19896 StandardConversionExists.
19898 * expression.cs (As): We were only implementing one of the three
19899 cases for the as operator. We now implement them all.
19900 (Is): Implement the various other cases for Is as well.
19902 * typemanager.cs (CACHE): New define used to control if we want or
19903 not the FindMembers cache. Seems to have a negative impact on
19904 performance currently
19906 (MemberLookup): Nested types have full acess to
19907 enclosing type members
19909 Remove code that coped with instance/static returns for events, we
19910 now catch this in RealFindMembers.
19912 (RealFindMembers): only perform static lookup if the instance
19913 lookup did not return a type or an event.
19915 2002-05-17 Miguel de Icaza <miguel@ximian.com>
19917 * assign.cs (CompoundAssign): We pass more semantic information
19918 now to Compound Assignments than we did before: now we have all
19919 the information at hand, and now we resolve the target *before* we
19920 do the expression expansion, which allows the "CacheValue" method
19921 to have the effect we intended (before, a [x] += 1 would generate
19922 two differen ArrayAccess expressions from the ElementAccess,
19923 during the resolution process).
19925 (CompoundAssign.DoResolve): Resolve target and original_source here.
19927 2002-05-16 Miguel de Icaza <miguel@ximian.com>
19929 * expression.cs (ArrayAccess): dropped debugging information.
19931 * typemanager.cs: Small bug fix: I was always returning i_members,
19932 instead of one of i_members or s_members (depending on which had
19935 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
19936 method is invoked before any code generation takes place, and it
19937 is a mechanism to inform that the expression will be invoked more
19938 than once, and that the method should use temporary values to
19939 avoid having side effects
19941 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
19943 * ecore.cs (Expression.CacheTemporaries): Provide empty default
19946 * expression.cs (Indirection, ArrayAccess): Add support for
19947 CacheTemporaries in these two bad boys.
19949 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
19950 ldobj or ldind_ref.
19951 (StoreFromPtr): Handle stobj as well.
19953 * expression.cs (UnaryMutator): Share more code.
19955 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
19956 down: I was not tracking the Filter function as well, which
19957 was affecting the results of the cache.
19959 2002-05-15 Miguel de Icaza <miguel@ximian.com>
19961 * attribute.cs: Remove the hack to handle the CharSet property on
19964 2002-05-14 Miguel de Icaza <miguel@ximian.com>
19966 * attribute.cs (DoResolve): More uglyness, we now only try to
19967 resolve the attribute partially, to extract the CharSet
19968 information (only if we are a StructLayout attribute). Otherwise
19970 (GetExtraTypeInfo): Add some code to conditionally kill in the
19971 future this. I am more and more convinced that the .NET
19972 framework has special code to handle the attribute setting on
19975 * expression.cs (IsParamsMethodApplicable): Revert my previous
19976 foreach change here, it was wrong.
19978 2002-05-13 Miguel de Icaza <miguel@ximian.com>
19980 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
19981 (pp_expr): do not abort on unknown input, just return.
19982 (eval): abort if there are pending chars.
19984 * attribute.cs (Attribute.Resolve): Positional parameters are
19985 optional. Deal with that case.
19987 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
19988 the Ansi/Unicode/Auto information for the type.
19990 (TypeContainer.DefineType): instantiate the EmitContext here, as
19991 we will be using it during the type definition (to resolve
19992 attributes) and during the emit phase.
19994 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
19995 to pull type information out of the attributes
19997 (Attribute.Resolve): track the constructor builder, and allow for
19998 multiple invocations (structs and classes will use this).
20000 * ecore.cs (MemberLookupFinal): new version with all the
20001 parameters customizable.
20003 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
20004 constructors. Return if the result value is null (as the error
20005 would have been flagged already by MemberLookupFinal)
20007 Do not allow instances of abstract classes or interfaces to be
20010 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
20011 We have to compare the assembly property here when dealing with
20012 FamANDAssem and Assembly access modifiers, because we might be
20013 creating an assembly from *modules* (that means that we are not
20014 getting TypeBuilders for types defined in other modules that are
20015 part of this assembly).
20017 (Method.Emit): If the method is marked abstract and has a body,
20020 (TypeContainer.DefineMembers): If both the defined member and the
20021 parent name match are methods, then do not emit any warnings: let
20022 the Method.Define routine take care of flagging warnings. But if
20023 there is a mismatch (method overrides something else, or method is
20024 overriwritten by something, then emit warning).
20026 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
20027 set to null, this means `do not check for the return type on the
20030 (Method.Define): set the return type for the method signature to
20031 null, so that we get methods with the same name and parameters and
20032 different return types. This is used to flag warning 114 (you are
20033 hiding a method, and you probably want to use the new/override
20036 * typemanager.cs (MemberLookup): Implemented proper access
20037 control, closing a long standing set of bug reports. The problem
20038 was that the Framework only has two bits: Public and NonPublic,
20039 and NonPublic includes private and protected methods, but we need
20040 to enforce the FamANDAssem, FamOrAssem and Family.
20042 2002-05-11 Miguel de Icaza <miguel@ximian.com>
20044 * statement.cs (GotoCase): Return true: Ammounts to giving up
20045 knowledge on whether we return or not, and letting the other case
20046 be responsible for it.
20048 2002-05-10 Miguel de Icaza <miguel@ximian.com>
20050 * driver.cs: Do not load directories for each file processed, only
20051 do it if there is a pattern.
20053 * ecore.cs: Report readonly assigns here as well, as we might have
20054 been resolved only by MemberAccess.
20056 (SimpleName.SimpleNameResolve): Also be useful for LValue
20057 resolution. We need this to propagate assign to local readonly variables
20059 * typemanager.cs: Use a ptrhashtable for the criteria, because we
20060 do not want to reuse potential criteria memory.
20062 * class.cs (MyEventBuilder): Set reflected_type;
20064 * ecore.cs (Constantify): Added support for constifying bools.
20066 (RootContext.LookupType): Added a cache for values looked up in
20067 the declaration space.
20069 * typemanager.cs (FindMembers): Now is a front-end to
20070 RealFindMembers, and provides a two-level hashtable-based cache to
20073 15% performance improvement: from 22.5 to 19.2 seconds.
20075 * expression.cs (IsParamsMethodApplicable): use foreach.
20076 (Invocation.DoResolve): ditto.
20077 (New.DoResolve): ditto.
20078 (ArrayCreation.DoResolve): ditto.
20080 * ecore.cs (FindMostEncompassingType): use foreach.
20082 * delegate.cs (NewDelegate.DoResolve): Use foreach
20084 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
20085 (RemoveMethods): use foreach.
20087 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
20088 nested foreach statements instead of for, and also break out of
20089 the inner loop once a match is found.
20091 (Invocation.OverloadResolve): Use foreach, simplify the code.
20093 2002-05-08 Miguel de Icaza <miguel@ximian.com>
20095 * cfold.cs (BinaryFold): During an enumeration evaluation context,
20096 we actually unwrap the expression to allow for extra information
20099 * expression.cs: Use Shr_Un on unsigned operations.
20101 2002-05-08 Ravi Pratap <ravi@ximian.com>
20103 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
20104 applicable operators was not being considered correctly. This closes
20105 the bug Miguel reported.
20107 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
20109 * attribute.cs: check that the type derives from System.Attribute
20110 and report the correct error in that case (moved the duplicate code to
20111 its own method, too).
20113 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
20115 * attribute.cs: lookup attribute type name as the spec says: first the
20116 bare attribute name and then name + "Attribute" (nant compiles with
20117 mcs after this fix).
20119 2002-05-07 Miguel de Icaza <miguel@ximian.com>
20121 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
20122 Because of the way we parse things, we should try to see if a
20123 UIntConstant can fit in an integer.
20125 2002-05-07 Ravi Pratap <ravi@ximian.com>
20127 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
20128 when we are in an explicit context.
20130 (ConvertReferenceExplicit): When converting from Iface type S to Class
20131 T make sure the rules are implemented as an OR.
20133 * parameter.cs (ParameterType): Make it a property for now although the
20134 purpose really isn't anything immediate.
20136 * expression.cs (Is*Applicable): Do better checking on the parameter type
20137 of a ref/out parameter. The ones from the system assemblies are already
20138 marked with the correct type so we don't need to do any correction.
20140 * ecore.cs (StandardConversionExists): Conversion from Interface types to
20141 the object type is standard too so include that.
20143 2002-05-06 Miguel de Icaza <miguel@ximian.com>
20145 * ecore.cs (StandardConversionExists): Augment with missing code:
20146 deal with IntConstant, LongConstants and Enumerations.
20148 * assign.cs: Report the error, instead of failing silently
20150 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
20151 typecontainer that they are declared, because the
20152 typecontainer/namespace will have the list of using clauses that
20153 need to be applied.
20155 Assembly Attributes were escaping the normal registration
20158 (EmitCode): Apply attributes within an EmitContext that represents
20159 the container they were declared on.
20161 * cs-parser.jay: Track bases for structs. How did I get this wrong?
20163 2002-05-06 Ravi Pratap <ravi@ximian.com>
20165 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
20166 Revamp completely - make much cleaner as we now operate only
20169 (FindMostSpecificSource, FindMostSpecificTarget): New methods
20170 to implement the logic detailed in the spec more correctly.
20172 (UserDefinedConversion): Update accordingly.
20174 2002-05-06 Miguel de Icaza <miguel@ximian.com>
20176 * statement.cs: Return flow analysis information up.
20178 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
20181 (token): Do not consume an extra character before calling
20184 2002-05-06 Piers Haken <piersh@friskit.com>
20186 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
20188 2002-05-06 Miguel de Icaza <miguel@ximian.com>
20190 * class.cs (Constructor.Emit): Set the IsStatic flag in the
20191 EmitContext during the instance constructor initializer
20192 resolution, to stop access to instance variables.
20194 This is mandated by the spec, last paragraph of the `constructor
20195 initializers' section.
20197 2002-05-05 Miguel de Icaza <miguel@ximian.com>
20199 * cs-parser.jay, class.cs (Accessor): new class used to represent
20200 an accessor (get or set). In the past we used `null' to represent
20201 a missing accessor. But this is ambiguous because there was no
20202 way to tell in abstract indexers/properties if one of them was
20205 Now there is a way of addressing that.
20207 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
20208 instead of FindMembers.
20210 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
20211 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
20213 * attribute.cs: Treat indexers and properties as the same in terms
20214 of applying attributes
20216 * ecore.cs (FindMostEncompassedType): Use statically initialized
20217 EmptyExpressions()s like we do elsewhere to avoid creating useless
20218 objects (and we take this out of the tight loop).
20220 (GetConversionOperators): Move the code to extract the actual
20221 operators to a separate routine to clean things up.
20223 2002-05-04 Miguel de Icaza <miguel@ximian.com>
20225 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
20226 events are always registered FieldBuilders.
20228 * class.cs (FieldBase): New class shared by Fields
20230 * delegate.cs: If we are a toplevel delegate, use our full name.
20231 If we are a nested delegate, then only use our tail name.
20233 2002-05-02 Ravi Pratap <ravi@ximian.com>
20235 * expression.cs (IsApplicable): Ensure that we add the "&" to
20236 ref/out types before comparing it with the type of the argument.
20238 (IsParamsMethodApplicable): Ditto.
20240 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
20243 * delegate.cs : Handle the case when we have more than one applicable
20244 method. Flag an error only when we finish checking all.
20246 2002-05-02 Miguel de Icaza <miguel@ximian.com>
20248 * expression.cs: Add support for boolean static initializers.
20250 2002-05-01 Miguel de Icaza <miguel@ximian.com>
20252 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
20254 * parameter.cs (ComputeParameterTypes,
20255 ComputeAndDefineParameterTypes): Better error handling: now we
20256 clear the `types' cache if we fail during any of the type lookups.
20257 We also return the status code correctly to our caller
20259 * delegate.cs: If we fail to define a delegate, abort the extra
20262 * expression.cs (Binary.ResolveOperator): for
20263 operator==(object,object) and operator !=(object, object) we also
20264 have to verify that there is an implicit conversion from one to
20267 (ArrayAccess.DoResolve): Array Access can operate on
20270 2002-04-30 Miguel de Icaza <miguel@ximian.com>
20272 * assign.cs (CompoundAssign): A new class used as a "flag" that
20273 the assignment actually is happening as part of a compound
20274 assignment operator.
20276 During compound assignment, a few new rules exist to enable things
20283 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
20284 to the type of x) if y is implicitly convertible to the type of x,
20285 and the operator is a builtin operator and the return type of the
20286 operator is explicitly convertible to the type of x.
20288 * rootcontext.cs: Reset warning level to 2. 4 catches various
20289 "interesting" features in mcs, we must clean this up at some
20290 point, but currently am trying to kill other bugs ;-)
20292 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
20293 in container classes as well.
20295 * expression.cs (Binary.ResolveOperator): Handle string case
20296 before anything else (as operator overloading does emit an error
20297 before doing anything else).
20299 This code could go away when we move to a table driven model, but
20300 i could not come up with a good plan last night.
20302 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
20304 * typemanager.cs (CSharpName): reimplementation using regex.
20305 * class.cs: added null check for fields in Emit
20306 * rootcontext.cs: set warninglevel to 4
20308 2002-04-29 Miguel de Icaza <miguel@ximian.com>
20310 * typemanager.cs (CSharpName): reimplemented with Lupus
20313 2002-04-28 Miguel de Icaza <miguel@ximian.com>
20315 * statement.cs (If): correclty implement Resolve, because we were
20316 not catching sem errors in there. The same process is needed
20318 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
20321 (Statement.Warning_DeadCodeFound): Factorize code.
20322 (While): Report dead code here too.
20324 (Statement): Added Resolve virtual method to allow
20325 for resolution split from the emit code.
20327 2002-04-26 Miguel de Icaza <miguel@ximian.com>
20329 * statement.cs (EmitBoolExpression): No longer try to resolve the
20331 (MakeBoolean): New utility function that resolve, implicitly
20332 converts to boolean and tags the expression.
20335 (If, Do): Implement dead code elimination.
20336 (While): Implement loop inversion
20338 (Do, While, For, If): Resolve the expression prior to calling our
20341 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
20344 - added method Report28 (warning: program has more than one entry point)
20345 - added method IsEntryPoint, implements paragraph 10.1 of the spec
20346 - modified method Method.Define, the part at the end of the method
20348 * rootcontext.cs: added static public Location EntryPointLocation;
20350 * ../errors/cs0028.cs : Add test case for the above warning.
20353 - modified method CSharpName to allow arrays of primitive type to
20354 be printed nicely (e.g. instead of System.Int32[][] it now prints
20356 - added method CSharpSignature: returns the signature of a method
20357 in string format to be used in reporting errors, warnings, etc.
20359 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
20362 2002-04-26 Ravi Pratap <ravi@ximian.com>
20364 * delegate.cs (Define): Fix extremely silly bug where I was
20365 setting the type of the 'object' parameter of the BeginInvoke
20366 method to System.IAsyncResult instead of System.Object ;-)
20368 2002-04-26 Miguel de Icaza <miguel@ximian.com>
20370 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
20373 (Constructor.Emit): return if we fail to initialize the
20374 constructor. Another door closed!
20376 * expression.cs (New.DoResolve): Improve error message (from -6 to
20377 1501). Use DeclaredOnly lookup to find the exact constructor.
20379 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
20380 loop. This is useful.
20382 * cs-parser.jay: Adjust the default parameters so that destructors
20383 have the proper signature.
20385 2002-04-26 Martin Baulig <martin@gnome.org>
20387 * driver.cs (LoadAssembly): If `assembly' contains any characters
20388 which are only valid in path names and not in assembly names
20389 (currently slash, backslash and point), use Assembly.LoadFrom ()
20390 instead of Assembly.Load () on the `assembly' (before iteration
20391 over the link_paths).
20393 2002-04-26 Martin Baulig <martin@gnome.org>
20395 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
20397 2002-04-25 Miguel de Icaza <miguel@ximian.com>
20399 * class.cs (Property): use the new typemanager.MemberLookup
20401 (TypeContainer.MemberLookup): Implement using the
20402 TypeManager.MemberLookup now.
20404 * typemanager.cs: Make MemberLookup a function of the TypeManager,
20405 and return MemberInfos, so that these can be used without an
20406 EmitContext (what we had before).
20408 2002-04-24 Miguel de Icaza <miguel@ximian.com>
20410 * expression.cs: Fix the case where the argument to params if the
20411 type of the params. I omitted handling this before. Fixed
20413 2002-04-22 Miguel de Icaza <miguel@ximian.com>
20415 * driver.cs: Call BootCorlib_PopulateCoreType
20417 * class.cs (Property.CheckBase): Check for properties only, not
20420 * interface.cs: Temporary hack: try/catch around the
20421 CustomAttributeBuilder, because I am getting an exception that I
20424 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
20425 types whose definitions are required to be there (attributes are
20426 defined before standard types).
20428 Compute definitions as we boot the various types, as they are used
20429 immediately (value_type class will need object_type, but if we do
20430 not initialize object_type, we will pass a null, which will let
20431 the runtime pick the System.Object from the existing corlib, which
20432 is not what we want).
20434 2002-04-22 Patrik Torstensson <totte@labs2.com>
20436 * cs-tokenizer.cs: fixed a number of trim() issues.
20438 2002-04-22 Ravi Pratap <ravi@ximian.com>
20440 * expression.cs (Argument.Type): Ensure that we return the correct
20441 type when we have out or ref parameters [in which case we
20444 2002-04-22 Miguel de Icaza <miguel@ximian.com>
20446 * class.cs (Property, Indexer): Allow extern modifier in there.
20448 * typemanager.cs (InitBaseTypes): Initializes object_type and
20449 value_type, since those will be used early on during the bootstrap
20450 process to compile corlib.
20452 (InitCoreTypes): Move code from here to InitBaseTypes.
20454 2002-04-21 Miguel de Icaza <miguel@ximian.com>
20456 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
20457 single-dimension arrays as using the ldlen opcode.
20459 Daniel Lewis discovered this optimization.
20461 * typemanager.cs: Add signature for System.Array::get_Length
20463 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20465 * statement.cs: report the error when the foreach does not apply to an
20466 array nor a collection.
20468 2002-04-19 Miguel de Icaza <miguel@ximian.com>
20470 * expression.cs: Add implicit conversions to the operator ~.
20472 * constant.cs (DecimalConstant.Emit): Emit decimal value.
20474 * typemanager.cs: Locate the decimal constructor.
20476 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20478 * attribute.cs: use the new property of TypeOf.
20479 * expression.cs: added 'get' property around typearg.
20481 These changes fix a build breaker reported by NickD. Is this the
20482 correct way to fix? If not, please, revert my changes and make it
20485 2002-04-17 Miguel de Icaza <miguel@ximian.com>
20487 * attribute.cs: Add support for typeof in attribute invocations.
20488 I am not sure that this is right though.
20490 2002-04-14 Duncan Mak <duncan@ximian.com>
20492 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
20493 Binary.Operator.Division case.
20495 2002-04-13 Ravi Pratap <ravi@ximian.com>
20497 * class.cs (DefineType): Ensure that we do a proper check on
20498 attribute types and also register it with the TypeManager.
20500 (TypeContainer.Targets): The default for attribute types is
20501 AttributeTargets.All.
20503 * attribute.cs (ApplyAttributes): Registering the attribute type
20504 is done elsewhere, not when we discover we have a Usage attribute.
20506 2002-04-12 Ravi Pratap <ravi@ximian.com>
20508 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
20509 and get rid of is_delegate parameter.
20511 * everywhere : update.
20513 2002-04-12 Ravi Pratap <ravi@ximian.com>
20515 * cs-parser.jay (compilation_unit): Revamp completely to use
20516 some new ideas that I got from Rhys' grammar to solve the problems
20517 with assembly level attributes.
20519 (outer_declaration): New grammar production.
20521 (attribute_sections): Add.
20523 (opt_attributes): Base on attribute_sections
20525 (namespace_declaration): Allow opt_attributes to tackle the case
20526 when we have assembly level attributes - we are clever in this
20529 * attribute.cs (ApplyAttributes): Do not worry about assembly
20530 attributes in the non-global context.
20532 * rootcontext.cs (AddGlobalAttributes): Go back to using this
20533 instead of SetGlobalAttributes.
20535 * class.cs, rootcontext.cs : Ensure we define and generate
20536 attribute types before anything else.
20538 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
20539 and flag the new error -20 for the case when the attribute type
20540 does not have valid targets specified. csc does not catch this.
20542 * ../errors/errors.txt : update for error # -20
20544 2002-04-11 Ravi Pratap <ravi@ximian.com>
20546 * support.cs (InternalParameters.ParameterModifier): Do some null
20547 checking and return sane values.
20549 * class.cs (Method.Define): If we are a PInvoke method, ensure
20550 that we are static and extern. Report error # 601
20552 * ../errors/cs0601.cs : Add test case for the above error.
20554 2002-04-07 Ravi Pratap <ravi@ximian.com>
20556 * rootcontext.cs (attribute_types): We need to keep type of
20557 all attribute types separately and emit code for them first.
20559 (RegisterAttribute) : Implement.
20561 * class.cs (DefineType): Check if the current Type is a custom
20562 attribute type and register it accordingly.
20564 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
20565 adding the first attribute twice and rename to
20567 (SetGlobalAttributes): this.
20569 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
20572 * attribute.cs (ApplyAttributes): Take an additional argument telling us
20573 if we are processing global arguments. Hmm, I am unsure of this.
20575 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20577 * expression.cs: added static array of strings to avoid calling
20578 Enum.ToString () for Operator in Binary. Significant recover of
20581 2002-04-10 Miguel de Icaza <miguel@ximian.com>
20583 * class.cs (FindMembers): Allow the Builders of the various
20584 members to be null. If they are skip them. This only happens
20585 during the PInvoke declaration.
20587 2002-04-09 Miguel de Icaza <miguel@ximian.com>
20589 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
20590 failure, so we do not keep going afterwards.
20592 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
20593 wanted to pass `false' as the `is_delegate' argument. If this is
20594 the case, why not use delegate_type == null to mean `is_delegate =
20595 false' and anything else as is_delegate = true.
20597 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
20599 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
20600 code for the section, not the beginning of the tests.
20602 2002-04-08 Miguel de Icaza <miguel@ximian.com>
20604 * cfold.cs: Handle operator + (Enum x, Underlying x)
20606 * expression.cs (Binary): same. Warn about errors where we have
20607 Enum/Enum in operator + as well.
20609 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
20612 - added support for switch(bool)
20613 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
20614 - add TableSwitchEmit() to handle table-based switch statements
20616 2002-04-05 Ravi Pratap <ravi@ximian.com>
20618 * expression.cs (Invocation.OverloadResolve): Factor out code which
20619 does parameter compatibility checking with arguments so that we can
20620 re-use the code even from Delegate.VerifyApplicability
20622 (VerifyArgumentsCompat): Move above code here.
20624 * delegate.cs (VerifyApplicability): Get rid of duplicate code
20625 and instead make a call to the above method.
20627 2002-03-31 Ravi Pratap <ravi@ximian.com>
20629 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
20630 We use it to keep track of classes which are attribute types.
20632 2002-04-02 Miguel de Icaza <miguel@ximian.com>
20634 * delegate.cs (Delegate.Define): Correctly define the types in the
20635 presence of fixed and array parameters.
20637 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
20640 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
20641 include NonPublic after the first iteration.
20643 * class.cs (Indexer.CheckBase): Only check if both parents are
20646 * cs-parser.jay (accessor_body): If empty, set to null.
20648 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
20649 same code path here to resolve constants names that we did have in
20650 MemberAccess.DoResolve. There is too much code duplicated here.
20652 2002-04-01 Miguel de Icaza <miguel@ximian.com>
20654 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
20656 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
20659 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
20660 tokens, numbers and strings.
20662 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
20665 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
20666 asyncronous parameters and the regular parameters.
20668 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
20669 specify the target directory.
20671 * expression.cs: (This.DoResolve): Simplify
20672 (As.Emit): Optimize, do not generate IsInst if the expression is
20673 always of the given type.
20675 (Is.DoResolve): Bug fix, we were reporting both always/never for
20678 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
20679 creating too many unnecessary arrays.
20681 2002-03-31 Miguel de Icaza <miguel@ximian.com>
20683 * class.cs (EmitFieldInitializer): Use Assign expression to assign
20684 fields instead of rolling our own initializer. Takes care of all
20685 implicit conversions, and drops unnecessary static checks/argument.
20687 2002-03-31 Dick Porter <dick@ximian.com>
20689 * driver.cs: use the GetDirectories() return values properly, and
20690 use "/" as path separator.
20692 2002-03-30 Miguel de Icaza <miguel@ximian.com>
20694 * expression.cs (Unary): Optimize - - expr into expr.
20695 (Binary): Optimize a + (-b) into a -b.
20697 * codegen.cs (CodeGen): Made all methods static.
20699 2002-03-29 Miguel de Icaza <miguel@ximian.com>
20703 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
20704 TypeBuilder property.
20706 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
20709 * tree.cs: Removed the various RecordXXXX, and replaced with a
20710 single RecordDecl. Removed all the accessor methods, and just
20711 left a single access point Type
20713 * enum.cs: Rename DefineEnum to DefineType.
20715 * decl.cs: New abstract method `DefineType' used to unify the
20716 Defines for Enumerations, Interfaces, TypeContainers and
20719 (FindType): Moved LookupInterfaceOrClass here. Moved the
20720 LookupBaseClasses method that used to live in class.cs and
20721 interface.cs here, and renamed to FindType.
20723 * delegate.cs: Implement DefineType. Take advantage of the
20724 refactored pattern for locating the parent builder without taking
20725 the parent_builder argument (which we know does not work if we are
20726 nested, and triggering a toplevel definition).
20728 2002-03-28 Miguel de Icaza <miguel@ximian.com>
20730 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
20731 accessibility of a member has changed during override and report
20734 * class.cs (Method.Define, Property.Define): Only complain on
20735 overrides if the method is private, any other accessibility is
20736 fine (and since we just checked the permission is the same, we are
20739 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
20740 and elif are processed always. The other pre-processing
20741 directives are only processed if we are "taking" the path
20743 2002-03-29 Martin Baulig <martin@gnome.org>
20745 * class.cs (Method.Emit): Only emit symbolic debugging info if the
20746 current location is not Null.
20748 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
20749 a separate method so we can profile it.
20751 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
20752 `span.Seconds' are just seconds, but no minutes or hours.
20753 (MainDriver): Profile the CodeGen.SaveSymbols calls.
20755 2002-03-28 Miguel de Icaza <miguel@ximian.com>
20757 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
20758 Remove the gratuitous set of Final:
20760 // If an interface implementation, then we can set Final.
20761 if (((flags & MethodAttributes.Abstract) == 0) &&
20762 implementing.DeclaringType.IsInterface)
20763 flags |= MethodAttributes.Final;
20765 I do not know what I was smoking when I used that.
20768 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
20769 step into fixing the name resolution issues for delegates and
20770 unifying the toplevel name resolution.
20772 2002-03-28 Martin Baulig <martin@gnome.org>
20774 * class.cs (Method.Emit): If we have a symbol writer, call its
20775 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
20776 tell it about the current method.
20778 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
20779 writer that we're going to emit the first byte of IL code for a new
20780 statement (a new source line).
20781 (EmitContext.EmitTopBlock): If we have a symbol writer, call
20782 EmitContext.Mark() before emitting any code.
20784 * location.cs (SymbolDocument): Return null when we're Null.
20786 * statement.cs (Statement): Moved the `Location loc' variable here.
20787 (Statement.EmitBoolExpression): If we have a symbol writer, call
20788 ec.Mark() before emitting any code to tell it that we're at the
20789 beginning of a new statement.
20790 (StatementExpression): Added `Location' argument to the constructor.
20791 (Block): Added public readonly variable `StartLocation' and public
20792 variable `EndLocation'. The latter is to be set using SetEndLocation().
20793 (Block): Added constructor which takes a start and end location.
20794 (Block.SetEndLocation): New method. This sets the end location.
20795 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
20796 local variables we create.
20797 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
20798 each statement and do also mark the begin and end of the block.
20800 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
20801 tell it the current lexer.Location, use Location.Null for the end of the
20803 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
20804 current block, set its end location using SetEndLocation().
20805 (statement_expression): StatementExpression constructor now takes the
20806 lexer.Location as additional argument.
20807 (for_statement, declare_local_variables): Likewise.
20808 (declare_local_variables): When creating a new implicit block, use the
20809 new Block constructor and pass it the lexer.Location.
20811 2002-03-28 Miguel de Icaza <miguel@ximian.com>
20813 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
20814 members also on the parent interfaces recursively.
20816 2002-03-27 Miguel de Icaza <miguel@ximian.com>
20818 * report.cs: Use new formats, since Gonzalo finished the missing
20821 * expression.cs (Binary.ResolveOperator): added missing operator|
20822 operator& and operator^ for bool/bool.
20824 * cs-parser.jay: CheckDef now takes a Location argument that is
20825 used to report errors more precisly (instead of reporting the end
20826 of a definition, we try to track something which is a lot closer
20827 to the source of the problem).
20829 * cs-tokenizer.cs: Track global token use, so we can properly flag
20830 the use of #define/#undef after the first token has been seen.
20832 Also, rename the reportXXXX to Error_DescriptiveName
20834 * decl.cs (DeclSpace.IsTopLevel): Move property here from
20835 TypeContainer, so that Enum and Interface can use this too.
20837 * class.cs (TypeContainer.LookupInterfaceOrClass,
20838 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
20839 `builder' argument. Typically this was used to pass the parent
20840 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
20843 The problem is that a nested class could trigger the definition of
20844 a toplevel class, and the builder would be obviously wrong in that
20847 So we drop this argument, and we compute dynamically the
20848 TypeBuilder/ModuleBuilder (the correct information was available
20849 to us anyways from DeclSpace.Parent)
20851 * interface.cs (Interface.DefineInterface): Drop builder
20852 parameter cleanup like class.cs
20854 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
20857 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
20860 (Try.Emit): Propagate the returns value from the statement.
20862 (Return.Emit): Even if we are leavning
20864 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
20866 * modifiers.cs: Fix the computation of MethodAttributes flags.
20868 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
20870 * driver.cs: allow compilation of files that start with '/'.
20871 Add a default case when checking the argument of --target.
20873 2002-03-25 Miguel de Icaza <miguel@ximian.com>
20875 * interface.cs: Implement the same search algorithm for types in
20876 the interface code.
20878 * delegate.cs: Do not allow multiple definition.
20880 * Recovered ChangeLog that got accidentally amputated
20882 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
20884 * rootcontext.cs: Load manually enum to allow core classes to
20885 contain enumerations.
20887 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
20888 Update to new static methods in TypeManager.
20890 * typemanager.cs (GetMethod, GetConstructor): Use our
20891 implementation of FindMembers to find the members, since during
20892 corlib compilation, the types are TypeBuilders and GetMethod and
20893 GetConstructor do not work.
20895 Make all methods in TypeManager static.
20897 (InitCodeHelpers): Split the functionality from
20898 the InitCodeTypes function.
20900 * driver.cs: Call InitCodeHelpers after we have populated the
20903 * cs-parser.jay (delegate_declaration): we did not used to compute
20904 the delegate name correctly for void delegates.
20906 2002-03-24 Miguel de Icaza <miguel@ximian.com>
20908 * rootcontext.cs (RootContext): Init the interface_resolve_order
20909 and type_container_resolve_order always.
20911 (ResolveCore, BootstrapCorlib_ResolveClass,
20912 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
20913 compiler when compiling with --nostdlib
20915 * class.cs (TypeContainer.DefineType): Check that our parent is
20916 not null. This test is most important when we are bootstraping
20919 * codegen.cs: Split out the symbol writing code.
20921 2002-03-25 Martin Baulig <martin@gnome.org>
20923 * driver.cs (-g): Made -g an alias for --debug.
20925 2002-03-24 Martin Baulig <martin@gnome.org>
20927 * codegen.cs (SymbolWriter): New public variable. Returns the
20928 current symbol writer.
20929 (CodeGen): Added `bool want_debugging_support' argument to the
20930 constructor. If true, tell the ModuleBuild that we want debugging
20931 support and ask it for the ISymbolWriter.
20932 (Save): If we have a symbol writer, call it's Close() method after
20933 saving the assembly.
20935 * driver.c (--debug): New command line argument to create a
20936 debugger information file.
20938 * location.cs (SymbolDocument): New public property. Returns an
20939 ISymbolDocumentWriter object for the current source file or null
20940 if we don't have a symbol writer.
20942 2002-03-21 Miguel de Icaza <miguel@ximian.com>
20944 * driver.cs (LoadAssembly): Correctly return when all the paths
20945 have been tried and not before.
20947 * statement.cs (Switch.Emit): return the actual coverage for this
20948 statement (returns/not-returns)
20950 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
20951 switch of the statement if we are the last switch section. That
20952 kills two problems: try/catch problems (we used to emit an empty
20953 nop at the end) and switch statements where all branches would
20956 2002-03-19 Miguel de Icaza <miguel@ximian.com>
20958 * driver.cs: Add default assemblies (the equivalent to the
20959 Microsoft CSC.RSP file)
20961 * cs-tokenizer.cs: When updating `cols and setting it to zero,
20962 also update tokens_seen and set it to false.
20964 * driver.cs: Implement --recurse for Mike.
20966 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
20967 correctly splitting out the paths.
20969 2002-03-18 Miguel de Icaza <miguel@ximian.com>
20971 * interface.cs (Interface.PopulateProperty): Instead of using
20972 `parent' as the declaration space for the set parameters, use
20975 * support.cs (InternalParameters): InternalParameters constructor
20976 takes a DeclSpace instead of a TypeContainer.
20978 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
20979 types are being initialized, load the address of it before calling
20982 (New): Provide a mechanism to disable the generation of local
20983 value type temporaries when the caller will be providing us with
20984 an address to store it.
20986 (ArrayCreation.EmitDynamicInitializers): Use it.
20988 2002-03-17 Miguel de Icaza <miguel@ximian.com>
20990 * expression.cs (Invocation.EmitArguments): Only probe for array
20991 property if there is more than one argument. Sorry about that.
20993 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
20994 empty param arrays.
20996 * class.cs (Method.LabelParameters): Fix incorrect code path that
20997 prevented the `ParamArrayAttribute' from being applied to the
21000 2002-03-16 Miguel de Icaza <miguel@ximian.com>
21002 * support.cs (ReflectionParameters): Correctly compute whether the
21003 last argument is a params array. Fixes the problem with
21006 * typemanager.cs: Make the assemblies array always be non-null
21007 (empty, but non-null)
21009 * tree.cs (RecordDecl): New function that abstracts the recording
21010 of names. This reports error 101, and provides a pointer to the
21011 previous declaration. Fixes a crash in the compiler.
21013 * cs-parser.jay (constructor_declaration): Update to new grammar,
21014 and provide a constructor_body that can be empty.
21016 2002-03-15 Miguel de Icaza <miguel@ximian.com>
21018 * driver.cs: Add support for --resources.
21020 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
21021 Make all types for the various array helper methods be integer.
21023 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
21024 CheckState to ConvCast.
21026 (ConvCast): Now it takes a `checked' state argument, to avoid
21027 depending on the emit context for the conversion, and just using
21028 the resolve time setting.
21030 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
21031 instead of Invocation.EmitArguments. We do not emit the original
21032 arguments, instead we emit those which have been converted to
21033 unsigned int expressions.
21035 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
21037 * codegen.cs: ditto.
21039 * expression.cs (LocalVariableReference): Drop the use of the
21040 Store function that depended on the variable index.
21042 * statement.cs (VariableInfo): Drop the `Idx' property from this
21043 class, as this is not taking into account the indexes for
21044 temporaries tat we generate during the execution, getting the
21047 * class.cs: First emit class initializers, then call the parent
21050 * expression.cs (Binary): Fix opcode emision.
21051 (UnaryMutator.EmitCode): Support checked code generation
21053 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
21054 matches for events for both the Static and Instance scans,
21055 pointing to the same element. Fix that.
21057 2002-03-14 Miguel de Icaza <miguel@ximian.com>
21059 * rootcontext.cs (ResolveTree): Always set the
21060 interface_resolve_order, because nested interfaces will be calling
21063 * class.cs (GetInterfaceOrClass): Track the same resolution
21064 process used by TypeManager.LookupType. This fixes the nested
21065 type lookups in class declarations (separate path from
21068 (TypeContainer.DefineType): Also define nested interfaces.
21069 (TypeContainer.RegisterOrder): New public function used to
21070 register the order in which child interfaces need to be closed.
21072 Nested interfaces need to be closed after their parents have been
21075 * interface.cs (InterfaceAttr): Put all the logic for computing
21076 the interface attribute here.
21078 (DefineInterface): Register our interface order with the
21079 RootContext or with the TypeContainer depending on the case.
21081 2002-03-12 Miguel de Icaza <miguel@ximian.com>
21083 * cs-parser.jay: rework foreach statement to work with the new
21084 changes to the policy on SimpleNames.
21086 * report.cs: support Stacktrace on warnings as well.
21088 * makefile: drop --unsafe and /unsafe from the compile.
21090 2002-03-13 Ravi Pratap <ravi@ximian.com>
21092 * ecore.cs (StandardConversionExists): Modify to take an Expression
21093 as the first parameter. Ensure we do null -> reference type conversion
21096 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
21097 temporary Expression objects.
21099 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
21101 * interface.cs: workaround bug in method overloading resolution
21102 (there is already a bugzilla bug for it).
21104 2002-03-12 Miguel de Icaza <miguel@ximian.com>
21106 We could also solve this problem by having a separate path for
21107 performing type lookups, instead of DoResolve, we could have a
21108 ResolveType entry point, and only participating pieces of the
21109 production (simplename, deref, array) would implement this.
21111 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
21112 signal SimpleName to only resolve type names and not attempt to
21113 resolve anything else.
21115 * expression.cs (Cast): Set the flag.
21117 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
21119 * class.cs: Only report 108 if there is no `new' modifier.
21121 * cs-parser.jay: rework foreach statement to work with the new
21122 changes to the policy on SimpleNames.
21124 * report.cs: support Stacktrace on warnings as well.
21126 * makefile: drop --unsafe and /unsafe from the compile.
21128 2002-03-11 Miguel de Icaza <miguel@ximian.com>
21130 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
21131 lookups here, instead of doing that at parse time. This means
21132 that our grammar will not introduce `LocalVariableReferences' as
21133 expressions at this point. That solves the problem of code like
21137 static void Main ()
21141 This is only half the fix. The full fix requires parameters to
21142 also be handled in this way.
21144 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
21145 makes the use more obvious of the DeclSpace. The
21146 ec.TypeContainer.TypeBuilder is now only used to pull the
21147 TypeBuilder for it.
21149 My theory is that I can get rid of the TypeBuilder completely from
21150 the EmitContext, and have typecasts where it is used (from
21151 DeclSpace to where it matters).
21153 The only pending problem is that the code that implements Aliases
21154 is on TypeContainer, and probably should go in DeclSpace.
21156 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
21157 lookups here, instead of doing that at parse time. This means
21158 that our grammar will not introduce `LocalVariableReferences' as
21159 expressions at this point. That solves the problem of code like
21163 static void Main ()
21167 This is only half the fix. The full fix requires parameters to
21168 also be handled in this way.
21170 * class.cs (Property.DefineMethod): When implementing an interface
21171 method, set newslot, when implementing an abstract method, do not
21172 set the flag (before we tried never setting it, or always setting
21173 it, which is the difference).
21174 (Indexer.DefineMethod): same.
21175 (Method.DefineMethod): same.
21177 * ecore.cs: Only set the status used flag if we get back a Field.
21179 * attribute.cs: Temporary hack, so Paolo can keep working.
21181 2002-03-08 Ravi Pratap <ravi@ximian.com>
21183 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
21184 the unmanaged type in the case we have a MarshalAs attribute.
21186 (Resolve): Handle the case when we are parsing the special MarshalAs
21187 attribute [we need to store the unmanaged type to use later]
21189 * typemanager.cs (marshal_as_attr_type): Built in type for the
21190 MarshalAs Attribute.
21192 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
21193 on parameters and accordingly set the marshalling info.
21195 2002-03-09 Miguel de Icaza <miguel@ximian.com>
21197 * class.cs: Optimizing slightly by removing redundant code after
21198 we switched to the `NoTypes' return value.
21199 (Property.DefineMethod): use NoTypes here too.
21201 This fixes the bug I introduced in my last batch of changes.
21203 2002-03-05 Ravi Pratap <ravi@ximian.com>
21205 * tree.cs (RecordEnum): Add. We now keep track of enums too.
21207 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
21208 Enums since those are types too.
21210 * cs-parser.jay (enum_declaration): Record enums as we parse them.
21212 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
21213 thanks to a call during the lookup process.
21215 2002-03-07 Miguel de Icaza <miguel@ximian.com>
21217 * statement.cs (Foreach): Lots of work to accomodate a particular
21218 kind of foreach statement that I had not kept in mind. It is
21219 possible to have foreachs on classes that provide a GetEnumerator
21220 method that return objects that implement the "pattern" for using
21221 a foreach, there is no need to support GetEnumerator
21224 This is needed to compile nant.
21226 * decl.cs: Only report 114 if the member is not `Finalize' and if
21227 the warning level is at least 2.
21229 * class.cs: Moved the compare function from Method to
21232 (MethodSignature.InheritableMemberSignatureCompare): Add new
21233 filter function that is used to extract inheritable methods from a
21236 (Method.Define): Use the new `inheritable_method_signature_filter'
21239 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
21242 2002-03-06 Miguel de Icaza <miguel@ximian.com>
21244 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
21246 * cs-parser.jay: Add opt_semicolon to the interface declaration.
21248 * expression.cs: Pass location information to
21249 ConvertImplicitStandard.
21251 * class.cs: Added debugging code to track return values from
21254 2002-03-05 Miguel de Icaza <miguel@ximian.com>
21256 * expression.cs (Is.DoResolve): If either side of the `is' is an
21257 interface, do not flag the warning.
21259 * ecore.cs (ImplicitReferenceConversion): We need a separate test
21262 * report.cs: Allow for --fatal to be used with --probe.
21264 * typemanager.cs (NoTypes): Move the definition for the empty Type
21267 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
21269 (TypeContainer.DefineProxy): New function used to proxy to parent
21270 implementations when implementing interfaces.
21271 (TypeContainer.ParentImplements): used to lookup if our parent
21272 implements a public function that is required by an interface.
21273 (TypeContainer.VerifyPendingMethods): Hook this up.
21275 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
21276 `modules' and `assemblies' arraylists into arrays. We only grow
21277 these are the very early start up of the program, so this improves
21278 the speedof LookupType (nicely measured).
21280 * expression.cs (MakeByteBlob): Replaced unsafe code with
21281 BitConverter, as suggested by Paolo.
21283 * cfold.cs (ConstantFold.Binary): Special case: perform constant
21284 folding of string concatenation, but if either side is a string,
21285 and the other is not, then return null, and let the runtime use
21286 the concatenation on the string plus the object (using
21287 `Object.ToString').
21289 2002-03-04 Miguel de Icaza <miguel@ximian.com>
21291 Constant Folding has been implemented now.
21293 * expression.cs (Unary.Reduce): Do not throw an exception, catch
21294 the error instead on types that are not supported in one's
21297 * constant.cs (Constant and all children): New set of functions to
21298 perform implict and explicit conversions.
21300 * ecore.cs (EnumConstant): Implement the new functions to perform
21301 conversion by proxying to the child expression.
21303 * codegen.cs: (ConstantCheckState): Constant evaluation has its
21304 own separate setting that can not be turned off from the command
21305 line using --unchecked or --checked and is only controlled using
21306 the checked/unchecked statements and expressions. This setting is
21307 used by the constant folder to flag errors.
21309 * expression.cs (CheckedExpr, UncheckedExpr): Set the
21310 ConstantCheckState as well.
21312 During Resolve, they also have to flag the state, because the
21313 constant folder runs completely in the Resolve phase.
21315 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
21318 2002-03-01 Miguel de Icaza <miguel@ximian.com>
21320 * cfold.cs: New file, this file contains the constant folder.
21322 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
21323 argument to track whether we are using the resulting address to
21324 load or store a value and provide better error messages.
21326 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
21327 new AddressOf arguments.
21329 * statement.cs (Foreach.EmitCollectionForeach): Update
21331 * expression.cs (Argument.Emit): Call AddressOf with proper
21332 arguments to track usage.
21334 (New.DoEmit): Call AddressOf with new arguments.
21336 (Unary.Emit): Adjust AddressOf call.
21338 2002-03-01 Ravi Pratap <ravi@ximian.com>
21340 * cs-parser.jay (member_access): Change the case for pre-defined types
21341 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
21344 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
21347 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
21348 essentially like methods and apply attributes like MethodImplOptions to them too.
21350 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
21353 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
21354 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
21357 * Update code everywhere accordingly.
21359 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
21361 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
21363 2002-02-28 Ravi Pratap <ravi@ximian.com>
21365 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
21366 try performing lookups against those instead of jumping straight into using
21367 the 'using' clauses.
21369 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
21371 (LookupType): Perform lookups in implicit parents too.
21373 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
21374 sequence as RootContext.LookupType.
21376 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
21377 the various cases of namespace lookups into this method.
21379 2002-03-01 Miguel de Icaza <miguel@ximian.com>
21381 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
21382 in positional arguments)
21384 * class.cs (Operator): Update the AllowedModifiers to contain
21387 * cs-parser.jay: Update operator declaration to allow for the
21388 operator body to be empty.
21390 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
21393 2002-02-27 Miguel de Icaza <miguel@ximian.com>
21395 * class.cs (Method.Emit): Label parameters.
21397 * driver.cs: Return 1 or 0 as the program exit code.
21399 2002-02-26 Miguel de Icaza <miguel@ximian.com>
21401 * expression.cs: Special case the `null' object when trying to
21402 auto-compute the type, as anything can be explicitly converted to
21405 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
21406 spotting this Paolo.
21408 (Expression.ImplicitNumericConversion): Perform comparissions of
21409 the type using the underlying type in the case of an enumeration
21410 rather than using the enumeration type for the compare.
21412 Cope with the underlying == type case, which is not possible to
21415 (Expression.ConvertNumericExplicit): Perform comparissions of
21416 the type using the underlying type in the case of an enumeration
21417 rather than using the enumeration type for the compare.
21419 * driver.cs: If the user does not supply an extension, assume .exe
21421 * cs-parser.jay (if_statement): Rewrote so that we can track the
21422 location for the if statement.
21424 * expression.cs (Binary.ConstantFold): Only concat strings when
21425 the operation is "+", not everything ;-)
21427 * statement.cs (Statement.EmitBoolExpression): Take a location
21429 (If, While, Do): Track location.
21431 * expression.cs (Binary.ResolveOperator): In the object + string
21432 case, I was missing a call to ConvertImplicit
21434 2002-02-25 Ravi Pratap <ravi@ximian.com>
21436 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
21437 Location arguments. Ensure we use RootContext.LookupType to do our work
21438 and not try to do a direct Type.GetType and ModuleBuilder.GetType
21440 * interface.cs (PopulateMethod): Handle the type of the parameter being
21443 * expression.cs (Invocation.BetterFunction): Handle the case when we
21444 have a params method with no fixed arguments and a call is made with no
21447 2002-02-25 Miguel de Icaza <miguel@ximian.com>
21449 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
21450 the verbatim-string-literal
21452 * support.cs (InternalParameters.ParameterModifier): handle null
21454 (InternalParameters.ParameterType): ditto.
21456 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
21457 duplicating the name of the variable parameter.
21458 (GetParameterByName): Fix bug where we were not looking up array
21459 paramters if they were the only present (thanks Paolo!).
21460 (GetParameterInfo): We only have an empty set of types if both
21461 fixed and array are set to null.
21462 (GetParameterInfo-idx): Handle FixedParameter == null
21464 * cs-parser.jay: Handle the case where there is no catch
21465 statements (missing null test).
21467 2002-02-22 Miguel de Icaza <miguel@ximian.com>
21469 * driver.cs (MainDriver): Be conservative on our command line
21472 Catch DirectoryNotFoundException when calling GetFiles.
21474 (SplitPathAndPattern): Used to split the input specification into
21475 a path and a pattern that we can feed to Directory.GetFiles.
21477 2002-02-21 Miguel de Icaza <miguel@ximian.com>
21479 * statement.cs (Fixed): Implement the last case of the Fixed
21480 statement (string handling).
21482 * expression.cs (StringPtr): New class used to return a char * to
21483 a string; Used by the Fixed statement.
21485 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
21487 * expression.cs (Binary.ResolveOperator): Remove redundant
21488 MemberLookup pn parent type.
21489 Optimize union call, we do not need a union if the types are the same.
21490 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
21493 Specialize the use of MemberLookup everywhere, instead of using
21494 the default settings.
21496 (StackAlloc): Implement stackalloc keyword.
21498 * cs-parser.jay: Add rule to parse stackalloc.
21500 * driver.cs: Handle /h, /help, /?
21502 * expression.cs (MakeByteBlob): Removed the hacks we had in place
21503 before we supported unsafe code.
21505 * makefile: add --unsafe to the self compilation of mcs.
21507 2002-02-20 Miguel de Icaza <miguel@ximian.com>
21509 * expression.cs (PointerArithmetic): New class that is used to
21510 perform pointer arithmetic.
21511 (Binary.Resolve): Handle pointer arithmetic
21512 Handle pointer comparission.
21513 (ArrayPtr): Utility expression class that is used to take the
21514 address of an array.
21516 (ElementAccess): Implement array access for pointers
21518 * statement.cs (Fixed): Implement fixed statement for arrays, we
21519 are missing one more case before we are done.
21521 * expression.cs (Indirection): Implement EmitAssign and set the
21522 ExprClass to Variable. This allows pointer dereferences to be
21523 treated as variables, and to have values assigned to them.
21525 * ecore.cs (Expression.StoreFromPtr): New utility function to
21526 store values dereferencing.
21528 2002-02-20 Ravi Pratap <ravi@ximian.com>
21530 * expression.cs (Binary.ResolveOperator): Ensure that we are
21531 not trying to operate on a void type - this fixes the reported
21534 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
21535 the parent implementation is sealed.
21537 * ../errors/cs0239.cs : Add.
21539 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
21541 * typemanager.cs (unverifiable_code_type): Corresponds to
21542 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
21543 which have unsafe code in them.
21545 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
21548 2002-02-19 Miguel de Icaza <miguel@ximian.com>
21550 * cs-tokenizer.cs: Add support for @"litreal strings"
21552 Make tokenizer accept pre-processor directives
21553 on any column (remove the old C-like limitation).
21555 * rootcontext.cs (EmitCode): Emit any global attributes.
21556 (AddGlobalAttributes): Used to keep track of assembly attributes.
21558 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
21560 * cs-parser.jay: Add support for global attributes.
21562 2002-02-17 Miguel de Icaza <miguel@ximian.com>
21564 * expression.cs (Indirection): New helper class. Unary will
21565 create Indirection classes to be able to implement the
21566 IMemoryLocation interface on it.
21568 2002-02-16 Miguel de Icaza <miguel@ximian.com>
21570 * cs-parser.jay (fixed_statement): reference the right statement.
21572 * statement.cs (Fixed.Emit): Finish implementing the fixed
21573 statement for the &x case.
21575 2002-02-14 Miguel de Icaza <miguel@ximian.com>
21577 * class.cs (Property.Define, Method.Define): Remove newslot when
21580 * modifiers.cs: My use of NewSlot when `Abstract' was set was
21581 wrong. NewSlot should only be used if the `new' keyword is present.
21583 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
21584 locating our system dir. Sorry about this.
21586 2002-02-13 Miguel de Icaza <miguel@ximian.com>
21588 * driver.cs (GetSystemDir): Compute correctly the location of our
21589 system assemblies. I was using the compiler directory instead of
21590 the library directory.
21592 2002-02-13 Ravi Pratap <ravi@ximian.com>
21594 * expression.cs (BetterFunction): Put back in what Miguel commented out
21595 since it is the correct fix. The problem is elsewhere ;-)
21597 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
21598 parameters of the parms method are themselves compatible or not !
21600 (StandardConversionExists): Fix very dangerous bug where we were forgetting
21601 to check that a class implements an interface before saying that an implicit
21602 conversion was allowed. Use ImplementsInterface to do the checking.
21604 2002-02-13 Miguel de Icaza <miguel@ximian.com>
21606 * class.cs (Method.Define): Track whether we are an explicit
21607 implementation or not. And only call DefineMethodOverride if we
21608 are an explicit implementation.
21610 (Property.DefineMethod): Ditto.
21612 2002-02-11 Ravi Pratap <ravi@ximian.com>
21614 * expression.cs (BetterFunction): Catch hideous bug which was
21615 preventing us from detecting ambiguous calls due to implicit casts i.e
21618 2002-01-29 Miguel de Icaza <miguel@ximian.com>
21620 * support.cs (Pair): Remove un-needed method. I figured why I was
21621 getting the error in cs-parser.jay, the variable in a foreach loop
21622 is readonly, and the compiler does not really treat this as a variable.
21624 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
21625 instead of EQUALS in grammar.
21627 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
21629 * expression.cs (Unary.DoResolve): Check whether the argument is
21632 2002-01-28 Miguel de Icaza <miguel@ximian.com>
21634 * support.cs: Api for Pair to set a value. Despite the fact that
21635 the variables are public the MS C# compiler refuses to compile
21636 code that accesses the field if the variable is part of a foreach
21639 * statement.cs (Fixed): Begin implementation of the fixed
21642 (Block.AddVariable): Return the VariableInfo on success and null
21643 on failure instead of true/false.
21645 * cs-parser.jay (foreach): Catch errors on variables already
21646 defined (we were ignoring this value before) and properly unwind
21647 the block hierarchy
21649 (fixed_statement): grammar for the fixed statement.
21651 2002-01-25 Miguel de Icaza <miguel@ximian.com>
21653 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
21654 pointer types to be incretemented.
21656 (SizeOf): Implement.
21658 * cs-parser.jay (pointer_member_access): Implement
21659 expr->IDENTIFIER production.
21661 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
21662 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
21665 (Unary): Implement indirection.
21667 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
21668 use in non-unsafe context).
21670 (SimpleName.DoResolve): Check for pointers in field access on safe
21673 (Expression.LoadFromPtr): Factor the load-indirect code in this
21674 function. This was duplicated in UnboxCast and ParameterReference
21676 2002-01-24 Miguel de Icaza <miguel@ximian.com>
21678 * expression.cs (ComposedCast): report an error if a pointer cast
21679 is used in a safe region.
21681 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
21682 pointer type casts in unsafe context.
21684 * codegen.cs (EmitContext): Set up IsUnsafe.
21686 * cs-parser.jay (non_expression_type): Add productions for pointer
21689 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
21690 code. We should not use force into static mode if the method is
21691 not virtual. Fixes bug in MIS
21693 * statement.cs (Do.Emit, While.Emit, For.Emit,
21694 Statement.EmitBoolExpression): Add support to Do and While to
21695 propagate infinite loop as `I do return' semantics.
21697 Improve the For case to also test for boolean constants.
21699 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
21700 to the list of attributes we can add.
21702 Remove `EmitContext' argument.
21704 * class.cs (Method.Define): Apply parameter attributes.
21705 (Constructor.Define): Apply parameter attributes.
21706 (MethodCore.LabelParameters): Move here the core of labeling
21709 * support.cs (ReflectionParameters.ParameterModifier,
21710 InternalParameters.ParameterModifier): Use IsByRef on the type and
21711 only return the OUT bit for these parameters instead of in/out/ref
21714 This is because I miss-understood things. The ParameterInfo.IsIn
21715 and IsOut represent whether the parameter has the [In] and [Out]
21718 2002-01-22 Miguel de Icaza <miguel@ximian.com>
21720 * ecore.cs (FieldExpr.Emit): Release temporaries.
21722 * assign.cs (LocalTemporary.Release): new function.
21724 * codegen.cs (EmitContext.GetTemporaryStorage,
21725 EmitContext.FreeTemporaryStorage): Rework the way we deal with
21726 temporary storage. Now we can "put back" localbuilders when we
21729 2002-01-21 Miguel de Icaza <miguel@ximian.com>
21731 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
21732 need to make a copy of the variable to generate verifiable code.
21734 2002-01-19 Miguel de Icaza <miguel@ximian.com>
21736 * driver.cs: Compute dynamically the system directory.
21738 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
21739 Slower, but more generally useful. Used by the abstract
21740 registering implementation.
21742 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
21743 the rules for the special rule on Type/instances. First check if
21744 we have the same name, and if so, try that special static path
21745 rather than the instance path.
21747 2002-01-18 Miguel de Icaza <miguel@ximian.com>
21749 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
21752 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
21753 Enum, ValueType, Delegate or Array for non-corlib compiles.
21755 * cs-tokenizer.cs: Catch long identifiers (645)
21757 * typemanager.cs (IndexerPropetyName): Ravi never tested this
21760 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
21761 fix, we were returning too early, so we were not registering
21762 pending methods from abstract classes.
21764 Do not register pending methods if the class is abstract.
21766 * expression.cs (Conditional.DoResolve): Report circular implicit
21767 conversions when we neecd to compute it for conditional
21770 (Is.DoResolve): If the expression is always of the provided type,
21771 flag warning 183. If the expression can not ever be of the
21772 provided type flag warning 184.
21774 * class.cs: Catch 169 as well.
21776 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
21779 2002-01-18 Nick Drochak <ndrochak@gol.com>
21781 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
21783 2002-01-17 Miguel de Icaza <miguel@ximian.com>
21785 * interface.cs: (PopulateMethod): Check for pointers being defined
21786 only if the unsafe context is active.
21787 (PopulateProperty): ditto.
21788 (PopulateIndexer): ditto.
21790 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
21791 specified. If pointers are present, make sure that they are
21792 present in an unsafe context.
21793 (Constructor, Constructor.Define): ditto.
21794 (Field, Field.Define): ditto.
21795 (Property, Property.Define): ditto.
21796 (Event, Event.Define): ditto.
21798 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
21799 hashtable if there are classes or structs defined.
21801 * expression.cs (LocalVariableReference.DoResolve): Simplify this
21802 code, as the constant resolution moved.
21804 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
21805 the metadata, so we can flag error 133.
21807 * decl.cs (MemberCore.UnsafeOK): New function to test that a
21808 pointer is being declared in an unsafe context.
21810 2002-01-16 Miguel de Icaza <miguel@ximian.com>
21812 * modifiers.cs (Modifiers.Check): Require a Location argument.
21813 Report error 227 for Unsafe use.
21815 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
21817 * statement.cs (For.Emit): If the test is null, then report that
21818 we do `return', as we wont reach anything afterwards.
21820 (Switch.SwitchGoverningType): Track the expression that matched
21823 * driver.cs: Allow negative numbers as an error code to flag.
21825 * cs-parser.jay: Handle 1551.
21827 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
21829 2002-01-15 Miguel de Icaza <miguel@ximian.com>
21831 * cs-parser.jay: Report 1518 (type declaration can only contain
21832 class, struct, interface, enum or delegate)
21834 (switch_label): Report 1523 (keywords `case' or `default' must
21837 (opt_switch_sections): Report 1522 (empty switch)
21839 * driver.cs: Report 1515 (response file specified multiple times)
21840 Report 1516 (Source file specified multiple times).
21842 * expression.cs (Argument.Resolve): Signal 1510
21844 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
21845 access not allowed in static code)
21847 2002-01-11 Ravi Pratap <ravi@ximian.com>
21849 * typemanager.cs (IsPointerType): Utility method which we are going
21852 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
21853 the object type, so we take care of that.
21855 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
21857 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
21858 added to non-params parameters :-)
21860 * typemanager.cs (CSharpName): Include 'void' type too.
21862 (void_ptr_type): Include in the set of core types.
21864 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
21867 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
21870 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
21871 completely forgotten about it.
21873 2002-01-10 Ravi Pratap <ravi@ximian.com>
21875 * cs-parser.jay (pointer_type): Add. This begins our implementation
21876 of parsing rules for unsafe code.
21878 (unsafe_statement): Implement.
21880 (embedded_statement): Modify to include the above.
21882 * statement.cs (Unsafe): Implement new class for unsafe blocks.
21884 * codegen.cs (EmitContext.InUnsafe): Add. This determines
21885 if the current context is an unsafe one.
21887 * cs-parser.jay (local_variable_pointer_type): Since local variable types
21888 are handled differently, we need separate rules for them.
21890 (local_variable_declaration): Update to use local_variable_pointer_type
21891 to allow variable declarations of unmanaged pointer types.
21893 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
21894 in unsafe contexts.
21896 * ../errors/cs0214.cs : Add.
21898 2002-01-16 Nick Drochak <ndrochak@gol.com>
21900 * makefile: remove 'response' file when cleaning.
21902 2002-01-15 Miguel de Icaza <miguel@ximian.com>
21904 * cs-parser.jay: Report 1524.
21906 2002-01-14 Miguel de Icaza <miguel@ximian.com>
21908 * typemanager.cs (RegisterMethod): drop checking if we have
21909 registered this from here
21911 2002-01-12 Miguel de Icaza <miguel@ximian.com>
21913 * class.cs (Method.EmitDestructor): Implement calling our base
21916 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
21917 value of InFinally.
21919 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
21920 this routine and will wrap the call in a try/catch block. Deal
21923 2002-01-11 Miguel de Icaza <miguel@ximian.com>
21925 * ecore.cs (Expression.MemberLookup): instead of taking a
21926 parameter `same_type' that was used to tell whether we could
21927 access private members we compute our containing type from the
21930 (FieldExpr): Added partial support for volatile fields. This does
21931 not work for volatile fields exposed from assemblies, as I can not
21932 figure out how to extract the modreq from it.
21934 Updated all the source files to use this.
21936 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
21937 because it is referenced by MemberLookup very often.
21939 2002-01-09 Ravi Pratap <ravi@ximian.com>
21941 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
21942 TypeBuilder.GetCustomAttributes to retrieve what we need.
21944 Get rid of redundant default_member_attr_type as this is the same as
21945 default_member_type which already exists.
21947 * interface.cs, attribute.cs : Update accordingly.
21949 2002-01-08 Miguel de Icaza <miguel@ximian.com>
21951 * typemanager.cs: Enable IndexerPropertyName again. It does not
21952 work for TYpeBuilders though. Ravi, can you please fix this?
21954 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
21956 * expression.cs (Argument.Emit): Handle the case of ref objects
21957 being passed to ref functions;
21959 (ParameterReference.EmitLoad): Loads the content of the pointer
21960 without dereferencing.
21962 2002-01-07 Miguel de Icaza <miguel@ximian.com>
21964 * cs-tokenizer.cs: Implemented the pre-processing expressions.
21966 2002-01-08 Ravi Pratap <ravi@ximian.com>
21968 * class.cs (Indexer.DefineMethod): Incorporate the interface
21969 type in the name of the method if we are doing explicit interface
21972 * expression.cs (ConversionExists): Remove as it is completely obsolete.
21974 (BetterConversion): Fix extremely trivial bug where we were referring to
21975 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
21978 * ../errors/bug16.cs : Add although we have fixed it.
21980 2002-01-07 Miguel de Icaza <miguel@ximian.com>
21982 * expression.cs (BaseIndexer): Begin implementation.
21984 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
21986 * cs-parser.jay (indexer_declarator): Use qualified_identifier
21987 production directly to remove a shift/reduce, and implement
21988 explicit interface implementation.
21990 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
21991 after a floating point suffix.
21993 * expression.cs (DoNumericPromotions): Improved the conversion for
21994 uint/uint. If we have a constant, we avoid doing a typecast to a
21997 * class.cs (Indexer): Implement explicit interface implementation
22000 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
22002 * class.cs: make the default instance constructor public and hidebysig.
22004 2001-01-03 Ravi Pratap <ravi@ximian.com>
22006 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
22007 so we can call it from elsewhere.
22009 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
22010 we emit it internally if the class has a defined indexer; otherwise the user
22011 emits it by decorating the class definition with the DefaultMemberAttribute.
22013 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
22014 attribute is not used on a type which defines an indexer.
22016 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
22017 character when we skip whitespace.
22019 * ../errors/cs0646.cs : Add.
22021 2002-01-03 Miguel de Icaza <miguel@ximian.com>
22023 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
22026 * makefile: Add practical target `mcs3.exe' which builds the third
22027 generation compiler.
22029 * expression.cs (New): Fix structures constructor calling.
22031 * class.cs (Property, Method, Indexer): Emit Final flag on the
22032 method if we are an interface implementation and we are not
22035 * ecore.cs (PropertyExpr): New public field `IsBase', tells
22036 whether this property is referencing a `base' method.
22038 * expression.cs (Invocation.EmitCall): take an extra argument:
22039 is_base, this is used to determine whether the `call' or
22040 `callvirt' opcode should be used.
22043 * delegate.cs: update EmitCall.
22045 * class.cs (Method.Define): Set NewSlot for the cases where we are
22046 not implementing an interface method.
22048 (Property.Define): ditto.
22050 2002-01-02 Miguel de Icaza <miguel@ximian.com>
22052 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
22053 'r'. Allows mcs to parse itself fully.
22055 2002-01-02 Ravi Pratap <ravi@ximian.com>
22057 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
22058 of the number of initializers that require the InitializeArray method.
22060 (CheckIndices): Store the Expression in all cases - not the plain value. Also
22061 update the above field where necessary.
22063 (MakeByteBlob): Update accordingly.
22065 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
22068 (EmitDynamicInitializers): Update in accordance with the new optimization.
22070 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
22071 same OpCode applies.
22073 * cs-parser.jay : Fix some glaring errors I introduced.
22075 2002-01-01 Ravi Pratap <ravi@ximian.com>
22077 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
22078 so that we can check for name clashes there too.
22080 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
22081 for interface indexers.
22083 * interfaces.cs (Define): Emit the default member attribute.
22085 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
22086 variable was being referred to while setting the value ;-)
22088 2002-01-01 Miguel de Icaza <miguel@ximian.com>
22090 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
22091 byte-by-byte information when we know the data is zero.
22093 Make the block always a multiple of 4, because
22094 DefineInitializedData has a bug.
22096 * assign.cs: Fix, we should assign from the temporary, not from
22099 * expression.cs (MakeByteBlob): Fix my incorrect code.
22101 2001-12-31 Miguel de Icaza <miguel@ximian.com>
22103 * typemanager.cs (EnumToUnderlying): This function is used to get
22104 the underlying type from an enumeration, because it does not
22107 * constant.cs: Use the I4_S form for values between -128 and 127.
22109 * statement.cs (Block.LookupLabel): Looks up a label.
22110 (Block): Drop support for labeled blocks.
22112 (LabeledStatement): New kind of statement that represents a label
22115 (Goto): Finally implement this bad boy.
22117 * cs-parser.jay: Update to reflect new mechanism to implement
22120 2001-12-30 Miguel de Icaza <miguel@ximian.com>
22122 * codegen.cs (EmitContext.This): a codegen property that keeps the
22123 a single instance of this instead of creating many different this
22126 * delegate.cs (Delegate.DoResolve): Update to use the property;
22128 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
22130 * expression.cs (BaseAccess.DoResolve): Ditto.
22132 2001-12-29 Ravi Pratap <ravi@ximian.com>
22134 * typemanager.cs (methodimpl_attr_type): Add to hold the type
22135 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
22137 (InitCoreTypes): Update accordingly.
22139 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
22140 so we can quickly store the state.
22142 (ApplyAttributes): Set the correct implementation flags
22143 for InternalCall methods.
22145 2001-12-29 Miguel de Icaza <miguel@ximian.com>
22147 * expression.cs (EmitCall): if a method is not virtual, then do
22148 not use callvirt on it.
22150 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
22151 user defined stuff) requires the use of stobj, which takes an
22152 address on the stack instead of an array and an index. So emit
22153 the Ldelema operation for it.
22155 (EmitStoreOpcode): Use stobj for valuetypes.
22157 (UnaryMutator.EmitCode): Use the right 1 value depending on
22158 whether we are dealing with int64/uint64, float or doubles.
22160 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
22161 constructors that I implemented last night.
22163 (Constructor.IsDefault): Fix to work properly for static
22166 * cs-parser.jay (CheckDef): report method signature errors.
22167 Update error number 103 to be 132.
22169 * decl.cs: New AdditionResult enumeration value: MethodExists.
22170 Although we do this check for methods later on in the semantic
22171 analysis, catching repeated default constructors is so easy that
22172 we catch these here.
22174 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
22177 (ParameterReference.EmitAssign, Emit): handle
22180 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
22181 (ArrayAccess.EmitStoreOpcode): ditto.
22183 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
22185 * expression.cs (MakeByteBlob): Complete all the missing types
22186 (uint, short, ushort, byte, sbyte)
22188 * class.cs: Only init instance field initializers on instance
22191 Rename `constructors' to instance_constructors.
22193 (TypeContainer.AddConstructor): Only add constructors to the list
22194 if it is not static.
22196 Make sure that we handle default_static_constructor independently
22197 everywhere where we handle instance_constructors
22199 2001-12-28 Miguel de Icaza <miguel@ximian.com>
22201 * class.cs: Do not lookup or create a base initializer for a
22202 static constructor.
22204 (ConstructorInitializer.Resolve): use the proper type to lookup
22207 * cs-parser.jay: Report error 1585 (modifiers between type and name).
22209 * enum.cs, interface.cs: Remove CloseType, this is taken care by
22212 * decl.cs: CloseType is now an virtual method, the default
22213 implementation just closes this type.
22215 2001-12-28 Ravi Pratap <ravi@ximian.com>
22217 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
22218 to PreserveSig by default. Also emit HideBySig on such methods.
22220 Basically, set the defaults to standard values.
22222 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
22223 argument, if candidate is better, it can't be worse than the best !
22225 (Invocation): Re-write bits to differentiate between methods being
22226 applicable in their expanded form and their normal form - for params
22229 Get rid of use_standard everywhere as only standard conversions are allowed
22230 in overload resolution.
22232 More spec conformance.
22234 2001-12-27 Miguel de Icaza <miguel@ximian.com>
22236 * driver.cs: Add --timestamp, to see where the compiler spends
22239 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
22240 `this' in static code.
22242 (SimpleName.DoResolve): Implement in terms of a helper function
22243 that allows static-references to be passed upstream to
22246 (Expression.ResolveWithSimpleName): Resolve specially simple
22247 names when called by MemberAccess to implement the special
22250 (Expression.ImplicitReferenceConversion): Handle conversions from
22251 Null to reference types before others, as Null's type is
22254 * expression.cs (Invocation.EmitCall): Handle the special case of
22255 calling methods declared on a reference type from a ValueType
22256 (Base classes System.Object and System.Enum)
22258 (MemberAccess.Resolve): Only perform lookups on Enumerations if
22259 the left hand side is a TypeExpr, not on every enumeration.
22261 (Binary.Resolve): If types are reference types, then do a cast to
22262 object on operators != and == of both arguments.
22264 * typemanager.cs (FindMembers): Extract instance and static
22265 members if requested.
22267 * interface.cs (PopulateProperty): Use void_type instead of null
22268 as the return type for the setter method.
22270 (PopulateIndexer): ditto.
22272 2001-12-27 Ravi Pratap <ravi@ximian.com>
22274 * support.cs (ReflectionParameters): Fix minor bug where we
22275 were examining the wrong parameter for the ParamArray attribute.
22277 Cope with requests for the type of the parameter at position
22278 greater than the params parameter's. We now return the element
22279 type of the params array as that makes more sense.
22281 * expression.cs (Invocation.IsParamsMethodApplicable): Update
22282 accordingly as we no longer have to extract the element type
22285 (Invocation.OverloadResolve): Update.
22287 2001-12-27 Miguel de Icaza <miguel@ximian.com>
22289 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
22290 against IEnumerator, test whether the return value is a descendant
22291 of the IEnumerator interface.
22293 * class.cs (Indexer.Define): Use an auxiliary method to implement
22294 the other bits of the method definition. Begin support for
22295 explicit interface implementation.
22297 (Property.DefineMethod): Use TypeManager.void_type instead of null
22298 for an empty return value.
22300 2001-12-26 Miguel de Icaza <miguel@ximian.com>
22302 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
22303 dealing with a FieldExpr which is composed of a FieldBuilder, in
22304 the code path we did extract the constant, but we should have
22305 obtained the underlying value to be able to cast it (otherwise we
22306 end up in an infinite loop, this is what Ravi was running into).
22308 (ArrayCreation.UpdateIndices): Arrays might be empty.
22310 (MemberAccess.ResolveMemberAccess): Add support for section
22311 14.5.4.1 that deals with the special case of E.I when E is a type
22312 and something else, that I can be a reference to a static member.
22314 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
22315 handle a particular array type to create byte blobs, it is just
22316 something we dont generate byteblobs for.
22318 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
22321 * location.cs (Push): remove the key from the hashtable that we
22322 are about to add. This happens for empty files.
22324 * driver.cs: Dispose files after we have parsed them.
22326 (tokenize): new function that only runs the tokenizer on its
22327 input, for speed testing.
22329 2001-12-26 Ravi Pratap <ravi@ximian.com>
22331 * class.cs (Event.Define): Define the private field only if there
22332 are no accessors defined.
22334 * expression.cs (ResolveMemberAccess): If there is no associated
22335 field with the event, that means we have an event defined with its
22336 own accessors and we should flag error cs0070 since transforming
22337 ourselves into a field is not valid in that case.
22339 * ecore.cs (SimpleName.DoResolve): Same as above.
22341 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
22342 and charset to sane values.
22344 2001-12-25 Ravi Pratap <ravi@ximian.com>
22346 * assign.cs (DoResolve): Perform check on events only if they
22347 are being accessed outside the declaring type.
22349 * cs-parser.jay (event_declarations): Update rules to correctly
22350 set the type of the implicit parameter etc.
22352 (add_accessor, remove_accessor): Set current local parameters.
22354 * expression.cs (Binary): For delegate addition and subtraction,
22355 cast the return value from the method into the appropriate delegate
22358 2001-12-24 Ravi Pratap <ravi@ximian.com>
22360 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
22361 of these as the workaround is unnecessary.
22363 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
22364 delegate data - none of that is needed at all.
22366 Re-write bits to extract the instance expression and the delegate method
22369 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
22372 * attribute.cs (ApplyAttributes): New method to take care of common tasks
22373 of attaching attributes instead of duplicating code everywhere.
22375 * everywhere : Update code to do attribute emission using the above method.
22377 2001-12-23 Miguel de Icaza <miguel@ximian.com>
22379 * expression.cs (IsParamsMethodApplicable): if there are not
22380 parameters, return immediately.
22382 * ecore.cs: The 0 literal can be implicity converted to an enum
22385 (SimpleName.DoResolve): First lookup the type, then lookup the
22388 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
22389 want to get its address. If the InstanceExpression is not
22390 addressable, store the result in a temporary variable, then get
22393 * codegen.cs: Only display 219 errors on warning level or above.
22395 * expression.cs (ArrayAccess): Make it implement the
22396 IMemoryLocation interface.
22398 (Binary.DoResolve): handle the operator == (object a, object b)
22399 and operator != (object a, object b) without incurring into a
22400 BoxedCast (because 5 != o should never be performed).
22402 Handle binary enumerator operators.
22404 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
22405 value type, otherwise use Ldelem_ref.
22407 Use precomputed names;
22409 (AddressOf): Implement address of
22411 * cs-parser.jay (labeled_statement): Fix recursive block
22412 addition by reworking the production.
22414 * expression.cs (New.DoEmit): New has a special case:
22416 If we are dealing with a ValueType, we have a few
22417 situations to deal with:
22419 * The target of New is a ValueType variable, that is
22420 easy, we just pass this as the variable reference
22422 * The target of New is being passed as an argument,
22423 to a boxing operation or a function that takes a
22426 In this case, we need to create a temporary variable
22427 that is the argument of New.
22430 2001-12-23 Ravi Pratap <ravi@ximian.com>
22432 * rootcontext.cs (LookupType): Check that current_type is not null before
22433 going about looking at nested types.
22435 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
22436 not implement the IAssignMethod interface any more.
22438 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
22439 where we tranform them into FieldExprs if they are being resolved from within
22440 the declaring type.
22442 * ecore.cs (SimpleName.DoResolve): Do the same here.
22444 * assign.cs (DoResolve, Emit): Clean up code considerably.
22446 * ../errors/bug10.cs : Add.
22448 * ../errors/cs0070.cs : Add.
22450 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
22452 * assign.cs : Get rid of EventIsLocal everywhere.
22454 2001-12-23 Miguel de Icaza <miguel@ximian.com>
22456 * ecore.cs (ConvertIntLiteral): finished the implementation.
22458 * statement.cs (SwitchLabel): Convert the value we are using as a
22459 key before looking up the table.
22461 2001-12-22 Miguel de Icaza <miguel@ximian.com>
22463 * codegen.cs (EmitTopBlock): Require a Location argument now.
22465 * cs-parser.jay (constructor_declarator): We need to setup
22466 current_local_parameters before we parse the
22467 opt_constructor_initializer, to allow the variables to be bound
22468 to the constructor arguments.
22470 * rootcontext.cs (LookupType): First lookup nested classes in our
22471 class and our parents before we go looking outside our class.
22473 * expression.cs (ConstantFold): Extract/debox the values at the
22476 * rootcontext.cs (EmitCode): Resolve the constants first before we
22477 resolve the types. This is not really needed, but it helps debugging.
22479 * statement.cs: report location.
22481 * cs-parser.jay: pass location to throw statement.
22483 * driver.cs: Small bug fix.
22485 * report.cs: Updated format to be 4-zero filled digits.
22487 2001-12-22 Ravi Pratap <ravi@ximian.com>
22489 * expression.cs (CheckIndices): Fix minor bug where the wrong
22490 variable was being referred to ;-)
22492 (DoEmit): Do not call EmitStaticInitializers when the
22493 underlying type is System.Object.
22495 2001-12-21 Ravi Pratap <ravi@ximian.com>
22497 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
22498 and do the usual workaround for SRE.
22500 * class.cs (MyEventBuilder.EventType): New member to get at the type
22501 of the event, quickly.
22503 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
22505 * assign.cs (Assign.DoResolve): Handle the case when the target
22506 is an EventExpr and perform the necessary checks.
22508 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
22511 (SimpleName.MemberStaticCheck): Include check for EventExpr.
22513 (EventExpr): Set the type in the constructor itself since we
22514 are meant to be born fully resolved.
22516 (EventExpr.Define): Revert code I wrote earlier.
22518 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
22519 instance expression is null. The instance expression is a This in that case
22520 or a null, depending on whether it is a static method or not.
22522 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
22523 refers to more than one method.
22525 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
22526 and accordingly flag errors.
22528 2001-12-21 Miguel de Icaza <miguel@ximian.com>
22530 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
22532 2001-12-22 Miguel de Icaza <miguel@ximian.com>
22534 * location.cs (ToString): Provide useful rutine.
22536 2001-12-21 Miguel de Icaza <miguel@ximian.com>
22538 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
22539 objects, return the actual integral boxed.
22541 * statement.cs (SwitchLabel): define an ILLabel for each
22544 (Switch.CheckSwitch): If the value is a Literal, extract
22545 the underlying literal.
22547 Also in the unused hashtable we had, add the SwitchLabel so we can
22548 quickly look this value up.
22550 * constant.cs: Implement a bunch of new constants. Rewrite
22551 Literal based on this. Made changes everywhere to adapt to this.
22553 * expression.cs (Expression.MakeByteBlob): Optimize routine by
22554 dereferencing array only once, and also copes with enumrations.
22556 bytes are two bytes wide, not one.
22558 (Cast): Perform constant conversions.
22560 * ecore.cs (TryImplicitIntConversion): Return literals instead of
22561 wrappers to the literals here.
22563 * expression.cs (DoNumericPromotions): long literals can converted
22564 to ulong implicity (this is taken care of elsewhere, but I was
22565 missing this spot).
22567 * ecore.cs (Expression.Literalize): Make the return type Literal,
22568 to improve type checking.
22570 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
22572 2001-12-20 Miguel de Icaza <miguel@ximian.com>
22574 * literal.cs: Revert code from ravi that checked the bounds. The
22575 bounds are sane by the definition of the type itself.
22577 * typemanager.cs: Fix implementation of ImplementsInterface. We
22578 need to actually look up in our parent hierarchy for interfaces
22581 * const.cs: Use the underlying type for enumerations
22583 * delegate.cs: Compute the basename for the delegate creation,
22584 that should fix the delegate test case, and restore the correct
22585 Type Lookup semantics in rootcontext
22587 * rootcontext.cs: Revert Ravi's last patch. The correct way of
22588 referencing a nested type with the Reflection API is using the "+"
22591 * cs-parser.jay: Do not require EOF token at the end.
22593 2001-12-20 Ravi Pratap <ravi@ximian.com>
22595 * rootcontext.cs (LookupType): Concatenate type names with
22596 a '.' instead of a '+' The test suite passes again.
22598 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
22599 field of the enumeration.
22601 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
22602 the case when the member is an EventExpr.
22604 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
22605 static has an associated instance expression.
22607 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
22609 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
22611 * class.cs (Event.Define): Register event and perform appropriate checks
22614 We define the Add and Remove methods even if the use provides none because
22615 in that case, we provide default implementations ourselves.
22617 Define a private field of the type of the event. This is done by the CSC compiler
22618 and we should be doing it too ;-)
22620 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
22621 More methods we use in code we generate.
22623 (multicast_delegate_type, delegate_type): Two separate types since the distinction
22626 (InitCoreTypes): Update accordingly for the above.
22628 * class.cs (Event.Emit): Generate code for default accessors that we provide
22630 (EmitDefaultMethod): Do the job in the above.
22632 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
22635 2001-12-20 Miguel de Icaza <miguel@ximian.com>
22637 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
22638 builders even if we were missing one.
22640 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
22641 pass the Basename as our class name instead of the Name. The
22642 basename will be correctly composed for us.
22644 * parameter.cs (Paramters): Now takes a Location argument.
22646 * decl.cs (DeclSpace.LookupType): Removed convenience function and
22647 make all the code call directly LookupType in RootContext and take
22648 this chance to pass the Location information everywhere.
22650 * Everywhere: pass Location information.
22652 2001-12-19 Miguel de Icaza <miguel@ximian.com>
22654 * class.cs (Constructor.Define): Updated way of detecting the
22655 length of the parameters.
22657 (TypeContainer.DefineType): Use basename as the type name for
22660 (TypeContainer.Define): Do not recursively define types here, as
22661 definition is taken care in order by the RootContext.
22663 * tree.cs: Keep track of namespaces in a per-file basis.
22665 * parameter.cs (Parameter.ComputeSignature): Update to use
22668 (Parameters.GetSignature): ditto.
22670 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
22671 instead of a TypeContainer.
22673 (Interface.SemanticAnalysis): Use `this' instead of our parent to
22674 resolve names. Because we need to be resolve in our context, not
22677 * driver.cs: Implement response files.
22679 * class.cs (TypeContainer.DefineType): If we are defined, do not
22680 redefine ourselves.
22682 (Event.Emit): Emit the code for add/remove handlers.
22683 (Event.Define): Save the MethodBuilders for add/remove.
22685 * typemanager.cs: Use pair here too.
22687 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
22688 DictionaryEntry requires the first argument to be non-null.
22690 (enum_declaration): Compute full name for registering the
22693 (delegate_declaration): Instead of using
22694 formal_parameter_list, use opt_formal_parameter_list as the list
22697 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
22698 (EventParsing): New property that controls whether `add' and
22699 `remove' are returned as tokens or identifiers (for events);
22701 2001-12-19 Ravi Pratap <ravi@ximian.com>
22703 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
22704 use MyEventBuilder only and let it wrap the real builder for us.
22706 (MyEventBuilder): Revamp constructor etc.
22708 Implement all operations that we perform on EventBuilder in precisely the same
22711 (FindMembers): Update to use the EventBuilder member.
22713 (Event.Emit): Update accordingly.
22715 2001-12-18 Ravi Pratap <ravi@ximian.com>
22717 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
22718 by calling the appropriate methods.
22720 (GetCustomAttributes): Make stubs as they cannot possibly do anything
22723 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
22725 2001-12-17 Ravi Pratap <ravi@ximian.com>
22727 * delegate.cs (Delegate.Populate): Check that the return type
22728 and various parameters types are indeed accessible.
22730 * class.cs (Constructor.Define): Same here.
22732 (Field.Define): Ditto.
22734 (Event.Define): Ditto.
22736 (Operator.Define): Check that the underlying Method defined itself
22737 correctly - so it's MethodBuilder should not be null.
22739 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
22740 expression happens to be null.
22742 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
22743 members but as of now we don't seem to be able to do anything really useful with it.
22745 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
22746 not the EventBuilder.
22748 2001-12-18 Miguel de Icaza <miguel@ximian.com>
22750 * cs-tokenizer.cs: Add support for defines.
22751 Add support for #if, #elif, #else, #endif
22753 (eval_var): evaluates a variable.
22754 (eval): stubbed for evaluating functions.
22756 * cs-parser.jay: Pass the defines information
22758 * driver.cs: Add --define command line option.
22760 * decl.cs: Move MemberCore here.
22762 Make it the base class for DeclSpace. This allows us to catch and
22763 report 108 and 109 for everything now.
22765 * class.cs (TypeContainer.Define): Extract all the members
22766 before populating and emit the warning 108 (new keyword required
22767 to override) instead of having each member implement this.
22769 (MemberCore.Define): New abstract method, we will be using this in
22770 the warning reporting engine in Populate.
22772 (Operator.Define): Adjust to new MemberCore protocol.
22774 * const.cs (Const): This does not derive from Expression, it is a
22775 temporary object we use to create fields, it is a MemberCore.
22777 * class.cs (Method.Define): Allow the entry point to be in a
22780 * driver.cs: Rewrite the argument handler to clean it up a bit.
22782 * rootcontext.cs: Made it just an auxiliary namespace feature by
22783 making everything static.
22785 * driver.cs: Adapt code to use RootContext type name instead of
22788 * delegate.cs: Remove RootContext argument.
22790 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
22793 * class.cs (Event.Define): The lookup can fail.
22795 * cs-tokenizer.cs: Begin implementation of pre-procesor.
22797 * expression.cs: Resolve the this instance before invoking the code.
22799 2001-12-17 Miguel de Icaza <miguel@ximian.com>
22801 * cs-parser.jay: Add a production in element_access that allows
22802 the thing to become a "type" reference. This way we can parse
22803 things like "(string [])" as a type.
22805 Note that this still does not handle the more complex rules of
22809 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
22811 * ecore.cs: (CopyNewMethods): new utility function used to
22812 assemble the list of methods from running FindMembers.
22814 (MemberLookup): Rework FindMembers so that
22816 2001-12-16 Miguel de Icaza <miguel@ximian.com>
22818 * class.cs (TypeContainer): Remove Delegates who fail to be
22821 * delegate.cs (Populate): Verify that we dont get null return
22822 values. TODO: Check for AsAccessible.
22824 * cs-parser.jay: Use basename to emit error 574 (destructor should
22825 have the same name as container class), not the full name.
22827 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
22828 possible representation.
22830 Also implements integer type suffixes U and L.
22832 2001-12-15 Miguel de Icaza <miguel@ximian.com>
22834 * expression.cs (ArrayCreation.DoResolve): We need to do the
22835 argument resolution *always*.
22837 * decl.cs: Make this hold the namespace. Hold the root context as
22839 (LookupType): Move here.
22841 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
22843 * location.cs (Row, Name): Fixed the code, it was always returning
22844 references to the first file.
22846 * interface.cs: Register properties defined through interfaces.
22848 * driver.cs: Add support for globbing on the command line
22850 * class.cs (Field): Make it derive from MemberCore as well.
22853 2001-12-15 Ravi Pratap <ravi@ximian.com>
22855 * class.cs (Event::Define): Check that the type of the event is a delegate
22856 type else flag error #66.
22858 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
22861 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
22862 values of EntryPoint, CharSet etc etc.
22864 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
22866 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
22867 be null and we should ignore this. I am not sure if this is really clean. Apparently,
22868 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
22869 which needs this to do its work.
22871 * ../errors/cs0066.cs : Add.
22873 2001-12-14 Miguel de Icaza <miguel@ximian.com>
22875 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
22878 * class.cs: (MethodSignature.MethodSignature): Removed hack that
22879 clears out the parameters field.
22880 (MemberSignatureCompare): Cleanup
22882 (MemberCore): New base class used to share code between MethodCore
22885 (RegisterRequiredImplementations) BindingFlags.Public requires
22886 either BindingFlags.Instace or Static. Use instance here.
22888 (Property): Refactored code to cope better with the full spec.
22890 * parameter.cs (GetParameterInfo): Return an empty array instead
22893 * class.cs (Property): Abstract or extern properties have no bodies.
22895 * parameter.cs (GetParameterInfo): return a zero-sized array.
22897 * class.cs (TypeContainer.MethodModifiersValid): Move all the
22898 method modifier validation to the typecontainer so we can reuse
22899 this on properties.
22901 (MethodCore.ParameterTypes): return an empty sized array of types.
22903 (Property.Define): Test property modifier validity.
22905 Add tests for sealed/override too.
22907 (Method.Emit): abstract or extern methods have no bodies.
22909 2001-12-14 Ravi Pratap <ravi@ximian.com>
22911 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
22914 (Method::Define, ::Emit): Modify accordingly.
22916 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
22918 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
22920 * makefile: Pass in /unsafe.
22922 2001-12-13 Miguel de Icaza <miguel@ximian.com>
22924 * class.cs (MakeKey): Kill routine.
22926 * class.cs (TypeContainer.Define): Correctly define explicit
22927 method implementations (they require the full interface name plus
22930 * typemanager.cs: Deply the PtrHashtable here and stop using the
22931 lame keys. Things work so much better.
22933 This of course broke everyone who depended on `RegisterMethod' to
22934 do the `test for existance' test. This has to be done elsewhere.
22936 * support.cs (PtrHashtable): A hashtable that avoid comparing with
22937 the object stupid Equals method (because, that like fails all over
22938 the place). We still do not use it.
22940 * class.cs (TypeContainer.SetRequiredInterface,
22941 TypeContainer.RequireMethods): Killed these two routines and moved
22942 all the functionality to RegisterRequiredImplementations.
22944 (TypeContainer.RegisterRequiredImplementations): This routine now
22945 registers all the implementations required in an array for the
22946 interfaces and abstract methods. We use an array of structures
22947 which can be computed ahead of time to reduce memory usage and we
22948 also assume that lookups are cheap as most classes will not
22949 implement too many interfaces.
22951 We also avoid creating too many MethodSignatures.
22953 (TypeContainer.IsInterfaceMethod): Update and optionally does not
22954 clear the "pending" bit if we find that there are problems with
22957 (TypeContainer.VerifyPendingMethods): Update to report errors of
22958 methods that look like implementations but are not.
22960 (TypeContainer.Define): Add support for explicit interface method
22963 2001-12-12 Miguel de Icaza <miguel@ximian.com>
22965 * typemanager.cs: Keep track of the parameters here instead of
22966 being a feature of the TypeContainer.
22968 * class.cs: Drop the registration of parameters here, as
22969 InterfaceMethods are also interface declarations.
22971 * delegate.cs: Register methods with the TypeManager not only with
22972 the TypeContainer. This code was buggy.
22974 * interface.cs: Full registation here.
22976 2001-12-11 Miguel de Icaza <miguel@ximian.com>
22978 * expression.cs: Remove reducer for binary expressions, it can not
22981 * const.cs: Put here the code that used to go into constant.cs
22983 * constant.cs: Put here the code for constants, this is a new base
22984 class for Literals.
22986 * literal.cs: Make Literal derive from Constant.
22988 2001-12-09 Miguel de Icaza <miguel@ximian.com>
22990 * statement.cs (Return.Emit): Report error 157 if the user
22991 attempts to return from a finally block.
22993 (Return.Emit): Instead of emitting a return, jump to the end of
22996 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
22997 LocalBuilder to store the result of the function. ReturnLabel is
22998 the target where we jump.
23001 2001-12-09 Radek Doulik <rodo@ximian.com>
23003 * cs-parser.jay: remember alias in current namespace
23005 * ecore.cs (SimpleName::DoResolve): use aliases for types or
23008 * class.cs (LookupAlias): lookup alias in my_namespace
23010 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
23012 (LookupAlias): lookup alias in this and if needed in parent
23015 2001-12-08 Miguel de Icaza <miguel@ximian.com>
23019 * rootcontext.cs: (ModuleBuilder) Made static, first step into
23020 making things static. I need this to avoid passing the
23021 TypeContainer when calling ParameterType.
23023 * support.cs (InternalParameters.ParameterType): Remove ugly hack
23024 that did string manipulation to compute the type and then call
23025 GetType. Use Parameter.ParameterType instead.
23027 * cs-tokenizer.cs: Consume the suffix for floating values.
23029 * expression.cs (ParameterReference): figure out whether this is a
23030 reference parameter or not. Kill an extra variable by computing
23031 the arg_idx during emission.
23033 * parameter.cs (Parameters.GetParameterInfo): New overloaded
23034 function that returns whether a parameter is an out/ref value or not.
23036 (Parameter.ParameterType): The type of the parameter (base,
23037 without ref/out applied).
23039 (Parameter.Resolve): Perform resolution here.
23040 (Parameter.ExternalType): The full type (with ref/out applied).
23042 * statement.cs (Using.Emit, Using.EmitExpression): Implement
23043 support for expressions on the using statement.
23045 2001-12-07 Miguel de Icaza <miguel@ximian.com>
23047 * statement.cs (Using.EmitLocalVariableDecls): Split the
23048 localvariable handling of the using statement.
23050 (Block.EmitMeta): Keep track of variable count across blocks. We
23051 were reusing slots on separate branches of blocks.
23053 (Try.Emit): Emit the general code block, we were not emitting it.
23055 Check the type of the declaration to be an IDisposable or
23056 something that can be implicity converted to it.
23058 Emit conversions if required.
23060 * ecore.cs (EmptyExpression): New utility class.
23061 (Expression.ImplicitConversionExists): New utility function.
23063 2001-12-06 Miguel de Icaza <miguel@ximian.com>
23065 * statement.cs (Using): Implement.
23067 * expression.cs (LocalVariableReference): Support read only variables.
23069 * statement.cs: Remove the explicit emit for the Leave opcode.
23070 (VariableInfo): Add a readonly field.
23072 2001-12-05 Miguel de Icaza <miguel@ximian.com>
23074 * ecore.cs (ConvCast): new class used to encapsulate the various
23075 explicit integer conversions that works in both checked and
23076 unchecked contexts.
23078 (Expression.ConvertNumericExplicit): Use new ConvCast class to
23079 properly generate the overflow opcodes.
23081 2001-12-04 Miguel de Icaza <miguel@ximian.com>
23083 * statement.cs: The correct type for the EmptyExpression is the
23084 element_type, not the variable type. Ravi pointed this out.
23086 2001-12-04 Ravi Pratap <ravi@ximian.com>
23088 * class.cs (Method::Define): Handle PInvoke methods specially
23089 by using DefinePInvokeMethod instead of the usual one.
23091 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
23092 above to do the task of extracting information and defining the method.
23094 2001-12-04 Ravi Pratap <ravi@ximian.com>
23096 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
23097 of the condition for string type.
23099 (Emit): Move that here.
23101 (ArrayCreation::CheckIndices): Keep string literals in their expression
23104 (EmitDynamicInitializers): Handle strings appropriately.
23106 2001-12-04 Miguel de Icaza <miguel@ximian.com>
23108 * codegen.cs (EmitContext): Replace multiple variables with a
23109 single pointer to the current Switch statement.
23111 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
23114 2001-12-03 Miguel de Icaza <miguel@ximian.com>
23118 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
23121 (Foreach.Emit): Foreach on arrays was not setting
23122 up the loop variables (for break/continue).
23124 (GotoCase): Semi-implented.
23126 2001-12-03 Ravi Pratap <ravi@ximian.com>
23128 * attribute.cs (CheckAttribute): Handle system attributes by using
23129 Attribute.GetAttributes to examine information we need.
23131 (GetValidPlaces): Same here.
23133 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
23135 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
23137 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
23139 (Method::Define): Set appropriate flags if we have a DllImport attribute.
23141 (Method::Emit): Handle the case when we are a PInvoke method.
23143 2001-12-03 Miguel de Icaza <miguel@ximian.com>
23145 * expression.cs: Use ResolveWithSimpleName on compound names.
23147 2001-12-02 Ravi Pratap <ravi@ximian.com>
23149 * constant.cs (EmitConstant): Make sure we resolve the associated expression
23150 before trying to reduce it.
23152 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
23154 * constant.cs (LookupConstantValue): Implement.
23156 (EmitConstant): Use the above in emitting the constant.
23158 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
23159 that are user-defined by doing a LookupConstantValue on them.
23161 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
23164 2001-11-29 Miguel de Icaza <miguel@ximian.com>
23166 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
23168 (BaseAccess.DoResolve): Implement.
23170 (MemberAccess.DoResolve): Split this routine into a
23171 ResolveMemberAccess routine that can be used independently
23173 2001-11-28 Miguel de Icaza <miguel@ximian.com>
23175 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
23176 As that share bits of the implementation. Is returns a boolean,
23177 while As returns the Type that is being probed.
23179 2001-12-01 Ravi Pratap <ravi@ximian.com>
23181 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
23182 instead of a Literal - much easier.
23184 (EnumInTransit): Remove - utterly useless :-)
23186 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
23188 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
23190 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
23191 chain when we have no associated expression.
23193 2001-11-30 Ravi Pratap <ravi@ximian.com>
23195 * constant.cs (Define): Use Location while reporting the errror.
23197 Also emit a warning when 'new' is used and there is no inherited
23200 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
23203 (LookupEnumValue): Implement to lookup an enum member's value and define it
23206 (Populate): Re-write accordingly to use the above routine.
23208 2001-11-27 Miguel de Icaza <miguel@ximian.com>
23210 * expression.cs (This): Fix prototype for DoResolveLValue to
23211 override the base class DoResolveLValue.
23213 * cs-parser.cs: Report errors cs574 and cs575 (destructor
23216 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
23217 (we need to load the address of the field here). This fixes
23220 (FieldExpr.DoResolveLValue): Call the DoResolve
23221 function to initialize the Instance expression.
23223 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
23224 correctly the GetEnumerator operation on a value type.
23226 * cs-parser.jay: Add more simple parsing error catches.
23228 * statement.cs (Switch): Add support for string switches.
23229 Handle null specially.
23231 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
23233 2001-11-28 Ravi Pratap <ravi@ximian.com>
23235 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
23237 (declare_local_constant): New helper function.
23239 * statement.cs (AddConstant): Keep a separate record of constants
23241 (IsConstant): Implement to determine if a variable is a constant.
23243 (GetConstantExpression): Implement.
23245 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
23247 * statement.cs (IsVariableDefined): Re-write.
23249 2001-11-27 Ravi Pratap <ravi@ximian.com>
23251 * class.cs (TypeContainer::FindMembers): Look for constants
23252 in the case when we are looking for MemberTypes.Field
23254 * expression.cs (MemberAccess::DoResolve): Check that in the
23255 case we are a FieldExpr and a Literal, we are not being accessed
23256 by an instance reference.
23258 * cs-parser.jay (local_constant_declaration): Implement.
23260 (declaration_statement): Implement for constant declarations.
23262 2001-11-26 Miguel de Icaza <miguel@ximian.com>
23264 * statement.cs (Switch): Catch double defaults.
23266 (Switch): More work on the switch() statement
23267 implementation. It works for integral values now, need to finish
23271 2001-11-24 Miguel de Icaza <miguel@ximian.com>
23273 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
23274 integer literals into other integer literals. To be used by
23277 2001-11-24 Ravi Pratap <ravi@ximian.com>
23279 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
23282 (EmitDynamicInitializers): Cope with the above since we extract data
23283 directly from ArrayData now.
23285 (ExpectInitializers): Keep track of whether initializers are mandatory
23288 (Bounds): Make it a hashtable to prevent the same dimension being
23289 recorded for every element in that dimension.
23291 (EmitDynamicInitializers): Fix bug which prevented the Set array method
23294 Also fix bug which was causing the indices to be emitted in the reverse
23297 2001-11-24 Miguel de Icaza <miguel@ximian.com>
23299 * expression.cs (ArrayCreation): Implement the bits that Ravi left
23300 unfinished. They do not work, because the underlying code is
23303 2001-11-22 Miguel de Icaza <miguel@ximian.com>
23305 * cs-parser.jay: Remove bogus fixme.
23307 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
23308 on Switch statement.
23310 2001-11-23 Ravi Pratap <ravi@ximian.com>
23312 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
23315 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
23316 parameter. Apparently, any expression is allowed.
23318 (ValidateInitializers): Update accordingly.
23320 (CheckIndices): Fix some tricky bugs thanks to recursion.
23322 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
23323 I was being completely brain-dead.
23325 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
23326 and re-write acordingly.
23328 (DelegateInvocation): Re-write accordingly.
23330 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
23332 (MakeByteBlob): Handle types more correctly.
23334 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
23335 initialization from expressions but it is incomplete because I am a complete
23338 2001-11-22 Miguel de Icaza <miguel@ximian.com>
23340 * statement.cs (If.Emit): Fix a bug that generated incorrect code
23341 on If. Basically, we have to return `true' (ie, we do return to
23342 our caller) only if both branches of the if return.
23344 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
23345 short-circuit operators, handle them as short circuit operators.
23347 (Cast.DoResolve): Resolve type.
23348 (Cast.Cast): Take an expression as the target type.
23350 * cs-parser.jay (cast_expression): Remove old hack that only
23351 allowed a limited set of types to be handled. Now we take a
23352 unary_expression and we resolve to a type during semantic
23355 Use the grammar productions from Rhys to handle casts (this is
23356 not complete like Rhys syntax yet, we fail to handle that corner
23357 case that C# has regarding (-x), but we will get there.
23359 2001-11-22 Ravi Pratap <ravi@ximian.com>
23361 * class.cs (EmitFieldInitializer): Take care of the case when we have a
23362 field which is an array type.
23364 * cs-parser.jay (declare_local_variables): Support array initialization too.
23366 * typemanager.cs (MakeKey): Implement.
23368 (everywhere): Use the above appropriately.
23370 * cs-parser.jay (for_statement): Update for array initialization while
23371 declaring variables.
23373 * ecore.cs : The error message was correct, it's the variable's names that
23374 were misleading ;-) Make the code more readable.
23376 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
23377 the correct type etc.
23379 (ConvertExplicit): Handle Enum types by examining the underlying type.
23381 2001-11-21 Ravi Pratap <ravi@ximian.com>
23383 * parameter.cs (GetCallingConvention): Always return
23384 CallingConventions.Standard for now.
23386 2001-11-22 Miguel de Icaza <miguel@ximian.com>
23388 * expression.cs (Binary.ResolveOperator): Update the values of `l'
23389 and `r' after calling DoNumericPromotions.
23391 * ecore.cs: Fix error message (the types were in the wrong order).
23393 * statement.cs (Foreach.ProbeCollectionType): Need to pass
23394 BindingFlags.Instance as well
23396 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
23397 implicit int literal conversion in an empty cast so that we
23398 propagate the right type upstream.
23400 (UnboxCast): new class used to unbox value types.
23401 (Expression.ConvertExplicit): Add explicit type conversions done
23404 (Expression.ImplicitNumericConversion): Oops, forgot to test for
23405 the target type before applying the implicit LongLiterals to ULong
23408 2001-11-21 Miguel de Icaza <miguel@ximian.com>
23410 * cs-parser.jay (for_statement): Reworked the way For works: now
23411 we declare manually any variables that are introduced in
23412 for_initializer to solve the problem of having out-of-band code
23413 emition (that is what got for broken).
23415 (declaration_statement): Perform the actual variable declaration
23416 that used to be done in local_variable_declaration here.
23418 (local_variable_declaration): Do not declare anything, just pass
23419 the information on a DictionaryEntry
23421 2001-11-20 Ravi Pratap <ravi@ximian.com>
23423 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
23424 re-write of the logic to now make it recursive.
23426 (UpdateIndices): Re-write accordingly.
23428 Store element data in a separate ArrayData list in the above methods.
23430 (MakeByteBlob): Implement to dump the array data into a byte array.
23432 2001-11-19 Ravi Pratap <ravi@ximian.com>
23434 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
23437 * constant.cs (Define): Implement.
23439 (EmitConstant): Re-write fully.
23441 Pass in location info.
23443 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
23446 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
23447 DictionaryEntry since we need location info too.
23449 (constant_declaration): Update accordingly.
23451 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
23452 code into another method : UpdateIndices.
23454 2001-11-18 Ravi Pratap <ravi@ximian.com>
23456 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
23457 some type checking etc.
23459 2001-11-17 Ravi Pratap <ravi@ximian.com>
23461 * expression.cs (ArrayCreation::ValidateInitializers): Implement
23462 bits to provide dimension info if the user skips doing that.
23464 Update second constructor to store the rank correctly.
23466 2001-11-16 Ravi Pratap <ravi@ximian.com>
23468 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
23469 and try to implement.
23471 * ../errors/cs0150.cs : Add.
23473 * ../errors/cs0178.cs : Add.
23475 2001-11-16 Miguel de Icaza <miguel@ximian.com>
23477 * statement.cs: Implement foreach on multi-dimensional arrays.
23479 * parameter.cs (Parameters.GetParameterByName): Also lookup the
23480 name of the params argument.
23482 * expression.cs: Use EmitStoreOpcode to get the right opcode while
23483 initializing the array.
23485 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
23486 we can use this elsewhere.
23488 * statement.cs: Finish implementation of foreach for single
23491 * cs-parser.jay: Use an out-of-band stack to pass information
23492 around, I wonder why I need this.
23494 foreach_block: Make the new foreach_block the current_block.
23496 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
23497 function used to return a static Parameters structure. Used for
23498 empty parameters, as those are created very frequently.
23500 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
23502 2001-11-15 Ravi Pratap <ravi@ximian.com>
23504 * interface.cs : Default modifier is private, not public. The
23505 make verify test passes again.
23507 2001-11-15 Ravi Pratap <ravi@ximian.com>
23509 * support.cs (ReflectionParameters): Fix logic to determine
23510 whether the last parameter is a params one. Test 9 passes again.
23512 * delegate.cs (Populate): Register the builders we define with
23513 RegisterParameterForBuilder. Test 19 passes again.
23515 * cs-parser.jay (property_declaration): Reference $6 instead
23516 of $$ to get at the location.
23518 (indexer_declaration): Similar stuff.
23520 (attribute): Ditto.
23522 * class.cs (Property): Register parameters for the Get and Set methods
23523 if they exist. Test 23 passes again.
23525 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
23526 call to EmitArguments as we are sure there aren't any params arguments.
23527 Test 32 passes again.
23529 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
23530 IndexOutOfRangeException.
23532 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
23533 Test 33 now passes again.
23535 2001-11-15 Miguel de Icaza <miguel@ximian.com>
23537 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
23538 broke a bunch of things. Will have to come up with a better way
23539 of tracking locations.
23541 * statement.cs: Implemented foreach for single dimension arrays.
23543 2001-11-09 Miguel de Icaza <miguel@ximian.com>
23545 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
23546 an error. This removes the lookup from the critical path.
23548 * cs-parser.jay: Removed use of temporary_loc, which is completely
23551 2001-11-14 Miguel de Icaza <miguel@ximian.com>
23553 * support.cs (ReflectionParameters.ParameterModifier): Report
23554 whether the argument is a PARAMS argument or not.
23556 * class.cs: Set the attribute `ParamArrayAttribute' on the
23557 parameter argument.
23559 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
23560 and cons_param_array_attribute (ConstructorInfo for
23561 ParamArrayAttribute).,
23563 * codegen.cs: Emit the return using the `Return' statement, that
23564 way we can report the error correctly for missing return values.
23566 * class.cs (Method.Emit): Clean up.
23568 * expression.cs (Argument.Resolve): Take another argument: the
23569 location where this argument is used. Notice that this is not
23570 part of the "Argument" class as to reduce the size of the
23571 structure (we know the approximate location anyways).
23573 Test if the argument is a variable-reference, if not, then
23574 complain with a 206.
23576 (Argument.Emit): Emit addresses of variables.
23578 (Argument.FullDesc): Simplify.
23580 (Invocation.DoResolve): Update for Argument.Resolve.
23582 (ElementAccess.DoResolve): ditto.
23584 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
23585 method should be virtual, as this method is always virtual.
23587 (NewDelegate.DoResolve): Update for Argument.Resolve.
23589 * class.cs (ConstructorInitializer.DoResolve): ditto.
23591 * attribute.cs (Attribute.Resolve): ditto.
23593 2001-11-13 Miguel de Icaza <miguel@ximian.com>
23595 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
23597 * expression.cs (ParameterReference): Drop IStackStorage and implement
23598 IAssignMethod instead.
23600 (LocalVariableReference): ditto.
23602 * ecore.cs (FieldExpr): Drop IStackStorage and implement
23603 IAssignMethod instead.
23605 2001-11-13 Miguel de Icaza <miguel@ximian.com>
23607 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
23608 enumerations that are used in heavily used structures derive from
23609 byte in a laughable and pathetic attempt to reduce memory usage.
23610 This is the kind of pre-optimzations that you should not do at
23611 home without adult supervision.
23613 * expression.cs (UnaryMutator): New class, used to handle ++ and
23614 -- separatedly from the other unary operators. Cleans up the
23615 code, and kills the ExpressionStatement dependency in Unary.
23617 (Unary): Removed `method' and `Arguments' from this class, making
23618 it smaller, and moving it all to SimpleCall, so I can reuse this
23619 code in other locations and avoid creating a lot of transient data
23620 strucutres when not required.
23622 * cs-parser.jay: Adjust for new changes.
23624 2001-11-11 Miguel de Icaza <miguel@ximian.com>
23626 * enum.cs (Enum.Populate): If there is a failure during
23629 * cs-parser.jay (opt_enum_base): we used to catch type errors
23630 here, but this is really incorrect. The type error should be
23631 catched during semantic analysis.
23633 2001-12-11 Ravi Pratap <ravi@ximian.com>
23635 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
23636 current_local_parameters as expected since I, in my stupidity, had forgotten
23639 * attribute.cs (GetValidPlaces): Fix stupid bug.
23641 * class.cs (Method::Emit): Perform check on applicability of attributes.
23643 (Constructor::Emit): Ditto.
23645 (Field::Emit): Ditto.
23647 (Field.Location): Store location information.
23649 (Property, Event, Indexer, Operator): Ditto.
23651 * cs-parser.jay (field_declaration): Pass in location for each field.
23653 * ../errors/cs0592.cs : Add.
23655 2001-11-12 Ravi Pratap <ravi@ximian.com>
23657 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
23659 (InitCoreTypes): Update accordingly.
23661 (RegisterAttrType, LookupAttr): Implement.
23663 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
23664 info about the same.
23666 (Resolve): Update to populate the above as necessary.
23668 (Error592): Helper.
23670 (GetValidPlaces): Helper to the above.
23672 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
23674 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
23676 2001-11-12 Ravi Pratap <ravi@ximian.com>
23678 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
23680 * ../errors/cs0617.cs : Add.
23682 2001-11-11 Ravi Pratap <ravi@ximian.com>
23684 * enum.cs (Emit): Rename to Populate to be more consistent with what
23685 we expect it to do and when exactly it is called.
23687 * class.cs, rootcontext.cs : Update accordingly.
23689 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
23690 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
23692 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
23694 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
23695 of a fieldinfo using the above, when dealing with a FieldBuilder.
23697 2001-11-10 Ravi Pratap <ravi@ximian.com>
23699 * ../errors/cs0031.cs : Add.
23701 * ../errors/cs1008.cs : Add.
23703 * ../errrors/cs0543.cs : Add.
23705 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
23708 (FindMembers): Implement.
23710 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
23711 enums and delegates too.
23713 (enum_types): Rename to builder_to_enum.
23715 (delegate_types): Rename to builder_to_delegate.
23717 * delegate.cs (FindMembers): Implement.
23719 2001-11-09 Ravi Pratap <ravi@ximian.com>
23721 * typemanager.cs (IsEnumType): Implement.
23723 * enum.cs (Emit): Re-write parts to account for the underlying type
23724 better and perform checking etc.
23726 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
23727 of the underlying type.
23729 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
23732 * enum.cs (error31): Helper to report error #31.
23734 * cs-parser.jay (enum_declaration): Store location of each member too.
23736 * enum.cs (member_to_location): New hashtable.
23738 (AddEnumMember): Update location hashtable.
23740 (Emit): Use the location of each member while reporting errors.
23742 2001-11-09 Miguel de Icaza <miguel@ximian.com>
23744 * cs-parser.jay: A for_initializer if is a
23745 local_variable_declaration really ammount to have an implicit
23746 block with the variable declaration and no initializer for for.
23748 * statement.cs (For.Emit): Cope with null initializers.
23750 This fixes the infinite loop on for initializers.
23752 2001-11-08 Miguel de Icaza <miguel@ximian.com>
23754 * enum.cs: More cleanup.
23756 * ecore.cs: Remove dead code.
23758 * class.cs (Property.Emit): More simplification.
23759 (Event.Emit): ditto.
23761 Reworked to have less levels of indentation.
23763 2001-11-08 Ravi Pratap <ravi@ximian.com>
23765 * class.cs (Property): Emit attributes.
23775 * enum.cs (Emit): Ditto.
23777 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
23780 * class.cs (Field, Event, etc.): Move attribute generation into the
23781 Emit method everywhere.
23783 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
23784 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
23785 as we had no way of defining nested enums !
23787 * rootcontext.cs : Adjust code accordingly.
23789 * typemanager.cs (AddEnumType): To keep track of enum types separately.
23791 2001-11-07 Ravi Pratap <ravi@ximian.com>
23793 * expression.cs (EvalConstantExpression): Move into ecore.cs
23795 * enum.cs (Enum): Rename some members and make them public and readonly
23796 according to our convention.
23798 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
23801 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
23803 (Enum::Emit): Write a simple version for now which doesn't try to compute
23804 expressions. I shall modify this to be more robust in just a while.
23806 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
23808 (TypeContainer::CloseType): Create the Enum types too.
23810 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
23812 * expression.cs (EvalConstantExpression): Get rid of completely.
23814 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
23815 user-defined values and other cases.
23817 (IsValidEnumLiteral): Helper function.
23819 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
23820 out there in the case we had a literal FieldExpr.
23822 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
23824 (Literalize): Revamp a bit to take two arguments.
23826 (EnumLiteral): New class which derives from Literal to wrap enum literals.
23828 2001-11-06 Ravi Pratap <ravi@ximian.com>
23830 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
23832 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
23834 (Resolve): Use the above to ensure we have proper initializers.
23836 2001-11-05 Ravi Pratap <ravi@ximian.com>
23838 * expression.cs (Expression::EvalConstantExpression): New method to
23839 evaluate constant expressions.
23841 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
23843 2001-11-07 Miguel de Icaza <miguel@ximian.com>
23845 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
23848 (Binary.ResolveOperator): Handle operator != (object a, object b)
23849 and operator == (object a, object b);
23851 (Binary.DoNumericPromotions): Indicate whether the numeric
23852 promotion was possible.
23854 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
23857 Made the ArrayAccess implement interface IAssignMethod instead of
23858 IStackStore as the order in which arguments are passed reflects
23861 * assign.cs: Instead of using expr.ExprClass to select the way of
23862 assinging, probe for the IStackStore/IAssignMethod interfaces.
23864 * typemanager.cs: Load InitializeArray definition.
23866 * rootcontext.cs (RootContext.MakeStaticData): Used to define
23867 static data that can be used to initialize arrays.
23869 2001-11-05 Miguel de Icaza <miguel@ximian.com>
23871 * expression.cs: Handle operator== and operator!= for booleans.
23873 (Conditioal.Reduce): Implement reducer for the ?: operator.
23875 (Conditional.Resolve): Implement dead code elimination.
23877 (Binary.Resolve): Catch string literals and return a new
23878 concatenated string.
23880 (Unary.Reduce): Implement reduction of unary expressions.
23882 * ecore.cs: Split out the expression core handling here.
23884 (Expression.Reduce): New method used to perform constant folding
23885 and CSE. This is needed to support constant-expressions.
23887 * statement.cs (Statement.EmitBoolExpression): Pass true and false
23888 targets, and optimize for !x.
23890 2001-11-04 Ravi Pratap <ravi@ximian.com>
23892 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
23893 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
23894 set custom atttributes.
23896 * literal.cs (Literal::GetValue): New abstract method to return the actual
23897 value of the literal, cast as an object.
23899 (*Literal): Implement GetValue method.
23901 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
23902 expressions to the arraylist but objects of type Argument.
23904 * class.cs (TypeContainer::Emit): Emit our attributes too.
23906 (Method::Emit, Constructor::Emit): Ditto.
23908 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
23909 to be ignoring earlier.
23911 2001-11-03 Ravi Pratap <ravi@ximian.com>
23913 * attribute.cs (AttributeSection::Define): Implement to do the business
23914 of constructing a CustomAttributeBuilder.
23916 (Attribute): New trivial class. Increases readability of code.
23918 * cs-parser.jay : Update accordingly.
23920 (positional_argument_list, named_argument_list, named_argument): New rules
23922 (attribute_arguments): Use the above so that we are more correct.
23924 2001-11-02 Ravi Pratap <ravi@ximian.com>
23926 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
23927 to perform all checks for a method with a params parameter.
23929 (Invocation::OverloadResolve): Update to use the above method and therefore
23930 cope correctly with params method invocations.
23932 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
23935 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
23936 constructors in our parent too because we can't afford to miss out on
23939 * attribute.cs (AttributeSection): New name for the class Attribute
23941 Other trivial changes to improve readability.
23943 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
23944 use the new class names.
23946 2001-11-01 Ravi Pratap <ravi@ximian.com>
23948 * class.cs (Method::Define): Complete definition for params types too
23950 (Indexer::Define): Ditto.
23952 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
23953 Cope everywhere with a request for info about the array parameter.
23955 2001-11-01 Ravi Pratap <ravi@ximian.com>
23957 * tree.cs (RecordNamespace): Fix up to check for the correct key.
23959 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
23960 local_variable_type to extract the string corresponding to the type.
23962 (local_variable_type): Fixup the action to use the new helper method.
23964 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
23967 * expression.cs : Clean out code which uses the above.
23969 2001-10-31 Ravi Pratap <ravi@ximian.com>
23971 * typemanager.cs (RegisterMethod): Check if we already have an existing key
23972 and bale out if necessary by returning a false.
23974 (RegisterProperty): Ditto.
23976 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
23977 and print out appropriate error messages.
23979 * interface.cs (everywhere): Ditto.
23981 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
23982 location to constructor.
23984 * class.cs (Property, Event, Indexer): Update accordingly.
23986 * ../errors/cs111.cs : Added.
23988 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
23989 of a method, as laid down by the spec.
23991 (Invocation::OverloadResolve): Use the above method.
23993 2001-10-31 Ravi Pratap <ravi@ximian.com>
23995 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
23996 now take a TypeContainer and a Parameters object.
23998 (ParameterData): Modify return type of ParameterModifier method to be
23999 Parameter.Modifier and not a string.
24001 (ReflectionParameters, InternalParameters): Update accordingly.
24003 * expression.cs (Argument::GetParameterModifier): Same here.
24005 * support.cs (InternalParameters::ParameterType): Find a better way of determining
24006 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
24007 symbol in it at all so maybe this is only for now.
24009 2001-10-30 Ravi Pratap <ravi@ximian.com>
24011 * support.cs (InternalParameters): Constructor now takes an extra argument
24012 which is the actual Parameters class.
24014 (ParameterDesc): Update to provide info on ref/out modifiers.
24016 * class.cs (everywhere): Update call to InternalParameters to pass in
24017 the second argument too.
24019 * support.cs (ParameterData): Add ParameterModifier, which is a method
24020 to return the modifier info [ref/out etc]
24022 (InternalParameters, ReflectionParameters): Implement the above.
24024 * expression.cs (Argument::ParameterModifier): Similar function to return
24025 info about the argument's modifiers.
24027 (Invocation::OverloadResolve): Update to take into account matching modifiers
24030 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
24031 a new SetFormalParameters object which we pass to InternalParameters.
24033 2001-10-30 Ravi Pratap <ravi@ximian.com>
24035 * expression.cs (NewArray): Merge into the ArrayCreation class.
24037 2001-10-29 Ravi Pratap <ravi@ximian.com>
24039 * expression.cs (NewArray): Merge classes NewBuiltinArray and
24040 NewUserdefinedArray into one as there wasn't much of a use in having
24043 * expression.cs (Argument): Change field's name to ArgType from Type.
24045 (Type): New readonly property which returns the proper type, taking into
24046 account ref/out modifiers.
24048 (everywhere): Adjust code accordingly for the above.
24050 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
24051 whether we are emitting for a ref or out parameter.
24053 * expression.cs (Argument::Emit): Use the above field to set the state.
24055 (LocalVariableReference::Emit): Update to honour the flag and emit the
24058 * parameter.cs (Attributes): Set the correct flags for ref parameters.
24060 * expression.cs (Argument::FullDesc): New function to provide a full desc.
24062 * support.cs (ParameterData): Add method ParameterDesc to the interface.
24064 (ReflectionParameters, InternalParameters): Implement the above method.
24066 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
24069 (Invocation::FullMethodDesc): Ditto.
24071 2001-10-29 Miguel de Icaza <miguel@ximian.com>
24073 * cs-parser.jay: Add extra production for the second form of array
24076 * expression.cs (ArrayCreation): Update to reflect the above
24079 * Small changes to prepare for Array initialization.
24081 2001-10-28 Miguel de Icaza <miguel@ximian.com>
24083 * typemanager.cs (ImplementsInterface): interface might be null;
24084 Deal with this problem;
24086 Also, we do store negative hits on the cache (null values), so use
24087 this instead of calling t.GetInterfaces on the type everytime.
24089 2001-10-28 Ravi Pratap <ravi@ximian.com>
24091 * typemanager.cs (IsBuiltinType): New method to help determine the same.
24093 * expression.cs (New::DoResolve): Get rid of array creation code and instead
24094 split functionality out into different classes.
24096 (New::FormArrayType): Move into NewBuiltinArray.
24098 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
24101 (NewBuiltinArray): New class to handle creation of built-in arrays.
24103 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
24104 account creation of one-dimensional arrays.
24106 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
24108 (NewUserdefinedArray::DoResolve): Implement.
24110 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
24112 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
24113 we maintain inside the TypeManager. This is necessary to perform lookups on the
24116 (LookupType): Update to perform GetType on the module builders too.
24118 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
24120 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
24122 2001-10-23 Ravi Pratap <ravi@ximian.com>
24124 * expression.cs (New::DoResolve): Implement guts of array creation.
24126 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
24128 2001-10-27 Miguel de Icaza <miguel@ximian.com>
24130 * expression.cs: Fix bug I introduced lsat night that broke
24133 (Expression.Resolve): Report a 246 error (can not resolve name)
24134 if we find a SimpleName in the stream.
24136 (Expression.ResolveLValue): Ditto.
24138 (Expression.ResolveWithSimpleName): This function is a variant of
24139 ResolveName, this one allows SimpleNames to be returned without a
24140 warning. The only consumer of SimpleNames is MemberAccess
24142 2001-10-26 Miguel de Icaza <miguel@ximian.com>
24144 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
24145 might arrive here. I have my doubts that this is correct.
24147 * statement.cs (Lock): Implement lock statement.
24149 * cs-parser.jay: Small fixes to support `lock' and `using'
24151 * cs-tokenizer.cs: Remove extra space
24153 * driver.cs: New flag --checked, allows to turn on integer math
24156 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
24157 Threading.Monitor.Exit
24159 2001-10-23 Miguel de Icaza <miguel@ximian.com>
24161 * expression.cs (IndexerAccess::DoResolveLValue): Set the
24162 Expression Class to be IndexerAccess.
24164 Notice that Indexer::DoResolve sets the eclass to Value.
24166 2001-10-22 Miguel de Icaza <miguel@ximian.com>
24168 * class.cs (TypeContainer::Emit): Emit code for indexers.
24170 * assign.cs (IAssignMethod): New interface implemented by Indexers
24171 and Properties for handling assignment.
24173 (Assign::Emit): Simplify and reuse code.
24175 * expression.cs (IndexerAccess, PropertyExpr): Implement
24176 IAssignMethod, clean up old code.
24178 2001-10-22 Ravi Pratap <ravi@ximian.com>
24180 * typemanager.cs (ImplementsInterface): New method to determine if a type
24181 implements a given interface. Provides a nice cache too.
24183 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
24186 (ConvertReferenceExplicit): Ditto.
24188 * delegate.cs (Delegate::Populate): Update to define the parameters on the
24189 various methods, with correct names etc.
24191 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
24192 Operator.UnaryNegation.
24194 * cs-parser.jay (operator_declarator): Be a little clever in the case where
24195 we have a unary plus or minus operator.
24197 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
24200 * everywhere : update accordingly.
24202 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
24205 * class.cs (Method::Define): For the case where we are implementing a method
24206 inherited from an interface, we need to set the MethodAttributes.Final flag too.
24207 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
24209 2001-10-21 Ravi Pratap <ravi@ximian.com>
24211 * interface.cs (FindMembers): Implement to work around S.R.E
24214 * typemanager.cs (IsInterfaceType): Implement.
24216 (FindMembers): Update to handle interface types too.
24218 * expression.cs (ImplicitReferenceConversion): Re-write bits which
24219 use IsAssignableFrom as that is not correct - it doesn't work.
24221 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
24222 and accordingly override EmitStatement.
24224 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
24225 using the correct logic :-)
24227 2001-10-19 Ravi Pratap <ravi@ximian.com>
24229 * ../errors/cs-11.cs : Add to demonstrate error -11
24231 2001-10-17 Miguel de Icaza <miguel@ximian.com>
24233 * assign.cs (Assign::Resolve): Resolve right hand side first, and
24234 then pass this as a hint to ResolveLValue.
24236 * expression.cs (FieldExpr): Add Location information
24238 (FieldExpr::LValueResolve): Report assignment to readonly
24241 (Expression::ExprClassFromMemberInfo): Pass location information.
24243 (Expression::ResolveLValue): Add new method that resolves an
24246 (Expression::DoResolveLValue): Default invocation calls
24249 (Indexers): New class used to keep track of indexers in a given
24252 (IStackStore): Renamed from LValue, as it did not really describe
24253 what this did. Also ResolveLValue is gone from this interface and
24254 now is part of Expression.
24256 (ElementAccess): Depending on the element access type
24258 * typemanager.cs: Add `indexer_name_type' as a Core type
24259 (System.Runtime.CompilerServices.IndexerNameAttribute)
24261 * statement.cs (Goto): Take a location.
24263 2001-10-18 Ravi Pratap <ravi@ximian.com>
24265 * delegate.cs (Delegate::VerifyDelegate): New method to verify
24266 if two delegates are compatible.
24268 (NewDelegate::DoResolve): Update to take care of the case when
24269 we instantiate a delegate from another delegate.
24271 * typemanager.cs (FindMembers): Don't even try to look up members
24272 of Delegate types for now.
24274 2001-10-18 Ravi Pratap <ravi@ximian.com>
24276 * delegate.cs (NewDelegate): New class to take care of delegate
24279 * expression.cs (New): Split the delegate related code out into
24280 the NewDelegate class.
24282 * delegate.cs (DelegateInvocation): New class to handle delegate
24285 * expression.cs (Invocation): Split out delegate related code into
24286 the DelegateInvocation class.
24288 2001-10-17 Ravi Pratap <ravi@ximian.com>
24290 * expression.cs (New::DoResolve): Implement delegate creation fully
24291 and according to the spec.
24293 (New::DoEmit): Update to handle delegates differently.
24295 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
24296 because of which we were printing out arguments in reverse order !
24298 * delegate.cs (VerifyMethod): Implement to check if the given method
24299 matches the delegate.
24301 (FullDelegateDesc): Implement.
24303 (VerifyApplicability): Implement.
24305 * expression.cs (Invocation::DoResolve): Update to accordingly handle
24306 delegate invocations too.
24308 (Invocation::Emit): Ditto.
24310 * ../errors/cs1593.cs : Added.
24312 * ../errors/cs1594.cs : Added.
24314 * delegate.cs (InstanceExpression, TargetMethod): New properties.
24316 2001-10-16 Ravi Pratap <ravi@ximian.com>
24318 * typemanager.cs (intptr_type): Core type for System.IntPtr
24320 (InitCoreTypes): Update for the same.
24322 (iasyncresult_type, asynccallback_type): Ditto.
24324 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
24327 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
24330 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
24331 the builders for the 4 members of a delegate type :-)
24333 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
24336 * expression.cs (New::DoResolve): Implement guts for delegate creation.
24338 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
24340 2001-10-15 Miguel de Icaza <miguel@ximian.com>
24342 * statement.cs (Break::Emit): Implement.
24343 (Continue::Emit): Implement.
24345 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
24346 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
24347 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
24348 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
24351 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
24352 properties that track the label for the current loop (begin of the
24353 loop and end of the loop).
24355 2001-10-15 Ravi Pratap <ravi@ximian.com>
24357 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
24358 use of emitting anything at all.
24360 * class.cs, rootcontext.cs : Get rid of calls to the same.
24362 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
24364 (Populate): Define the constructor correctly and set the implementation
24367 * typemanager.cs (delegate_types): New hashtable to hold delegates that
24370 (AddDelegateType): Implement.
24372 (IsDelegateType): Implement helper method.
24374 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
24376 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
24377 and accordingly handle it.
24379 * delegate.cs (Populate): Take TypeContainer argument.
24380 Implement bits to define the Invoke method. However, I still haven't figured out
24381 how to take care of the native int bit :-(
24383 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
24384 Qualify the name of the delegate, not its return type !
24386 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
24389 (StandardConversionExists): Checking for array types turns out to be recursive.
24391 (ConvertReferenceExplicit): Implement array conversion.
24393 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
24395 2001-10-12 Ravi Pratap <ravi@ximian.com>
24397 * cs-parser.jay (delegate_declaration): Store the fully qualified
24398 name as it is a type declaration.
24400 * delegate.cs (ReturnType, Name): Rename members to these. Make them
24403 (DefineDelegate): Renamed from Define. Does the same thing essentially,
24404 as TypeContainer::DefineType.
24406 (Populate): Method in which all the definition of the various methods (Invoke)
24409 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
24412 (CloseDelegate): Finally creates the delegate.
24414 * class.cs (TypeContainer::DefineType): Update to define delegates.
24415 (Populate, Emit and CloseType): Do the same thing here too.
24417 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
24418 delegates in all these operations.
24420 2001-10-14 Miguel de Icaza <miguel@ximian.com>
24422 * expression.cs: LocalTemporary: a new expression used to
24423 reference a temporary that has been created.
24425 * assign.cs: Handle PropertyAccess back here, so that we can
24426 provide the proper semantic access to properties.
24428 * expression.cs (Expression::ConvertReferenceExplicit): Implement
24429 a few more explicit conversions.
24431 * modifiers.cs: `NEW' modifier maps to HideBySig.
24433 * expression.cs (PropertyExpr): Make this into an
24434 ExpressionStatement, and support the EmitStatement code path.
24436 Perform get/set error checking, clean up the interface.
24438 * assign.cs: recognize PropertyExprs as targets, and if so, turn
24439 them into toplevel access objects.
24441 2001-10-12 Miguel de Icaza <miguel@ximian.com>
24443 * expression.cs: PropertyExpr::PropertyExpr: use work around the
24446 * typemanager.cs: Keep track here of our PropertyBuilders again to
24447 work around lameness in SRE.
24449 2001-10-11 Miguel de Icaza <miguel@ximian.com>
24451 * expression.cs (LValue::LValueResolve): New method in the
24452 interface, used to perform a second resolution pass for LValues.
24454 (This::DoResolve): Catch the use of this in static methods.
24456 (This::LValueResolve): Implement.
24458 (This::Store): Remove warning, assigning to `this' in structures
24461 (Invocation::Emit): Deal with invocation of
24462 methods on value types. We need to pass the address to structure
24463 methods rather than the object itself. (The equivalent code to
24464 emit "this" for structures leaves the entire structure on the
24465 stack instead of a pointer to it).
24467 (ParameterReference::DoResolve): Compute the real index for the
24468 argument based on whether the method takes or not a `this' pointer
24469 (ie, the method is static).
24471 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
24472 value types returned from functions when we need to invoke a
24473 method on the sturcture.
24476 2001-10-11 Ravi Pratap <ravi@ximian.com>
24478 * class.cs (TypeContainer::DefineType): Method to actually do the business of
24479 defining the type in the Modulebuilder or Typebuilder. This is to take
24480 care of nested types which need to be defined on the TypeBuilder using
24481 DefineNestedMethod.
24483 (TypeContainer::GetClassBases): Implement. Essentially the code from the
24484 methods in RootContext, only ported to be part of TypeContainer.
24486 (TypeContainer::GetInterfaceOrClass): Ditto.
24488 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
24490 * interface.cs (Interface::DefineInterface): New method. Does exactly
24491 what RootContext.CreateInterface did earlier, only it takes care of nested types
24494 (Interface::GetInterfaces): Move from RootContext here and port.
24496 (Interface::GetInterfaceByName): Same here.
24498 * rootcontext.cs (ResolveTree): Re-write.
24500 (PopulateTypes): Re-write.
24502 * class.cs (TypeContainer::Populate): Populate nested types too.
24503 (TypeContainer::Emit): Emit nested members too.
24505 * typemanager.cs (AddUserType): Do not make use of the FullName property,
24506 instead just use the name argument passed in as it is already fully
24509 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
24510 to TypeContainer mapping to see if a type is user-defined.
24512 * class.cs (TypeContainer::CloseType): Implement.
24514 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
24515 the default constructor.
24517 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
24520 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
24522 * interface.cs (CloseType): Create the type here.
24524 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
24527 Remove all the methods which are now in TypeContainer.
24529 2001-10-10 Ravi Pratap <ravi@ximian.com>
24531 * delegate.cs (Define): Re-write bits to define the delegate
24534 2001-10-10 Miguel de Icaza <miguel@ximian.com>
24536 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
24538 * expression.cs (ImplicitReferenceConversion): handle null as well
24539 as a source to convert to any reference type.
24541 * statement.cs (Return): Perform any implicit conversions to
24542 expected return type.
24544 Validate use of return statement.
24546 * codegen.cs (EmitContext): Pass the expected return type here.
24548 * class.cs (Method, Constructor, Property): Pass expected return
24549 type to EmitContext.
24551 2001-10-09 Miguel de Icaza <miguel@ximian.com>
24553 * expression.cs: Make DoResolve take an EmitContext instead of a
24556 Replaced `l' and `location' for `loc', for consistency.
24558 (Error, Warning): Remove unneeded Tc argument.
24560 * assign.cs, literal.cs, constant.cs: Update to new calling
24563 * codegen.cs: EmitContext now contains a flag indicating whether
24564 code is being generated in a static method or not.
24566 * cs-parser.jay: DecomposeQI, new function that replaces the old
24567 QualifiedIdentifier. Now we always decompose the assembled
24568 strings from qualified_identifier productions into a group of
24571 2001-10-08 Miguel de Icaza <miguel@ximian.com>
24573 * rootcontext.cs: Deal with field-less struct types correctly now
24574 by passing the size option to Define Type.
24576 * class.cs: Removed hack that created one static field.
24578 2001-10-07 Miguel de Icaza <miguel@ximian.com>
24580 * statement.cs: Moved most of the code generation here.
24582 2001-10-09 Ravi Pratap <ravi@ximian.com>
24584 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
24587 (ElementAccess): Remove useless bits for now - keep checks as the spec
24590 2001-10-08 Ravi Pratap <ravi@ximian.com>
24592 * expression.cs (ElementAccess::DoResolve): Remove my crap code
24593 and start performing checks according to the spec.
24595 2001-10-07 Ravi Pratap <ravi@ximian.com>
24597 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
24598 rank_specifiers instead.
24600 (rank_specifiers): Change the order in which the rank specifiers are stored
24602 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
24604 * expression.cs (ElementAccess): Implement the LValue interface too.
24606 2001-10-06 Ravi Pratap <ravi@ximian.com>
24608 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
24609 except that user defined conversions are not included.
24611 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
24612 perform the conversion of the return type, if necessary.
24614 (New::DoResolve): Check whether we are creating an array or an object
24615 and accordingly do the needful.
24617 (New::Emit): Same here.
24619 (New::DoResolve): Implement guts of array creation.
24621 (New::FormLookupType): Helper function.
24623 2001-10-07 Miguel de Icaza <miguel@ximian.com>
24625 * codegen.cs: Removed most of the code generation here, and move the
24626 corresponding code generation bits to the statement classes.
24628 Added support for try/catch/finalize and throw.
24630 * cs-parser.jay: Added support for try/catch/finalize.
24632 * class.cs: Catch static methods having the flags override,
24633 virtual or abstract.
24635 * expression.cs (UserCast): This user cast was not really doing
24636 what it was supposed to do. Which is to be born in fully resolved
24637 state. Parts of the resolution were being performed at Emit time!
24641 2001-10-05 Miguel de Icaza <miguel@ximian.com>
24643 * expression.cs: Implicity convert the result from UserCast.
24645 2001-10-05 Ravi Pratap <ravi@ximian.com>
24647 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
24648 prevented it from working correctly.
24650 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
24651 merely ConvertImplicit.
24653 2001-10-05 Miguel de Icaza <miguel@ximian.com>
24655 * typemanager.cs: Make the LookupTypeContainer function static,
24656 and not per-instance.
24658 * class.cs: Make static FindMembers (the one that takes a Type
24661 * codegen.cs: Add EmitForeach here.
24663 * cs-parser.jay: Make foreach a toplevel object instead of the
24664 inline expansion, as we need to perform semantic analysis on it.
24666 2001-10-05 Ravi Pratap <ravi@ximian.com>
24668 * expression.cs (Expression::ImplicitUserConversion): Rename to
24669 UserDefinedConversion.
24671 (Expression::UserDefinedConversion): Take an extra argument specifying
24672 whether we look for explicit user conversions too.
24674 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
24676 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
24678 (ExplicitUserConversion): Make it a call to UserDefinedConversion
24679 with the appropriate arguments.
24681 * cs-parser.jay (cast_expression): Record location too.
24683 * expression.cs (Cast): Record location info.
24685 (Expression::ConvertExplicit): Take location argument.
24687 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
24688 to determine if we are doing explicit conversions.
24690 (UserCast::Emit): Update accordingly.
24692 (Expression::ConvertExplicit): Report an error if everything fails.
24694 * ../errors/cs0030.cs : Add.
24696 2001-10-04 Miguel de Icaza <miguel@ximian.com>
24698 * modifiers.cs: If the ABSTRACT keyword is present, also set the
24699 virtual and newslot bits.
24701 * class.cs (TypeContainer::RegisterRequiredImplementations):
24702 Record methods we need.
24704 (TypeContainer::MakeKey): Helper function to make keys for
24705 MethodBases, since the Methodbase key is useless.
24707 (TypeContainer::Populate): Call RegisterRequiredImplementations
24708 before defining the methods.
24710 Create a mapping for method_builders_to_methods ahead of time
24711 instead of inside a tight loop.
24713 (::RequireMethods): Accept an object as the data to set into the
24714 hashtable so we can report interface vs abstract method mismatch.
24716 2001-10-03 Miguel de Icaza <miguel@ximian.com>
24718 * report.cs: Make all of it static.
24720 * rootcontext.cs: Drop object_type and value_type computations, as
24721 we have those in the TypeManager anyways.
24723 Drop report instance variable too, now it is a global.
24725 * driver.cs: Use try/catch on command line handling.
24727 Add --probe option to debug the error reporting system with a test
24730 * report.cs: Add support for exiting program when a probe
24731 condition is reached.
24733 2001-10-03 Ravi Pratap <ravi@ximian.com>
24735 * expression.cs (Binary::DoNumericPromotions): Fix the case when
24736 we do a forcible conversion regardless of type, to check if
24737 ForceConversion returns a null.
24739 (Binary::error19): Use location to report error.
24741 (Unary::error23): Use location here too.
24743 * ../errors/cs0019.cs : Check in.
24745 * ../errors/cs0023.cs : Check in.
24747 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
24748 case of a non-null MethodInfo object with a length of 0 !
24750 (Binary::ResolveOperator): Flag error if overload resolution fails to find
24751 an applicable member - according to the spec :-)
24752 Also fix logic to find members in base types.
24754 (Unary::ResolveOperator): Same here.
24756 (Unary::report23): Change name to error23 and make first argument a TypeContainer
24757 as I was getting thoroughly confused between this and error19 :-)
24759 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
24760 (::FindMostEncompassedType): Implement.
24761 (::FindMostEncompassingType): Implement.
24762 (::StandardConversionExists): Implement.
24764 (UserImplicitCast): Re-vamp. We now need info about most specific
24765 source and target types so that we can do the necessary conversions.
24767 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
24768 mathematical union with no duplicates.
24770 2001-10-03 Miguel de Icaza <miguel@ximian.com>
24772 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
24773 in order from base classes to child classes, so that we can in
24774 child classes look up in our parent for method names and
24775 attributes (required for handling abstract, virtual, new, override
24776 constructs: we need to instrospect our base class, and if we dont
24777 populate the classes in order, the introspection might be
24778 incorrect. For example, a method could query its parent before
24779 the parent has any methods and would determine that the parent has
24780 no abstract methods (while it could have had them)).
24782 (RootContext::CreateType): Record the order in which we define the
24785 2001-10-02 Miguel de Icaza <miguel@ximian.com>
24787 * class.cs (TypeContainer::Populate): Also method definitions can
24788 fail now, keep track of this.
24790 (TypeContainer::FindMembers): Implement support for
24791 DeclaredOnly/noDeclaredOnly flag.
24793 (Constructor::Emit) Return the ConstructorBuilder.
24795 (Method::Emit) Return the MethodBuilder.
24796 Check for abstract or virtual methods to be public.
24798 * rootcontext.cs (RootContext::CreateType): Register all the
24799 abstract methods required for the class to be complete and the
24800 interface methods that must be implemented.
24802 * cs-parser.jay: Report error 501 (method requires body if it is
24803 not marked abstract or extern).
24805 * expression.cs (TypeOf::Emit): Implement.
24807 * typemanager.cs: runtime_handle_type, new global type.
24809 * class.cs (Property::Emit): Generate code for properties.
24811 2001-10-02 Ravi Pratap <ravi@ximian.com>
24813 * expression.cs (Unary::ResolveOperator): Find operators on base type
24814 too - we now conform exactly to the spec.
24816 (Binary::ResolveOperator): Same here.
24818 * class.cs (Operator::Define): Fix minor quirk in the tests.
24820 * ../errors/cs0215.cs : Added.
24822 * ../errors/cs0556.cs : Added.
24824 * ../errors/cs0555.cs : Added.
24826 2001-10-01 Miguel de Icaza <miguel@ximian.com>
24828 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
24829 single integer which is really efficient
24831 2001-10-01 Ravi Pratap <ravi@ximian.com>
24833 * expression.cs (Expression::ImplicitUserConversion): Use location
24834 even in the case when we are examining True operators.
24836 * class.cs (Operator::Define): Perform extensive checks to conform
24837 with the rules for operator overloading in the spec.
24839 * expression.cs (Expression::ImplicitReferenceConversion): Implement
24840 some of the other conversions mentioned in the spec.
24842 * typemanager.cs (array_type): New static member for the System.Array built-in
24845 (cloneable_interface): For System.ICloneable interface.
24847 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
24848 we start resolving the tree and populating types.
24850 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
24852 2001-10-01 Miguel de Icaza <miguel@ximian.com>
24854 * expression.cs (Expression::ExprClassFromMemberInfo,
24855 Expression::Literalize): Create literal expressions from
24856 FieldInfos which are literals.
24858 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
24859 type casts, because they were wrong. The test suite in tests
24862 (ImplicitNumericConversion): ushort to ulong requires a widening
24865 Int32 constant to long requires widening cast as well.
24867 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
24868 for integers because the type on the stack is not i4.
24870 2001-09-30 Miguel de Icaza <miguel@ximian.com>
24872 * expression.cs (report118): require location argument.
24874 * parameter.cs: Do not dereference potential null value.
24876 * class.cs: Catch methods that lack the `new' keyword when
24877 overriding a name. Report warnings when `new' is used without
24878 anything being there to override.
24880 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
24882 * class.cs: Only add constructor to hashtable if it is non-null
24883 (as now constructors can fail on define).
24885 (TypeManager, Class, Struct): Take location arguments.
24887 Catch field instance initialization in structs as errors.
24889 accepting_filter: a new filter for FindMembers that is static so
24890 that we dont create an instance per invocation.
24892 (Constructor::Define): Catch errors where a struct constructor is
24895 * cs-parser.jay: Pass location information for various new
24898 * delegate.cs (Delegate): take a location argument.
24900 * driver.cs: Do not call EmitCode if there were problesm in the
24901 Definition of the types, as many Builders wont be there.
24903 * decl.cs (Decl::Decl): Require a location argument.
24905 * cs-tokenizer.cs: Handle properly hex constants that can not fit
24906 into integers, and find the most appropiate integer for it.
24908 * literal.cs: Implement ULongLiteral.
24910 * rootcontext.cs: Provide better information about the location of
24911 failure when CreateType fails.
24913 2001-09-29 Miguel de Icaza <miguel@ximian.com>
24915 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
24918 * expression.cs (Binary::CheckShiftArguments): Add missing type
24920 (Binary::ResolveOperator): Add type to the logical and and logical
24921 or, Bitwise And/Or and Exclusive Or code paths, it was missing
24924 (Binary::DoNumericPromotions): In the case where either argument
24925 is ulong (and most signed types combined with ulong cause an
24926 error) perform implicit integer constant conversions as well.
24928 2001-09-28 Miguel de Icaza <miguel@ximian.com>
24930 * expression.cs (UserImplicitCast): Method should always be
24932 (Invocation::BetterConversion): Simplified test for IntLiteral.
24934 (Expression::ImplicitNumericConversion): Split this routine out.
24935 Put the code that performs implicit constant integer conversions
24938 (Expression::Resolve): Become a wrapper around DoResolve so we can
24939 check eclass and type being set after resolve.
24941 (Invocation::Badness): Remove this dead function
24943 (Binary::ResolveOperator): Do not compute the expensive argumnets
24944 unless we have a union for it.
24946 (Probe::Emit): Is needs to do an isinst and then
24947 compare against null.
24949 (::CanConvert): Added Location argument. If the Location argument
24950 is null (Location.Null), then we do not report errors. This is
24951 used by the `probe' mechanism of the Explicit conversion. We do
24952 not want to generate an error for something that the user
24953 explicitly requested to be casted. But the pipeline for an
24954 explicit cast first tests for potential implicit casts.
24956 So for now, if the Location is null, it means `Probe only' to
24957 avoid adding another argument. Might have to revise this
24960 (ClassCast): New class used to type cast objects into arbitrary
24961 classes (used in Explicit Reference Conversions).
24963 Implement `as' as well.
24965 Reverted all the patches from Ravi below: they were broken:
24967 * The use of `level' as a mechanism to stop recursive
24968 invocations is wrong. That was there just to catch the
24969 bug with a strack trace but not as a way of addressing
24972 To fix the problem we have to *understand* what is going
24973 on and the interactions and come up with a plan, not
24974 just get things going.
24976 * The use of the type conversion cache that I proposed
24977 last night had an open topic: How does this work across
24978 protection domains. A user defined conversion might not
24979 be public in the location where we are applying the
24980 conversion, a different conversion might be selected
24981 (ie, private A->B (better) but public B->A (worse),
24982 inside A, A->B applies, but outside it, B->A will
24985 * On top of that (ie, even if the above is solved),
24986 conversions in a cache need to be abstract. Ie, `To
24987 convert from an Int to a Short use an OpcodeCast', not
24988 `To convert from an Int to a Short use the OpcodeCast on
24989 the variable 5' (which is what this patch was doing).
24991 2001-09-28 Ravi Pratap <ravi@ximian.com>
24993 * expression.cs (Invocation::ConversionExists): Re-write to use
24994 the conversion cache
24996 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
24997 cache all conversions done, not just user-defined ones.
24999 (Invocation::BetterConversion): The real culprit. Use ConversionExists
25000 to determine if a conversion exists instead of acutually trying to
25001 perform the conversion. It's faster too.
25003 (Expression::ConvertExplicit): Modify to use ConversionExists to check
25004 and only then attempt the implicit conversion.
25006 2001-09-28 Ravi Pratap <ravi@ximian.com>
25008 * expression.cs (ConvertImplicit): Use a cache for conversions
25009 already found. Check level of recursion and bail out if necessary.
25011 2001-09-28 Miguel de Icaza <miguel@ximian.com>
25013 * typemanager.cs (string_concat_string_string, string_concat_object_object):
25014 Export standard methods that we expect for string operations.
25016 * statement.cs (Block::UsageWarning): Track usage of variables and
25017 report the errors for not used variables.
25019 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
25022 2001-09-27 Miguel de Icaza <miguel@ximian.com>
25024 * codegen.cs: remove unnneded code
25026 * expression.cs: Removed BuiltinTypeAccess class
25028 Fix the order in which implicit conversions are
25031 The previous fixed dropped support for boxed conversions (adding a
25032 test to the test suite now)
25034 (UserImplicitCast::CanConvert): Remove test for source being null,
25035 that code is broken. We should not feed a null to begin with, if
25036 we do, then we should track the bug where the problem originates
25037 and not try to cover it up here.
25039 Return a resolved expression of type UserImplicitCast on success
25040 rather than true/false. Ravi: this is what I was talking about,
25041 the pattern is to use a static method as a "constructor" for
25044 Also, do not create arguments until the very last minute,
25045 otherwise we always create the arguments even for lookups that
25046 will never be performed.
25048 (UserImplicitCast::Resolve): Eliminate, objects of type
25049 UserImplicitCast are born in a fully resolved state.
25051 * typemanager.cs (InitCoreTypes): Init also value_type
25052 (System.ValueType).
25054 * expression.cs (Cast::Resolve): First resolve the child expression.
25056 (LValue): Add new method AddressOf to be used by
25059 Change the argument of Store to take an EmitContext instead of an
25060 ILGenerator, because things like FieldExpr need to be able to call
25061 their children expression to generate the instance code.
25063 (Expression::Error, Expression::Warning): Sugar functions for
25066 (Expression::MemberLookup): Accept a TypeContainer instead of a
25067 Report as the first argument.
25069 (Expression::ResolvePrimary): Killed. I still want to improve
25070 this as currently the code is just not right.
25072 (Expression::ResolveMemberAccess): Simplify, but it is still
25075 (Unary::Resolve): Catch errors in AddressOf operators.
25077 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
25078 index to a byte for the short-version, or the compiler will choose
25079 the wrong Emit call, which generates the wrong data.
25081 (ParameterReference::Emit, ::Store): same.
25083 (FieldExpr::AddressOf): Implement.
25085 * typemanager.cs: TypeManager: made public variable instead of
25088 * driver.cs: document --fatal.
25090 * report.cs (ErrorMessage, WarningMessage): new names for the old
25091 Error and Warning classes.
25093 * cs-parser.jay (member_access): Turn built-in access to types
25094 into a normal simplename
25096 2001-09-27 Ravi Pratap <ravi@ximian.com>
25098 * expression.cs (Invocation::BetterConversion): Fix to cope
25099 with q being null, since this was introducing a bug.
25101 * expression.cs (ConvertImplicit): Do built-in conversions first.
25103 2001-09-27 Ravi Pratap <ravi@ximian.com>
25105 * expression.cs (UserImplicitCast::Resolve): Fix bug.
25107 2001-09-27 Ravi Pratap <ravi@ximian.com>
25109 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
25110 I had introduced long ago (what's new ?).
25112 * expression.cs (UserImplicitCast::CanConvert): Static method to do
25113 the work of all the checking.
25114 (ConvertImplicit): Call CanConvert and only then create object if necessary.
25115 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
25117 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
25118 that is the right way.
25120 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
25121 overloading resolution. Use everywhere instead of cutting and pasting code.
25123 (Binary::ResolveOperator): Use MakeUnionSet.
25125 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
25126 we have to convert to bool types. Not complete yet.
25128 2001-09-27 Miguel de Icaza <miguel@ximian.com>
25130 * typemanager.cs (TypeManager::CSharpName): support ushort.
25132 * expression.cs (Expression::TryImplicitIntConversion): Attempts
25133 to provide an expression that performsn an implicit constant int
25134 conversion (section 6.1.6).
25135 (Expression::ConvertImplicitRequired): Reworked to include
25136 implicit constant expression conversions.
25138 (Expression::ConvertNumericExplicit): Finished.
25140 (Invocation::Emit): If InstanceExpression is null, then it means
25141 that we perform a call on this.
25143 2001-09-26 Miguel de Icaza <miguel@ximian.com>
25145 * expression.cs (Unary::Emit): Remove some dead code.
25146 (Probe): Implement Resolve and Emit for `is'.
25147 (Expression::ConvertImplicitRequired): Attempt to do constant
25148 expression conversions here. Maybe should be moved to
25149 ConvertImplicit, but I am not sure.
25150 (Expression::ImplicitLongConstantConversionPossible,
25151 Expression::ImplicitIntConstantConversionPossible): New functions
25152 that tell whether is it possible to apply an implicit constant
25153 expression conversion.
25155 (ConvertNumericExplicit): Started work on explicit numeric
25158 * cs-parser.jay: Update operator constants.
25160 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
25161 (Parameters::GetSignature): Hook up VerifyArgs here.
25162 (Parameters::VerifyArgs): Verifies that no two arguments have the
25165 * class.cs (Operator): Update the operator names to reflect the
25166 ones that the spec expects (as we are just stringizing the
25169 * expression.cs (Unary::ResolveOperator): Fix bug: Use
25170 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
25171 previous usage did only work for our methods.
25172 (Expression::ConvertImplicit): Handle decimal implicit numeric
25173 conversions as well.
25174 (Expression::InternalTypeConstructor): Used to invoke constructors
25175 on internal types for default promotions.
25177 (Unary::Emit): Implement special handling for the pre/post
25178 increment/decrement for overloaded operators, as they need to have
25179 the same semantics as the other operators.
25181 (Binary::ResolveOperator): ditto.
25182 (Invocation::ConversionExists): ditto.
25183 (UserImplicitCast::Resolve): ditto.
25185 2001-09-26 Ravi Pratap <ravi@ximian.com>
25187 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
25188 operator, return after emitting body. Regression tests pass again !
25190 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
25191 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
25192 (Invocation::OverloadResolve): Ditto.
25193 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
25195 * everywhere : update calls to the above methods accordingly.
25197 2001-09-26 Miguel de Icaza <miguel@ximian.com>
25199 * assign.cs (Assign): Make it inherit from ExpressionStatement.
25201 * expression.cs (ExpressionStatement): New base class used for
25202 expressions that can appear in statements, so that we can provide
25203 an alternate path to generate expression that do not leave a value
25206 (Expression::Emit, and all the derivatives): We no longer return
25207 whether a value is left on the stack or not. Every expression
25208 after being emitted leaves a single value on the stack.
25210 * codegen.cs (EmitContext::EmitStatementExpression): Use the
25211 facilties of ExpressionStatement if possible.
25213 * cs-parser.jay: Update statement_expression.
25215 2001-09-25 Miguel de Icaza <miguel@ximian.com>
25217 * driver.cs: Change the wording of message
25219 2001-09-25 Ravi Pratap <ravi@ximian.com>
25221 * expression.cs (Binary::ResolveOperator): Had forgottten to set
25222 the type of the expression to the return type of the method if
25223 we have an overloaded operator match ! The regression tests pass again !
25224 (Unary::ResolveOperator): Ditto.
25226 * expression.cs (Invocation::ConversionExists): Correct the member lookup
25227 to find "op_Implicit", not "implicit" ;-)
25228 (UserImplicitCast): New class to take care of user-defined implicit conversions.
25229 (ConvertImplicit, ForceConversion): Take TypeContainer argument
25231 * everywhere : Correct calls to the above accordingly.
25233 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
25234 (ConvertImplicit): Do user-defined conversion if it exists.
25236 2001-09-24 Miguel de Icaza <miguel@ximian.com>
25238 * assign.cs: track location.
25239 (Resolve): Use implicit conversions on assignment.
25241 * literal.cs: Oops. Not good, Emit of short access values should
25242 pass (Bytes) or the wrong argument will be selected.
25244 * expression.cs (Unary::Emit): Emit code for -expr.
25246 (Unary::ResolveOperator): Handle `Substract' for non-constants
25247 (substract from zero from the non-constants).
25248 Deal with Doubles as well.
25250 (Expression::ConvertImplicitRequired): New routine that reports an
25251 error if no implicit conversion exists.
25253 (Invocation::OverloadResolve): Store the converted implicit
25254 expressions if we make them
25256 2001-09-24 Ravi Pratap <ravi@ximian.com>
25258 * class.cs (ConstructorInitializer): Take a Location argument.
25259 (ConstructorBaseInitializer): Same here.
25260 (ConstructorThisInitializer): Same here.
25262 * cs-parser.jay : Update all calls accordingly.
25264 * expression.cs (Unary, Binary, New): Take location argument.
25265 Update accordingly everywhere.
25267 * cs-parser.jay : Update all calls to the above to take a location
25270 * class.cs : Ditto.
25272 2001-09-24 Ravi Pratap <ravi@ximian.com>
25274 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
25275 (Invocation::BetterConversion): Same here
25276 (Invocation::ConversionExists): Ditto.
25278 (Invocation::ConversionExists): Implement.
25280 2001-09-22 Ravi Pratap <ravi@ximian.com>
25282 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
25283 Also take an additional TypeContainer argument.
25285 * All over : Pass in TypeContainer as argument to OverloadResolve.
25287 * typemanager.cs (CSharpName): Update to check for the string type and return
25290 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
25293 2001-09-21 Ravi Pratap <ravi@ximian.com>
25295 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
25296 (Invocation::BetterFunction): Implement.
25297 (Invocation::BetterConversion): Implement.
25298 (Invocation::ConversionExists): Skeleton, no implementation yet.
25300 Okay, things work fine !
25302 2001-09-21 Miguel de Icaza <miguel@ximian.com>
25304 * typemanager.cs: declare and load enum_type, delegate_type and
25307 * expression.cs (Expression::Emit): Now emit returns a value that
25308 tells whether a value is left on the stack or not. This strategy
25309 might be reveted tomorrow with a mechanism that would address
25310 multiple assignments.
25311 (Expression::report118): Utility routine to report mismatches on
25314 (Unary::Report23): Report impossible type/operator combination
25317 (Unary::IsIncrementableNumber): Whether the type can be
25318 incremented or decremented with add.
25319 (Unary::ResolveOperator): Also allow enumerations to be bitwise
25321 (Unary::ResolveOperator): Implement ++, !, ~,
25323 (Invocation::Emit): Deal with new Emit convetion.
25325 * All Expression derivatives: Updated their Emit method to return
25326 whether they leave values on the stack or not.
25328 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
25329 stack for expressions that are statements.
25331 2001-09-20 Miguel de Icaza <miguel@ximian.com>
25333 * expression.cs (LValue): New interface. Must be implemented by
25335 (LocalVariableReference, ParameterReference, FieldExpr): Implement
25338 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
25339 interface for generating code, simplifies the code.
25341 2001-09-20 Ravi Pratap <ravi@ximian.com>
25343 * expression.cs (everywhere): Comment out return statements in ::Resolve
25344 methods to avoid the warnings.
25346 2001-09-20 Miguel de Icaza <miguel@ximian.com>
25348 * driver.cs (parse): Report error 2001 if we can not open the
25351 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
25354 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
25357 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
25358 otherwise nested blocks end up with the same index.
25360 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
25362 * expression.cs: Instead of having FIXMEs in the Resolve
25363 functions, throw exceptions so it is obvious that we are facing a
25366 * cs-parser.jay (invocation_expression): Pass Location information.
25368 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
25369 Use a basename for those routines because .NET does not like paths
25372 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
25375 2001-09-19 Miguel de Icaza <miguel@ximian.com>
25377 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
25378 are loading the correct data types (throws an exception if not).
25379 (TypeManager::InitCoreTypes): Use CoreLookupType
25381 * expression.cs (Unary::ResolveOperator): return the child
25382 expression for expressions which are just +expr.
25383 (Unary::ResolveOperator): Return negative literals for -LITERAL
25384 expressions (otherwise they are Unary {Literal}).
25385 (Invocation::Badness): Take into account `Implicit constant
25386 expression conversions'.
25388 * literal.cs (LongLiteral): Implement long literal class.
25389 (IntLiteral): export the `Value' of the intliteral.
25391 2001-09-19 Ravi Pratap <ravi@ximian.com>
25393 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
25395 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
25396 instead of 'Operator'
25398 * expression.cs (Binary::ResolveOperator): Update accordingly.
25399 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
25402 * cs-parser.jay (unary_expression): Update to use the new names.
25404 * gen-treedump.cs (GetUnary): Same here.
25406 * expression.cs (Unary::Resolve): Implement.
25407 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
25408 operators are found instead of making noise ;-)
25409 (Unary::ResolveOperator): New method to do precisely the same thing which
25410 Binary::ResolveOperator does for Binary expressions.
25411 (Unary.method, .Arguments): Add.
25412 (Unary::OperName): Implement.
25413 (Unary::ForceConversion): Copy and Paste !
25415 * class.cs (Operator::Define): Fix a small bug for the case when we have
25418 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
25419 for the inbuilt operators. Only overloading works for now ;-)
25421 2001-09-18 Miguel de Icaza <miguel@ximian.com>
25423 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
25424 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
25426 * expression.cs (This::Emit): Implement.
25427 (This::Resolve): Implement.
25428 (TypeOf:Resolve): Implement.
25429 (Expression::ResolveSimpleName): Add an implicit this to instance
25431 (MemberAccess::Resolve): Deal with Parameters and Fields.
25432 Bind instance variable to Field expressions.
25433 (FieldExpr::Instance): New field used to track the expression that
25434 represents the object instance.
25435 (FieldExpr::Resolve): Track potential errors from MemberLookup not
25437 (FieldExpr::Emit): Implement.
25439 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
25440 the last instruction contains a return opcode to avoid generating
25441 the last `ret' instruction (this generates correct code, and it is
25442 nice to pass the peverify output).
25444 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
25445 initializer for static and instance variables.
25446 (Constructor::Emit): Allow initializer to be null in the case of
25447 static constructors. Only emit initializer for instance
25450 (TypeContainer::FindMembers): Return a null array if there are no
25453 Also fix the code for the MemberTypes.Method branch, as it was not
25454 scanning that for operators (or tried to access null variables before).
25456 * assign.cs (Assign::Emit): Handle instance and static fields.
25460 * driver.cs: Stop compilation if there are parse errors.
25462 * cs-parser.jay (constructor_declaration): Provide default base
25463 initializer for non-static constructors.
25464 (constructor_declarator): Do not provide a default base
25465 initializers if none was specified.
25466 Catch the fact that constructors should not have parameters.
25468 * class.cs: Do not emit parent class initializers for static
25469 constructors, that should be flagged as an error.
25471 2001-09-18 Ravi Pratap <ravi@ximian.com>
25473 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
25474 Move back code into TypeContainer::Populate.
25476 2001-09-18 Ravi Pratap <ravi@ximian.com>
25478 * class.cs (TypeContainer::AddConstructor): Fix the check to
25479 compare against Name, not Basename.
25480 (Operator::OpType): Change Plus and Minus to Add and Subtract.
25482 * cs-parser.jay : Update accordingly.
25484 * class.cs (TypeContainer::FindMembers): For the case where we are searching
25485 for methods, don't forget to look into the operators too.
25486 (RegisterMethodBuilder): Helper method to take care of this for
25487 methods, constructors and operators.
25488 (Operator::Define): Completely revamp.
25489 (Operator.OperatorMethod, MethodName): New fields.
25490 (TypeContainer::Populate): Move the registering of builders into
25491 RegisterMethodBuilder.
25492 (Operator::Emit): Re-write.
25494 * expression.cs (Binary::Emit): Comment out code path to emit method
25495 invocation stuff for the case when we have a user defined operator. I am
25496 just not able to get it right !
25498 2001-09-17 Miguel de Icaza <miguel@ximian.com>
25500 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
25503 (Expression::MemberLookup): Provide a version that allows to
25504 specify the MemberTypes and BindingFlags.
25506 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
25507 so it was not fetching variable information from outer blocks.
25509 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
25510 Beforefieldinit as it was buggy.
25512 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
25513 that Ravi put here.
25515 * class.cs (Constructor::Emit): Only emit if block is not null.
25516 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
25517 deal with this by semantically definining it as if the user had
25520 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
25521 constructors as we now "emit" them at a higher level.
25523 (TypeContainer::DefineDefaultConstructor): Used to define the
25524 default constructors if none was provided.
25526 (ConstructorInitializer): Add methods Resolve and Emit.
25528 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
25530 2001-09-17 Ravi Pratap <ravi@ximian.com>
25532 * class.cs (TypeContainer::EmitDefaultConstructor): Register
25533 the default constructor builder with our hashtable for methodbuilders
25536 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
25537 and argument_count is 0 in which case we have a match.
25538 (Binary::ResolveOperator): More null checking and miscellaneous coding
25541 2001-09-17 Ravi Pratap <ravi@ximian.com>
25543 * rootcontext.cs (IsNameSpace): Compare against null.
25545 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
25547 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
25548 and Unary::Operator.
25550 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
25553 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
25554 we have overloaded operators.
25555 (Binary::ResolveOperator): Implement the part which does the operator overload
25558 * class.cs (Operator::Emit): Implement.
25559 (TypeContainer::Emit): Emit the operators we have too.
25561 * expression.cs (Binary::Emit): Update to emit the appropriate code for
25562 the case when we have a user-defined operator.
25564 2001-09-17 Miguel de Icaza <miguel@ximian.com>
25566 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
25568 2001-09-16 Ravi Pratap <ravi@ximian.com>
25570 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
25571 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
25572 (Constructor::Emit): Implement.
25573 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
25574 if we have no work to do.
25575 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
25578 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
25579 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
25581 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
25584 2001-09-15 Ravi Pratap <ravi@ximian.com>
25586 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
25588 (Tree::RecordNamespace): Method to do what the name says ;-)
25589 (Tree::Namespaces): Property to get at the namespaces hashtable.
25591 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
25594 * rootcontext.cs (IsNamespace): Fixed it :-)
25596 2001-09-14 Miguel de Icaza <miguel@ximian.com>
25598 * class.cs (TypeContainer::FindMembers): Add support for
25600 (MethodCore): New class that encapsulates both the shared aspects
25601 of a Constructor and a Method.
25602 (Method, Constructor): Factored pieces into MethodCore.
25604 * driver.cs: Added --fatal which makes errors throw exceptions.
25605 Load System assembly as well as part of the standard library.
25607 * report.cs: Allow throwing exceptions on errors for debugging.
25609 * modifiers.cs: Do not use `parent', instead use the real type
25610 container to evaluate permission settings.
25612 * class.cs: Put Ravi's patch back in. He is right, and we will
25613 have to cope with the
25615 2001-09-14 Ravi Pratap <ravi@ximian.com>
25617 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
25618 FamORAssem, not FamANDAssem.
25620 2001-09-14 Miguel de Icaza <miguel@ximian.com>
25622 * driver.cs: Added --parse option that only parses its input files
25625 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
25626 incorrect. IsTopLevel is not used to tell whether an object is
25627 root_types or not (that can be achieved by testing this ==
25628 root_types). But to see if this is a top-level *class* (not
25629 necessarly our "toplevel" container).
25631 2001-09-14 Ravi Pratap <ravi@ximian.com>
25633 * enum.cs (Enum::Define): Modify to call the Lookup method on the
25634 parent instead of a direct call to GetType.
25636 2001-09-14 Ravi Pratap <ravi@ximian.com>
25638 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
25639 Modifiers.TypeAttr. This should just be a call to that method.
25641 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
25642 object so that we can determine if we are top-level or not.
25644 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
25647 * enum.cs (Enum::Define): Ditto.
25649 * modifiers.cs (FieldAttr): Re-write.
25651 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
25652 (TypeContainer::HaveStaticConstructor): New property to provide access
25653 to precisely that info.
25655 * modifiers.cs (MethodAttr): Re-write.
25656 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
25658 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
25659 of top-level types as claimed.
25661 2001-09-13 Miguel de Icaza <miguel@ximian.com>
25663 * expression.cs (MemberLookup): Fruitless attempt to lookup
25664 constructors. Maybe I need to emit default constructors? That
25665 might be it (currently .NET emits this for me automatically).
25666 (Invocation::OverloadResolve): Cope with Arguments == null.
25667 (Invocation::EmitArguments): new function, shared by the new
25668 constructor and us.
25669 (Invocation::Emit): Handle static and instance methods. Emit
25670 proper call instruction for virtual or non-virtual invocations.
25671 (New::Emit): Implement.
25672 (New::Resolve): Implement.
25673 (MemberAccess:Resolve): Implement.
25674 (MethodGroupExpr::InstanceExpression): used conforming to the spec
25675 to track instances.
25676 (FieldExpr::Resolve): Set type.
25678 * support.cs: Handle empty arguments.
25680 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
25681 SimpleLookup): Auxiliary routines to help parse a qualifier
25684 Update qualifier_identifier rule.
25686 * codegen.cs: Removed debugging messages.
25688 * class.cs: Make this a global thing, this acts just as a "key" to
25689 objects that we might have around.
25691 (Populate): Only initialize method_builders_to_methods once.
25693 * expression.cs (PropertyExpr): Initialize type from the
25696 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
25697 Resolve pattern. Attempt to implicitly convert value to boolean.
25700 * expression.cs: Set the type for the int32/int32 argument case.
25701 (Binary::ResolveOperator): Set the return type to boolean for
25702 comparission operators
25704 * typemanager.cs: Remove debugging print code.
25706 (Invocation::Resolve): resolve type.
25708 * class.cs: Allocate a MemberInfo of the correct size, as the code
25709 elsewhere depends on the test to reflect the correct contents.
25711 (Method::) Keep track of parameters, due to System.Reflection holes
25713 (TypeContainer::Populate): Keep track of MethodBuilders to Method
25716 (TypeContainer::FindMembers): Use ArrayList and then copy an array
25717 of the exact size and return that.
25719 (Class::LookupMethodByBuilder): New function that maps
25720 MethodBuilders to its methods. Required to locate the information
25721 on methods because System.Reflection bit us again.
25723 * support.cs: New file, contains an interface ParameterData and
25724 two implementations: ReflectionParameters and InternalParameters
25725 used to access Parameter information. We will need to grow this
25728 * expression.cs (Invocation::GetParameterData): implement a cache
25729 and a wrapper around the ParameterData creation for methods.
25730 (Invocation::OverloadResolve): Use new code.
25732 2001-09-13 Ravi Pratap <ravi@ximian.com>
25734 * class.cs (TypeContainer::EmitField): Remove and move into
25735 (Field::Define): here and modify accordingly.
25736 (Field.FieldBuilder): New member.
25737 (TypeContainer::Populate): Update accordingly.
25738 (TypeContainer::FindMembers): Implement.
25740 2001-09-13 Miguel de Icaza <miguel@ximian.com>
25742 * statement.cs: (VariableInfo::VariableType): New field to be
25743 initialized with the full type once it is resolved.
25745 2001-09-12 Miguel de Icaza <miguel@ximian.com>
25747 * parameter.cs (GetParameterInfo): Use a type cache to compute
25748 things only once, and to reuse this information
25750 * expression.cs (LocalVariableReference::Emit): Implement.
25751 (OpcodeCast::Emit): fix.
25753 (ParameterReference::Resolve): Implement.
25754 (ParameterReference::Emit): Implement.
25756 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
25757 that are expressions need to stay as Expressions.
25759 * typemanager.cs (CSharpName): Returns the C# name of a type if
25762 * expression.cs (Expression::ConvertImplicit): New function that
25763 implements implicit type conversions.
25765 (Expression::ImplicitReferenceConversion): Implements implicit
25766 reference conversions.
25768 (EmptyCast): New type for transparent casts.
25770 (OpcodeCast): New type for casts of types that are performed with
25771 a sequence of bytecodes.
25773 (BoxedCast): New type used for casting value types into reference
25774 types. Emits a box opcode.
25776 (Binary::DoNumericPromotions): Implements numeric promotions of
25777 and computation of the Binary::Type.
25779 (Binary::EmitBranchable): Optimization.
25781 (Binary::Emit): Implement code emission for expressions.
25783 * typemanager.cs (TypeManager): Added two new core types: sbyte
25786 2001-09-12 Ravi Pratap <ravi@ximian.com>
25788 * class.cs (TypeContainer::FindMembers): Method which does exactly
25789 what Type.FindMembers does, only we don't have to use reflection. No
25790 implementation yet.
25792 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
25793 typecontainer objects as we need to get at them.
25794 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
25796 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
25797 typecontainer object.
25799 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
25800 of just a Report object.
25802 2001-09-11 Ravi Pratap <ravi@ximian.com>
25804 * class.cs (Event::Define): Go back to using the prefixes "add_" and
25806 (TypeContainer::Populate): Now define the delegates of the type too.
25807 (TypeContainer.Delegates): Property to access the list of delegates defined
25810 * delegates.cs (Delegate::Define): Implement partially.
25812 * modifiers.cs (TypeAttr): Handle more flags.
25814 2001-09-11 Ravi Pratap <ravi@ximian.com>
25816 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
25818 (Operator::Define): Re-write logic to get types by using the LookupType method
25819 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
25820 (Indexer::Define): Ditto.
25821 (Event::Define): Ditto.
25822 (Property::Define): Ditto.
25824 2001-09-10 Ravi Pratap <ravi@ximian.com>
25826 * class.cs (TypeContainer::Populate): Now define operators too.
25827 (TypeContainer.Operators): New property to access the list of operators
25829 (Operator.OperatorMethodBuilder): New member to hold the method builder
25830 for the operator we are defining.
25831 (Operator::Define): Implement.
25833 2001-09-10 Ravi Pratap <ravi@ximian.com>
25835 * class.cs (Event::Define): Make the prefixes of the accessor methods
25836 addOn_ and removeOn_
25838 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
25839 of the location being passed in too. Ideally, this should go later since all
25840 error reporting should be done through the Report object.
25842 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
25843 (Populate): Iterate thru the indexers we have and define them too.
25844 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
25845 for the get and set accessors.
25846 (Indexer::Define): Implement.
25848 2001-09-09 Miguel de Icaza <miguel@ximian.com>
25850 * expression.cs (Binary::Resolve): Beginning of it. I scratched
25851 my previous implementation, did not work.
25853 * typemanager.cs: Add a couple of missing types (the longs).
25855 * literal.cs: Use TypeManager.bool_type instead of getting it.
25857 * expression.cs (EventExpr): New kind of expressions.
25858 (Expressio::ExprClassFromMemberInfo): finish
25860 2001-09-08 Miguel de Icaza <miguel@ximian.com>
25862 * assign.cs: Emit stores to static fields differently.
25864 2001-09-08 Ravi Pratap <ravi@ximian.com>
25866 * Merge in changes and adjust code to tackle conflicts. Backed out my
25867 code in Assign::Resolve ;-)
25869 2001-09-08 Ravi Pratap <ravi@ximian.com>
25871 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
25872 instead Report.Error and also pass in the location.
25873 (CSharpParser::Lexer): New readonly property to return the reference
25874 to the Tokenizer object.
25875 (declare_local_variables): Use Report.Error with location instead of plain
25879 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
25880 (Operator.CheckBinaryOperator): Ditto.
25882 * cs-parser.jay (operator_declarator): Update accordingly.
25884 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
25885 (CheckBinaryOperator): Same here.
25887 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
25888 on the name without any prefixes of namespace names etc. This is because we
25889 already might have something already fully qualified like
25890 'System.Console.WriteLine'
25892 * assign.cs (Resolve): Begin implementation. Stuck ;-)
25894 2001-09-07 Ravi Pratap <ravi@ximian.com>
25896 * cs-tokenizer.cs (location): Return a string which also contains
25899 * expression.cs (ElementAccess): New class for expressions of the
25900 type 'element access.'
25901 (BaseAccess): New class for expressions of the type 'base access.'
25902 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
25905 * cs-parser.jay (element_access): Implement action.
25906 (base_access): Implement actions.
25907 (checked_expression, unchecked_expression): Implement.
25909 * cs-parser.jay (local_variable_type): Correct and implement.
25910 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
25912 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
25914 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
25915 name and the specifiers.
25917 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
25919 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
25920 making them all public ;-)
25922 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
25925 2001-09-07 Miguel de Icaza <miguel@ximian.com>
25927 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
25929 (FieldExpr, PropertyExprs): New resolved expressions.
25930 (SimpleName::MemberStaticCheck): Perform static checks for access
25931 to non-static fields on static methods. Maybe this should be
25932 generalized for MemberAccesses.
25933 (SimpleName::ResolveSimpleName): More work on simple name
25936 * cs-parser.jay (primary_expression/qualified_identifier): track
25937 the parameter index.
25939 * codegen.cs (CodeGen::Save): Catch save exception, report error.
25940 (EmitContext::EmitBoolExpression): Chain to expression generation
25941 instead of temporary hack.
25942 (::EmitStatementExpression): Put generic expression code generation.
25944 * assign.cs (Assign::Emit): Implement variable assignments to
25945 local variables, parameters and fields.
25947 2001-09-06 Miguel de Icaza <miguel@ximian.com>
25949 * statement.cs (Block::GetVariableInfo): New method, returns the
25950 VariableInfo for a variable name in a block.
25951 (Block::GetVariableType): Implement in terms of GetVariableInfo
25953 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
25954 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
25956 2001-09-06 Ravi Pratap <ravi@ximian.com>
25958 * cs-parser.jay (operator_declaration): Continue on my quest : update
25959 to take attributes argument.
25960 (event_declaration): Ditto.
25961 (enum_declaration): Ditto.
25962 (indexer_declaration): Ditto.
25964 * class.cs (Operator::Operator): Update constructor accordingly.
25965 (Event::Event): Ditto.
25967 * delegate.cs (Delegate::Delegate): Same here.
25969 * enum.cs (Enum::Enum): Same here.
25971 2001-09-05 Ravi Pratap <ravi@ximian.com>
25973 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
25975 * ../tests/cs0658.cs : New file to demonstrate error 0658.
25977 * attribute.cs (Attributes): New class to encapsulate all attributes which were
25978 being passed around as an arraylist.
25979 (Attributes::AddAttribute): Method to add attribute sections.
25981 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
25982 (struct_declaration): Update accordingly.
25983 (constant_declaration): Update.
25984 (field_declaration): Update.
25985 (method_header): Update.
25986 (fixed_parameter): Update.
25987 (parameter_array): Ditto.
25988 (property_declaration): Ditto.
25989 (destructor_declaration): Ditto.
25991 * class.cs (Struct::Struct): Update constructors accordingly.
25992 (Class::Class): Ditto.
25993 (Field::Field): Ditto.
25994 (Method::Method): Ditto.
25995 (Property::Property): Ditto.
25996 (TypeContainer::OptAttribute): update property's return type.
25998 * interface.cs (Interface.opt_attributes): New member.
25999 (Interface::Interface): Update to take the extra Attributes argument.
26001 * parameter.cs (Parameter::Parameter): Ditto.
26003 * constant.cs (Constant::Constant): Ditto.
26005 * interface.cs (InterfaceMemberBase): New OptAttributes field.
26006 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
26007 the attributes as a parameter.
26008 (InterfaceProperty): Update constructor call.
26009 (InterfaceEvent): Ditto.
26010 (InterfaceMethod): Ditto.
26011 (InterfaceIndexer): Ditto.
26013 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
26014 pass the attributes too.
26015 (interface_event_declaration): Ditto.
26016 (interface_property_declaration): Ditto.
26017 (interface_method_declaration): Ditto.
26018 (interface_declaration): Ditto.
26020 2001-09-05 Miguel de Icaza <miguel@ximian.com>
26022 * class.cs (Method::Define): Track the "static Main" definition to
26023 create an entry point.
26025 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
26026 EntryPoint if we find it.
26028 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
26029 (EmitContext::ig): Make this variable public.
26031 * driver.cs: Make the default output file be the first file name
26032 with the .exe extension.
26034 Detect empty compilations
26036 Handle various kinds of output targets. Handle --target and
26037 rename -t to --dumper.
26039 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
26040 methods inherited from Expression return now an Expression. This
26041 will is used during the tree rewriting as we resolve them during
26044 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
26045 the spec. Missing entirely is the information about
26046 accessability of elements of it.
26048 (Expression::ExprClassFromMemberInfo): New constructor for
26049 Expressions that creates a fully initialized Expression based on
26050 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
26053 (Invocation::Resolve): Begin implementing resolution of invocations.
26055 * literal.cs (StringLiteral): Implement Emit.
26057 2001-09-05 Ravi Pratap <ravi@ximian.com>
26059 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
26062 2001-09-04 Ravi Pratap <ravi@ximian.com>
26064 * cs-parser.jay (attribute_arguments): Implement actions.
26065 (attribute): Fix bug in production. Implement action.
26066 (attribute_list): Implement.
26067 (attribute_target): Implement.
26068 (attribute_target_specifier, opt_target_specifier): Implement
26069 (CheckAttributeTarget): New method to check if the attribute target
26071 (attribute_section): Implement.
26072 (opt_attributes): Implement.
26074 * attribute.cs : New file to handle attributes.
26075 (Attribute): Class to hold attribute info.
26077 * cs-parser.jay (opt_attribute_target_specifier): Remove production
26078 (attribute_section): Modify production to use 2 different rules to
26079 achieve the same thing. 1 s/r conflict down !
26080 Clean out commented, useless, non-reducing dimension_separator rules.
26082 * class.cs (TypeContainer.attributes): New member to hold list
26083 of attributes for a type.
26084 (Struct::Struct): Modify to take one more argument, the attribute list.
26085 (Class::Class): Ditto.
26086 (Field::Field): Ditto.
26087 (Method::Method): Ditto.
26088 (Property::Property): Ditto.
26090 * cs-parser.jay (struct_declaration): Update constructor call to
26091 pass in the attributes too.
26092 (class_declaration): Ditto.
26093 (constant_declaration): Ditto.
26094 (field_declaration): Ditto.
26095 (method_header): Ditto.
26096 (fixed_parameter): Ditto.
26097 (parameter_array): Ditto.
26098 (property_declaration): Ditto.
26100 * constant.cs (Constant::Constant): Update constructor similarly.
26101 Use System.Collections.
26103 * parameter.cs (Parameter::Parameter): Update as above.
26105 2001-09-02 Ravi Pratap <ravi@ximian.com>
26107 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
26108 (TypeContainer.delegates): New member to hold list of delegates.
26110 * cs-parser.jay (delegate_declaration): Implement the action correctly
26111 this time as I seem to be on crack ;-)
26113 2001-09-02 Miguel de Icaza <miguel@ximian.com>
26115 * rootcontext.cs (RootContext::IsNamespace): new function, used to
26116 tell whether an identifier represents a namespace.
26118 * expression.cs (NamespaceExpr): A namespace expression, used only
26119 temporarly during expression resolution.
26120 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
26121 utility functions to resolve names on expressions.
26123 2001-09-01 Miguel de Icaza <miguel@ximian.com>
26125 * codegen.cs: Add hook for StatementExpressions.
26127 * class.cs: Fix inverted test for static flag in methods.
26129 2001-09-02 Ravi Pratap <ravi@ximian.com>
26131 * class.cs (Operator::CheckUnaryOperator): Correct error number used
26132 to make it coincide with MS' number.
26133 (Operator::CheckBinaryOperator): Ditto.
26135 * ../errors/errors.txt : Remove error numbers added earlier.
26137 * ../errors/cs1019.cs : Test case for error # 1019
26139 * ../errros/cs1020.cs : Test case for error # 1020
26141 * cs-parser.jay : Clean out commented cruft.
26142 (dimension_separators, dimension_separator): Comment out. Ostensibly not
26143 used anywhere - non-reducing rule.
26144 (namespace_declarations): Non-reducing rule - comment out.
26146 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
26147 with TypeContainer::AddEnum.
26149 * delegate.cs : New file for delegate handling classes.
26150 (Delegate): Class for declaring delegates.
26152 * makefile : Update.
26154 * cs-parser.jay (delegate_declaration): Implement.
26156 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
26158 * class.cs (Event::Define): Implement.
26159 (Event.EventBuilder): New member.
26161 * class.cs (TypeContainer::Populate): Update to define all enums and events
26163 (Events): New property for the events arraylist we hold. Shouldn't we move to using
26164 readonly fields for all these cases ?
26166 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
26168 * class.cs (Property): Revamp to use the convention of making fields readonly.
26169 Accordingly modify code elsewhere.
26171 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
26172 the Define method of the Property class.
26174 * class.cs : Clean up applied patch and update references to variables etc. Fix
26176 (TypeContainer::Populate): Update to define all the properties we have. Also
26177 define all enumerations.
26179 * enum.cs (Define): Implement.
26181 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
26183 * cs-parser.jay (overloadable_operator): The semantic value is an
26184 enum of the Operator class.
26185 (operator_declarator): Implement actions.
26186 (operator_declaration): Implement.
26188 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
26189 validity of definitions.
26190 (Operator::CheckBinaryOperator): Static method to check for binary operators
26191 (TypeContainer::AddOperator): New method to add an operator to a type.
26193 * cs-parser.jay (indexer_declaration): Added line to actually call the
26194 AddIndexer method so it gets added ;-)
26196 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
26197 already taken care of by the MS compiler ?
26199 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
26201 * class.cs (Operator): New class for operator declarations.
26202 (Operator::OpType): Enum for the various operators.
26204 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
26206 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
26207 ostensibly handle this in semantic analysis.
26209 * cs-parser.jay (general_catch_clause): Comment out
26210 (specific_catch_clauses, specific_catch_clause): Ditto.
26211 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
26212 (catch_args, opt_catch_args): New productions.
26213 (catch_clause): Rewrite to use the new productions above
26214 (catch_clauses): Modify accordingly.
26215 (opt_catch_clauses): New production to use in try_statement
26216 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
26217 and re-write the code in the actions to extract the specific and
26218 general catch clauses by being a little smart ;-)
26220 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
26221 Hooray, try and catch statements parse fine !
26223 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
26225 * statement.cs (Block::GetVariableType): Fix logic to extract the type
26226 string from the hashtable of variables.
26228 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
26229 I end up making that mistake ;-)
26230 (catch_clauses): Fixed gross error which made Key and Value of the
26231 DictionaryEntry the same : $1 !!
26233 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
26235 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
26237 * cs-parser.jay (event_declaration): Correct to remove the semicolon
26238 when the add and remove accessors are specified.
26240 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
26242 * cs-parser.jay (IndexerDeclaration): New helper class to hold
26243 information about indexer_declarator.
26244 (indexer_declarator): Implement actions.
26245 (parsing_indexer): New local boolean used to keep track of whether
26246 we are parsing indexers or properties. This is necessary because
26247 implicit_parameters come into picture even for the get accessor in the
26248 case of an indexer.
26249 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
26251 * class.cs (Indexer): New class for indexer declarations.
26252 (TypeContainer::AddIndexer): New method to add an indexer to a type.
26253 (TypeContainer::indexers): New member to hold list of indexers for the
26256 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
26258 * cs-parser.jay (add_accessor_declaration): Implement action.
26259 (remove_accessor_declaration): Implement action.
26260 (event_accessors_declaration): Implement
26261 (variable_declarators): swap statements for first rule - trivial.
26263 * class.cs (Event): New class to hold information about event
26265 (TypeContainer::AddEvent): New method to add an event to a type
26266 (TypeContainer::events): New member to hold list of events.
26268 * cs-parser.jay (event_declaration): Implement actions.
26270 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
26272 * cs-parser.jay (dim_separators): Implement. Make it a string
26273 concatenating all the commas together, just as they appear.
26274 (opt_dim_separators): Modify accordingly
26275 (rank_specifiers): Update accordingly. Basically do the same
26276 thing - instead, collect the brackets here.
26277 (opt_rank_sepcifiers): Modify accordingly.
26278 (array_type): Modify to actually return the complete type string
26279 instead of ignoring the rank_specifiers.
26280 (expression_list): Implement to collect the expressions
26281 (variable_initializer): Implement. We make it a list of expressions
26282 essentially so that we can handle the array_initializer case neatly too.
26283 (variable_initializer_list): Implement.
26284 (array_initializer): Make it a list of variable_initializers
26285 (opt_array_initializer): Modify accordingly.
26287 * expression.cs (New::NType): Add enumeration to help us
26288 keep track of whether we have an object/delegate creation
26289 or an array creation.
26290 (New:NewType, New::Rank, New::Indices, New::Initializers): New
26291 members to hold data about array creation.
26292 (New:New): Modify to update NewType
26293 (New:New): New Overloaded contructor for the array creation
26296 * cs-parser.jay (array_creation_expression): Implement to call
26297 the overloaded New constructor.
26299 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
26301 * class.cs (TypeContainer::Constructors): Return member
26302 constructors instead of returning null.
26304 2001-08-26 Miguel de Icaza <miguel@ximian.com>
26306 * typemanager.cs (InitCoreTypes): Initialize the various core
26307 types after we have populated the type manager with the user
26308 defined types (this distinction will be important later while
26309 compiling corlib.dll)
26311 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
26312 on Expression Classification. Now all expressions have a method
26313 `Resolve' and a method `Emit'.
26315 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
26316 generation from working. Also add some temporary debugging
26319 2001-08-24 Miguel de Icaza <miguel@ximian.com>
26321 * codegen.cs: Lots of code generation pieces. This is only the
26322 beginning, will continue tomorrow with more touches of polish. We
26323 handle the fundamentals of if, while, do, for, return. Others are
26324 trickier and I need to start working on invocations soon.
26326 * gen-treedump.cs: Bug fix, use s.Increment here instead of
26329 * codegen.cs (EmitContext): New struct, used during code
26330 emission to keep a context. Most of the code generation will be
26333 * cs-parser.jay: Add embedded blocks to the list of statements of
26334 this block. So code generation proceeds in a top down fashion.
26336 2001-08-23 Miguel de Icaza <miguel@ximian.com>
26338 * statement.cs: Add support for multiple child blocks.
26340 2001-08-22 Miguel de Icaza <miguel@ximian.com>
26342 * codegen.cs (EmitCode): New function, will emit the code for a
26343 Block of code given a TypeContainer and its ILGenerator.
26345 * statement.cs (Block): Standard public readonly optimization.
26346 (Block::Block constructors): Link children.
26347 (Block::Child): Child Linker.
26348 (Block::EmitVariables): Emits IL variable declarations.
26350 * class.cs: Drop support for MethodGroups here, delay until
26352 (Method::): Applied the same simplification that I did before, and
26353 move from Properties to public readonly fields.
26354 (Method::ParameterTypes): Returns the parameter types for the
26355 function, and implements a cache that will be useful later when I
26356 do error checking and the semantic analysis on the methods is
26358 (Constructor::GetCallingConvention): Renamed from CallingConvetion
26359 and made a method, optional argument tells whether this is a class
26360 or a structure to apply the `has-this' bit.
26361 (Method::GetCallingConvention): Implement, returns the calling
26363 (Method::Define): Defines the type, a second pass is performed
26364 later to populate the methods.
26366 (Constructor::ParameterTypes): implement a cache similar to the
26367 one on Method::ParameterTypes, useful later when we do semantic
26370 (TypeContainer::EmitMethod): New method. Emits methods.
26372 * expression.cs: Removed MethodGroup class from here.
26374 * parameter.cs (Parameters::GetCallingConvention): new method.
26376 2001-08-21 Miguel de Icaza <miguel@ximian.com>
26378 * class.cs (TypeContainer::Populate): Drop RootContext from the
26381 (Constructor::CallingConvention): Returns the calling convention.
26382 (Constructor::ParameterTypes): Returns the constructor parameter
26385 (TypeContainer::AddConstructor): Keep track of default constructor
26386 and the default static constructor.
26388 (Constructor::) Another class that starts using `public readonly'
26389 instead of properties.
26391 (Constructor::IsDefault): Whether this is a default constructor.
26393 (Field::) use readonly public fields instead of properties also.
26395 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
26396 track of static constructors; If none is used, turn on
26397 BeforeFieldInit in the TypeAttributes.
26399 * cs-parser.jay (opt_argument_list): now the return can be null
26400 for the cases where there are no arguments.
26402 (constructor_declarator): If there is no implicit `base' or
26403 `this', then invoke the default parent constructor.
26405 * modifiers.cs (MethodAttr): New static function maps a set of
26406 modifiers flags into a MethodAttributes enum
26407 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
26408 MethodAttr, TypeAttr to represent the various mappings where the
26409 modifiers are used.
26410 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
26412 2001-08-19 Miguel de Icaza <miguel@ximian.com>
26414 * parameter.cs (GetParameterInfo): Fix bug where there would be no
26417 * interface.cs (PopulateIndexer): Implemented the code generator
26418 for interface indexers.
26420 2001-08-17 Miguel de Icaza <miguel@ximian.com>
26422 * interface.cs (InterfaceMemberBase): Now we track the new status
26425 (PopulateProperty): Implement property population. Woohoo! Got
26426 Methods and Properties going today.
26428 Removed all the properties for interfaces, and replaced them with
26429 `public readonly' fields.
26431 2001-08-16 Miguel de Icaza <miguel@ximian.com>
26433 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
26434 initialize their hashtables/arraylists only when they are needed
26435 instead of doing this always.
26437 * parameter.cs: Handle refs and out parameters.
26439 * cs-parser.jay: Use an ArrayList to construct the arguments
26440 instead of the ParameterCollection, and then cast that to a
26443 * parameter.cs: Drop the use of ParameterCollection and use
26444 instead arrays of Parameters.
26446 (GetParameterInfo): Use the Type, not the Name when resolving
26449 2001-08-13 Miguel de Icaza <miguel@ximian.com>
26451 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
26452 and instead use public readonly fields.
26454 * class.cs: Put back walking code for type containers.
26456 2001-08-11 Miguel de Icaza <miguel@ximian.com>
26458 * class.cs (MakeConstant): Code to define constants.
26460 * rootcontext.cs (LookupType): New function. Used to locate types
26463 2001-08-08 Miguel de Icaza <miguel@ximian.com>
26465 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
26466 this System.Reflection code is. Kudos to Microsoft
26468 * typemanager.cs: Implement a type cache and avoid loading all
26469 types at boot time. Wrap in LookupType the internals. This made
26470 the compiler so much faster. Wow. I rule!
26472 * driver.cs: Make sure we always load mscorlib first (for
26473 debugging purposes, nothing really important).
26475 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
26476 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
26478 * rootcontext.cs: Lookup types on their namespace; Lookup types
26479 on namespaces that have been imported using the `using' keyword.
26481 * class.cs (TypeContainer::TypeAttr): Virtualize.
26482 (Class::TypeAttr): Return attributes suitable for this bad boy.
26483 (Struct::TypeAttr): ditto.
26484 Handle nested classes.
26485 (TypeContainer::) Remove all the type visiting code, it is now
26486 replaced with the rootcontext.cs code
26488 * rootcontext.cs (GetClassBases): Added support for structs.
26490 2001-08-06 Miguel de Icaza <miguel@ximian.com>
26492 * interface.cs, statement.cs, class.cs, parameter.cs,
26493 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
26494 Drop use of TypeRefs, and use strings instead.
26496 2001-08-04 Miguel de Icaza <miguel@ximian.com>
26500 * class.cs (Struct::Struct): set the SEALED flags after
26501 checking the modifiers.
26502 (TypeContainer::TypeAttr): new property, returns the
26503 TypeAttributes for a class.
26505 * cs-parser.jay (type_list): Oops, list production was creating a
26506 new list of base types.
26508 * rootcontext.cs (StdLib): New property.
26509 (GetInterfaceTypeByName): returns an interface by type name, and
26510 encapsulates error handling here.
26511 (GetInterfaces): simplified.
26512 (ResolveTree): Encapsulated all the tree resolution here.
26513 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
26516 * driver.cs: Add support for --nostdlib, to avoid loading the
26517 default assemblies.
26518 (Main): Do not put tree resolution here.
26520 * rootcontext.cs: Beginning of the class resolution.
26522 2001-08-03 Miguel de Icaza <miguel@ximian.com>
26524 * rootcontext.cs: Provide better error reporting.
26526 * cs-parser.jay (interface_base): set our $$ to be interfaces.
26528 * rootcontext.cs (CreateInterface): Handle the case where there
26529 are no parent interfaces.
26531 (CloseTypes): Routine to flush types at the end.
26532 (CreateInterface): Track types.
26533 (GetInterfaces): Returns an array of Types from the list of
26534 defined interfaces.
26536 * typemanager.c (AddUserType): Mechanism to track user types (puts
26537 the type on the global type hash, and allows us to close it at the
26540 2001-08-02 Miguel de Icaza <miguel@ximian.com>
26542 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
26543 RecordInterface instead.
26545 * cs-parser.jay: Updated to reflect changes above.
26547 * decl.cs (Definition): Keep track of the TypeBuilder type that
26548 represents this type here. Not sure we will use it in the long
26549 run, but wont hurt for now.
26551 * driver.cs: Smaller changes to accomodate the new code.
26553 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
26556 * rootcontext.cs (CreateInterface): New method, used to create
26557 the System.TypeBuilder type for interfaces.
26558 (ResolveInterfaces): new entry point to resolve the interface
26560 (CodeGen): Property, used to keep track of the code generator.
26562 2001-07-26 Miguel de Icaza <miguel@ximian.com>
26564 * cs-parser.jay: Add a second production for delegate_declaration
26567 (enum_body): Put an opt_comma here instead of putting it on
26568 enum_body or enum_member_declarations so we can handle trailing
26569 commas on enumeration members. Gets rid of a shift/reduce.
26571 (type_list): Need a COMMA in the middle.
26573 (indexer_declaration): Tell tokenizer to recognize get/set
26575 * Remove old targets.
26577 * Re-add the parser target.
26579 2001-07-13 Simon Cozens <simon@simon-cozens.org>
26581 * cs-parser.jay: Add precendence rules for a number of operators
26582 ot reduce the number of shift/reduce conflicts in the grammar.
26584 2001-07-17 Miguel de Icaza <miguel@ximian.com>
26586 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
26589 Get rid of old crufty code.
26591 * rootcontext.cs: Use this to keep track of the parsed
26592 representation and the defined types available to the program.
26594 * gen-treedump.cs: adjust for new convention.
26596 * type.cs: Split out the type manager, and the assembly builder
26599 * typemanager.cs: the type manager will live here now.
26601 * cil-codegen.cs: And the code generator here.
26603 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
26605 * makefile: Fixed up for easy making.
26607 2001-07-13 Simon Cozens <simon@simon-cozens.org>
26609 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
26612 (unary_expression): Expand pre_increment_expression and
26613 post_decrement_expression to reduce a shift/reduce.
26615 2001-07-11 Simon Cozens
26617 * cs-tokenizer.cs: Hex numbers should begin with a 0.
26619 Improve allow_keyword_as_indent name.
26621 2001-06-19 Miguel de Icaza <miguel@ximian.com>
26623 * Adjustments for Beta2.
26625 2001-06-13 Miguel de Icaza <miguel@ximian.com>
26627 * decl.cs: Added `Define' abstract method.
26628 (InTransit): new property, used to catch recursive definitions.
26630 * interface.cs: Implement `Define'.
26632 * modifiers.cs: Map Modifiers.constants to
26633 System.Reflection.TypeAttribute flags.
26635 * class.cs: Keep track of types and user-defined types.
26636 (BuilderInit): New method for creating an assembly
26637 (ResolveType): New function to launch the resolution process, only
26638 used by interfaces for now.
26640 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
26641 that are inserted into the name space.
26643 2001-06-08 Miguel de Icaza <miguel@ximian.com>
26645 * ARGH. I have screwed up my tree so many times due to the use of
26646 rsync rather than using CVS. Going to fix this at once.
26648 * driver.cs: Objetify driver. Load assemblies, use assemblies to
26651 2001-06-07 Miguel de Icaza <miguel@ximian.com>
26653 * Experiment successful: Use System.Type rather that our own
26656 2001-05-25 Miguel de Icaza <miguel@ximian.com>
26658 * cs-parser.jay: Removed nsAliases from here.
26660 Use new namespaces, handle `using XXX;'
26662 * namespace.cs: Reimplemented namespace handling, use a recursive
26663 definition of the class. Now we can keep track of using clauses
26664 and catch invalid using clauses.
26666 2001-05-24 Miguel de Icaza <miguel@ximian.com>
26668 * gen-treedump.cs: Adapted for all the renaming.
26670 * expression.cs (Expression): this class now has a Type property
26671 which returns an expression Type.
26673 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
26674 `Type', as this has a different meaning now in the base
26676 2001-05-22 Miguel de Icaza <miguel@ximian.com>
26678 * interface.cs, class.cs: Removed from all the sources the
26679 references to signature computation, as we can not do method
26680 signature computation during the parsing time, as we are not
26681 trying to solve at that point distinguishing:
26685 void a (NS.Blah x) {}
26688 Which depending on the context might be valid or not, as we do not
26689 know if Blah is the same thing as NS.Blah at that point.
26691 * Redid everything so the code uses TypeRefs now instead of
26692 Types. TypeRefs are just temporary type placeholders, that need
26693 to be resolved. They initially have a pointer to a string and the
26694 current scope in which they are used. This is used later by the
26695 compiler to resolve the reference to an actual Type.
26697 * DeclSpace is no longer a CIR.Type, and neither are
26698 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
26699 are all DeclSpaces, but no Types.
26701 * type.cs (TypeRefManager): This implements the TypeRef manager,
26702 which keeps track of all the types that need to be resolved after
26703 the parsing has finished.
26705 2001-05-13 Miguel de Icaza <miguel@ximian.com>
26707 * ARGH. We are going to have to store `foreach' as a class rather
26708 than resolving it, as we need to verify error 1579 after name
26709 resolution. *OR* we could keep a flag that says `This request to
26710 IEnumerator comes from a foreach statement' which we can then use
26711 to generate the error.
26713 2001-05-10 Miguel de Icaza <miguel@ximian.com>
26715 * class.cs (TypeContainer.AddMethod): we now add methods to the
26716 MethodGroup instead of the method hashtable.
26718 * expression.cs: Add MethodGroup abstraction, which gets us one
26719 step closer to the specification in the way we handle method
26722 * cs-parser.jay (primary_expression): qualified_identifier now
26723 tried to match up an identifier to a local variable reference or
26724 to a parameter reference.
26726 current_local_parameters is now a parser global variable that
26727 points to the current parameters for the block, used during name
26730 (property_declaration): Now creates an implicit `value' argument to
26733 2001-05-09 Miguel de Icaza <miguel@ximian.com>
26735 * parameter.cs: Do not use `param' arguments as part of the
26736 signature, per the spec.
26738 2001-05-08 Miguel de Icaza <miguel@ximian.com>
26740 * decl.cs: Base class for classes, structs and interfaces. This
26741 is the "Declaration Space"
26743 * cs-parser.jay: Use CheckDef for checking declaration errors
26744 instead of having one on each function.
26746 * class.cs: Factor out some code for handling error handling in
26747 accordance to the "Declarations" section in the "Basic Concepts"
26748 chapter in the ECMA C# spec.
26750 * interface.cs: Make all interface member classes derive from
26751 InterfaceMemberBase.
26753 2001-05-07 Miguel de Icaza <miguel@ximian.com>
26755 * Many things: all interfaces are parsed and generated in
26756 gen-treedump. Support for member variables, constructors,
26757 destructors, properties, constants is there.
26759 Beginning of the IL backend, but very little done, just there for
26762 2001-04-29 Miguel de Icaza <miguel@ximian.com>
26764 * cs-parser.jay: Fix labeled statement.
26766 * cs-tokenizer.cs (escape): Escape " and ' always.
26767 ref_line, ref_name: keep track of the line/filename as instructed
26768 by #line by the compiler.
26771 2001-04-27 Miguel de Icaza <miguel@ximian.com>
26773 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
26774 to match the values in System.CodeDOM.
26776 Divid renamed to Divide.
26778 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
26780 (Statements.set): remove.
26782 * System.CodeDOM/CodeCatchClause.cs: always have a valid
26785 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
26786 falseStatements always have valid values.
26788 * cs-parser.jay: Use System.CodeDOM now.