1 2007-08-08 Marek Safar <marek.safar@gmail.com>
3 * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
5 2007-08-07 Miguel de Icaza <miguel@novell.com>
7 * expression.cs: Fix the previous commit, the creation of the
8 arguments array list needs also to be conditional on the arguments
11 * class.cs: Add a little bit of help to help narrow down problems.
13 * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
14 not try to copy in that case.
16 * driver.cs: When building SMCS, include a new different set of
17 default assemblies here. Do this here so we can control whether
18 to include the default assemblies with /noconfig.
20 2007-08-03 Marek Safar <marek.safar@gmail.com>
23 * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
26 2007-08-03 Marek Safar <marek.safar@gmail.com>
30 * anonymous.cs (AnonymousContainer.Define): Don't define anything when
31 we are in probing scope.
33 2007-08-03 Marek Safar <marek.safar@gmail.com>
37 * statement.cs (Catch.CloneTo): Clone blocks in the right order.
38 (Statement.CloneTo): Clone and not map children blocks.
40 2007-08-03 Marek Safar <marek.safar@gmail.com>
44 * expression.cs (LocalVariableReference.CloneTo): Remap local info
47 * statement.cs (Statement.CloneTo): Clone variables before statements
48 to allow remaping of local variables.
50 2007-08-03 Marek Safar <marek.safar@gmail.com>
55 * report.cs: Log crash details for future clone problems.
57 * statement.cs (Return.Clone): Don't clone non-existent expression.
59 2007-08-03 Raja R Harinath <harinath@gmail.com>
61 * class.cs (TypeContainer.AddBasesForPart): Make virtual.
62 (Class.AddBasesForPart): Move CS0537 check here from ...
63 * cs-parser.jay (class_declaration): ... here. Move calling of
64 'AddBasesForPart' to ...
65 (class_bases): ... here.
66 (struct_declaration, interface_declaration): Update to changes.
68 2007-08-02 Marek Safar <marek.safar@gmail.com>
72 * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
73 conversion is allowed.
75 2007-08-02 Marek Safar <marek.safar@gmail.com>
79 * ecore.cs (EventExpr): Add IsBase handling.
81 * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
84 2007-08-02 Raja R Harinath <harinath@gmail.com>
86 Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
87 * cs-parser.jay: Some whitespace cleanups.
88 (current_delegate): New.
90 (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
91 a dummy code block, and use 'type_name' instead of 'member_name'.
92 (interface_declaration, class_declaration): Likewise.
93 (delegate_declaration): Likewise. Rearrange slightly and use
95 * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
96 (GetKeyword): Update to change. Use '!foo' instead of 'foo == false'.
98 2007-08-02 Marek Safar <marek.safar@gmail.com>
102 * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
105 * typemanager.cs (CSharpName): Split to string overload.
107 2007-08-02 Marek Safar <marek.safar@gmail.com>
110 * report.cs: Updated warning CS0472.
112 2007-08-01 Marek Safar <marek.safar@gmail.com>
116 * cs-tokenizer.cs: Ignore partial keyword inside block expression.
118 2007-08-01 Marek Safar <marek.safar@gmail.com>
121 * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
123 2007-08-01 Marek Safar <marek.safar@gmail.com>
125 ** C# 3.0 Type Inference (major bits are working)
127 * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
128 (.ImplicitStandardConversionExists): Uses compatible.
129 (.ExplicitTypeInference): Infers type arguments based on explicit arguments
130 (.InferReturnType): New method.
131 (.Compatible): Refactored.
132 (.ResolveParameters): Uses factory to create resolved parameters.
133 (.CompatibleMethod): Add probing mode support.
134 (AnonymousContainer): Removed unused fields. Split Define and Resolve to
135 clearly distinguish between 2 different operations.
136 (LambdaMethod): Moved to lambda.cs.
137 (AnonymousMethod): Removed unused fields and methods.
138 (AnonymousDelegate): Simplified.
140 * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
142 * convert. cs (ImplicitConversionStandard): Compatible works differently.
144 * delegate.cs (Delegate): New mehods to reduce code duplication.
145 (.GetConstructor): New method.
146 (.GetInvokeMethod): New method.
147 (DelegateCreation): Updated.
149 * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
151 (OverloadResolve): Made probing little bit faster.
153 * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
156 * generic.cs (TypeInferenceContext): Dummy implementation.
158 * iterators.cs: Updated after Resolve/Define rename.
160 * lambda.cs (LambdaExpression)
161 (.ResolveParameters): Handles both type of arguments and type inference too.
163 * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
164 (InflateTypes): Updated.
166 * support.cs (InflateTypes): Changed signature and updated.
168 * typemanager.cs (LookupMemberCache): Better dynamic type check.
169 (MemberLookup_FindMembers): More MS tricks.
170 (GetParameterData): Ditto.
171 (GetDelegateParameters): Uses quick path for dynamic types.
173 2007-08-01 Marek Safar <marek.safar@gmail.com>
175 * class.cs (MethodData.Define): EmitContext is required for generic stuff
178 2007-07-31 Marek Safar <marek.safar@gmail.com>
180 * statement.cs (ProcessParameters): Don't crash when parameters have wrong
183 2007-07-26 Jb Evain <jbevain@novell.com>
185 * typemanager.cs (TypeManager.GetConstructor): Add a method overload
186 which takes a boolean 'report_errors', similar to the GetMethod.
187 (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
188 in .net 2.1, do not report errors here.
190 * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
191 System.Runtime.CompilerServices.RequiredAttributeAttribute and
192 System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
195 * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
196 of the type InternalsVisibleToAttribute before the first call
197 to CoreLookupType which is allowed to fail (third boolean parameter
198 to true). Because, during the resolution for a type that is not
199 immediately found, we try to check if the type is not defined in
200 a friend assembly, and to do so, we need the
201 InternalVisibleToAttribute.
203 2007-07-23 Miguel de Icaza <miguel@novell.com>
205 * expression.cs (Binary): Add support for the brain-dead CSC 2.x
206 feature that allows structs to be compared against null and inline
207 the result as true or false.
209 Notice that the same code is not permitted inside a generic block
210 of code that would do:
212 class Foo<T> where T : struct {
219 It is only allowed if the type of T is not bound (no where
220 clause). In my opinion, this CSC 2 behavior is broken but people
221 seem to be using it (IronRuby does, a few bug reports on bugzilla
222 have it and some people have complained about it).
224 All of the users that depend on this behavior have code that is
227 * report.cs (Warning, Error): make these take object arguments,
228 not strings, as that allows us to take advantage of Format.
230 2007-07-20 William Holmes <billholmes54@gmail.com>
232 * decl.cs: Changed MemberName.CountTypeArguments to also check the
233 Left member variable for the Count.
234 * doc.cs: Changed DocUtil.GetMethodDocCommentName to call
235 MemberName.CountTypeArguments to avoid a NRE.
237 This code is contributed under the MIT X11 license
239 2007-07-18 Marek Safar <marek.safar@gmail.com>
241 * cs-tokenizer.cs: Improved lambda parsing and removed old code.
243 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
245 * doc.cs : generic method arguments are written as ``x while generic
246 type arguments are `x. Combined with the previous change, fixed bug
249 2007-07-18 Raja R Harinath <rharinath@novell.com>
252 * expression.cs (Binary.ResolveOperator): When converting
253 'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
255 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
257 * doc.cs : when T: or whatever x: is specified, it does not really
258 check the doc comment's syntax correctness. Fixed bug #82006.
260 2007-07-18 Marek Safar <marek.safar@gmail.com>
262 * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
263 LambdaExpression better.
265 * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
267 * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
269 * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
270 as it can be generated.
272 * expression.cs (Invocation.Error_InvalidArguments): Show correct
275 * lambda.cs (LambdaExpression): Refactored to share same code with
276 AnonymousMethodExpression.
278 2007-07-17 Marek Safar <marek.safar@gmail.com>
280 * anonymous.cs (MakeName): Include host name for easier debugging.
281 (LambdaMethod): New class for lambda spcecific stuff.
283 * attribute.cs: Set EmitContext return type.
285 * class.cs: Set EmitContext return type.
287 * codegen.cs (EmitContext): Return type cannot be null to stop messing
288 with null/void meaning.
290 * iterators.cs (ContainerType): Implemented.
292 * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
294 * statement.cs (Return): Updated to lambda expressions.
295 (Block.CloneTo): Parent can be null.
297 2007-07-13 Marek Safar <marek.safar@gmail.com>
300 * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
302 * class.cs (FixedField): Check whether field is in unsafe scope.
304 * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
305 (FieldExpr.Emit): Fixed buffers cannot be volatile.
307 * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
310 * statement.cs (Fixed.Resolve): Simplified fixed buffers.
312 2007-07-13 Marek Safar <marek.safar@gmail.com>
314 * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
315 rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
318 2007-07-13 Marek Safar <marek.safar@gmail.com>
320 * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
322 2007-07-13 Marek Safar <marek.safar@gmail.com>
324 * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
325 (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
327 * codegen.cs(EmitContext): Add ProbingMode flag.
329 * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
331 * driver.cs: For now set both warning values.
333 * ecore.cs (SimpleName): Name is readonly.
334 (MethodGroup.OverloadResolve): One quick path for probing.
336 * expression.cs (Unary): Set Oper r/o.
337 (Binary): Set Oper r/o.
338 (ParameterReference): Set few instance variables as r/o.
339 (ParameterReference.DoResolveBase): Don't capture aruments when
341 (Invocation.CloneTo): Fixed typo, looks easy, yeah.
342 (Arglist): arguments are private.
343 (SizeOf): type is private and r/o.
344 (MemberAccess): arguments are private.
346 * report.cs: Enhanced reporting on/off capabilities.
348 * lambda.cs: Uses ec.IsInProbingMode.
349 (ContextualReturn): Derives from return.
351 * rootcontext.cs: For now set both warning values.
353 * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
355 (Return.Resolve): Don't die immediately.
356 (Block.Resolve): Speed-up probing.
357 (Block.CloneTo): Clone only child blocks.
359 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
361 * iterators.cs: reverted Miguel's latest change (r81925) as it
362 breaks the build in System.
364 2007-07-13 Miguel de Icaza <miguel@novell.com>
366 * iterators.cs (Yield.CheckContext): Check for the iterator type
367 also here as we can call into Yield even in codepaths that are not
369 (MethodOrOperator is the only path that was checked).
371 In addition to the standard check, use a more specific check for
372 constructors to report a more verbose error.
374 2007-07-12 Miguel de Icaza <miguel@novell.com>
376 * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
377 report the warning and continue
379 * statement.cs (Using.EmitLocalVariableDecls): We were leaving
380 values on the stack on the call to Emit. Use EmitStatement if
381 possible, or using Emit + Pop if not possible. Fixes #82064
383 2007-07-12 Raja R Harinath <rharinath@novell.com>
385 * expression.cs (Invocation.IsApplicable): Reorganize slightly to
386 avoid try...finally in some cases.
388 2007-07-10 Marek Safar <marek.safar@gmail.com>
390 * attribute.cs (Attribute.ResolveConstructor): Uses method group.
392 * class.cs (ConstructorInitializer.Resolve): Use and keep method group
393 instead of method. Re-use standard error handling.
394 (ConstructorInitializer.Emit): Simplified.
396 * delegate.cs: Updated after Invocation.EmitCall change.
398 * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
399 (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
400 (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
401 method and don't permanently changing input arguments.
402 (MethodGroupExpr): Introduced resolved best_candidate, when method group
403 is resolved it has one of the candidates is the best one which is later
404 used to emit. Removed a few unused method.
405 (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
407 * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
408 (Binary.ResolveOperator): Ditto.
409 (ConditionalLogicalOperator.DoResolve): Ditto.
410 (Invocation): Uses method group.
411 (Invocation.DoResolve): Simplified.
412 (Invocation.EmitCall): Removed useless is_static.
413 (Invocation.Emit): Delegate to method group.
414 (Invocation.EmitStatement): Simplified.
415 (New): Uses method group.
416 (MemberAccess.DoResolve): Don't destroy original expression.
418 * statement.cs (ForEach.Resolve): Use null for no method arguments.
420 2007-07-04 Marek Safar <marek.safar@gmail.com>
422 * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
425 * lambda.cs: Add custom error message type.
427 2007-07-03 Marek Safar <marek.safar@gmail.com>
429 * lambda.cs: Simplified little bit.
431 * parameter.cs: Introduced ImplicitLambdaParameter.
432 (Parameters.CreateFullyResolved): New factory instead of ctor.
436 * delegate.cs: Updated parameter creation.
438 2007-07-03 Marek Safar <marek.safar@gmail.com>
440 * ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
443 * generic.cs: Synchronized with gmcs.
445 2007-07-03 Marek Safar <marek.safar@gmail.com>
447 * class.cs (Indexer): Check return type as soon as possible.
449 * cs-parser.jay: Initialize implicit_value_parameter_type for interface
452 * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
454 * expression.cs (Invocation.Error_InvalidArguments): Show type only.
456 * parameter.cs (Parameter): Use expression type when it is available.
458 * support.cs (ReflectionParameters.ParameterDesc): Show an extension
459 method modifier for the first parameter only.
461 2007-06-24 Marek Safar <marek.safar@gmail.com>
464 * typemanager.cs (ChangeType): Fixed couple of char conversions.
466 * constant.cs: Tide up an exception message.
468 2007-06-22 Marek Safar <marek.safar@gmail.com>
470 * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
471 an uninitialized variable is used.
473 * expression.cs (LocalVariableReference.DoResolve): Ditto.
475 2007-06-22 Marek Safar <marek.safar@gmail.com>
477 * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
478 not found error handling.
480 * expression.cs (ArrayCreation): Removed redundant fields and little bit
482 (ArrayCreation.ResolveArrayElement): To be ready to customization.
483 (ArrayCreation.DoResolve): Simplified.
484 (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
485 its own resolve process.
486 (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
488 2007-06-20 Marek Safar <marek.safar@gmail.com>
490 * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
493 2007-06-20 Marek Safar <marek.safar@gmail.com>
495 * cs-tokenizer.cs: Removed var related stuff.
497 * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
498 (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
499 a type and a keyword at same time.
501 * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
504 * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
505 implicitly typed arrays, more changes will follow.
507 * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
509 2007-06-19 Marek Safar <marek.safar@gmail.com>
511 * ecore.cs (VarExpr): Removed Handled field.
513 * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
514 build-in assign functionality.
515 (ForEach.Resolve): Removed all implicitly typed local variable code and
517 (ArrayForeach.Resolve): Infer implicitly typed local variable here.
518 (CollectionForeach.Resolve): Infer implicitly typed local variable here.
520 2007-06-18 Marek Safar <marek.safar@gmail.com>
522 * assign.cs: Removed implicitly typed local variable check.
524 * expression.cs (LocalVariableReference.DoResolve): Add check for self
525 referencing implicitly typed local variable.
526 (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
529 * statement.cs (Fixed): Removed unsupported implicitly typed local
532 2007-06-15 Marek Safar <marek.safar@gmail.com>
534 * decl.cs (MemberName): Moved all Unbound stuff to parser.
536 2007-06-14 Marek Safar <marek.safar@gmail.com>
538 A fix for bugs #81855 and #76274
539 * attribute.cs (AttachTo): Always set owner for global attributes to
542 * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
545 * cs-parser.jay: Assembly and module attributes must precede all other
546 elements except using clauses and extern alias declarations.
548 2007-06-13 Marek Safar <marek.safar@gmail.com>
552 * expression.cs: More checks for non ISO-1 features.
554 2007-06-12 Marek Safar <marek.safar@gmail.com>
557 * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
558 present inside switch statement and it is required by nullable check.
560 2007-06-12 Marek Safar <marek.safar@gmail.com>
563 * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
564 when type matching fails.
566 * namespace.cs: Tiny error message change.
568 2007-06-12 Marek Safar <marek.safar@gmail.com>
570 * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
571 reporting. Added automatic property check.
573 * class.cs: Updated after CheckAbstractAndExtern relocation.
574 (AEventPropertyAccessor.GetSignatureForError): Customized.
576 2007-06-11 Marek Safar <marek.safar@gmail.com>
578 * class.cs (DefineBaseTypes): Base type can be undefined.
580 * ecore.cs (TypeLookup): Minor refactoring.
581 (DoResolveAsTypeStep): Removed redundant check.
583 * namespace.cs (Lookup): Removed redundant check.
585 * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal
586 ResolveAsTypeTerminal step.
587 (BootstrapCorlib_*): Simplified.
588 (PopulateCoreType): Core types can be now external.
590 2007-06-07 Marek Safar <marek.safar@gmail.com>
592 * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
594 (InferTypeArguments): Infers anonymous expression type arguments.
595 (Compatible): Split to Compatible and InferTypeArguments.
597 * lambda.cs: Updated.
599 2007-06-08 Marek Safar <marek.safar@gmail.com>
601 * anonymous.cs (AnonymousContainer): Marked as compiler generated.
603 2007-06-07 Raja R Harinath <harinath@gmail.com>
605 Fix #80477, cs0135-2.cs, cs0135-3.cs
606 * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
607 names to the "known" variables list.
608 (Block.CheckInvariantMeaningInBlock): Handle the fact the
609 parameter names are also "known".
610 (Block.CheckError136): Remove.
611 (ExplicitBlock.CloneTo): New. Set 'known_variables' in target to
614 2007-06-07 Marek Safar <marek.safar@gmail.com>
616 * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
618 2007-06-06 Marek Safar <marek.safar@gmail.com>
620 * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
621 internal error not an user error.
623 * expression.cs (IsApplicable): Refactored to make debugging easier.
625 * support.cs: More tricks for non-mono runtimes.
627 * typemanager.cs (CoreLookupType): Made public.
628 (InitSystemCore): All linq specific stuff moved to linq.cs
630 2007-06-05 Marek Safar <marek.safar@gmail.com>
632 * typemanager.cs (CSharpSignature): One more missing build-in types
634 More tricks for non-mono runtime.
636 2007-06-05 Raja R Harinath <harinath@gmail.com>
638 * statement.cs (Block.CheckError136_InParents): Remove.
639 (Block.AddVariable): Use GetParameterInfo instead.
640 (ToplevelBlock.ProcessArguments): Likewise.
642 2007-06-04 Raja R Harinath <rharinath@novell.com>
644 * statement.cs (ToplevelBlock.CloneTo): New. Copy over parameter
646 (ToplevelBlock.GetParameterInfo): Split out of ...
647 (ToplevelBlock.GetParameterRefernce): ... this.
648 (ToplevelBlock.ParameterMap): Remove.
649 * expression.cs (ParameterReference): Update to use
650 ToplevelParameterInfo.
652 * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
655 * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
656 * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
658 * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
659 (ToplevelBlock.ProcessParameters) ... here.
660 (ToplevelBlock..ctor): Invoke it.
662 * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
665 * statement.cs (IKnownVariable): New interface.
666 (LocalInfo): Implement it.
667 (ToplevelParameterInfo): New class.
668 (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
669 (ExplicitBlock.GetKnownVariable): Likewise. Rename from
670 GetKnownVariableInfo.
672 2007-06-03 Raja R Harinath <harinath@gmail.com>
674 Partly speed up CS0136 error checks.
675 * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
677 (Block.DoCheckError136): Only check errors in parameters. Move
678 local variable checks ...
679 (Block.AddVariable): ... here, and ...
680 (ToplevelBlock.ResolveMeta): ... here.
682 2007-06-02 Raja R Harinath <harinath@gmail.com>
684 * statement.cs (Block.IsChildOf): Remove.
686 * statement.cs (Statement.Clone): Move special case code ...
687 (Block.CloneTo): ... here.
689 2007-05-29 Raja R Harinath <rharinath@novell.com>
691 * statement.cs (ToplevelBlock.container): Remove field. It's
692 redundant with 'Parent'.
693 (ToplevelBlock.ContainerBlock): Remove accessor.
694 (ToplevelBlock..ctor): Update to changes. Register anonymous
695 child with parent here, ...
696 * cs-parser.jay (end_anonymous): ... not here. Don't modify
698 (start_anonymous): Don't save current_block.
699 (top_current_block): Remove.
701 * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
702 (Block.Resolve): Update to changes.
703 (Block..ctor): Move setting of "correct" 'Toplevel'
704 and 'Explicit' fields to ...
705 (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
707 2007-05-27 Raja R Harinath <harinath@gmail.com>
710 * statement.cs (Block.Implicit): Remove.
711 (Block): Update to changes.
712 * flowanalysis.cs: Likewise.
714 Mildly speed up CheckInvariantMeaningInBlock
715 * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
716 Recursively call AddKnownVariable to all enclosing blocks.
717 (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
718 Remove recursive calls.
719 (Block): Update to changes.
721 New ExplicitBlock invariants
722 * statement.cs (Block.Explicit): New field. It points to the
723 immediately enclosing non-implicit block.
724 (Block..ctor): Maintain the invariant.
725 * cs-parser.jay: Take advantage of invariant.
727 Introduce ExplicitBlock
728 * statement.cs (ExplicitBlock): New.
729 (ToplevelBlock): Derive from it.
730 (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
732 (Block.Implicit): Update to changes.
733 * cs-parser.jay: Update to changes.
736 * codegen.cs (EmitContext.IsLastStatement): Remove.
737 * statement.cs (Block.DoEmit): Update to changes.
739 2007-05-25 Raja R Harinath <rharinath@novell.com>
741 * cs-parser.jay: Use 'start_block' and 'end_block' rather than
742 modifying current_block directly.
744 2007-05-23 Scott Peterson <lunchtimemama@gmail.com>
746 * class.cs: Implemented automatic properties (C# 3.0)
747 Thanks to Marek for the help.
749 2007-05-23 Raja R Harinath <rharinath@novell.com>
751 * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
752 variable as assigned, note also that all its components are
754 (MyBitVector.SetRange): New. Function to set multiple bits to true.
756 2007-05-19 Marek Safar <marek.safar@gmail.com>
758 * anonymous.cs, class.cs: Emit Compiler generated attribute when
759 member is marked as compiler generated.
761 * decl.cs (MemberCore): Refactored ModFlags into property.
763 * modifiers.cs: Add new modifier (COMPILER_GENERATED).
764 (Check): Check only accessibility modifiers.
766 2007-05-18 Raja R Harinath <rharinath@novell.com>
768 Track all assignable slots in one bit array
769 * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
770 (ToplevelBlock.ResolveMeta): Don't create a VariableMap. Move
771 logic from VariableMap constructor here. Use the same 'offset'
772 variable that's later used for computing offsets of local
774 * flowanalysis.cs (UsageVector.parameters): Remove.
775 (UsageVector): Update to changes.
776 (VariableMap): Remove.
778 Avoid creating ParameterMap in every block
779 * statement.cs (Block.ParameterMap): Move ...
780 (ToplevelBlock.ParameterMap): ... here.
781 (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
783 * flowanalysis.cs (FlowBranching.param_map): Remove.
784 (FlowBranching.UsageVector): Update to changes.
785 (FlowBranchingToplevel.CheckOutParameters): Likewise.
787 * statement.cs (Block.CloneTo): Clone Toplevel field too.
789 * expression.cs (ParameterReference): Distinguish between block
790 where parameter was referenced and declared.
792 2007-05-18 Marek Safar <marek.safar@gmail.com>
794 * flowanalysis.cs, statement.cs: Put back improved error handling.
796 2007-05-15 Scott Peterson <lunchtimemama@gmail.com>
800 Imporved object and collection initialization (C# 3.0).
802 2007-05-15 Marek Safar <marek.safar@gmail.com>
805 * expression.cs (Is.DoResolve): Only value types have constant `is'
808 2007-05-15 Raja R Harinath <rharinath@novell.com>
810 * statement.cs (ToplevelBlock.child): Remove.
812 2007-05-15 Raja R Harinath <harinath@gmail.com>
814 Rationalize ResolveMeta: refactoring
815 (Block.ResolveMeta): Remove wrong or superfluous comments. Carve
816 out constant handling code into ...
817 (Block.DoResolveConstants): ... this.
819 Rationalize ResolveMeta: kill local_map
820 * statement.cs (Block.local_map, Block.LocalMap): Remove.
821 (Block.AssignableSlots): New.
822 (Block.ResolveMeta): Make protected. Don't create a VariableMap
823 for locals -- move code from VariableMap here. Avoid unnecessary
825 * flowanalysis.cs (FlowBranching.local_map): Remove.
826 (FlowBranching..ctor): Use Block.AssignableSlots.
827 (VariableMap): Remove unused constructors.
829 2007-05-11 Raja R Harinath <rharinath@novell.com>
831 * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
833 2007-05-11 Marek Safar <marek.safar@gmail.com>
835 * typemanager.cs (IsFriendAssembly): Should not be called for building
838 2007-05-09 Marek Safar <marek.safar@gmail.com>
840 * literal.cs (NullConstant): Print null in all cases.
842 * expression.cs (Binary.ResolveOperator): Implemented delegate
843 comparison based on C# 2.0 changes.
845 2007-04-28 Scott Peterson <lunchtimemama@gmail.com>
847 This code is contributed under the MIT X11 license
849 The following enables support for several C# 3.0 language features:
851 * cs-tokenizer.cs: Added support for the "var" keyword.
853 * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
854 Added VarExpr class to facilitate type inferencing.
856 * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
857 to support anonymous types.
859 * assign.cs: Added support for type inferencing and initialization.
861 * anonymous.cs: Added AnonymousClass class to enable anonymous types.
863 * expression.cs: Added implicit array support to ArrayCreation.
864 Added 5 types and 1 interface:
866 IInitializable Implementing classes can inject initializing
867 statements after object instantiation.
869 Initializer Stores data for object initialization.
871 AnonymousType An expression for anonymous types.
873 AnonymousTypeParameter Stores data about an anonymous type's field.
875 NewInitialize An expression for object initialization.
877 CollectionInitialize An expression for collection initialization.
879 * statement.cs: Added "var" keyword support to the foreach, using, and fixed
882 2007-05-06 Marek Safar <marek.safar@gmail.com>
885 * cs-tokenizer.cs: Add special handling for coalescing operator.
887 2007-05-06 Marek Safar <marek.safar@gmail.com>
890 * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
891 its value from base class until it is redefined.
893 2007-05-02 Raja R Harinath <rharinath@novell.com>
895 Fix regression in cs0631-3.cs
896 * cs-parser.jay (operator_declarator): Add opt_attributes to error
897 fallback. Make error fallback catch more cases.
899 2007-05-01 Miguel de Icaza <miguel@novell.com>
901 * cs-parser.jay: Allow parameters in operator declarations to have
904 2007-04-27 Miguel de Icaza <miguel@novell.com>
906 * statement.cs (If.CloneTo): Only clone the FalseStatement if it
909 * lambda.cs (ContextualReturn.Resolve): An expression is valid
910 inside the ContextualReturn, it does not have to be an
913 2007-04-24 Miguel de Icaza <miguel@novell.com>
915 * lambda.cs (ContextualReturn.Resolve): if the return type is not
918 2007-04-23 Miguel de Icaza <miguel@novell.com>
920 * anonymous.cs (AnonymousContainer): split the virtual Resolve
921 method in two methods: ResolveNoDefine and Resolve.
923 ResolveNoDefine will stop just after ResolveTopBlock has been
926 Resolve will then continue by creating a method and issuing the
927 call to method.Define ().
929 (AnonymousMethod): Split and implement the new Resolve and
930 ResolveNoDefine as well.
932 * lambda.cs (LambdaExpression): Split the anonymous method
933 resolution code into a separate routine (CoreCompatibilityTest)
934 from DoCompatibleTest.
936 (LambdaExpression.TryBuild): New method, this method tries to
937 build the LambdaExpression with the given set of types to be used
938 as the types for the various parameters of the lambda expression.
940 If the compilation succeed with the given types, the infered type
941 of the Anonymous method is returned, otherwise null is returned.
943 2007-04-23 Marek Safar <marek.safar@gmail.com>
946 * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
948 2007-04-22 Miguel de Icaza <miguel@novell.com>
950 * cs-tokenizer.cs: Change various identifiers here from the
951 camelCasing to the recommended Linux-like style for instance
952 variables from the Coding Guidelines.
954 2007-04-19 Martin Baulig <martin@ximian.com>
957 (Convert.ImplicitReferenceConversionCore): Allow conversions from
958 System.Enum to System.ValueType.
960 2007-04-13 Martin Baulig <martin@ximian.com>
962 Rewrote implicit reference conversions. We need to distinguish
963 between implicit reference conversions (13.1.4) and implicit
964 boxing conversions (13.1.5).
966 According to the spec, there's an an implicit conversion
967 "From a one-dimensional array-type S[] to IList<T> and base
968 interfaces of this interface, provided there is an implicit
969 reference conversion from S to T." Note that this does not
970 include boxing conversions.
973 (Convert.ImplicitTypeParameterBoxingConversion): New method.
974 (Convert.ImplicitReferenceConversion): Split into
975 ImplicitReferenceConversionCore() and
976 ImplicitBoxingConversionExist().
977 (Convert.ImplicitReferenceConversionExists): Use the new
978 ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
980 2007-04-12 Martin Baulig <martin@ximian.com>
982 * convert.cs (Convert.ImplicitReferenceConversion): Move the
983 `TypeManager.null_type' checks up to the top of the method.
985 2007-04-11 Marek Safar <marek.safar@gmail.com>
988 * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
991 2007-04-11 Martin Baulig <martin@ximian.com>
993 * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
994 Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
995 to make this work for generic classes; fixes #79561.
997 2007-04-11 Martin Baulig <martin@ximian.com>
999 * expression.cs (As): Add support for nullable types; fixes #79371.
1001 2007-04-11 Martin Baulig <martin@ximian.com>
1003 * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
1004 `type.FullName' is null; fixes #80243.
1006 2007-04-11 Martin Baulig <martin@ximian.com>
1008 * expression.cs (Invocation.IsApplicable): Don't modify the method
1009 if type inference succeeded, but the method was not applicable.
1012 2007-04-10 Marek Safar <marek.safar@gmail.com>
1014 A fix for bug #81324
1015 * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
1016 internal and external namespaces containers.
1018 2007-04-10 Martin Baulig <martin@ximian.com>
1020 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
1021 TypeManager.DropGenericMethodArguments() so we also call
1022 IMethodData.SetMemberIsUsed() for generic methods. Fixes #80357.
1024 2007-04-10 Martin Baulig <martin@ximian.com>
1026 * iterators.cs (Iterator.CreateIterator): Don't crash if
1027 `method.ReturnType' is null. This happens if something went wrong
1028 while resolving that typ (we already reported an error in this case).
1030 2007-04-10 Martin Baulig <martin@ximian.com>
1032 * expression.cs (New.DoResolve): Don't call CheckComImport() on
1033 generic interfaces; report the CS0144 directly.
1035 2007-04-10 Martin Baulig <martin@ximian.com>
1037 * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
1038 `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
1040 2007-04-10 Martin Baulig <martin@ximian.com>
1042 * expression.cs (New.DoEmitTypeParameter): Fix #81109.
1044 2007-04-09 Raja R Harinath <rharinath@novell.com>
1047 * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
1048 * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
1051 * statement.cs (For.Resolve): If resolution fails, use
1054 2007-04-08 Marek Safar <marek.safar@gmail.com>
1056 * anonymous.cs (MakeName): Make faster and zero-based.
1057 (VerifyExplicitParameterCompatibility): Back to mode where generic
1058 parameter is ignored.
1059 (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
1061 * class.cs (EmitType): Method can emit another new method.
1063 * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
1065 * driver.cs: Updated.
1067 * lambda.cs: Reuse predefined empty parameters.
1069 * parameter.cs: Updated
1071 * support.cs: Implemented InflateTypes.
1073 * typemanager.cs (GetFullName): Don't use FullName as it can be null.
1074 (InitSystemCore): Introduced to isolate 3.0 dependencies.
1076 2007-04-03 Martin Baulig <martin@ximian.com>
1080 * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
1081 version of TypeManager.IsOverride() which also works with generic
1084 2007-04-03 Martin Baulig <martin@ximian.com>
1089 (Convert.ExplicitReferenceConversion): We need to cast when
1090 converting from IList<T> to S[].
1092 2007-04-01 Marek Safar <marek.safar@gmail.com>
1094 * decl.cs (FindExtensionMethods): Consider all candidates with same name
1097 * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
1099 2007-03-31 Marek Safar <marek.safar@gmail.com>
1101 * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
1102 argument and return type inferring.
1104 * codegen.cs (InferReturnType): Flag whether return can be inferred.
1105 (ReturnType): Turned to property.
1107 * statement.cs (Return): Implemented return type inferring.
1109 * support.cs (ReflectionParameters): Use local types if possible.
1111 2007-03-30 Raja R Harinath <rharinath@novell.com>
1113 * flowanalysis.cs (FlowBranching.Reachability): Remove.
1114 (FlowBranching.UsageVector): Update to changes.
1116 Prepare to kill 'Reachability'
1117 * flowanalysis.cs (UsageVector): Remove 'Reachability' from
1118 argument of constructor.
1120 2007-03-29 Raja R Harinath <rharinath@novell.com>
1122 Prepare to kill 'Reachability'
1123 * flowanalysis.cs (UsageVector.is_unreachable): New.
1124 (UsageVector): Update to maintain 'is_unreachable' in parallel to
1125 'reachability', and verify they're consistent.
1128 * expression.cs (New.EmitStatement): Handle type parameters here too.
1130 2007-03-29 Martin Baulig <martin@ximian.com>
1135 (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
1136 CompilerGeneratedClass.
1137 (ScopeInfo.EmitScopeInstance): Make this protected.
1138 (CapturedVariable.EmitInstance): Use `Ldarg_0' if
1139 `ec.CurrentAnonymousMethod.Scope == Scope'.
1141 * statement.cs (Block.ScopeInfo): Make this a property.
1143 2007-03-27 Raja R Harinath <harinath@gmail.com>
1145 Prepare to kill 'Reachability'
1146 * flowanalysis.cs (FlowBranching.Reachability): Make class private.
1147 (FlowBranching.UsageVector.Reachability): Remove property.
1148 (FlowBranching.UsageVector.IsUnreachable): New property.
1149 (FlowBranching.UsageVector.ResetBarrier): New.
1150 (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
1151 * codegen.cs, statement.cs: Update to changes.
1153 2007-03-27 Martin Baulig <martin@ximian.com>
1158 (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
1161 2007-03-26 Raja R Harinath <rharinath@novell.com>
1163 * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
1164 instead of TriState. Remove all mention of TriState.
1166 * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
1167 replaced by a boolean. Add boolean 'is_unreachable' field, check
1168 and maintain invariants.
1170 2007-03-25 Marek Safar <marek.safar@gmail.com>
1172 * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
1174 2007-03-25 Marek Safar <marek.safar@gmail.com>
1176 * expression.cs: Stop using obsolete 2.0 opcodes.
1178 2007-03-25 Marek Safar <marek.safar@gmail.com>
1180 * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
1181 one of the latests Martin's fixes.
1183 2007-03-23 Miguel de Icaza <miguel@novell.com>
1185 * expression.cs: On BigEndian systems, swap the bytes, temporary
1186 solution until we get a new bitconverter class.
1188 2007-03-23 Martin Baulig <martin@ximian.com>
1192 * decl.cs (MemberCache.AddMembers): Add generic methods both as
1193 "Method" and "Method`1". Normally, a cache lookup is done on the
1194 "Method" form (ie. without the generic arity), but this one makes
1195 lookups on the full form work as well.
1197 2007-03-22 Raja R Harinath <rharinath@novell.com>
1199 * flowanalysis.cs (Reachability): Reorganize slightly, and remove
1202 2007-03-20 Bill Holmes <billholmes54@gmail.com>
1204 Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
1205 ordered_member_list, to TypeBuilder to store members to be defined
1206 in the order they were parsed in.
1207 - ordered_explicit_member_list contains all properties indexers
1208 and methods that are defined as explicit implementation of an
1209 interface or base class.
1210 - ordered_member_list contains all properties indexers and methods
1211 that are not defined as explicit implementation of an interface
1214 Removed MethodArrayList and IndexerArrayList from TypeBuilder. The
1215 functionality in these removed classes has been replaced with
1216 ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and
1217 CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
1219 Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
1220 to CheckForDuplications inside GetMethod and SetMethod Define Method
1221 to handle method property and indexer name conflicts.
1225 All code is contributed under the MIT/X11 license.
1227 2007-03-20 Martin Baulig <martin@ximian.com>
1229 * class.cs (TypeContainer.Interfaces): Removed; they're now
1230 included in `TypeContainer.Types'.
1232 2007-03-20 Martin Baulig <martin@ximian.com>
1234 Fix #77963, #80314 and #81019. Added gtest-317, ..., gtest-320.
1236 * class.cs (TypeContainer.CreateType): New public method. This is
1237 now called before DefineType() to create the TypeBuilders.
1238 (TypeContainer.DefineType): Don't create the TypeBuilder here; it
1239 has already been created by CreateType().
1240 (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
1241 don't resolve our base classes here; this has been moved into
1242 DefineBaseTypes(). We're now called from CreateType().
1243 (TypeContainer.DefineBaseTypes): New private method; resolve our
1244 base classes here. We're now called from DefineType().
1247 (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
1248 our types first to create all the TypeBuilders. After that, call
1249 TypeContainer.DefineType() on all the types which'll resolve their
1250 base classes and setup the resolve order.
1252 2007-03-20 Martin Baulig <martin@ximian.com>
1254 * class.cs (TypeContainer.Enums): Removed; they're now included in
1255 `TypeContainer.Types'.
1257 2007-03-20 Martin Baulig <martin@ximian.com>
1260 (TypeContainer.DefineType): Don't call ResolveMembers() here.
1261 (TypeContainer.DoResolveMembers): Call DefineType() on our
1262 `compiler_generated' classes; moved here from DefineNestedTypes().
1265 (RootContext.ResolveTree): Call ResolveMembers() on all
1266 TypeContainer's in the `type_container_resolve_order'.
1268 2007-03-19 Marek Safar <marek.safar@gmail.com>
1270 * class.cs: Use corlib to handle InternalMethodImplAttribute.
1272 2007-03-17 Marek Safar <marek.safar@gmail.com>
1274 * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
1275 implementation flags.
1277 2007-03-17 Marek Safar <marek.safar@gmail.com>
1279 * class.cs: More optimizations for type parameters.
1281 2007-03-15 Marek Safar <marek.safar@gmail.com>
1283 * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
1285 * ecore.cs, parameter.cs: More common code for both corlibs.
1287 * typemanager.cs (IsGenericMethod): Simplified.
1289 2007-03-15 Raja R Harinath <rharinath@novell.com>
1291 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
1293 * statement.cs, iterators.cs, lambda.cs: Update to changes.
1295 * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
1296 unconditionally. Simplify explanation.
1297 (Try.Resolve, Using.Resolve): Likewise.
1299 2007-03-15 Martin Baulig <martin@ximian.com>
1303 * decl.cs (DeclSpace): If we're a partial class, use our
1304 `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
1306 2007-03-15 Raja R Harinath <rharinath@novell.com>
1308 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
1310 (FlowBranching.UsageVector): Update to changes.
1311 (FlowBranching.MergeSiblings): Likewise.
1312 * statement.cs: Likewise.
1314 2007-03-15 Martin Baulig <martin@ximian.com>
1319 (MemberCache): Added a special .ctor for type parameters.
1322 (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
1325 2007-03-09 Martin Baulig <martin@ximian.com>
1327 * enum.cs (Enum): Make this a TypeContainer.
1328 (EnumMember): Derive from `Const'.
1331 (Const.DoResolveValue): New protected virtual method; move most of
1332 the functionality of ResolveValue() here so we can override it in
1334 (Const.CreateConstantReference): Make this virtual.
1336 * class.cs (Kind): Add `Kind.Enum'.
1337 (TypeContainer.Emit): Don't emit the enums here; they're already
1338 in the `RootContext.typecontainer_resolve_order'.
1340 * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
1341 here; they're already in the `typecontainer_resolve_order'.
1343 * ecore.cs (EnumConstant.ConvertImplicitly): Add
1344 TypeManager.DropGenericTypeArguments().
1347 (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
1348 (TypeManager.IsEnumType): Likewise.
1349 (TypeManager.EnumToUnderlying): Likewise.
1350 (TypeManager.IsEqual): Add support for enums.
1352 2007-03-12 Raja R Harinath <rharinath@novell.com>
1354 * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
1355 DefaultParameterValueAttribute to be undefined, say if System.dll
1358 2007-03-11 Marek Safar <marek.safar@gmail.com>
1360 * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
1363 2007-03-10 Marek Safar <marek.safar@gmail.com>
1365 * class.cs, parameter.cs: Unified parameters verification.
1367 2007-03-08 Martin Baulig <martin@ximian.com>
1369 * cs-parser.jay (constructor_header): Pass the location to the
1370 newly created TopLevelBlock.
1372 2007-03-07 Martin Baulig <martin@ximian.com>
1374 * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
1376 2007-03-06 Miguel de Icaza <miguel@novell.com>
1378 * convert.cs (ExplicitReferenceConversionExists): Sync this method
1379 with the changes from David, fixes the build.
1381 2007-03-05 David Mitchell <dmitchell@logos.com>
1383 * convert.cs: Implement From System.Collecitons.Generic.IList<T>
1384 and its base interfaces to a one-dimensional array type S[],
1385 provided there is an implicit or explicit reference conversion
1388 2007-03-03 Marek Safar <marek.safar@gmail.com>
1390 * cs-tokenizer.cs: Implemented basic linq grammar.
1392 * driver.cs: Set linq lang version on demand.
1394 2007-02-26 Marek Safar <marek.safar@gmail.com>
1396 * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
1398 2007-02-25 Marek Safar <marek.safar@gmail.com>
1400 * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
1403 * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
1405 Check property and event extern attributes.
1407 * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
1410 2007-02-24 Marek Safar <marek.safar@gmail.com>
1412 A fix for bug #80407
1413 * ecore.cs: Don't report ambiguity error when methods have same parent.
1415 2007-02-23 Marek Safar <marek.safar@gmail.com>
1417 A fix for bug #80878
1418 * class.cs, cs-parser.jay: Event property can host anonymous methods.
1420 2007-02-22 Marek Safar <marek.safar@gmail.com>
1422 * attribute.cs: Enable ExtensionAttribute presence test.
1424 2007-02-22 Marek Safar <marek.safar@gmail.com>
1426 * class.cs: Warn about missing GetHashCode only when Equals is override.
1428 * decl.cs: Check accessibility of type arguments.
1430 * typemanager.cs: Correctly report nullable array.
1432 2007-02-20 Marek Safar <marek.safar@gmail.com>
1434 * class.cs, report.cs: Capture more details when things go wrong.
1436 2007-02-20 Marek Safar <marek.safar@gmail.com>
1438 A fix for bug #80650
1439 * cs-parser.jay: Anonymous container starts at constructor declaration
1440 and not at block beginning because it has to be usable in constructor
1443 * statement.cs: Use context location and not block one for error reporting.
1445 2007-02-18 Marek Safar <marek.safar@gmail.com>
1447 A fix for bug #78712
1448 * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
1451 2007-02-18 Marek Safar <marek.safar@gmail.com>
1453 A fix for bug #80493 by Atsushi Enomoto
1454 * cs-parser.jay: Ignore invalid attribute target.
1456 2007-02-18 Marek Safar <marek.safar@gmail.com>
1458 * cs-tokenizer.cs: Ignore '\0' as white space character.
1460 2007-02-17 Miguel de Icaza <miguel@novell.com>
1462 * cs-parser.jay: Add support for lambda expressions to the mcs
1465 * lambda.cs: Only clone when we are probing, not on the final call
1466 (Compatible is the final call).
1468 * statement.cs (CloneContext): Introduce class to provide block
1469 remapping during clone.
1471 All statements Clone themselves now.
1473 (Clone): special handling for blocks, when we clone a block, we
1474 register the block inside this routine, as children of the block
1475 might trigger a lookup.
1477 * expression.cs: Add support for CloneContext in all expressions.
1479 2007-02-17 Marek Safar <marek.safar@gmail.com>
1481 A fix for bug #80493
1482 * statement.cs: Report ambiguous warning when interfaces are not related.
1484 2007-02-15 Marek Safar <marek.safar@gmail.com>
1486 C# 3.0 extension methods.
1488 * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
1489 cannot be used directly.
1491 * class.cs (Class.Emit): Emit extension attribute if any class method
1492 is extension method.
1493 (Method.Define): Add basic extension method validation conditions.
1494 (Method.Emit): Emit extension attribute for method.
1496 * codegen.cs (AssemblyClass): Emit extension attribute if at least one
1497 extension method exists. Currently we follow same approach as Microsoft
1498 does, emit even if a method or a class are private but this can change
1501 * cs-parser.jay: Add handling of `this' keyword in method parameters
1504 * decl.cs (DeclSpace.IsStaticClass): New property.
1505 (MemberCache.FindExtensionMethods): Looks for extension methods with
1506 defined name and extension type.
1508 * doc.cs: Updated after OverloadResolve changes.
1510 * driver.cs: Add new soft reference to System.Core.dll.
1512 * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
1513 (ExtensionMethodGroupExpr): Represents group of extension methods.
1515 * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
1516 BetterFunction, IsOverride, IsAncestralType, OverloadResolve
1517 to MethodGroupExpr and made non-static for easier customization.
1518 (Invocation.DoResolve): Add extension method lookup when no standard
1520 (MemberAccess.DoResolve): Try extension methods if no member exists.
1522 * modifiers.cs: Add METHOD_EXTENSION modifier.
1524 * namespace.cs (RegisterExtensionMethodClass): Register class namespace
1525 as well as candidate extension type.
1526 (ComputeNamespaces): When assembly constains extension methods registers
1528 (Namespace.RegisterExternalExtensionMethodClass): Register type for later
1529 extension method lookup.
1530 (Namespace.LookupExtensionMethod): Looks for extension method in this
1532 (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
1533 find a method which matches name and extensionType.
1535 * parameter.cs (Parameter): Add This modifer.
1536 (HasExtensionMethodModifier): New property.
1537 (Resolve): Add extension parameter check.
1538 (ModFlags): turned to property to exclude this modifier as it is not real
1540 (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
1542 * support.cs (ParameterData): Add ExtensionMethodType.
1543 (ReflectionParameters): Implemented ExtensionMethodType interface property.
1545 * typemanager.cs: Add type and ctor extension attribute type.
1547 2007-02-15 Miguel de Icaza <miguel@novell.com>
1549 * report.cs (DisableErrors, EnableErrors): used to prevent error
1550 output when we are "trying" to compile various methods with
1553 * ecore.cs (Expression): Add Clone method that calls the virtual
1554 CloneTo method. The current CloneTo method in Expression throws
1555 an exception so we can track down all the places where this must
1556 be implemented (not using abstract, because that would be a lot of
1557 up-front-work before we can start testing the implementation
1560 Important: we only need Clone capabilities for expressions created
1561 by the parser, as the expressions we will be cloning are
1562 expressions in the pre-resolved state. This vastly simplifies
1565 (SimpleName): Add CloneTo that does nothing.
1566 (EmptyCast): Add CloneTo.
1568 * expression.cs (Binary): Implement CloneTo.
1569 (Invocation.IsApplicable): Store the current ec in
1570 EmitContext.TempEc and restore it on return. This is used so we
1571 do not have to sprinkle hundres of methods with an extra
1572 EmitContext, we know that the only user is the lambda expression
1573 ImplicitConversionExists code.
1575 (Argument): Add Cloning capabilities.
1576 (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
1577 Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
1578 ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
1579 UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
1580 IndexerAccess): Add Clone capability.
1582 (LocalVariableReference, This): TODO: needs cloned Block mapping.
1584 (Argument): Add cloning capability.
1586 * assign.cs (Assign): Implement CloneTo.
1588 * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
1590 * lambda.cs (ImplicitStandardConversionExists): Implement lambda
1591 version by calling Convert with the EmitContext (that we are
1592 currently storing in ec, this is not great, but will do for now,
1593 to avoid passing EmitContext parameters to hundreds of functions
1594 that do not need them now).
1596 (SetExpression): Remove, it is not needed.
1598 (ContextualReturn): Implement CloneTo.
1600 * statement.cs (Statement): Implement cloning infrastructure,
1601 similar to expressions.
1603 (Block): Partial implementation of Clone for statements.
1605 (Return): Implement clone.
1607 * constant.cs (Constant.CloneTo): New method, does nothing.
1609 * codegen.cs (TempEc): Add a static EmitContext as a temporary
1610 solution, until we decide how to exactly do this.
1612 2007-02-14 Marek Safar <marek.safar@gmail.com>
1614 A fix for bug #80493
1615 * class.cs (FindOutBaseMethod): When the base accessor does not exist and
1616 a property is override we need to use second accessor.
1618 2007-02-13 Marek Safar <marek.safar@gmail.com>
1620 A fix for bug #80418
1621 * attribute.cs, class.cs: Use correct calling conventions for pinvoke
1624 2007-02-13 Marek Safar <marek.safar@gmail.com>
1626 Another fix for bug #80749
1627 * pending.cs: Abstract class has priority over interfaces.
1629 2007-02-13 Marek Safar <marek.safar@gmail.com>
1631 Another fix for bug #80749
1632 * pending.cs: Abstract class has priority over interfaces.
1634 2007-02-13 Marek Safar <marek.safar@gmail.com>
1636 Another fix for bug #80749
1637 * pending.cs: Abstract class has priority over interfaces.
1639 2007-02-13 Marek Safar <marek.safar@gmail.com>
1641 Another fix for bug #80749
1642 * pending.cs: Abstract class has priority over interfaces.
1644 2007-02-13 Marek Safar <marek.safar@gmail.com>
1646 * class.cs Better error message.
1648 * driver.cs: Add shorter versions of -optimize option.
1650 2007-02-13 Martin Baulig <martin@ximian.com>
1652 * class.cs (Constructor.Emit): Check the return value of
1653 ec.ResolveTopBlock() and return on error.
1655 2007-02-13 Raja R Harinath <rharinath@novell.com>
1657 * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
1658 message to fix error message regression.
1660 2007-02-12 Marek Safar <marek.safar@gmail.com>
1662 * delegate.cs: Delegate creation expression cannot be of Nullable type.
1664 2007-02-12 Marek Safar <marek.safar@gmail.com>
1666 A fix for bug #80749
1667 * assign.cs (FieldInitializer): FieldInitializer has to keep track of
1668 its parent container.
1670 * class.cs (DefineFieldInitializers): Each initializer can has different
1673 * const.cs: Updated.
1675 2007-02-11 Miguel de Icaza <miguel@novell.com>
1677 * lambda.cs (LambdaExpression.Compatible): Remove some early code,
1678 now all the heavy lifting to check that embedded statements or
1679 expressions have the right form is done in the ContextualReturn.
1681 (ContextualReturn): New class.
1683 * ecore.cs (Error_InvalidExpressionStatement): Make a helper
1684 method that can be invoked to report 201, so we do not replicate
1687 * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
1689 * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
1690 treating tabs as spaces.
1692 2007-02-09 Marek Safar <marek.safar@gmail.com>
1694 A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
1695 * assign.cs: Use full implicit conversion for right side check.
1697 2007-02-09 Marek Safar <marek.safar@gmail.com>
1699 * statement.cs (Switch): Switch over boolean type is not standardized.
1701 2007-02-08 Marek Safar <marek.safar@gmail.com>
1703 A fix for bug #80755
1704 * decl.cs (FindBaseEvent): Don't use method cache for events.
1706 2007-02-07 Marek Safar <marek.safar@gmail.com>
1708 * cs-parser.jay: Better syntax error handling.
1710 * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
1711 instead of underlying type value.
1713 2007-02-06 Marek Safar <marek.safar@gmail.com>
1715 * driver.cs: Check define identifier before is registered.
1717 * namespace.cs: Use existing error message.
1719 * report.cs: New warning.
1721 2007-02-06 Marek Safar <marek.safar@gmail.com>
1723 A fix for bug #80742
1724 * expression.cs: Delegate Invoke method can be called directly.
1726 2007-02-06 Marek Safar <marek.safar@gmail.com>
1728 A fix for bug #80676
1729 * class.cs (IsEntryPoint): The Main method can have params modifier.
1731 2007-02-04 Miguel de Icaza <miguel@novell.com>
1733 * parameter.cs (Parameter, Parameters): Add Clone method.
1735 * anonymous.cs (Compatible): Turn method into virtual method, so
1736 LambdaExpression can implement a different behavior.
1738 (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
1739 out the basic checking here, so it can be used by
1742 * lambda.cs: Introduce "Compatible" function that will do the
1745 2007-02-02 Marek Safar <marek.safar@gmail.com>
1747 * attribute.cs: Unified one error message.
1749 * class.cs (Class): Use type attributes and not properties to test static
1751 (IsEntryPoint): Don's pass local variable.
1753 * convert.cs: Removed duplicate check.
1755 * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
1757 * driver.cs: Don't crash when soft reference does not exist.
1759 * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
1760 (UsingEntry): Removed redundant allocation.
1762 * parameter.cs: Add fast path for type parameters.
1764 * support.cs: Don't allocate attribute when it's not used.
1766 2007-01-30 Miguel de Icaza <miguel@novell.com>
1769 (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
1770 this into a virtual method, so we can override it in LambdaExpression.
1772 * driver.cs: Improve diagnostics in case of failure.
1774 * cs-tokenizer.cs: Instead of trying to parse a type and a name,
1775 write a function that is slightly more complex and that parses:
1777 type identifier [, type identifier]* )
1779 The old function would return incorrectly a OPEN_PARENS_LAMBDA for
1782 (canEmpty ? i >= 0 : i > 0)
1784 2007-01-30 Raja R Harinath <rharinath@novell.com>
1786 * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
1787 exception on possibly valid code.
1789 2007-01-29 Raja R Harinath <rharinath@novell.com>
1791 * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
1793 (parse_opt_type_arguments): Remove. It's almost the same as
1795 (parse_namespace_or_typename): Use parse_less_than.
1797 2007-01-28 Miguel de Icaza <miguel@novell.com>
1799 * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
1800 this bug took a few hours to find, because the state saved and
1801 restored by PushPosition and PopPosition was ignoring the state of
1802 parse_generic_less_than.
1804 I can also now remove the handling of OP_LT and OP_GT, this solves
1807 * cs-tokenizer.cs: store the location for the ARROW token, we use
1810 (PushPosition, PopPosition): save/restore also `current_token',
1811 restore `parse_generic_less_than' (was missing).
1813 (parse_opt_type_arguments): use parse_type, not
1814 parse_namespace_or_typename to parse types.
1816 * lambda.cs: Empty new file, will eventually have the lambda
1817 expression implementation.
1819 * lambda.test: used to test the internal tokenizer.
1821 * report.cs (FeatureIsNotISO1): Rename from
1822 FeatureIsNotStandardized, because it was about the language level
1823 (1 vs 2) it was not about standarization.
1825 (FeatureRequiresLINQ): New.
1827 * support.cs (SeekableStreamReader): Only require that the reader
1828 is a TextReader, not a StreamReader, so we can plug StringReader.
1830 * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
1831 given position in the input stream the following tokens can be
1832 parsed as a type followed by an identifier.
1834 (is_punct): after a '(' if parse_type_and_parameter returns true,
1835 then return a special token OPEN_PARENS_LAMBDA which is used to
1836 avoid reduce/reduce errors in the grammar for the
1837 lambda_expression rules.
1839 (parse_type): implement a type parser inside the
1840 tokenizer, the parser only returns true or false depending on
1841 whether the input at a given position can be parsed as a type.
1843 (peek_token): new method used during type parsing.
1845 2007-01-28 Raja R Harinath <rharinath@novell.com>
1848 * anonymous.cs (ScopeInfo.InflateParameters): New.
1849 (AnonymousContainer.Resolve): Use it to redirect types of
1850 delegate parameters.
1852 2007-01-27 Raja R Harinath <rharinath@novell.com>
1855 * expression.cs (Error_InvalidArguments): Don't use two different
1856 messages for CS1503. Use ExtraInformation and
1857 SymbolRelatedToPreviousError instead.
1860 * decl.cs (DeclSpace.initialize_type_params): Don't access
1861 'type_params' of a partial class directly.
1863 2007-01-26 Miguel de Icaza <miguel@novell.com>
1865 * constant.cs: Removed a handful of out-of-range checks that were
1868 2007-01-25 Marek Safar <marek.safar@gmail.com>
1870 * expression.cs (CheckUselessComparison): Add additional check for char
1873 * namespace.cs: Fixed typo.
1875 2007-01-23 Miguel de Icaza <miguel@novell.com>
1877 * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
1878 gone, instead we inline the test, preventing the needless casts to
1879 longs, ulongs and doubles for the parameters, avoiding calls to
1880 methods that overchecked stuff, and instead inlined things
1883 2007-01-20 Marek Safar <marek.safar@gmail.com>
1885 * cs-parser.jay: Better parameter error handling.
1887 2007-01-17 Marek Safar <marek.safar@gmail.com>
1889 A fix for bug #80368, #80522
1890 * expression.cs (ArrayCreation.only_constant_initializers): Indicates
1891 whether array initializer contains constants only.
1892 (ArrayCreation.Emit): Use better formula to decide when
1893 are array initializers for static initialization.
1894 (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
1895 have to emit even constants otherwise they are pre-initialized.
1897 2007-01-17 Bill Holmes <bill.holmes@ansys.com>
1898 Raja R Harinath <rharinath@novell.com>
1900 Fix emit order of 'get' vs. 'set'.
1901 * support.cs (Accessors): New.
1902 * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
1903 Note the order in which accessors are declared in the source.
1904 * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
1905 Refactored from Property.Define and Indexer.Define.
1906 (PropertyBase.DefineAccessors): New helper that calls the above in
1907 appropriate order as noted by the parser.
1908 (Property.Define, Indexer.Define): Update to changes.
1909 (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
1911 2007-01-17 Raja R Harinath <rharinath@novell.com>
1913 Fix cs0029-6.cs and gcs0029-2.cs (regression)
1914 * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
1915 there's an implicit conversion from the current type to the target
1916 type before converting the underlying constant.
1918 2007-01-16 Marek Safar <marek.safar@gmail.com>
1920 * const.cs (ResolveValue): Updated after constant conversion was made more
1923 * constant.cs (GetAttributableValue): constant to object conversion is
1924 used for attributes only.
1925 (IntConstant.ConvertImplicitly): Moved from convert to be used in all
1926 constant conversions.
1927 (LongConstant.ConvertImplicitly): Ditto.
1929 * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
1930 (ImplicitConversionStandard): Handle constant conversion as extra step.
1931 It solves the issue when constant conversion was called indirectly like
1932 inside array initializer and constant folding was skipped.
1934 * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
1937 * statement.cs(ImplicitConversionStandard): Updated after constant
1938 conversion was made more generic.
1940 2007-01-16 Sergey P. Kondratyev <se@unicom.tomica.ru>
1942 * expression.cs (As.DoResolve): Use GenericConstraints instead of
1943 Constraints, solves the problem where the compiler incorrectly
1944 reported that a type parameter was not constrained to a class (Bug
1947 2007-01-14 Marek Habersack <grendello@gmail.com>
1949 * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
1951 2007-01-14 Marek Safar <marek.safar@gmail.com>
1953 A fix for bug #80368
1954 * assign.cs (FieldInitializer): New class implements field
1955 initializer statement.
1957 * attribute.cs: Update after FieldMember rename.
1959 * class.cs (PropertyBasedMember): New common class for property based
1961 (InterfaceMemberBase): New base class for all members which can be used as
1962 an interface members.
1963 (MethodCore): Moved really common code to InterfaceMemberBase.
1964 (Method.Define): Equal and GetHasCode detection is relevant for methods
1966 (MethodData.Define): Don't assume that public event implements an
1967 interface automatically.
1968 (MethodData.DefineMethodBuilder): Issue an error even if only extern
1970 (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
1971 (FieldMember): Merged with FieldBase.
1972 (EventProperty.AEventPropertyAccessor): New specialization to check whether
1973 event extern modifier can be used.
1974 (EventField.EventFieldAccessor): Moved event field specific code here.
1975 (Event.AllowedModifiers): Even event can be extern.
1976 (Event.FindOutBaseMethod): New override specific to events.
1977 (Indexer.parameters): Reintroduce parameters because base class holds
1978 only properties common data.
1979 (Indexer.CheckForDuplications): Indexers are threated as methods so we
1980 need do extra parameters check.
1982 * const.cs: Update after FieldMember rename.
1984 * decl.cs (MemberCache.FindBaseEvent): New method.
1986 * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
1987 to reflect that indexer is now derived from PropertyBased.
1989 * ecore.cs (GetMemberType): Made public.
1990 (EventExpr.ResolveMemberAccess): Use right event cache and checks for
1993 * flowanalysis.cs, statement.cs: Update after FieldMember rename.
1995 * typemanager.cs (CSharpSignature): Correctly print event accessors.
1996 (RegisterEvent): Removed.
1997 (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
1998 (GetPrivateFieldOfEvent): Renamed to GetEventField.
2000 2007-01-11 Raja R Harinath <rharinath@novell.com>
2003 * statement.cs (CollectionForeach.TryType): Prefer generic
2004 GetEnumerator over non-generic variant. Fix code to follow comments.
2006 2007-01-09 Raja R Harinath <rharinath@novell.com>
2009 * support.cs (ReflectionParameter): Don't use an invalid index on
2010 the generic parameter data.
2012 2007-01-08 Miguel de Icaza <miguel@novell.com>
2014 * driver.cs: Just add a tiny bit of infrastructure.
2016 2007-01-02 Marek Safar <marek.safar@gmail.com>
2018 * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
2019 where field type is struct from current assembly.
2021 * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
2024 2007-01-02 Marek Safar <marek.safar@gmail.com>
2026 A fix for bug #80381
2027 * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
2030 * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
2032 (Namespace.LookupType): Always use core types from corlib when speficied.
2034 * report.cs: A new warning.
2036 * rootcontext.cs (BootstrapCorlib_ResolveInterface,
2037 BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
2038 (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
2040 * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
2041 (InitCoreTypes): Set expression type of object_type and value_type
2042 immediately after lookup.
2044 2007-01-01 Miguel de Icaza <miguel@novell.com>
2046 * cs-tokenizer.cs: Accept Pc class characters (Connector
2047 Punctuation) as valid identifiers. Fixes #78259
2049 * expression.cs (Invocation.DoResolve): Moved the check for the
2050 use of `this' for doing method calls to the Invocation resolution
2051 step, after overload resolution has taken place instead of doing
2052 the check at the low-level `This.DoResolve' level.
2054 The `This.DoResolve'(appens before overload resolution, so it has
2055 no way of knowing if the method that will be called will be
2056 instace or static, triggering an erroneous report for cs0188 (Bug
2059 We now do the check for instance method invocations after we know
2060 what method will be called.
2062 (This.CheckThisUsage): Move the actual use of this structure
2063 checking into its own method and expose it.
2065 * Everywhere that called Error_ValueCannotBeConverted: pass a new
2068 Exceptions: Null.ConvertImplicitly,
2069 Constant.ImplicitConversionRequired as there are too many call
2070 sites for passing the ec.
2072 * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
2073 EmitContext, if the value is null, then we do not try to provide
2074 the extra information from the error (If a userdefined conversion
2075 exists, as UserDefinedConversion requires a non null-EmitContext).
2079 2006-12-30 Raja R Harinath <rharinath@novell.com>
2081 * flowanalysis.cs (MyBitVector): Document some invariants.
2082 (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
2083 introduced below, and add a couple of others,
2085 2006-12-30 Marek Safar <marek.safar@gmail.com>
2087 * attribute.cs (GetMethodObsoleteAttribute): Uses new
2088 GetPropertyFromAccessor and GetEventFromAccessor.
2090 * class.cs (MethodCore.CheckBase): A new warning when obsolete member
2091 overrides non-obsolete one.
2092 (Indexer.Define): Error message has been moved to the parser.
2094 * cs-parser.jay: Better syntax errors handling.
2096 * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
2097 when an invocation has no arguments.
2099 * ecore.cs: Removed not used caching.
2101 * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
2104 * report.cs: Add a new warning.
2106 * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
2108 * typemanager.cs (enumeration_type): Removed.
2109 (CSharpSignature): Reuses IsSpecialMethod.
2110 (IsEqual): Hack for MS BCL.
2111 (GetPropertyFromAccessor): New method.
2112 (GetEventFromAccessor): New method.
2113 (IsSpecialMethod): Fixed to handle more cases.
2115 2006-12-30 Marek Safar <marek.safar@gmail.com>
2117 * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
2118 Made white spaces array static.
2120 * ecore.cs (RemoveGenericArity): Optimized.
2122 * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
2124 (MyBitVector.initialize_vector): Simplified.
2126 2006-12-22 Miguel de Icaza <miguel@novell.com>
2128 * ecore.cs: Am not entirely happy with this hack, but it seems to
2129 address the issue in 80257 (a small test case for
2132 I set the MethodGroupExpr.Type to an internal compiler type
2133 (itself in this case) to force the resolution to take place. Why
2134 it does not take place with a null is beyond me.
2136 2006-12-20 Marek Safar <marek.safar@gmail.com>
2138 A fix for bug #80288
2139 * expression.cs (ResolveOperator): Consider user defined conversion for
2140 logical and operator too.
2141 (EmitBranchable): Optimization for logical and when full constant folding
2142 could not be applied but one operand is constant.
2144 2006-12-19 Marek Safar <marek.safar@gmail.com>
2146 * class.cs (GetClassBases): Write 5 times every day, will never use
2147 FullName for error reporting.
2149 * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
2151 2006-12-19 Martin Baulig <martin@ximian.com>
2153 * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
2154 the symbol file info here.
2156 2006-12-18 Marek Safar <marek.safar@gmail.com>
2158 * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
2159 of `elseif' is taking then following sections are not taking.
2160 Fixes an issue reported on mono mailing list.
2162 2006-12-18 Marek Safar <marek.safar@gmail.com>
2164 A fix for bug #80300
2165 * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
2166 a caller is not taking.
2168 2006-12-18 Raja R Harinath <rharinath@novell.com>
2170 * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
2171 (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
2172 (RootScopeInfo, AnonymousMethodMethod): Update to changes.
2173 * iterator.cs: Change several TypeContainer declarations to DeclSpace.
2174 * class.cs: Update to changes.
2176 2006-12-17 Marek Safar <marek.safar@gmail.com>
2178 A fix for bug #79934
2179 * anonymous.cs (CompilerGeneratedClass): Register class in a shared
2182 * class.cs (ResolveMembers): Register an iterator in current container and
2185 2006-12-16 Raja R Harinath <rharinath@novell.com>
2188 * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
2189 satisfy a params annotated parameter.
2191 2006-12-16 Marek Safar <marek.safar@gmail.com>
2193 A fix for bug #77014
2194 * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
2195 paramters correctly and not rely on hacks in Parameters class.
2196 (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
2198 (Invocation.VerifyArgumentsCompat): Ditto.
2199 (Invocation.EmitArguments): Changed to correctly emit params arguments at
2202 * parameter.cs (HasParams): Don't assume that params is the last one.
2204 * support.cs (ReflectionParameters.ctor): Look for params attribute
2206 (ReflectionParameters.ParameterType): Removed hack when we returned last
2207 parameter for out of range parameters.
2208 (ParameterName, ParameterModifier): Ditto.
2210 2006-12-14 Marek Safar <marek.safar@gmail.com>
2212 A fix for bug #79987
2213 * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
2214 when assembly is not CLS compliant but type is. I have no idea why is this
2217 * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
2219 2006-12-13 Miguel de Icaza <miguel@novell.com>
2221 * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
2222 in struct constructors, they are basically no-ops.
2224 2006-12-12 Marek Safar <marek.safar@gmail.com>
2226 * cs-tokenizer.cs (Position): Save preprocessor status too.
2228 2006-12-12 Marek Safar <marek.safar@gmail.com>
2230 A fix for bug #77794
2231 * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
2233 2006-12-12 Marek Safar <marek.safar@gmail.com>
2235 * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
2237 (pp_expr): Report error for an invalid expression.
2238 (handle_preprocessing_directive): Simplified; add more error checking.
2240 2006-12-11 Marek Safar <marek.safar@gmail.com>
2242 A fix for bug #74939
2243 * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
2244 directives handling.
2246 2006-12-10 Marek Safar <marek.safar@gmail.com>
2248 A fix for bugs #80093, and #75984
2249 * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
2250 logic, it seems to me as it worked before "by coincidence".
2251 (xtoken): Simplified to use reworked handle_preprocessing_directive.
2252 (cleanup): Enabled endif check.
2254 2006-12-09 Marek Safar <marek.safar@gmail.com>
2256 A fix for bug #80162
2257 * statement.cs (CollectionForeach.TryType): Generics and non-generics
2258 enumerators are never ambiguous.
2260 2006-12-08 Raja R Harinath <rharinath@novell.com>
2263 * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
2265 2006-12-06 Marek Safar <marek.safar@gmail.com>
2267 A fix for bug #80144
2268 * class.cs (EventProperty.Define): Explicit implementation means
2269 that an even is used.
2271 2006-12-06 Marek Safar <marek.safar@gmail.com>
2273 Fixes the operators implementation (part II)
2275 * cfold.cs (DoConstantNumericPromotions): Renamed to
2276 DoBinaryNumericPromotions and simplified.
2277 (BinaryFold): Couple of conversion fixes; simplified.
2279 * constant.cs, ecore.cs, literal.cs
2280 (ToType): Renamed to ConvertImplicitly.
2281 (Reduce): Renamed to ConvertExplicitly.
2283 * class.cs, convert.cs: Updated.
2285 * expression.cs: TryReduce doesn't throw an exception.
2287 2006-12-01 Marek Safar <marek.safar@gmail.com>
2289 A fix for bug #80108
2290 * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
2293 2006-11-30 Marek Safar <marek.safar@gmail.com>
2295 Fixes unary operators implementation (part I)
2298 * cfold.cs (Error_CompileTimeOverflow): Made internal
2300 * const.cs (IConstant): Changed to use reference to constant and
2301 not constant itself.
2302 Updated IConstant implementations.
2304 * constant.cs (CreateConstant): New factory method.
2305 Updated IConstant implementation.
2307 * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
2309 * ecore.cs: Updated to use CreateConstantReference.
2311 * enum.cs: Reflects IConstant changes.
2313 * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
2315 * literal.cs (NullConstant): Change to be independently usable.
2317 2006-11-29 Martin Baulig <martin@ximian.com>
2319 * class.cs (Constructor.Emit): Correctly handle anonymous methods;
2320 we need to emit the scope initializer before calling the base .ctor.
2322 * anonymous.cs: Merged back from the new anonymous methods branch.
2323 (AnonymousMethodHost): Renamed to `RootScopeInfo'.
2325 * expression.cs (ParameterReference.DoResolveBase): Create a
2326 "normal" ScopeInfo when capturing parameters rather than using the
2327 root scope; this makes things work with anonymous methods having
2331 (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
2333 2006-11-22 Marek Safar <marek.safar@gmail.com>
2335 A fix for bug #79987
2336 * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
2337 check to a base class.
2338 * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
2339 only when assembly has missing attribute.
2340 * report.cs: Update.
2342 2006-11-21 Marek Safar <marek.safar@gmail.com>
2344 * cs-tokenizer.cs: Merged with gmcs version.
2346 2006-11-20 Marek Safar <marek.safar@gmail.com>
2349 * cs-parser.jay: Better error message when partial keyword is misplaced.
2351 2006-11-19 Gert Driesen <drieseng@users.sourceforge.net>
2353 A fix for bug #79810
2354 report.cs: CS1058 only applies to 2.0 profile (gmcs).
2355 codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
2356 a RuntimeWrappedException by default.
2358 2006-11-18 Marek Safar <marek.safar@gmail.com>
2360 A fix for bug #79843
2361 * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
2363 (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
2365 2006-11-18 Marek Safar <marek.safar@gmail.com>
2367 * driver.cs, namespace.cs: Uses faster IndexOf version.
2369 2006-11-17 Marek Safar <marek.safar@gmail.com>
2371 A fix for bug #79941
2372 * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
2374 (Operator.Define): Implicit/Explicit operator of same type is duplicate
2375 even if internal name is different.
2376 * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
2377 (UserDefinedConversion): Simplified as the operators cannot be internal.
2378 * ecore.cs (Error_ValueCannotBeConverted): Take account of user
2380 (MethodLookup): Replaced EmitContext with parentType.
2381 * expression.cs: Updated.
2383 2006-11-09 Raja R Harinath <rharinath@novell.com>
2385 * driver.cs (BadAssembly): Handle all the ugliness of
2386 DefineDynamicAssembly.
2388 2006-11-08 Raja R Harinath <rharinath@novell.com>
2390 Address parts of #58244 -- most of what's left is in the runtime
2391 * driver.cs (LoadAssembly): Simplify slightly. Add CS0009 and
2392 CS1509 error checks, and handle them for all assembly loads, not
2393 just the first invocation.
2394 (LoadModule): Likewise. Move handling of 'adder_method' ...
2395 * codegen.cs (AssemblyClass.AddModule): ... here.
2397 2006-11-02 Marek Safar <marek.safar@gmail.com>
2399 * statement.cs.cs (CollectionForeach.TryType): Issue a error when
2400 IEnumerable<T> is ambiguous.
2402 2006-10-31 Marek Safar <marek.safar@gmail.com>
2404 A fix for bug #67689
2405 * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
2406 GetEnumerator is ambiguous.
2408 * report.cs: Add new warning.
2410 2006-10-29 Marek Safar <marek.safar@gmail.com>
2412 A fix for bug #78602
2413 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
2414 to protected member can be nested type.
2416 2006-10-28 Marek Safar <marek.safar@gmail.com>
2418 A fix for bug #78965
2419 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
2420 to protected member must derive from current type.
2422 2006-10-27 Marek Safar <marek.safar@gmail.com>
2424 assign.cs: Reuses error method.
2426 ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
2427 instead of type for constants.
2428 (Expression.Error_ValueAssignment): Common error method.
2430 * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
2433 2006-10-27 Marek Safar <marek.safar@gmail.com>
2435 A fix for bug #79081
2436 * expression.cs (MemberAccess.DoResolve): Check nested type
2439 2006-10-27 Atsushi Enomoto <atsushi@ximian.com>
2441 * doc.cs : nested delegates were not handled. Fixed bug #79754.
2443 2006-10-26 Marek Safar <marek.safar@gmail.com>
2445 A fix for bug #76591
2446 * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
2448 2006-10-26 Marek Safar <marek.safar@gmail.com>
2450 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
2451 type forwarder of the same type multiple times.
2453 2006-10-26 Raja R Harinath <rharinath@novell.com>
2456 * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
2457 instance as an rvalue, even when we later resolve as an lvalue.
2459 2006-10-25 Martin Baulig <martin@ximian.com>
2461 * anonymous.cs: Fix #79673.
2463 2006-10-24 Marek Safar <marek.safar@seznam.cz>
2465 A fix for bug #79666
2466 expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
2467 ignored when is optimized (= default value) as its value is already set.
2469 2006-10-23 Marek Safar <marek.safar@seznam.cz>
2471 A fix for bug #79724
2472 * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
2473 TypeContainer for type lookup.
2475 2006-10-23 Marek Safar <marek.safar@seznam.cz>
2477 A fix for bug #79231
2478 * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
2479 * expression.cs (OverloadResolve): Always convert type name for
2481 (ResolveNamespaceOrType): Don't confuse a nested type with any
2484 2006-10-18 Martin Baulig <martin@ximian.com>
2486 * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
2488 2006-10-17 Miguel de Icaza <miguel@novell.com>
2490 * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
2491 an int32, but requesting an int64 from the conversion
2493 2006-10-12 Martin Baulig <martin@ximian.com>
2496 (AnonymousContainer.Resolve): Inflate the `ReturnType'. Fixes #79592.
2498 2006-10-12 Martin Baulig <martin@ximian.com>
2501 (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
2503 2006-10-11 Miguel de Icaza <miguel@novell.com>
2505 * convert.cs: Remove broken code: I was doing the "Existance"
2506 tests for Implicit conversions.
2508 2006-10-10 Miguel de Icaza <miguel@novell.com>
2510 * convert.cs: Added one missing case in
2511 ImplicitStandardConversionExists uint64 to intptr.
2515 * typemanager.cs (uintptr_type): another core known type.
2517 * ecore.cs (OperatorCast): routine used to do cast operations that
2518 depend on op_Explicit. We could change some of the Decimal
2519 conversions to use this.
2521 This one has a probe mechanism that checks both types for an op_
2522 which it coudl be used to eliminate two classes: CastToDecimal
2523 and CastFromDecimal.
2525 * convert.cs: Implement the conversions documented in #59800
2527 2006-10-10 Martin Baulig <martin@ximian.com>
2529 * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
2530 before RootScope.ResolveMembers().
2532 * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
2533 `CurrentType' if appropriate.
2535 2006-10-09 Marek Safar <marek.safar@seznam.cz>
2537 A fix for bug #78568
2538 * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
2539 when contains binary operators.
2540 * cs-parser.jay: Updated.
2542 2006-10-09 Martin Baulig <martin@ximian.com>
2545 (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
2546 moved that into Define() and also do the other type parameter
2547 checks there. Fixes #79094. Added gtest-292.cs.
2550 (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
2551 since that doesn't include type parameters; don't use `Ldelema'
2552 for type parameters. Fixes #78980. Added gtest-293.cs.
2554 2006-10-08 Marek Safar <marek.safar@seznam.cz>
2557 * convert.cs (ExplicitReferenceConversion): Only enum to enum value
2558 conversion is allowed.
2560 2006-10-06 Marek Safar <marek.safar@seznam.cz>
2562 * ecore.cs (Expression.MemberLookup): Don't register any symbol for
2563 error reporting when no error occurs.
2565 2006-10-06 Marek Safar <marek.safar@seznam.cz>
2567 * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
2570 2006-10-06 Raja R Harinath <rharinath@novell.com>
2573 * class.cs (DefineTypeBuilder): Check circular dependencies before
2574 setting the parent of the TypeBuilder.
2575 (CheckRecursiveDefinition): Don't use 'BaseType', since
2576 it may not be valid until after DefineTypeBuilder. Use
2577 'base_type' instead.
2579 2006-10-04 Martin Baulig <martin@ximian.com>
2581 Merged the Anonymous Methods patch.
2583 * anonymous.cs, iterators.cs: The new anonymous methods code.
2585 * statement.cs (Variable): New public abstract class.
2586 (LocalInfo.Variable): New public property.
2587 (LocalInfo.ResolveVariable): New public method.
2588 (Block.Flags): Add `IsIterator'.
2589 (Block.AddVariable): Improved the CS0136 check.
2590 (Block.AnonymousChildren): New public property.
2591 (Block.AddAnonymousChild): New public method.
2592 (ToplevelBlock): Update to use the new anonymous method framework.
2593 (ToplevelBlock.ctor): `container' is now a `Block' and not a
2594 `ToplevelBlock'; this is required to correctly implement the
2596 (Fixed, Using): Use `TemporaryVariable' instead of directly
2597 creating the `LocalBuilder'.
2599 * parameter.cs (Parameter.ResolveVariable): New public method.
2600 (Parameters.ResolveVariable): Likewise.
2602 * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
2604 * class.cs (TypeContainer): Replaced the `iterators' list and
2605 corresponding methods with a list of `CompilerGeneratedClass'es.
2606 (TypeContainer.ResolveMembers): New public method.
2607 (Method): `IIteratorContainer' has been replaced by
2610 * expression.cs (VariableReference): New public abstract base
2611 class for `LocalVariableReference', `ParameterReference' and
2614 * codegen.cs (EmitContext): Removed `capture_context',
2615 `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
2616 (EmitContext.EmitThis): Removed.
2618 * cs-parser.jay: Replace `iterator_container' with
2621 2006-10-04 Martin Baulig <martin@ximian.com>
2623 * generic.cs (GenericMethod): Don't make this abstract.
2624 (Constraints.Clone): Added dummy implementation.
2626 2006-10-04 Raja R Harinath <harinath@gmail.com>
2629 * namespace.cs (LookForAnyGenericType): Avoid nullref on
2630 'declspaces'. Avoid allocating arrays willy-nilly.
2633 * cfold.cs (BinaryFold): Move boolean Equality and Inequality
2634 cases out of the switch.
2636 2006-09-28 Marek Safar <marek.safar@seznam.cz>
2638 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
2639 message when non-generic type is used with the type arguments.
2640 * expression.cs: Updated.
2642 2006-09-28 Raja R Harinath <rharinath@novell.com>
2645 * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
2646 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
2647 Change semantics slightly. Don't insist on having only one
2648 temporary EmptyExpression -- just throttle the creation of new ones.
2651 * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
2652 non-interfaces too. If no methods are found, don't try to create
2655 2006-09-28 Marek Safar <marek.safar@seznam.cz>
2657 * ecore.cs (ResolveAsTypeStep): Print better error when type can be
2660 * namespace.cs (Namespace.LookForAnyGenericType): New method to help
2661 us produce better error message.
2663 2006-09-27 Marek Safar <marek.safar@seznam.cz>
2665 * expression.cs (Binary.ResolveOperator): Warn about a side effect
2666 of the `|' operator.
2668 * report.cs: A new warning added.
2670 2006-09-27 Martin Baulig <martin@ximian.com>
2672 * generic.cs (GenericMethod): Don't make this abstract.
2674 2006-09-27 Martin Baulig <martin@ximian.com>
2677 (InternalErrorException): Added overloaded ctor taking a params array.
2679 2006-09-26 Marek Safar <marek.safar@seznam.cz>
2681 * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
2682 Fixed the cases when same error was reported twice.
2684 * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
2685 now report symbol information.
2687 2006-09-25 Martin Baulig <martin@ximian.com>
2689 * class.cs: Completely unified with the gmcs version.
2691 2006-09-25 Martin Baulig <martin@ximian.com>
2693 * typemanager.cs (TypeManager.IsNullableType): New public function.
2694 (TypeManager.IsNullableTypeOf): Likewise.
2695 (TypeManager.IsNullableValueType): Likewise.
2697 * class.cs (MethodCore): Added the `GenericMethod' argument from
2698 gmcs and also unified all classes derived from `MethodCore' with gmcs.
2700 2006-09-24 Raja R Harinath <harinath@gmail.com>
2702 * convert.cs: Unify with gmcs version.
2704 2006-09-24 Marek Safar <marek.safar@seznam.cz>
2706 * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
2707 verify them as well.
2709 * report.cs: New warning.
2711 2006-09-24 Marek Safar <marek.safar@seznam.cz>
2713 * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
2714 for anonymous block with out argument.
2716 2006-09-24 Marek Safar <marek.safar@seznam.cz>
2718 * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
2719 not used private events only.
2721 2006-09-23 Marek Safar <marek.safar@seznam.cz>
2723 * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
2725 * const.cs (Const.Define): Check for constant type.
2726 (Const.IsConstantTypeValid): Looks for valid constant types.
2728 * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
2730 * ecore.cs (EmptyConstantCast): New common class for all constant based
2733 * expression.cs (Is.DoResolve): Handle null constant especially.
2734 (New.DoResolve): Check for new void().
2735 (MemberAccess.DoResolve): Cope with all kind of nulls.
2737 * literal.cs (NullConstant): Uses EmptyConstantCast.
2738 (NullDefault): Based on EmptyConstantCast.
2739 (NullLiteral): Uses EmptyConstantCast.
2741 * statement.cs (Block.ResolveMeta): Check for constant type.
2743 2006-09-22 Martin Baulig <martin@ximian.com>
2745 * delegate.cs, attribute.cs: Merged with the gmcs versions.
2747 2006-09-22 Raja R Harinath <rharinath@novell.com>
2749 * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
2753 * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
2754 * decl.cs (DeclSpace.FindMemberToOverride): Likewise. Reorganize
2757 2006-09-22 Martin Baulig <martin@ximian.com>
2759 * ecore.cs: Merged with the gmcs version.
2761 * generic.cs (ConstructedType): New dummy class.
2762 (TypeArguments): Don't make this abstract.
2765 (TypeManager.IsGenericTypeDefinition): New method.
2766 (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
2768 2006-09-22 Raja R Harinath <rharinath@novell.com>
2770 * expression.cs (ComposedCast): Check for arrays of TypedReference
2771 before creating the type, not after.
2773 2006-09-21 Marek Safar <marek.safar@seznam.cz>
2775 * cfold.cs, const.cs, enum.cs, statement.cs: Updated
2776 after ToType change.
2778 * constant.cs (Constant.ImplicitConversionRequired): Designed to used
2779 when constant must be implicitly convertible.
2781 * convert.cs (ImplicitReferenceConversion): Reuse ToType.
2783 * ecore.cs (NullCast): Derives from NullConstant.
2785 * expression.cs (Is.DoResolve): Removed useless variables.
2786 (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
2787 (New.Constantify): Add enum support.
2788 (MemberAccess.DoResolve): Add warning when accessing null constant or
2791 * generic.cs (GenericConstraints.IsReferenceType): Another dummy
2794 * literal.cs (NullConstant): New abstract class with common
2795 functionality for all null specializations.
2796 (NullDefault): Represents default(X) when result can be
2798 (NullLiteral): Updated.
2800 * report.cs: Add new warning.
2802 2006-09-21 Martin Baulig <martin@ximian.com>
2804 * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
2806 2006-09-21 Martin Baulig <martin@ximian.com>
2808 * generic.cs (GenericConstraints): New dummy class.
2809 (Constraints): Likewise.
2810 (TypeParameter): Likewise.
2811 (TypeParameterName): Likewise.
2812 (GenericMethod): Likewise.
2814 * typemanager.cs (TypeManager.GetGenericArguments): New method.
2816 * decl.cs: Merged with the gmcs version.
2818 2006-09-21 Raja R Harinath <rharinath@novell.com>
2820 * generic.cs (TypeParameter): Implement IMemberContainer.
2821 (GenericTypeParameterBuilder): New. An abominable repugnant hack.
2823 * rootcontext.cs: Unify with gmcs version.
2825 * report.cs: Unify with gmcs version.
2826 * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
2827 from gmcs/generics.cs.
2828 * generics.cs (TypeParameter): New dummy class.
2830 * support.cs: Unify with gmcs version.
2832 2006-09-20 Raja R Harinath <rharinath@novell.com>
2834 * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
2835 * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
2837 * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
2838 * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
2839 * mcs.exe.sources: Add generic.cs.
2841 * codegen.cs: Unify with gmcs version.
2843 * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
2844 (EmitContext): Add GenericDeclContainer implementation.
2845 * decl.cs (MemberCore, DeclSpace): Likewise.
2846 * namespace.cs: Remove #ifdef GMCS_SOURCE.
2848 * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
2849 MCS TypeManager has a corresponding dummy method.
2851 2006-09-19 Martin Baulig <martin@ximian.com>
2853 * expression.cs: Completely merged with the gmcs version.
2855 2006-09-19 Martin Baulig <martin@ximian.com>
2857 * expression.cs (Invocation): Merged with the gmcs version.
2858 (ArrayAccess.GetStoreOpcode): Likewise.
2860 2006-09-19 Martin Baulig <martin@ximian.com>
2863 (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
2864 (TypeManager.IsGenericMethodDefinition): Likewise.
2866 2006-09-19 Martin Baulig <martin@ximian.com>
2869 (TypeManager.IsEqual): Moved the gmcs implementation here.
2870 (TypeManager.DropGenericTypeArguments): Likewise.
2871 (TypeManager.DropGenericMethodArguments): Likewise.
2872 (TypeManager.GetTypeArguments): Moved here from gmcs.
2873 (TypeManager.HasGenericArguments): Likewise.
2875 2006-09-19 Martin Baulig <martin@ximian.com>
2877 * expression.cs (Binary): Merged with the gmcs version.
2879 2006-09-19 Martin Baulig <martin@ximian.com>
2881 * expression.cs (Probe, As, Is): Merged with the gmcs version.
2883 2006-09-19 Martin Baulig <martin@ximian.com>
2885 * typemanager.cs: Merged with the gmcs version.
2887 2006-09-16 Raja R Harinath <rharinath@novell.com>
2889 * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
2890 * driver.cs: Likewise.
2892 2006-09-16 Marek Safar <marek.safar@seznam.cz>
2895 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
2896 only if parent type is class.
2897 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
2900 2006-09-15 Marek Safar <marek.safar@seznam.cz>
2903 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
2905 * typemanager.cs(CSharpName): Converts NullType to null.
2907 2006-09-15 Martin Baulig <martin@ximian.com>
2910 (TypeManager.GetMethodName): Added mcs implementation.
2911 (TypeManager.IsEqual): Likewise.
2914 (SimpleName.RemoveGenericArity): Added dummy implementation.
2916 * pending.cs: Merged with the gmcs version.
2918 2006-09-15 Martin Baulig <martin@ximian.com>
2920 * statement.cs: Merge with the gmcs version.
2922 2006-09-15 Martin Baulig <martin@ximian.com>
2924 * statement.cs (Switch): Merge with the gmcs implementation
2925 (without nullables), which is newer.
2927 2006-09-15 Martin Baulig <martin@ximian.com>
2929 * statement.cs (Block.Variables): Make this public.
2930 (ToplevelBlock.Parameters): Make this a property.
2931 (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
2933 2006-09-15 Martin Baulig <martin@ximian.com>
2935 * namespace.cs: Merge with the gmcs version.
2937 2006-09-15 Martin Baulig <martin@ximian.com>
2939 * decl.cs (MemberName): Minor code cleanups.
2941 2006-09-15 Martin Baulig <martin@ximian.com>
2943 * parameter.cs: Merge with the gmcs version.
2945 2006-09-15 Martin Baulig <martin@ximian.com>
2947 * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
2948 and an error in mcs.
2950 2006-09-15 Martin Baulig <martin@ximian.com>
2952 * flowanalysis.cs: Merged from GMCS; added the generics code into
2953 a `GMCS_SOURCE' conditional so we can share this file.
2955 2006-09-08 Martin Baulig <martin@ximian.com>
2957 * typemanager.cs (TypeManager.interlocked_type): New public field.
2958 (TypeManager.int_interlocked_compare-exchange): New public field.
2959 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
2960 enumerator types here and call InitGenericCoreTypes().
2961 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
2962 after calling InitEnumUnderlyingTypes().
2965 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
2966 `classes_second_stage'.
2968 2006-09-14 Marek Safar <marek.safar@seznam.cz>
2970 * assign.cs, ecore.cs, expression.cs: Share error message text.
2971 * class.cs (FieldMember.Define): Check for varible of static type.
2972 * driver.cs (LoadAssembly): Uses error output for errors.
2973 * statement.cs: Updated.
2975 2006-09-08 Marek Safar <marek.safar@seznam.cz>
2977 * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
2980 2006-09-07 Martin Baulig <martin@ximian.com>
2983 (MainDriver): Revert r62663 from Marek; see #70506 for details.
2985 2006-08-29 Miguel de Icaza <miguel@novell.com>
2987 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
2989 2006-08-17 Miguel de Icaza <miguel@novell.com>
2991 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
2992 #52019 and #79064, the use of the \uXXXX sequence in source code
2993 to represent unicode characters.
2995 2006-08-15 Marek Safar <marek.safar@seznam.cz>
2997 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
2999 * class.cs, ecore.cs, statement.cs: Merged to one error message.
3001 2006-08-13 Miguel de Icaza <miguel@novell.com>
3003 * assign.cs: Catch attempts to assign to a method groups in += and
3006 2006-08-13 Marek Safar <marek.safar@seznam.cz>
3009 * cs-parser.jay: Don't destroy current array type by typeof of array's.
3011 2006-08-12 Marek Safar <marek.safar@seznam.cz>
3013 * class.cs (Method.Define): Issue a warning when generic method looks like
3015 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
3018 2006-08-09 Marek Safar <marek.safar@seznam.cz>
3020 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
3022 * decl.cs (MemberCache.FindMembers): When container is interface we need to
3023 search all base interfaces as a member can be ambiguous.
3024 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
3025 Constructor member type filter.
3026 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
3027 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
3028 reporting for returned memberinfos.
3029 * report.cs: Updated.
3030 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
3031 version to work on all runtimes.
3032 (TypeManager.RealMemberLookup): Removed members filtering.
3034 2006-08-08 Raja R Harinath <rharinath@novell.com>
3036 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
3037 (PropertyExpr.EmitAssign): Likewise.
3038 * expression.cs (Indirection.EmitAssign): Likewise.
3039 (LocalVariableReference.EmitAssign): Likewise.
3040 (ParameterReference.EmitAssign): Likewise.
3041 (Invocation.EmitArguments): Likewise.
3042 (ArrayAccess.EmitAssign): Likewise.
3043 (IndexerAccess.EmitAssign): Likewise.
3044 (This.EmitAssign): Likewise.
3045 (ConditionalLogicalOperator.Emit): Likewise.
3048 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
3049 instead of ArrayList. If the hashtable has a LocalBuilder, don't
3050 leave it in after returning it.
3051 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
3053 2006-08-06 Marek Safar <marek.safar@seznam.cz>
3055 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
3058 2006-08-03 Raja R Harinath <rharinath@novell.com>
3060 Fix cs0146-3.cs and cs0146-4.cs.
3061 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
3062 enclosing types don't depend on the current type.
3064 2006-08-02 Raja R Harinath <rharinath@novell.com>
3067 * class.cs (TypeContainer.DoDefineMembers): Use
3068 FindBaseMemberWithSameName on Parent, since we're interested in
3069 whether we hide inherited members or not.
3070 (FindBaseMemberWithSameName): Make slightly more robust.
3072 Fix the non-generic testcase from #77396
3073 * decl.cs (DeclSpace.DeclContainer): Remove override.
3075 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
3076 declspaces for doppelgangers too.
3077 (UsingEntry): Implement IResolveContext.
3078 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
3079 'this' as the resolve context.
3080 (LocalAliasEntry): Likewise.
3082 Implement parts of #77403
3083 * roottypes.cs (RootDeclSpace): New. Used to represent the
3084 toplevel declaration space. Each namespace declaration introduces
3085 a "partial" root declaretion space.
3086 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
3087 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
3088 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
3089 from 'current_namespace.SlaveDeclSpace'.
3090 (namespace_declaration): Likewise.
3091 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
3092 check. It can't happen now.
3093 * decl.cs (DeclSpace.LookupType): Likewise.
3094 * driver.cs (MainDriver): Sanity check.
3096 2006-08-01 Raja R Harinath <rharinath@novell.com>
3098 * decl.cs (DeclSpace.FindNestedType): Remove.
3099 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
3100 LookupTypeContainer to get the container of the nested type.
3101 * class.cs (TypeContainer.FindNestedType): Make non-override.
3103 2006-07-31 Raja R Harinath <rharinath@novell.com>
3105 * decl.cs (DeclSpace.PartialContainer): Move field from ...
3106 * class.cs (TypeContainer.PartialContainer): ... here.
3107 (TypeContainer.AddBasesForPart): New helper.
3108 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
3110 * cs-parser.jay (current_class): Convert to DeclSpace.
3111 (struct_declaration, interface_declaration, class_declaration):
3112 Use AddBasesForPart instead of .Bases directly.
3113 * const.cs, iterators.cs: Update to changes.
3115 2006-07-28 Raja R Harinath <rharinath@novell.com>
3117 * class.cs (TypeContainer.AddMemberType): Rename from
3119 (TypeContainer.AddMember): Rename from AddToMemberContainer.
3120 (AddTypeContainer): New. Combine AddClassOrStruct and
3122 (AddPartial): Update. Add 'is_partial' argument.
3123 * roottypes.cs: Update to changes.
3124 * cs-parser.jay (push_current_class): New helper for handling
3125 current_container and current_class.
3126 (struct_declaration, interface_declaration, class_declaration):
3129 2006-07-26 Raja R Harinath <rharinath@novell.com>
3131 * roottypes.cs: Rename from tree.cs.
3133 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
3134 * tree.cs (Tree, ITreeDump): Remove types.
3135 * rootcontext.cs (tree, Tree): Remove fields.
3136 (root, ToplevelTypes): New.
3137 * *.cs: Update to rename.
3139 * tree.cs (Tree.RecordDecl): Remove.
3140 (RootTypes.AddToTypeContainer): Record the toplevel type in its
3142 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
3144 2006-07-23 Raja R Harinath <harinath@gmail.com>
3146 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
3147 DoFlowAnalysis and OmitStructFlowAnalysis here.
3148 (ec.With): Rename from WithUnsafe and generalize.
3149 (ec.WithCheckState): Remove. All users can be handled by 'With'.
3150 (ec.WithFlowAnalyis): New.
3151 * ecore.cs, expression.cs, statement.cs: Update.
3153 2006-07-22 Raja R Harinath <harinath@gmail.com>
3155 * statement.cs (Block.ResolveMeta): Simplify slightly.
3157 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
3158 multiple boolean fields. Convert InUnsafe, constant_check_state,
3159 check_state to flags.
3160 (CheckState, ConstantCheckState): Update.
3161 (InUnsafe): New read-only property.
3162 (FlagsHandle): Rename from CheckStateHandle and convert to handle
3164 (WithUnsafe): New helper similar to WithCheckState.
3165 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
3166 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
3168 2006-07-21 Raja R Harinath <rharinath@novell.com>
3170 Make comparisons use the same IL irrespective of whether they're
3171 in a 'checked' or 'unchecked' context: one of the issues in #78899
3172 * codegen.cs (EmitContext.CheckState): Make read-only property.
3173 (EmitContext.ConstantCheckState): Likewise.
3174 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
3175 helper that implement a save/restore stack for CheckState
3176 values. This is the only way to change check-state.
3177 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
3178 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
3179 (CheckedExpr.EmitBranchable): New forwarding method.
3180 (UnCheckedExpr): Likewise.
3181 * statement.cs (Block.ResolveMeta): Use WithCheckState.
3182 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
3183 (Checked.Resolve, checked.DoEmit): Likewise.
3185 2006-07-20 Miguel de Icaza <miguel@novell.com>
3187 * anonymous.cs: Cache the resolved anonymous delegate, and return
3188 this so that the ResolveTopBlock is only triggered once, not
3191 Currently we trigger ResolvetopBlock twice due to a first pass of
3192 argument check compatibility, and a second pass that does the
3195 2006-07-15 Marek Safar <marek.safar@seznam.cz>
3197 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
3199 * rootcontext.cs (Reset): Add helper_classes.
3201 2006-07-15 Marek Safar <marek.safar@seznam.cz>
3204 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
3207 2006-07-13 Miguel de Icaza <miguel@novell.com>
3209 * statement.cs (Lock): Handle expressions of type
3210 TypeManager.null_type specially. Fixes #78770
3212 2006-07-08 Marek Safar <marek.safar@seznam.cz>
3214 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
3217 2006-07-08 Marek Safar <marek.safar@seznam.cz>
3219 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
3220 for accessors as well.
3221 * ecore.cs (EventExpr): Add AccessorTable.
3223 2006-07-01 Marek Safar <marek.safar@seznam.cz>
3226 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
3227 for CS0122 where appropriate.
3228 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
3230 (Filter): Assembly can be null in the case of top level attributes.
3232 2006-06-25 Marek Safar <marek.safar@seznam.cz>
3236 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
3237 is done at global level.
3239 2006-06-24 Marek Safar <marek.safar@seznam.cz>
3241 A fix for #77002, Implemented TypeForwarder support.
3243 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
3244 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
3245 * typemanager.cs (): Add type_forwarder_attr_type.
3247 2006-06-24 Marek Safar <marek.safar@seznam.cz>
3249 * report.cs: Add CS0469 warning.
3251 2006-06-21 Martin Baulig <martin@ximian.com>
3253 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
3254 the `try'-block, so we also report CS0016 etc. there.
3256 2006-06-21 Martin Baulig <martin@ximian.com>
3259 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
3261 2006-06-21 Martin Baulig <martin@ximian.com>
3263 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
3264 also report CS1686 for parameters.
3266 2006-06-21 Martin Baulig <martin@ximian.com>
3268 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
3269 instead of an error if the value is not implicitly convertible to
3270 the switch types; fixes #77964.
3272 2006-06-21 Raja R Harinath <rharinath@novell.com>
3275 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
3276 FieldBuilder is null.
3279 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
3280 'left' and 'right' before error-checking.
3282 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
3284 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
3286 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
3287 (FieldExpr.DoResolve): likewise.
3288 (PropertyExpr.InstanceResolve): likewise.
3289 (EventExpr.InstanceResolve): likewise.
3291 2006-06-04 Marek Safar <marek.safar@seznam.cz>
3293 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
3294 attribute applicable tests for attribute argument.
3296 2006-06-02 Raja R Harinath <rharinath@novell.com>
3299 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
3300 (Binary.OverloadResolve_PredefinedIntegral): New.
3301 (Binary.OverloadResolve_PredefinedFloating): New.
3302 (Binary.OverloadResolve_PredefinedString): New.
3303 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
3304 Follow the standard more closely, and treat numeric promotions in
3305 terms of overload resolution.
3306 (Binary.CheckShiftArguments): Simplify.
3308 2006-06-01 Raja R Harinath <rharinath@novell.com>
3310 * flowanalysis.cs (MyBitVector): Simplify representation.
3311 (MyBitVector.Clone): Avoid allocating BitArray.
3312 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
3313 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
3314 (*): Update. Change all references to MyBitVector.And and
3315 MyBitVector.Or to &= and |=.
3317 2006-05-29 Raja R Harinath <rharinath@novell.com>
3320 * cs-parser.jay (formal_parameter_list): Extend the pattern below
3321 to param arguments too.
3323 2006-05-26 Miguel de Icaza <miguel@novell.com>
3325 * cs-parser.jay: Catch another parsing form for arglist being
3326 followed by other arguments. Fixes #78313.
3328 2006-05-24 Raja R Harinath <rharinath@novell.com>
3330 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
3331 checking of out parameters to ...
3332 (FlowBranchingToplevel.Merge): ... here.
3333 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
3334 set, propagate the origin upward, and only complain if there was
3336 (FlowBranchingException.AddContinueOrigin): Likewise.
3337 (FlowBranchingException.AddReturnOrigin): Likewise.
3338 (FlowBranchingException.AddGotoOrigin): Likewise.
3340 2006-05-23 Raja R Harinath <rharinath@novell.com>
3342 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
3343 unreachable, skip it.
3344 (FlowBranchingException.Merge): Always propagate jumps, even if
3345 the finally block renders subsequent code unreachable.
3347 2006-05-18 Raja R Harinath <rharinath@novell.com>
3350 * statement.cs (Goto.Resolve): Move responsibility for resolving
3351 'goto' to FlowBranching.AddGotoOrigin.
3352 (Goto.SetResolvedTarget): New. Callback to set the
3353 LabeledStatement that's the target of the goto.
3354 (Goto.DoEmit): Use Leave instead of Br when crossing an
3355 unwind-protect boundary.
3356 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
3357 LookupLabel and adjust to new semantics.
3358 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
3359 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
3360 Goto.SetResolvedTarget to update target.
3361 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
3362 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
3363 AddBreakOrigin & co. Delay propagation until ...
3364 (FlowBranchingException.Merge): ... this.
3366 * statement.cs (Block.Resolve): Always depend on flow-branching to
3367 determine unreachability. Kill workaround that originally emitted
3368 only one statement after an "unreachable" label (see infloop in
3371 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
3372 This is still "wrong", but anything better would probably need a
3373 multi-pass algorithm.
3374 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
3375 usage vector. Force current usage vector to be reachable, to
3376 optimistically signify backward jumps.
3377 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
3379 (FlowBranchingLabeled.Merge): New. If no backward jump was
3380 detected, return the original salted-away usage vector instead,
3381 updated with appropriate changes. Print unreachable warning if
3383 * statement.cs (Block.Resolve): Don't print unreachable warning on
3384 a labeled statement.
3386 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
3388 * driver.cs: Pass filename without path to AssemblyBuilder's
3389 AddResourceFile. Fixes bug #78407.
3391 2006-05-17 Raja R Harinath <rharinath@novell.com>
3393 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
3394 * flowanalysis.cs (FlowBranchingLabeled): ... here.
3395 (FlowBranching.MergeChild): Overwrite
3396 reachability information from Labeled branchings too.
3398 2006-05-16 Raja R Harinath <rharinath@novell.com>
3400 * statement.cs (Goto.Resolve): Merge jump origins here ...
3401 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
3403 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
3404 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
3405 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
3406 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
3408 * statement.cs (Goto.Resolve): ... not here.
3409 (Goto.Emit): Remove CS1632 check.
3411 2006-05-14 Marek Safar <marek.safar@seznam.cz>
3413 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
3416 2006-05-11 Raja R Harinath <rharinath@novell.com>
3418 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
3419 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
3420 (FlowBranchingException.Label): Likewise.
3422 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
3424 (MyBitVector.Or): Use it to avoid losing information (Count).
3425 (FlowBranching.MergeOrigins): Likewise.
3427 * flowanalysis.cs (UsageVector.IsDirty): Remove.
3428 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
3429 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
3430 (UsageVector.ToString): Simplify.
3431 (UsageVector.MergeSiblings): Move here from ...
3432 (FlowBranching.Merge): ... here.
3433 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
3436 2006-05-10 Raja R Harinath <rharinath@novell.com>
3438 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
3439 null bitvector is treated as all-true.
3441 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
3442 (MyBitVector): Rationalize invariants. 'vector != null' implies
3443 that we have our own copy of the bitvector. Otherwise,
3444 'InheritsFrom == null' implies all inherited bits are true.
3446 2006-05-09 Marek Safar <marek.safar@seznam.cz>
3448 * statement.cs (LocalInfo): Add IsConstant.
3449 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
3450 local variable for constants.
3452 2006-05-09 Raja R Harinath <rharinath@novell.com>
3454 * flowanalysis.cs (MyBitVector.Empty): New.
3455 (MyBitVector): Don't allow InheritedFrom to be null.
3456 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
3457 (UsageVector, FlowBranching): Update to changes.
3459 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
3460 recursion. The 'Parent == null' condition isn't sufficient for
3462 (FlowBranching.AddBreakOrigin): Likewise.
3463 (FlowBranching.AddContinueOrigin): Likewise.
3464 (FlowBranching.AddReturnOrigin): Likewise.
3465 (FlowBranching.StealFinallyClauses): Likewise.
3466 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
3467 (FlowBranching.CheckOutParameters): Likewise.
3468 (FlowBranchingToplevel): Terminate all the above recursions here.
3469 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
3470 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
3472 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
3474 (FlowBranchingToplevel): New. Empty for now.
3475 (FlowBranching.MergeTopBlock): Update.
3476 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
3477 branching for the anonymous delegate.
3478 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
3480 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
3481 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
3482 information at the start of the merge. Reorganize.
3484 2006-05-07 Marek Safar <marek.safar@seznam.cz>
3486 * class.cs (MethodData.Define): Method cannot implement interface accessor.
3488 2006-05-07 Marek Safar <marek.safar@seznam.cz>
3490 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
3491 to newly introduced ctor.
3493 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
3494 message to one place.
3495 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
3498 2006-05-07 Marek Safar <marek.safar@seznam.cz>
3500 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
3502 * ecore.cs (Expression.ResolveAsConstant): Updated.
3504 * statement.cs (ResolveMeta): Updated.
3506 2006-05-06 Marek Safar <marek.safar@seznam.cz>
3508 * cs-parser.jay: __arglist cannot be used in initializer.
3510 2006-05-06 Marek Safar <marek.safar@seznam.cz>
3513 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
3516 2006-05-05 Raja R Harinath <rharinath@novell.com>
3518 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
3519 (LabeledStatement): Add 'name' parameter.
3520 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
3521 (Block.AddLabel): Update to changes.
3522 * cs-parser.jay (labeled_statement): Likewise.
3524 * flowanalysis.cs (BranchingType.Labeled): New.
3525 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
3526 (FlowBranchingLabeled): New. Does nothing for now, but will
3527 eventually handle 'goto' flows.
3528 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
3529 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
3530 that's terminated ...
3531 (Block.Resolve): ... here.
3533 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
3534 (UsageVector.MergeFinallyOrigins): Likewise.
3535 (FlowBranching.InTryOrCatch): Likewise.
3536 (FlowBranching.AddFinallyVector): Likewise.
3537 (FlowBranchingException): Update to changes.
3540 * statement.cs (Return.Resolve): Move error checking to ...
3541 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
3542 (FlowBranchingException): Handle return origins like break and
3544 (FlowBranching.UsageVector.CheckOutParameters): Remove.
3546 2006-05-04 Marek Safar <marek.safar@seznam.cz>
3549 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
3552 2006-05-04 Marek Safar <marek.safar@seznam.cz>
3555 * class.cs (MethodData.Define): Do public accessor check only when method
3556 implements an interface.
3558 2006-05-04 Raja R Harinath <rharinath@novell.com>
3560 Remove special handling of 'break'
3561 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
3562 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
3563 (UsageVector.Break): Remove.
3564 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
3566 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
3568 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
3569 UsageVector.Breaks (). Don't set NeedsReturnLabel.
3571 2006-05-03 Marek Safar <marek.safar@seznam.cz>
3574 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
3575 be the interface member.
3577 2006-05-03 Marek Safar <marek.safar@seznam.cz>
3580 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
3581 for emitting small (int) values.
3583 2006-05-03 Raja R Harinath <rharinath@novell.com>
3586 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
3587 control-flow passes through the 'finally' after merging-in all the
3588 control-flows from 'try' and the 'catch' clauses.
3590 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
3591 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
3592 always true at the only non-recursive entry point.
3593 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
3594 FlowBranchingBreakable.
3595 (FlowBranchingLoop): Remove.
3596 * statement.cs (Return.DoResolve): Update to changes.
3599 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
3600 (FlowBranching.CreateBranching): Handle it: create a
3601 FlowBranchingContinuable.
3602 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
3603 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
3604 except that it handles the 'continue' command.
3605 (FlowBranching.UsageVector.MergeOrigins): Rename from
3607 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
3608 except that it overrides AddContinueOrigin.
3609 (FlowBranchingException): Override AddContinueOrigin, similar to
3611 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
3612 Create a new branching around the embedded statement.
3613 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
3614 control flow after the embedded statement.
3615 (Continue.Resolve): Move all error checking to AddContinueOrigin.
3617 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
3618 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
3619 FlowBranchingBreakable.
3620 (FlowBranchingSwitch): Remove.
3623 * statement.cs (Break.Resolve): Simplify. Move responsibility for
3624 error reporting to ...
3625 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
3626 Rename from 'AddBreakVector'. Add new location argument. Return
3627 a bool indicating whether the 'break' crosses an unwind-protect.
3628 (FlowBranchingException.AddBreakOrigin): Add.
3629 (FlowBranchingException.Merge): Propagate 'break's to surrounding
3630 flowbranching after updating with the effects of the 'finally'
3632 (FlowBranchingBreakable): New common base class for
3633 FlowBranchingLoop and FlowBranchingSwitch.
3635 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
3637 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
3639 2006-05-02 Raja R Harinath <rharinath@novell.com>
3641 * statement.cs (Do.Resolve): If the loop is infinite, set the
3643 (While.Resolve, For.Resolve): Set a barrier after the embedded
3644 statement. There's no direct control flow that goes from the end
3645 of the embedded statement to the end of the loop.
3646 * flowanalysis.cs (FlowBranching.Infinite): Remove.
3647 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
3648 above ensure that the reachability is correctly computed.
3650 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
3651 (UsageVector.MergeBreakOrigins): If the current path is
3652 unreachable, treat it as if all parameters/locals are initialized.
3653 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
3654 infinite loops before merging-in break origins.
3656 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
3657 (Reachability.Reachable): Split part into ...
3658 (Reachability.Unreachable): ... this. Simplify.
3659 (Reachability.IsUnreachable): Use 'Unreachable' instead.
3661 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
3662 (Reachability.SetThrowsSometimes): Likewise.
3663 (FlowBranchingBlock.MergeTopBlock): Don't compare against
3664 TriState.Always, use corresponding property.
3665 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
3666 (Block.Resolve): Likewise. Remove some redundant checks.
3668 2006-05-02 Raja R Harinath <harinath@gmail.com>
3670 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
3671 (Reachability.Meet): Don't bother checking AlwaysThrows --
3672 barrier is always set.
3673 (FlowBranchingBlock.Merge): Likewise.
3675 2006-05-01 Raja R Harinath <harinath@gmail.com>
3677 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
3678 checks for unreachable.
3680 2006-05-01 Marek Safar <marek.safar@seznam.cz>
3683 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
3685 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
3686 whether field is really assigned.
3688 2006-04-30 Raja R Harinath <harinath@gmail.com>
3690 * flowanalysis.cs (Reachability): Make 4-argument constructor
3692 (Reachability.Meet): Rename from 'And'. Remove static variant.
3693 (Reachability.Always): Rename from the highly misleading
3694 'Reachability.Never'.
3695 (FlowBranching.Merge): Update to changes. Mark an impossible
3696 situation with a 'throw'.
3697 (*): Update to changes.
3699 2006-04-29 Raja R Harinath <harinath@gmail.com>
3701 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
3703 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
3704 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
3705 (*): Update to changes.
3706 * statement.cs: Update to changes.
3708 2006-04-28 Marek Safar <marek.safar@seznam.cz>
3711 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
3713 2006-04-28 Raja R Harinath <harinath@gmail.com>
3715 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
3718 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
3719 argument to two arguments: an usage-vector and a bool. Move call
3720 to FlowBranching.Merge () ...
3721 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
3723 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
3724 handling of loop and switch reachability to ...
3725 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
3727 2006-04-27 Raja R Harinath <harinath@gmail.com>
3729 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
3730 handling to FlowBranchingLoop.InLoop.
3731 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
3733 2006-04-26 Marek Safar <marek.safar@seznam.cz>
3736 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
3737 anonymous method is allowed from AnonymousContainer here.
3739 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
3741 2006-04-24 Raja R Harinath <rharinath@novell.com>
3744 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
3746 2006-04-23 Marek Safar <marek.safar@seznam.cz>
3749 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
3750 (DoubleConstant.Reduce): Ditto.
3752 2006-04-23 Raja R Harinath <rharinath@novell.com>
3754 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
3755 Remove 'lvalue_right_side' argument. Move parts to ...
3756 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
3757 (LocalVariable.DoResolveLValue): ... these.
3759 2006-04-21 Raja R Harinath <rharinath@novell.com>
3762 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
3763 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
3764 (LocalVariableReference.DoResolveBase): Use it to implement new
3766 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
3767 (Argument.Resolve): Simplify. Move CS1510 check ...
3768 * ecore.cs (Expression.ResolveLValue): ... here.
3769 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
3770 (PropertyExpr.DoResolveLValue): Likewise.
3771 (FieldExpr.Report_AssignToReadonly): Likewise.
3772 (FieldExpr.DoResolve): Add 'out_access' argument. Use
3773 LValueMemberAccess or LValueMemberOutAccess on instance depending
3775 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
3776 DoResolve as appropriate.
3778 2006-04-20 Raja R Harinath <rharinath@novell.com>
3781 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
3782 implicit conversions on 'out' and 'ref' arguments.
3784 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
3785 improve clarity. Remove dead code.
3788 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
3789 (Catch.Resolve): Resolve VarBlock if it exists.
3791 2006-04-19 Miguel de Icaza <miguel@novell.com>
3793 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
3794 twice, this was some residual code, the enumerator was emitted
3795 properly in the two branche of if later.
3797 2006-04-19 Raja R Harinath <rharinath@novell.com>
3799 * expression.cs (Cast.ResolveLValue): Remove. The result of a
3800 cast is never an lvalue.
3801 (Cast.DoResolve, Cast.ResolveRest): Combine.
3802 (Argument.Emit): Simplify slightly. Move 'Expr is
3803 IMemoryLocation' check ...
3804 (Argument.Resolve): ... here.
3805 (Argument.Error_LValueRequired): Remove. Inline into only user.
3807 Simplifications. Fix cs0191-2.cs
3808 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
3809 CS1649 and CS1651 to ...
3810 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
3811 the actual selection of the error code and message to a lookup
3812 table. Add a dummy return value to simplify callsites.
3813 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
3814 readonly fields of other instances of the same type. Move CS0197
3816 * expression.cs (Argument.Resolve): ... here. Simplify code.
3817 Ensure that ec.InRefOutArgumentResolving is only set during LValue
3818 resolution of an out or ref argument. The code simplification
3819 above uses this invariant.
3821 2006-04-18 Raja R Harinath <rharinath@novell.com>
3823 Possibly fix #77752. Fix cs1690-[4-7].cs.
3824 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
3825 CheckMarshallByRefAccess. Drop parameter.
3826 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
3828 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
3830 * report.cs (AllWarnings): Add CS1690.
3831 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
3833 (LocalVariableReference.DoResolveBase): Update.
3835 2006-04-09 Marek Safar <marek.safar@seznam.cz>
3837 * class.cs (MethodOrOperator): Moved common parts from method class.
3838 detect obsolete attributes.
3839 (Method.Define): Simplified as it reuses code from base.
3840 (Constructor.ValidAttributeTargets): Fixed issue found during
3842 (Destructor.ValidAttributeTargets): Fixed issue found during
3844 (Operator): Finished refactoring set off by #78020. Operator class is now
3845 ordinary method class.
3847 * anonymous.cs: Updated.
3849 * decl.cs (DeclSpace): Add IsGeneric
3851 2006-04-09 Marek Safar <marek.safar@seznam.cz>
3853 * class.cs (Constructor.Emit): Don't emit the attributes twice.
3855 2006-04-09 Marek Safar <marek.safar@seznam.cz>
3857 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
3858 detect obsolete attributes.
3859 (Method.CreateEmitContext): Moved to MethodOrOperator.
3861 2006-04-09 Marek Safar <marek.safar@seznam.cz>
3864 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
3865 customized exception to make crash detection easier.
3866 (MethodOrOperator): Started to work on new base class for methods and
3868 (Method): Derives from MethodOrOperator.
3869 (Constructor.Emit): Emits its own attributes.
3870 (AbstractPropertyEventMethod.Emit): Ditto.
3871 (Operator): Derives from MethodOrOperator, will refactor fully in extra
3873 (Operator.Emit): It's temporary more tricky than should be.
3875 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
3877 * report.cs (InternalErrorException): Add ctor with inner exception.
3879 2006-04-08 Marek Safar <marek.safar@seznam.cz>
3882 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
3885 2006-04-07 Marek Safar <marek.safar@seznam.cz>
3888 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
3891 2006-04-06 Marek Safar <marek.safar@seznam.cz>
3893 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
3894 attribute is present and Guid not.
3895 (Interface.ApplyAttributeBuilder): Ditto.
3897 * attribute.cs: Add error message.
3899 2006-04-06 Marek Safar <marek.safar@seznam.cz>
3903 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
3904 sources (it's composite) so hold them in extra array as they are used in
3905 Emit phase only. It worked in the previous versions by mistake.
3906 (Attribute.Emit): Emit attribute for more owners when exist.
3908 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
3909 it has now different behaviour.
3911 2006-04-04 Marek Safar <marek.safar@seznam.cz>
3913 * constant.cs (Constant.IsDefaultInitializer): New method.
3915 * class.cs: Updated.
3917 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
3918 re-initialize default values. It saves KBs almost for every assembly.
3919 Thanks Zoltan for the idea.
3920 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
3921 (ArrayCreation.DoResolve): Resolve only once.
3922 (ArrayCreation.Emit): Emit static initializer only when it is faster.
3923 (ArrayCreation.GetAttributableValue): Cope with optimized values.
3925 2006-04-03 Zoltan Varga <vargaz@gmail.com>
3927 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
3930 2006-04-01 Marek Safar <marek.safar@seznam.cz>
3932 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
3933 in an embedded statement too.
3935 2006-04-01 Raja R Harinath <rharinath@novell.com>
3938 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
3940 2006-04-01 Marek Safar <marek.safar@seznam.cz>
3944 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
3947 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
3949 2006-03-31 Marek Safar <marek.safar@seznam.cz>
3951 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
3954 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
3955 LocalTemporary change.
3957 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
3959 (ClassOrStruct.DefineFieldInitializers): Implemented static field
3960 initializers optimization.
3961 (ClassOrStruct.TypeAttr): Moved from modifiers.
3962 (Constructor.CheckBase): Don't crash when static ctor has parameters.
3963 (FieldBase.ResolveInitializer): Resolves initializer.
3964 (FieldBase.HasDefaultInitializer): New property.
3966 * cs-parser.jay: Removed message.
3968 * expression.cs (CompilerGeneratedThis): New specialization.
3970 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
3972 2006-03-28 Marek Safar <marek.safar@seznam.cz>
3974 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
3976 2006-03-27 Marek Safar <marek.safar@seznam.cz>
3978 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
3979 be now EnumConstants only.
3981 2006-03-27 Marek Safar <marek.safar@seznam.cz>
3983 * attribute.cs, driver.cs: Reset more caches.
3985 2006-03-26 Marek Safar <marek.safar@seznam.cz>
3987 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
3989 2006-03-26 Marek Safar <marek.safar@seznam.cz>
3991 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
3992 for easier reuse. Updated all overrides.
3993 (IntegralConstant): New base class for all integral constants.
3994 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
3995 of the constant range, report custom error.
3996 (UIntConstant.Reduce): Fixed uint conversion.
3998 * ecore.cs, literal.cs: Reduce updates.
4000 2006-03-26 Marek Safar <marek.safar@seznam.cz>
4004 * class.cs (Constructor.Define): Removed extra if for default ctors.
4005 A patch from Atsushi Enomoto.
4007 2006-03-26 Marek Safar <marek.safar@seznam.cz>
4009 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
4010 GetAttributableValue.
4012 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
4015 * convert.cs (ImplicitConversionRequired): Error message moved to
4018 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
4019 automatic implicit conversion of an output value.
4020 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
4022 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
4024 (TypeOf.GetAttributableValue): Add extra handling for object type.
4026 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
4027 special error message.
4029 2006-03-25 Marek Safar <marek.safar@seznam.cz>
4031 * class.cs (Constructor.Emit): Don't crash when struct ctor is
4033 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
4034 compatible with MS runtime.
4036 2006-03-23 Marek Safar <marek.safar@seznam.cz>
4038 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
4039 attribute arguments here.
4041 * class.cs (Indexer.Define): The check was moved to attribute class.
4043 2006-03-22 Marek Safar <marek.safar@seznam.cz>
4045 * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
4046 expression.cs, typemanager.cs: Minor changes from gmcs to make merging
4049 2006-03-22 Raja R Harinath <rharinath@novell.com>
4051 Support ParameterDefaultValueAttribute in gmcs. Also applied to
4052 mcs to keep code differences small.
4053 * attribute.cs (Attribute.GetParameterDefaultValue): New.
4054 * typemanager.cs (parameter_default_value_attribute_type): New.
4055 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
4058 2006-03-21 Marek Safar <marek.safar@seznam.cz>
4060 * expression.cs (StringConcat.Append): Reverted back to no warning state.
4062 2006-03-21 Marek Safar <marek.safar@seznam.cz>
4064 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
4066 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
4069 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
4071 * doc-bootstrap.cs : fix build.
4073 2006-03-20 Marek Safar <marek.safar@seznam.cz>
4075 * expression.cs (StringConcat.Append): Issue a warning when empty string
4078 2006-03-20 Marek Safar <marek.safar@seznam.cz>
4080 * assign.cs (CompoundAssign.ResolveSource): Removed.
4082 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
4085 * class.cs (TypeContainer.FindMethods): Removed.
4086 (TypeContainer.CheckMemberUsage): Made static.
4088 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
4090 * constant.cs (CheckRange): Removed unused type argument.
4091 (CheckUnsigned): Removed unused type argument.
4093 * cs-parser.jay: Updated after MemberAccess clean up.
4094 Uses Length for empty string test.
4096 * cs-tokenizer.cs: Uses Length for empty string test.
4097 (IsCastToken): Made static.
4098 (is_hex): Made static.
4099 (real_type_suffix): Made static.
4101 * decl.cs (SetupCache): Made static.
4102 (OnGenerateDocComment): Removed unused ds argument.
4104 * delegate.cs (VerifyDelegate): Removed unused argument.
4106 * doc.cs: Uses Length for empty string test.
4108 * driver.cs: Uses Length for empty string test.
4110 * enum.cs (IsValidEnumType): Made static
4112 * expression.cs (EnumLiftUp): Removed unused argument.
4113 (ResolveMethodGroup): Ditto.
4114 (BetterConversion): Ditto.
4115 (GetVarargsTypes): Ditto.
4116 (UpdateIndices): Ditto.
4117 (ValidateInitializers): Ditto.
4118 (MemberAccess.ctor): Ditto.
4119 (GetIndexersForType): Ditto.
4121 * flowanalysis.cs: (MergeFinally): Removed unused argument.
4123 * iterators.cs: Updated after MemberAccess clean up.
4125 * location.cs: Uses Length for empty string test.
4127 * namespace.cs: Uses Length for empty string test.
4129 * report.cs (CheckWarningCode): Made static.
4131 * statement.cs (LabeledStatement): Removed unused argument.
4133 * typemanager.cs (FilterNone): Removed.
4135 2006-03-18 Marek Safar <marek.safar@seznam.cz>
4137 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
4140 * class.cs: Updated.
4142 2006-03-18 Marek Safar <marek.safar@seznam.cz>
4144 * cs-parser.jay.cs: __arglist is not allowed for delegates.
4146 2006-03-18 Marek Safar <marek.safar@seznam.cz>
4150 * expression.cs (VerifyArgumentsCompat): Reverted to double error
4151 reporting, it's more tricky than I thought.
4153 2006-03-18 Marek Safar <marek.safar@seznam.cz>
4157 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
4159 (AnonymousMethod.ImplicitStandardConversionExists): New method.
4160 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
4161 Add more error reporting; Fixed issue with params.
4163 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
4165 * cs-parser.jay: AnonymousMethod requires host container.
4167 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
4169 2006-03-18 Raja R Harinath <harinath@gmail.com>
4171 * class.cs: Change 'TypeContainer ds' constructor argument to
4172 'DeclSpace parent'. Some classes were missed below due to
4173 different naming convention.
4175 * class.cs (MemberCore.Parent): Delete. This makes the
4176 ParentContainer changes below enforceable by the compiler.
4178 Treat pointers to enclosing declaration space as 'DeclSpace', not
4180 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
4181 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
4183 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
4185 (Block.AddThisVariable): Likewise.
4186 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
4187 (AbstractPropertyEventMethod.Emit): Likewise.
4188 (AbstractPropertyEventMethod.EmitMethod): Likewise.
4189 (GetMethod.Define, SetMethod.Define): Likewise.
4190 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
4191 (DelegateMethod.EmitMethod): Likewise.
4193 Fix regression test-partial-13.cs.
4194 Rationalize use of PartialContainer. Ensure that the partial
4195 class semantics can be tied to type-correctness, i.e., any
4196 violation will cause a compile error.
4197 * class.cs, const.cs: Access all fields that belong to class
4198 TypeContainer via ParentContainer. Arguments of EmitContexts and
4199 Resolve()-like functions still use 'Parent'.
4201 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
4202 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
4203 (PropertyMethod.CheckModifiers): Remove unused argument.
4204 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
4207 2006-03-17 Raja R Harinath <harinath@gmail.com>
4209 Make semantics of PartialContainer simpler.
4210 * decl.cs (DeclSpace.IsPartial): Remove.
4211 * class.cs (TypeContainer.IsPartial): Likewise.
4212 (TypeContainer..ctor): Set PartialContainer to point to self.
4213 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
4214 (TypeContainer.FindNestedType): Likewise.
4215 (MemberCore.ParentContainer): Simplify. Remove deprecation.
4217 2006-03-17 Marek Safar <marek.safar@seznam.cz>
4219 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
4221 2006-03-15 Marek Safar <marek.safar@seznam.cz>
4223 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
4226 2006-03-15 Marek Safar <marek.safar@seznam.cz>
4228 * class.cs (Operator.Define): An error for base conversion was not
4231 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
4233 * iterator.cs : yield break is allowed in try statement which has
4234 catch clauses. Fixed bug #77767.
4236 2006-03-13 Marek Safar <marek.safar@seznam.cz>
4238 A fix for #77593, #77574.
4240 * class.cs (MethodCore.CheckBase): Another if for operator.
4242 2006-03-09 Marek Safar <marek.safar@seznam.cz>
4244 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
4247 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
4248 (DelegateCreation.ImplicitStandardConversionExists): New method for just
4251 *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
4254 * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
4255 Updated after another emitcontext usage was clean up. It should help us to
4256 synchronize with gmcs easier.
4258 2006-03-04 Marek Safar <marek.safar@seznam.cz>
4262 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
4263 (Event.Define): ditto
4264 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
4266 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
4267 Removed redundant code and set NewSlot for Invoke method too.
4269 * parameter.cs (Parameters.ctor): Add custom, type ctor.
4270 (Parameters.MergeGenerated): New method. Use this method when you merge
4271 compiler generated argument with user arguments.
4273 2006-03-03 Marek Safar <marek.safar@seznam.cz>
4275 * attribute.cs (ResolveAsTypeTerminal): Removed.
4277 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
4278 specialization for predefined types; 30% speed up.
4279 Finally placed obsolete check to right place.
4280 (Expression.ResolveType): Removed.
4282 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
4283 Updated after ResolveType was removed.
4285 * expression.cs (Cast.ctor): Check void cast.
4286 (Binary.ResolveAsTypeTerminal): Is never type.
4287 (Conditional.ResolveAsTypeTerminal): Is never type.
4289 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
4291 2006-03-01 Raja R Harinath <rharinath@novell.com>
4294 * expression.cs (ParameterReference.DoResolveBase): Change return
4296 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
4300 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
4303 * typemanager.cs (GetFullNameSignature): Don't nullref on
4304 protected accessors.
4306 2006-02-27 Marek Safar <marek.safar@seznam.cz>
4308 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
4309 these two separated members to simplify the code.
4310 (Attribute.Resolve): Refactored to use new fields and methods.
4311 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
4312 implemented obsolete attribute checking.
4313 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
4314 implemented obsolete checking again. It look line never ending quest ;-)
4315 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
4317 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
4319 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
4321 *class.cs (Property.Define): Add RegisterProperty call.
4323 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
4324 argument groups (only 2).
4326 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
4327 encoding expression to arguments.
4328 (Expression.ExprClassToResolveFlags): Just turned to property.
4330 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
4331 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
4332 optimized as well as implemented support for zero-length attributes.
4334 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
4335 Add caching of PropertyInfo's.
4337 2006-02-25 Marek Safar <marek.safar@seznam.cz>
4339 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
4340 error multiple times.
4342 2006-02-25 Marek Safar <marek.safar@seznam.cz>
4344 New partial class implementation.
4345 A fix for #77027, #77029, #77403
4347 * attribute.cs (Attributable): Made attributes protected.
4349 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
4350 the replacements of ClassPart and PartialContainer.
4351 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
4352 (TypeContainer.AddInterface): Ditto.
4353 (TypeContainer.AddPartial): The main method for partial classes. It checks
4354 for errors and merges ModFlags and attributes. At the end class is added to
4356 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
4358 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
4359 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
4360 from the rest of partial classes.
4361 (TypeContainer.GetClassBases): Simplified.
4362 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
4364 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
4365 (TypeContainer.HasExplicitLayout): Uses Flags now.
4366 (PartialContainer): Removed.
4367 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
4368 (StaticClass): Was merged with Class.
4369 (Class.GetClassBases): class and static class bases are verified here.
4370 (Class.TypeAttr): Added static attributes when class is static.
4371 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
4372 (MemberBase): In some cases we need to call parent container for partial
4373 class. It should be eliminated but it's not easy now.
4375 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
4377 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
4378 partial classed to accumulate class comments.
4379 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
4381 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
4383 * driver.cs (MainDriver): Tree.GetDecl was removed.
4385 * modifiers.cs (Modifiers): Add partial modifier.
4387 * tree.cs (Tree.decl): Removed.
4388 (RootTypes): Started to use this class more often for root types
4391 2006-02-22 Marek Safar <marek.safar@seznam.cz>
4395 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
4396 external interface does not have an attribute.
4398 2006-02-22 Marek Safar <marek.safar@seznam.cz>
4400 Another prerequisites for new partial classs implementation.
4402 * attribute.cs (Attribute.Equal): Implemented.
4403 (Attribute.Emit): Changed as attributes can be applied more than twice.
4404 (Attributes.Emit): Check for duplicate attributes here.
4406 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
4407 as a parameter, clean-up.
4409 2006-02-11 Marek Safar <marek.safar@seznam.cz>
4413 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
4414 contains obsolete attribute check which can in some cases look for base
4415 type of current class which is not initialized yet.
4416 (TypeContainer.BaseType): Replacement of ptype.
4418 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
4420 2006-02-11 Marek Safar <marek.safar@seznam.cz>
4422 First of prerequisites for new partial classs implemention.
4424 * attribute.cs (Attributable): Extended by ResolveContext;
4425 Attributes finally have correct context for resolving in all cases.
4426 (AttachTo): Attribute owner is assigned here.
4428 * codegen.cs (IResolveContext): Introduce new interface to hold
4429 all information needed in resolving phase.
4430 (EmitContext): Implements IResolveContext; more clean-up needed here.
4432 * decl.cs (MemberCore): Implemented IResolveContext.
4434 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
4435 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
4436 parameter.cs, statement.cs, tree.cs, typemanager.cs:
4437 Refactored to use new IResolveContext instead of EmitContext; cleanup
4439 2006-02-06 Miguel de Icaza <miguel@novell.com>
4441 * codegen.cs (EmitScopeInitFromBlock): check here the
4442 capture_context, there is no need to make two calls to the
4445 * anonymous.cs: Add some debugging messages that might help me
4446 track other instances of this problem in the future (the
4447 regression of test 467).
4449 * cs-parser.jay: track the variable block, as we need to initalize
4450 any captured variables declared in this block for the "catch"
4451 portion of the "Try" statement.
4453 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
4454 scope initialization for captured variables.
4456 Also, move the emit for the variables after the block location has
4459 2006-02-06 Marek Safar <marek.safar@seznam.cz>
4461 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
4463 2006-02-02 Miguel de Icaza <miguel@novell.com>
4465 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
4466 commit yesterday, the initialization for the roots is necessary.
4467 What is not necessary is the scope activation.
4469 2006-02-02 Raja R Harinath <rharinath@novell.com>
4471 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
4472 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
4474 (Argument.Resolve): Remove CS0206 checks.
4476 2006-02-01 Miguel de Icaza <miguel@novell.com>
4478 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
4479 scopes for all the roots, the scopes will now be emitted when the
4480 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
4482 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
4483 code. This reduces a lot of existing cruft.
4485 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
4486 that the ScopeInfo is generated as we enter the scope, not at the
4487 time of use, which is what we used to do before.
4489 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
4490 every time a Block is about to be emitted if we have a
4493 2006-02-01 Raja R Harinath <rharinath@novell.com>
4495 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
4497 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
4499 * typemanager.cs (cons_param_array_attribute): Make private.
4500 (Reset): Set it to null.
4501 (InitCoreHelpers): Don't initialize it.
4502 (ConsParamArrayAttribute): New. Initialize it as needed.
4503 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
4505 2006-01-31 Miguel de Icaza <miguel@novell.com>
4507 * expression.cs: There might be errors reported during the
4508 selection of applicable methods. If there are errors, do not
4509 continue execution as it will lead the compiler to crash.
4511 2006-01-30 Miguel de Icaza <miguel@novell.com>
4513 * expression.cs: Member access is not allowed on anonymous
4514 methods. Fixes #77402.
4516 2006-01-30 Raja R Harinath <rharinath@novell.com>
4519 * cs-parser.jay (VariableDeclaration): Don't set
4520 current_array_type to null.
4521 (field_declaration, event_declaration, declaration_statement):
4522 Set it to null here.
4524 2006-01-28 Raja R Harinath <harinath@gmail.com>
4526 * typemanager.cs (GenericParameterPosition): New.
4529 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
4531 * doc.cs : To process "include" elements, first we should create
4532 another list than XmlNodeList, because it could result in node
4533 removal, which could result in that the XmlNodeList gives up
4536 (Also made code identical to gmcs again.)
4538 2006-01-25 Miguel de Icaza <miguel@novell.com>
4540 * ecore.cs: Introduce an error report that we were not catching
4541 before, if not silent, we must report the error. Gonzalo ran into
4544 2006-01-23 Miguel de Icaza <miguel@novell.com>
4546 A fix for bug: #76957
4548 * iterators.cs (MoveNextMethod.CreateMethodHost): call
4549 ComputeMethodHost before creating the method, this is a new
4552 * anonymous.cs (AnonymousContainer): Now we track all the scopes
4553 that this method references (RegisterScope). The actual scope
4554 where the method is hosted is computed with the ComputeMethodHost
4555 before we create the method.
4557 Moved the Deepest routine here.
4559 (AnonymousContainer.ComputeMethodHost): New routine used to
4560 compute the proper ScopeInfo that will host the anonymous method.
4562 (ScopeInfo): Deal with multiple roots. The problem was that we
4563 did not have a unique root where all ScopeInfos could be hanged
4564 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
4567 Remove AdjustMethodScope which is now computed at the end. Remove
4568 LinkScope which did a partial link, instead link all ScopeInfos
4569 before code generation from the new "LinkScopes" routine.
4571 Simplify all the Add* routines as they no longer need to maintain
4572 the tree, they just need to record that they are using variables
4575 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
4576 routines to produce the forest of ScopeInfo trees.
4578 * class.cs (TypeContainer.AppendMethod): This is just like
4579 AddMethod, but ensures that an interface implementation method
4580 (IEnumerable.XXX) is not inserted at the beginning of the queue of
4581 methods, but at the end.
4583 We use this functionality to ensure that the generated MoveNext
4584 method in the iterator class is resolved/emitted before the
4585 enumerator methods created.
4587 This is required because the MoveNext method computes the right
4588 ScopeInfo for the method. And the other methods will eventually
4589 need to resolve and fetch information computed from the anonymous
4592 2006-01-21 Raja R Harinath <harinath@gmail.com>
4593 Carlos Alberto Cortez <calberto.cortez@gmail.com>
4596 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
4598 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
4599 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
4601 2006-01-18 Raja R Harinath <rharinath@novell.com>
4603 Fix #76656, cs0231-2.cs.
4604 * cs-parser.jay (formal_parameter_list): Make error case catch
4606 (parenthesized_expression_0): Add CS1026 check.
4607 (invocation_expression): Remove unused { $$ = lexer.Location }.
4609 2006-01-17 Raja R Harinath <rharinath@novell.com>
4612 * cs-parser.jay (statement_expression): Don't list out the
4613 individual statement-expressions. Convert syntax error into
4616 2006-01-16 Raja R Harinath <rharinath@novell.com>
4619 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
4620 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
4621 CheckIntermediateModification.
4622 (FieldExpr.DoResolve): Add new two-argument version that
4623 allows us to resolve the InstanceExpression as an lvalue.
4624 The one-argument variant is now just a wrapper.
4625 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
4626 Resolve the lhs as an lvalue if the it has a value type.
4627 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
4628 from Assign.DoResolve.
4629 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
4630 resolved as an lvalue.
4631 (PropertyExpr.DoResolve): Update.
4632 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
4633 has a value type. Move CS1612 check here from
4634 CheckIntermediateModification.
4635 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
4636 * expression.cs (EmptyExpression.OutAccess): New. Used as the
4637 'right_side' of a ResolveLValue on an 'out' argument.
4638 (EmptyExpression.LValueMemberAccess): New. Used as the
4639 'right_side' of a propagated ResolveLValue on a value type.
4640 (LocalVariableReference.DoResolveBase): Recognize
4641 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
4643 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
4644 EmptyExpression.Null.
4646 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
4648 * typemanager.cs : added IsGenericParameter(). In mcs it always
4650 * doc.cs : for generic parameters, use GenericParameterPosition,
4653 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
4655 * expression.cs: Fix Console.WriteLine ((this = x).foo);
4657 2006-01-12 Miguel de Icaza <miguel@novell.com>
4659 This fixes the problem where we used ldfld instead of ldflda to
4660 load the "THIS" pointer on captured parameters, when THIS is a
4661 value type. See bug #77205.
4663 * iterators.cs (CapturedThisReference.Emit): Pass false to
4664 EmitThis (we do not need the address).
4666 * codegen.cs (EmitThis): it needs to know whether we need the
4667 address of `this' or not. This is used by value types.
4669 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
4670 every other call passes false.
4672 2006-01-12 Raja R Harinath <rharinath@novell.com>
4675 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
4677 * expression.cs (Invocation.OverloadResolve): Update.
4678 (Invocation.DoResolve): Avoid double resolution of invocation.
4680 2006-01-11 Raja R Harinath <rharinath@novell.com>
4683 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
4684 unary negation of floating point types as 0-expr; negation cannot
4685 overflow in floating point types.
4688 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
4689 on operands of 'void' type.
4692 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
4693 and ExclusiveOr for boolean constants too.
4695 2006-01-09 Raja R Harinath <rharinath@novell.com>
4698 * expression.cs (Invocation.OverloadResolve): Replace reflected
4699 override methods with their base virtual methods, rather than
4701 * typemanager.cs (TypeManager.GetOverride): New.
4703 2006-01-05 Jb Evain <jbevain@gmail.com>
4705 * class.cs (Property.Define, Indexer.Define): do not tag the
4706 properties as SpecialName | RTSpecialName.
4708 2006-01-04 Miguel de Icaza <miguel@novell.com>
4710 * class.cs (MethodCore.IsDuplicateImplementation): This method was
4711 doing a low-level comparission of parameter types. It was lacking
4712 a check for __argslist.
4714 2005-12-30 Miguel de Icaza <miguel@novell.com>
4716 * expression.cs (ParameterReference.DoResolveBase): Allow
4717 reference parameters if they are local to this block.
4719 This allows the ref and out parameters of a delegate to be used in
4720 an anonymous method, for example:
4722 delegate void set (out int x);
4724 set s = delegate (out int x){
4728 This is used by functionality introduced late in the C# language.
4730 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
4731 method that take ref and out parameters.
4733 Fixes #77119 which was a late change in the spec.
4735 2005-12-23 Miguel de Icaza <miguel@novell.com>
4737 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
4738 parent if its the same scope. Fixes #77060.
4740 2005-12-21 Miguel de Icaza <miguel@novell.com>
4742 * driver.cs: Report the case of no source files and no -out:
4745 2005-12-20 Raja R Harinath <rharinath@novell.com>
4748 * expression.cs (ComposedCast.GetSignatureForError): Define.
4750 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
4754 * namespace.cs (NamespaceEntry): Add extern_aliases as a
4755 ListDictionary, to contain the ExternAliasEntry entries (in
4756 addition to the NamespaceEntry.aliases hashtable). This field is
4757 shared between the original entry and its doppelganger (bodyless
4759 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
4760 extern_aliases field.
4761 (NamespaceEntry.Lookup): Move the IsImplicit check after the
4762 lookup in extern_aliases.
4764 2005-12-16 Raja R Harinath <rharinath@novell.com>
4767 * class.cs (TypeContainer.Mark_HasEquals): New.
4768 (TypeContainer.Mark_HasGetHashCode): New.
4769 (ClassPart): Override them.
4770 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
4773 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
4774 'parent' argument to the base constructor.
4776 Remove all mention of TypeContainer from decl.cs.
4777 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
4778 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
4779 (DeclSpace.DeclSpace): Likewise.
4780 (DeclSpace.DefineMembers): Remove unused argument.
4781 * cs-parser.jay (pop_current_class): Update to changes. Simplify
4782 debugging check -- we don't care if the debug code throws an
4783 InvalidCastException instead of an InternalErrorException.
4784 * class.cs (TypeContainer.DefineMembers): Update to changes.
4785 (TypeContainer.DoDefineMembers): Likewise.
4786 (TypeContainer.GetMethods): Likewise.
4787 (PropertyMember.Define): Likewise.
4788 (MemberBase.Parent): New property that forwards to
4789 MemberCore.Parent, but ensures that we get a TypeContainer.
4790 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
4791 (RootContext.PopulateTypes): Likewise. Remove special case code
4792 for !RootContext.StdLib: DefineMembers is idempotent.
4794 2005-12-14 Miguel de Icaza <miguel@novell.com>
4796 * convert.cs (ExplicitConversionCore): Check the return value from
4797 ExplicitConversionCore which can return null on failure. Fixes #76914
4799 2005-12-13 Marek Safar <marek.safar@seznam.cz>
4801 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
4803 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
4805 * doc.cs : The search for referenced namespace was insufficient to
4806 get global one as it used to do. Fixed bug #76965.
4808 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
4810 * doc.cs : check name in cref in the last phase that whether it is
4813 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
4815 * cs-tokenizer.cs : reverted the latest change: it somehow broke
4818 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
4820 * doc.cs : so it turned out that we cannot skip override check for
4821 interface members. Fixed bug #76954.
4823 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
4825 * cs-tokenizer.cs : fixed bug #75984:
4826 - #warning and #error should not be handled when the source line
4828 - #line is not checked strictly when the source line is disabled.
4829 - #define and #undef is on the other hand checked strictly at any
4832 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
4834 * cs-tokenizer.cs : missing Location (actually, filename) in one of
4837 2005-12-05 Marek Safar <marek.safar@seznam.cz>
4839 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
4841 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
4843 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
4844 (FieldBase.Initializer): Initializer is now optional.
4845 (EventField.Define): Only event field can have initializer.
4847 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
4849 * const.cs (Const): Reuse initializer.
4851 * cs-parser.jay: Updated after FieldBase changes.
4852 Added current_array_type to simplify array initializers.
4854 * ecore.cs (NullCast.IsDefaultValue): Implemented.
4856 * expression.cs, iterators.cs: Updated.
4858 * namespace.cs (NamespaceEntry): Made UsingFound private.
4860 2005-12-05 Marek Safar <marek.safar@seznam.cz>
4862 * parameterCollection.cs: Obsolete, removed.
4863 * parser.cs: Obsolete, removed.
4865 2005-12-05 Marek Safar <marek.safar@seznam.cz>
4868 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
4870 * enum.cs (Enum.Define): Set obsolete context here.
4872 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
4875 - FindDocumentedMember() now expects 1) paramList as null
4876 when "we don't have to check the number of parameters" and
4877 2) Type.EmptyTypes when "there is no arguments".
4878 - Introduced FoundMember struct to hold the exact type which was
4879 used to find the documented member (the above change broke
4880 test-xml-044; it might be better just to use DeclaringType than
4881 what MS does, like this change does, but it depends on usage.)
4883 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
4885 * doc.cs : documented member might be from DeclaringType for nested
4886 types. Fixed bug #76782.
4888 2005-12-03 Ben Maurer <bmaurer@ximian.com>
4890 * anonymous.cs: Have the param code handle leaving copies on the
4891 stack etc. Allows anonymous params to take part in the assignment
4892 code (++, +=, etc). Fixes bug #76550
4894 * expression.cs: Handle the prepare_for_load/leave_copy by passing
4895 it down to the anon code.
4897 * iterators.cs: Use dummy var here
4899 * codegen.cs: Handle new vars
4901 2005-12-01 Marek Safar <marek.safar@seznam.cz>
4904 * class.cs (MethodData.Define): Set proper Obsolete context.
4906 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
4908 (FieldExpr.DoResolve): Ditto.
4910 2005-12-01 Marek Safar <marek.safar@seznam.cz>
4913 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
4914 parent is not obsolete.
4916 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
4918 * doc.cs : (FindDocumentedMember) find parameterless members first
4919 and get CS0419 in the early stage. Fixed first case of bug #76727.
4921 2005-11-30 Marek Safar <marek.safar@seznam.cz>
4924 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
4925 no error was reported.
4927 *expression.cs (Binary.DoResolve): left can be null.
4929 2005-11-22 Marek Safar <marek.safar@seznam.cz>
4932 * class.cs (MethodData.Emit): Parameters should be labeled first.
4934 2005-11-21 Marek Safar <marek.safar@seznam.cz>
4937 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
4939 2005-11-18 Marek Safar <marek.safar@seznam.cz>
4941 * attribute.cs (AreParametersCompliant): Moved to Parameter.
4943 * class.cs (MethodCore): Parameter clean up.
4944 (IMethodData): Added ParameterInfo.
4945 (MethodData): Parameter clean up.
4946 (Indexer.Define): Parameter clean up.
4958 * typemanager.cs: Parameter clean up.
4960 * delegate.cs (Define): Get rid of duplicated code.
4962 * expression.cs (ParameterReference): Removed useless parameters
4964 (Invocation): Ditto.
4966 * parameter.cs (ParamsParameter): New class, params specialization.
4967 (ArglistParameter): Attemp to separate arglist.
4968 (Parameter): Refactored to be reusable and faster.
4969 (Parameter.Modifier): Made understandable.
4970 (Parameters): Changed to be used as a class for `this' assembly
4971 parameters. Refactored to use new specialized classes.
4973 * support.cs (ParameterData): Added Types property.
4974 (InternalParameters): Deleted.
4976 2005-08-20 Martin Baulig <martin@ximian.com>
4978 Merging this patch from GMCS to fix #75867.
4980 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
4981 scope if we don't already have it.
4983 2005-11-17 Martin Baulig <martin@ximian.com>
4986 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
4987 inherit the scope from our parent. Fixes #76653.
4989 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
4991 * doc.cs : the previous patch does not actually fix the bug.
4992 PropertyInfo override check is now implemented and really fixed it.
4993 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
4995 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
4997 * doc.cs : apply "override filter" also to properties.
5000 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
5002 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
5003 no need to check overrides. For classes, omit those results from
5004 interfaces since they must exist in the class. Fixed bug #76726.
5006 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
5008 * typemanager.cs : (GetFullNameSignature) differentiate indexers
5009 with different parameters. Fixed the second problem in #76685.
5011 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
5013 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
5014 get expected 'protected' access in CheckValidFamilyAccess()).
5017 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
5019 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
5020 Fixed bug #76705. CS1569 was incorrectly commented out.
5022 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
5024 * doc.cs : use Invocation.IsOverride() to do real override check.
5025 * expression.cs : made Invocation.IsOverride() internal.
5027 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
5029 * doc.cs : use TypeManager.FindMembers() instead of (possible)
5030 TypeBuilder.FindMembers() and filter overriden base members out.
5033 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
5035 * doc.cs : ref/out parameters are represented as '@' (instead of
5036 '&' in type FullName). Fixed bug #76630 (additionally crefs).
5038 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
5040 * doc.cs : when there was no '.' in cref to methods in doc comment,
5041 then parameters were missing in the output. Fixed bug #76691.
5043 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
5045 * driver.cs : don't output docs when there is an error.
5048 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
5051 Now it should detect indexers. Fixed primary concern in bug #76685.
5052 Fixed CS0419 message to not show the identical member signature in
5055 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
5057 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
5058 instead of Type.FindMembers() since it does not handle events.
5061 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
5063 * codegen.cs: Fixed typo (speficied -> specified).
5065 2005-11-11 Marek Safar <marek.safar@seznam.cz>
5068 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
5070 2005-11-11 Marek Safar <marek.safar@seznam.cz>
5072 * attribute.cs: Changed error message.
5074 * cs-tokenizer.cs: One more check.
5076 2005-11-10 Marek Safar <marek.safar@seznam.cz>
5078 * statement.cs (Block.Resolve): Ignore empty statement.
5080 2005-11-10 Marek Safar <marek.safar@seznam.cz>
5082 * report.cs: Made error/warning methods more strict to avoid
5085 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
5086 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
5087 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
5088 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
5090 2005-11-08 Marek Safar <marek.safar@seznam.cz>
5092 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
5093 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
5095 * class.cs (TypeContainer.IsComImport): New property.
5096 (Constructor.Define): Create proper ctor for ComImport types.
5098 * expression.cs (New.CheckComImport): Fixed.
5100 2005-11-07 Miguel de Icaza <miguel@novell.com>
5102 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
5103 that a parameter has been captured does not mean that we do not
5104 have to do the rest of the processing. This fixes the second part
5105 of #76592. If there was another anonymous method capturing
5106 values in the past, the Scope would never be set for the second
5107 method that captured the same parameter.
5109 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
5110 properly manipulate the stack. Second part of fix for #76592.
5112 * expression.cs (New): Add support for invoking "new" on
5113 interfaces that have been flagged with the ComImport attribute and
5114 the CoClass. Fixes #76637
5116 * statement.cs (Try.DoEmit): When a variable is captured, do not
5117 try to emit the vi.LocalBuilder variable as it has been captured.
5118 Create a temporary variable and store the results on the
5119 FieldBuilder. Fixes #76642
5121 2005-11-07 Marek Safar <marek.safar@seznam.cz>
5123 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
5125 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
5127 * expression.cs (Binary.DoResolve): Added && optimalization.
5129 * typemanager.cs (AddUserType): Removed useless argument.
5131 2005-11-04 Marek Safar <marek.safar@seznam.cz>
5133 * statement.cs (Block.variables): Uses ListDictionary.
5135 2005-11-03 Marek Safar <marek.safar@seznam.cz>
5138 * class.cs (PartialContainer.EmitType): Customized to emit
5139 security attributes.
5140 (ClassPart.ApplyAttributeBuilder): Transform security attribute
5141 for partial classes.
5143 2005-11-03 Marek Safar <marek.safar@seznam.cz>
5146 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
5147 access has to be fixed.
5149 * typemanager.cs (IsUnmanagedType): Wrong common field type.
5151 2005-11-01 Marek Safar <marek.safar@seznam.cz>
5154 * ecore.cs (NullCast.Reduce): Implemented.
5156 * expression.cs (ArrayCreation.CheckIndices): Correcly check
5159 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
5161 (Foreach.Resolve): Catch null properly.
5163 2005-10-29 Marek Safar <marek.safar@seznam.cz>
5165 * cs-tokenizer.cs: Warning text fix.
5167 * driver.cs: AllWarningNumbers exposed on public interface.
5169 * report.cs (): Reviewed warning numbers.
5170 (IsValidWarning): Use binary search.
5172 2005-10-29 Marek Safar <marek.safar@seznam.cz>
5174 * driver.cs: Implemeted resource visibility.
5175 (Resources): New class for code sharing between /res: and
5178 2005-10-28 Marek Safar <marek.safar@seznam.cz>
5181 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
5184 * convert (Convert.ImplicitReferenceConversion): NullCast holds
5187 * ecore.cs (NullCast): Child is contant only.
5189 * literal.cs (NullLiteral.Reduce): null can be converted to any
5192 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
5194 * driver.cs: Use Encoding.Default as default code page instead
5197 2005-10-27 Raja R Harinath <rharinath@novell.com>
5200 * expression.cs (Invocation.Error_InvalidArguments): Handle
5201 __arglist parameters.
5202 (Invocation.VerifyArgumentsCompat): Likewise.
5203 * support.cs (ReflectionParameters.GetSignatureForError): Print
5204 __arglist parameters.
5205 (InternalParamters.GetSignatureForError): Likewise.
5206 * parameter.cs (Parameters.GetSignatureForError): Likewise.
5208 2005-10-26 Marek Safar <marek.safar@seznam.cz>
5210 * attribute.cs (GetPropertyValue): Made public.
5212 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
5214 Add new property WrapNonExceptionThrows to handle 2.0 assembly
5216 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
5219 * driver.cs: Reflect method name change.
5221 * statement.cs (Try.Resolve): Warn when try has both general
5224 * typemanager.cs: runtime_compatibility_attr_type new predefined
5227 2005-10-26 Raja R Harinath <harinath@gmail.com>
5230 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
5231 treat it as an empty parameter list.
5233 2005-10-26 Raja R Harinath <rharinath@novell.com>
5236 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
5237 ResolveAsTypeStep silent.
5238 * statement.cs (Block.AddConstant): Mark block as used.
5239 (Block.ResolveMeta): Avoid piling on error messages
5240 if a constant initializer resolution fails.
5242 2005-10-25 Raja R Harinath <rharinath@novell.com>
5244 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
5246 (NamespaceEntry.VerifyAllUsing): New.
5247 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
5248 behaviour. Delegates actual resolution of alias to ...
5249 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
5250 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
5252 * driver.cs (Driver.MainDriver): Update.
5254 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
5255 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
5257 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
5259 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
5260 RootNamespace.DefineNamespacesForAll.
5262 2005-10-24 Raja R Harinath <harinath@gmail.com>
5264 * typemanager.cs (assemblies, external_aliases, modules)
5265 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
5266 (ComputeNamespaces, GetRootNamespace): Remove extra staging
5267 overhead. Move resposibility ...
5268 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
5269 * driver.cs, attribute.cs, codegen.cs: Update to changes.
5271 2005-10-23 Raja R Harinath <harinath@gmail.com>
5273 * namespace.cs (RootNamespace.all_namespaces): Renamed from
5274 cached_namespaces. Improve usage.
5275 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
5276 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
5277 Move from GlobalRootNamespace and simplify.
5278 (RootNamespace.Global): Make instance variable.
5279 (RootNamespace.RootNamespace): Add "alias name" parameter.
5280 (GlobalRootNamespace): Simplify drastically.
5281 (Namespace.Lookup): Don't use GetNamespace.
5282 * typemanager.cs (GetRootNamespace): Rename from
5283 ComputeNamespaceForAlias.
5284 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
5286 2005-10-23 Marek Safar <marek.safar@seznam.cz>
5288 * anonymous.cs (AnonymousContainer): Don't crash when container
5291 2005-10-23 Marek Safar <marek.safar@seznam.cz>
5293 * expression.cs (Binary.DoResolve): Warn when comparing same
5296 2005-10-23 Marek Safar <marek.safar@seznam.cz>
5299 * expression.cs (Binary.DoResolve): It looks like there are no
5300 convetsion rules in enum context.
5302 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
5304 Add support for extern alias qualifiers.
5305 * typemanager.cs: Move some LookupTypeReflection code
5306 to namespace.cs, to have cleaner code. Added some methods
5307 to help us keep track of the extern aliased references.
5308 * driver.cs: Add suport for extern alias assemblies on command
5309 line and check for their warnings/errors. Also keep track of the
5310 extern aliased assemblies.
5311 * namespace.cs: Move the global functionality of Namespace
5312 to GlobalRootNamespace/RootNamespace. Now the global namespace
5313 is GlobalRootNamespace.Globa. Also the code moved from
5314 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
5315 Finally added LocalAliasEntry (AliasEntry before) and
5316 ExternAliasEntry, to handle alias statements.
5317 * cs-parser.jay: Add support in the grammar for extern alias
5319 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
5320 Update callings to Namespace (now in GlobalRootNamespace).
5322 2005-10-18 Raja R Harinath <rharinath@novell.com>
5325 * class.cs (TypeContainer.DefineType): Move updating of
5326 topological sort earlier in the code.
5327 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
5329 2005-10-18 Marek Safar <marek.safar@seznam.cz>
5332 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
5334 * constant.cs (Constant.TryReduce): Moved from Cast class.
5335 (Reduce): Made little bit more OO and fixed missing conversions.
5337 * ecore.cs (Reduce): Implemented.
5338 (Binary.EnumLiftUp): New method to upgrade values to enum values.
5340 * literal.cs (Reduce): Implemented.
5342 * class.cs: Reverted Miguel's wrong commit.
5344 2005-10-14 Miguel de Icaza <miguel@novell.com>
5346 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
5348 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
5350 * cs-parser.jay, expression.cs : CS0214 was missing error location
5351 for constants. Fixed bug #76404.
5353 2005-10-11 Marek Safar <marek.safar@seznam.cz>
5356 * convert.cs (ExplicitConversionCore): Fixed object->enum
5359 2005-10-10 Raja R Harinath <rharinath@novell.com>
5361 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
5363 (PropertyExpr.EmitCall): Likewise.
5364 * expression.cs (Invocation.EmitArguments): Handle case where
5366 (Invocation.EmitCall): Avoid allocating temporary variable if
5367 there are no arguments.
5369 2005-10-07 Raja R Harinath <rharinath@novell.com>
5372 * convert.cs (ImplicitConversionStandard): Move conversion of
5373 void* to arbitrary pointer types ...
5374 (ExplicitConversionStandard): .. here.
5375 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
5376 error to always print typenames.
5378 2005-10-07 Raja R Harinath <rharinath@novell.com>
5380 * convert.cs (GetConversionOperator): Rename from
5381 GetConversionOperators. Move operator selection code from ...
5382 (UserDefinedConversion): ... here.
5384 2005-10-06 Marek Safar <marek.safar@seznam.cz>
5386 * convert.cs (ExplicitConversionCore): Removed duplicate enum
5389 2005-10-05 Marek Safar <marek.safar@seznam.cz>
5391 * assign.cs (Assign.DoResolve): Error method changed.
5393 * cfold.cs (DoConstantNumericPromotions): Error method changed.
5395 * const.cs (ResolveValue): Reset in_transit immediately.
5397 * constant.cs: Error method changed.
5399 * convert.cs: Removed useless location parameter.
5400 (ExplicitNumericConversion): Don't do double enum check.
5401 (ExplicitConversionCore): Renamed from ExplicitConversion.
5402 (ExplicitUnsafe): Extracted from ExplicitConversion.
5403 (ExplicitConversion): Uses for error reporting.
5405 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
5407 (ResolveBoolean): Uses common error method.
5408 (CastToDecimal): Get rid of ec.
5409 (CastFromDecimal): Optimized.
5410 (ConvCast): Get rid of ec.
5412 * enum.cs (ResolveValue): Reset in_transit immediately.
5413 (Emit): Return after first error.
5415 * expression.cs: Convert changes.
5417 * literal.cs: Error method changed.
5419 * statement.cs: Error method changed.
5421 2005-10-03 Raja R Harinath <rharinath@novell.com>
5423 * support.cs (SeekableStreamReader.Position): Don't error out when
5424 the requested position is just beyond the end of the current
5427 2005-09-28 Raja R Harinath <rharinath@novell.com>
5429 * support.cs (SeekableStreamReader): Simplify drastically. Don't
5430 try to keep in sync with the byte count of the underlying Stream.
5431 However, this limits us to a window size of 2048 characters: i.e.,
5432 the maximum lookahead of our lexer/parser can be 2048 characters.
5434 2005-09-28 Marek Safar <marek.safar@seznam.cz>
5437 * driver.cs: Fix compilation files with full root path.
5439 2005-09-25 Miguel de Icaza <miguel@novell.com>
5441 * report.cs (SymbolRelatedToPreviousError): Format the output so
5442 it does not use an open parenthesis that is never closed.
5444 * driver.cs: Follow coding guidelines
5446 2005-09-27 Marek Safar <marek.safar@seznam.cz>
5449 * const.cs (Const.ResolveValue): Check for assigning non-null
5450 value to reference type.
5452 2005-09-27 Marek Safar <marek.safar@seznam.cz>
5454 * anonymous.cs: Implemented ExprClassName.
5456 * assign.cs (Assign.DoResolve): Don't chrash when type is not
5459 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
5462 * class.cs (StaticClass.DefineContainerMembers): Report protected
5465 * codegen.cs: if(ed) PRODUCTION.
5467 * convert.cs (Error_CannotImplicitConversion): Better error
5470 * cs-parser.jay: More error checks.
5472 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
5474 * driver.cs (CSCParseOption): Enabled wrong option check.
5476 * ecore.cs (Expression.ExprClassName): Turned to property.
5477 (MemberExpr.CheckIntermediateModification): For checking boxed
5478 value types modification.
5480 * statement.cs (Fixed.Resolve): Expression type must be
5481 convertible to fixed type.
5482 (CollectionForeach.GetEnumeratorFilter,TryType):
5483 Small refactoring for easier error checking.
5485 2005-09-26 Marek Safar <marek.safar@seznam.cz>
5487 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
5490 * class.cs (GeneratedBaseInitializer): New class for customization
5491 compiler generated initializers.
5492 (MemberBase.DoDefine): Check Obsolete attribute here.
5493 (FieldMember.DoDefine): Ditto.
5495 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
5498 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
5499 (MemberCore.GetObsoleteAttribute): Removed argument.
5500 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
5501 (MemberCore.CheckObsoleteType): New helper.
5505 * statement.cs: Updates after MemberCore changes.
5507 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
5508 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
5510 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
5511 obsolete attribute for compiler construct.
5512 (As.DoResolve): Cache result.
5514 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
5516 2005-09-26 Raja R Harinath <rharinath@novell.com>
5519 * expression.cs (This.VerifyFixed): In a value type T, the type of
5520 'this' is T&, iow, 'this' is either an out or ref parameter. In a
5521 value type R, 'this' is treated as a value parameter.
5523 2005-09-22 Miguel de Icaza <miguel@novell.com>
5525 * statement.cs (Lock): Use the TemporaryVariable class instead of
5526 manually using local variables as those do not work when variables
5529 * ecore.cs: Moved the TemporaryVariable class from being a nested
5530 class inside Foreach to be a public class that can be employed in
5533 2005-09-19 Marek Safar <marek.safar@seznam.cz>
5535 * cs-parser.jay: interface_accessors replaced by
5536 accessor_declarations.
5538 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
5541 * statement.cs (GotoCase.Resolve): Convert null constant to
5543 (SwitchLabel.ResolveAndReduce): Ditto.
5544 (SwitchLabel.NullStringCase): Custom null stamp.
5545 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
5547 typemanager.cs (CSharpSignature): Don't skip first argument
5550 2005-09-18 Miguel de Icaza <miguel@novell.com>
5552 * driver.cs: Set InEmacs based on the environment variable EMACS.
5554 * location.cs (InEmacs): in this mode, do not report column
5555 location as it confuses Emacs.
5557 2005-09-16 Marek Safar <marek.safar@seznam.cz>
5559 * cfold.cs, constant.cs, convert.cs, ecore.cs,
5560 expression.cs, iterators.cs, literal.cs: Store constants and
5563 * class.cs (MemberBase.ShortName): Pass location.
5565 * cs-parser.jay: Some location fixes.
5567 * ecore.cs (Expression.Location): Made virtual.
5569 2005-09-05 Miguel de Icaza <miguel@novell.com>
5571 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
5572 if the underlying types are the same, otherwise we need to produce
5573 code that will do the proper cast.
5575 This was exposed by Marek's constant rewrite which produced
5576 invalid code for the call site:
5579 void Method (X v) {}
5583 This fixes test-49.cs
5585 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
5587 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
5588 Type/Object should be allowed as well. Fixed bug #75968.
5590 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
5592 * expression.cs : (Binary.DoResolve): when one is enum constant and
5593 another is constant 0, then return enum one *as enum type*.
5596 2005-09-02 Raja R Harinath <rharinath@novell.com>
5598 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
5602 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
5603 flow-branching for LocalVariableReferences in case we were invoked
5604 from a MemberAccess.
5605 * expression.cs (LocalVariableReference.VerifyAssigned): New.
5607 (LocalVariableReference.DoResolveBase): ... this.
5608 (MemberAccess.Resolve): Do the check that was disabled during
5611 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
5614 (PartialContainer.Create): check abstract/sealed/static strictly
5615 but abstract/sealed can exist only at one side. Fixed bug #75883.
5617 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
5620 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
5621 specified, don't default to UnmanagedType.I4.
5623 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
5625 * expression.cs : conditional operator should check possibly
5626 incorrect assign expression. Fixed bug #75946.
5628 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
5630 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
5631 Reverting the change. gmcs is much complex than mcs on this matter.
5633 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
5635 * cs-tokenizer.cs : To read another token ahead of the actual
5636 consumption, use new SavedToken and cache token instead of moving
5637 back the stream with SeekableStreamReader (it seemed problematic).
5639 driver.cs : Thus use StreamReader directly.
5640 * support.cs : Thus removed SeekableStreamReader.
5642 2005-08-30 Raja R Harinath <rharinath@novell.com>
5645 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
5646 (ScopeInfo.EmitScopeType): Use it to construct field names from
5647 names of captured locals.
5650 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
5651 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
5652 Pass 'target_type' to BoxedCast. Don't default to 'object'.
5653 (ExplicitConversion): Remove enum cases already handled by
5654 implicit conversion. Move implicit conversion check to the beginning.
5655 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
5656 * expression.cs (ArrayCreation.EmitDynamicInitializers):
5657 Don't treat System.Enum as a struct.
5659 2005-08-30 Jb Evain <jbevain@gmail.com>
5661 * attribute.cs: handles as expression in parameters.
5663 2005-08-30 Raja R Harinath <rharinath@novell.com>
5666 * class.cs (TypeContainer.VerifyClsName): Don't use a
5667 PartialContainer when verifying CLS compliance.
5668 (AbstractPropertyEventMethod): Set Parent here, ...
5669 (PropertyMethod): ... not here.
5671 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
5673 * attribute.cs : escaped attribute name should not be allowed to be
5674 resolved (e.g. @class as classAttribute). Fixed bug #75930.
5676 2005-08-29 Raja R Harinath <rharinath@novell.com>
5679 * convert.cs (ImplicitStandardConversionExists): Allow zero also
5680 when converting a long constant to unsigned long.
5681 * expression.cs (Invocation.OverloadResolve): Add sanity check to
5682 detect where IsApplicable and VerifyArgumentsCompat disagree.
5684 2005-08-29 Raja R Harinath <rharinath@novell.com>
5685 and Carlos Alberto Cortez <carlos@unixmexico.org>
5688 * class.cs (TypeContainer.CanElideInitializer): New helper.
5689 (TypeContainer.EmitFieldInitializers): Use it to determine if we
5690 can safely emitting the initializer of a field.
5692 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
5694 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
5695 allowed inside a switch (without loop). Fixed bug #75433.
5697 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
5699 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
5700 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
5702 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
5704 * driver.cs : kinda reverting the default encoding changes (not exact
5705 revert since I noticed that "codepage:reset" might not work fine).
5707 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
5709 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
5710 Location. Now getter and setter store location correctly.
5711 (errors/cs0111-12.cs now reports the expected location.)
5713 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
5715 * driver.cs : Use default encoding on the environment.
5716 Removed (now that) extra parameter for SeekableStreamReader.
5717 * support.cs : (SeekableStreamReader) third .ctor() argument for
5718 StreamReader is not required (always true). preamble size could
5719 be acquired in simpler and safe way.
5721 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
5723 * cs-parser.jay: report CS0642 at warning level 3
5724 and report CS0642 for an if else statement also
5725 fixes bug #74745. Patch by John Luke (and a bit
5727 Removed extra CS0642 warning check for "while",
5729 * statement.cs: In Block.Resolve(), CS0642 check
5730 is reimplemented to check a sequence of an empty
5731 statement and a block.
5733 Both fix bug #66777.
5735 2005-08-24 Marek Safar <marek.safar@seznam.cz>
5737 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
5738 detection until I fix it.
5740 * cs-tokenizer.cs: Changed error message.
5742 * cs-parser.jay: Fixed 2 error locations.
5744 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
5745 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
5748 * enum.cs (GetSignatureForError): Fixed.
5750 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
5754 * typemanager.cs (RegisterProperty): Removed.
5756 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
5758 2005-08-24 Raja R Harinath <rharinath@novell.com>
5761 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
5762 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
5764 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
5766 * expression.cs : tiny fix is required for not warning positive ulong.
5769 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
5771 * expression.cs : add CS0652 check for constant and integral
5772 expression. Fixed bug #53974.
5774 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
5776 * expression.cs : in DoNumericPromotions(), check if there is implicit
5777 conversion overload for string (to check CS0034). Fixed bug #52492.
5779 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
5781 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
5783 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
5785 * ecore.cs : report location when it is *not* Null.
5787 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
5793 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
5794 correctly. Fixed bug #75721.
5796 2005-08-23 Raja R Harinath <rharinath@novell.com>
5798 * support.cs (SeekableStreamReader.Position): Avoid an expensive
5799 loop that performs 'min (pos, char_count)'.
5802 * expression.cs (Unary.ResolveOperator): Don't discard implicit
5803 converted value in Operator.OnesComplement.
5805 2005-08-22 Ben Maurer <bmaurer@ximian.com>
5807 * anonymous.cs: If the anon method is pulled into a helper class,
5808 it needs to be `internal' not `private'. Fixes runtime behavior on
5811 2005-08-20 Martin Baulig <martin@ximian.com>
5813 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
5814 scope if we don't already have it.
5816 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
5817 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
5820 2005-08-17 Marek Safar <marek.safar@seznam.cz>
5823 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
5826 2005-08-16 Marek Safar <marek.safar@seznam.cz>
5828 The big constants rewrite
5829 Fix #75746, #75685 and more
5830 As a side effect saved 1MB for MWF ;-)
5832 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
5833 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
5834 enum based for corlib compilation.
5836 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
5839 * class.cs (FixedField.Define): Use ResolveAsConstant.
5841 * const.cs (IConstant): Interface constants and enums.
5842 (Const.ResolveValue): New method for constant resolvning.
5843 (ExternalConstant): Constants from imported assemblies.
5845 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
5846 conversion; like enums.
5847 (Constant.ToType): Converts this constant to different type.
5848 (Constant.Increment): Adds 1.
5850 * convert.cs (ImplicitConversionRequired): Simplified.
5852 * cs-parser.jay: Create EnumMember directly.
5854 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
5856 * doc.cs (GenerateEnumDocComment): Removed.
5858 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
5859 (ConvertIntLiteral): Removed.
5860 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
5862 * enum.cs (EnumMember): Implement IConstant.
5863 (Enum.IsValidEnumConstant): Removed.
5864 (Enum.GetNextDefaultValue): Removed.
5865 (Enum.FindMembers): Updated.
5866 (Enum.GenerateDocComment): Iterate enum members.
5868 * expression.cs (Cast.TryReduce): Handle enums correctly.
5869 (New.Constantify): Made public.
5870 (MemberAccess.DoResolve): Removed contant specific if(s).
5872 * literal.cs (NullLiteral): Implement new abstract methods.
5874 * statement.cs (GotoCase.Resolve): Use new constant methods.
5875 (SwitchLabel.ResolveAndReduce): Use new constant methods.
5877 * typemanager.cs (LookupEnum): Removed.
5878 (IsEnumType): Fixed to work with corlib.
5879 (RegisterConstant): Removed.
5880 (LookupConstant): Removed.
5881 (GetConstant): Changed to work with IConstant.
5883 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
5885 * location.cs : Fixed overflown (>255) column number.
5887 2005-08-03 Raja R Harinath <rharinath@novell.com>
5889 First cut of the qualified-alias-member feature.
5890 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
5892 * cs-parser.jay (DOUBLE_COLON): New token.
5893 (namespace_or_type_name): Add rule for recognizing
5894 qualified-alias-members.
5895 (primary_expression): Likewise.
5896 (element_access): Allow QualifiedAliasMember as a possible
5897 type-bearing expression.
5898 (local_variable_type, local_variable_pointer_type): Likewise.
5899 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
5900 aliases in the current and enclosing namespace declarations.
5901 (NamespaceEntry.UsingAlias): Add CS0440 warning.
5902 * decl.cs (MemberName.is_double_colon): New.
5903 (MemberName.MemberName): Add new constructor for alias-member.
5904 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
5905 * expression.cs (QualifiedAliasMember): New expression type.
5907 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
5909 * location.cs : it borked when no argument was specified.
5911 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
5913 * location.cs : tiny ToString() format fix.
5915 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
5917 * statement.cs : oops, it was missing.
5919 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
5921 A set of fixes for precise line/column location.
5924 "token" field now holds a file/line "delta", a line number offset
5925 from the segment, and a column number. See also:
5926 http://lists.ximian.com/pipermail/mono-devel-list/2004-
5927 December/009508.html
5928 Removed static IsNull. Use instance IsNull property instead.
5930 For some tokens it stores Location. For Identifier it stores
5931 LocatedToken which is a pair of string name and location.
5932 Column numbers are adjusted only at getChar().
5934 Use Location.ToString() for reporting (it now contains column).
5936 Largely modified to use LocatedToken instead of
5937 string (IDENTIFIER), and to acquire Location from some tokens.
5938 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
5939 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
5941 Now MemberName holds Location. DeclSpace.ctor() receives Location
5942 as a parameter. Removed extra parameters to all derived classes.
5943 Replaced Location.IsNull() with instance property.
5944 * assign.cs, expression.cs :
5945 Added .ctor() overload that omits Location.
5947 Added "nameEscaped" flag that indicates the identifier was escaped
5948 in the source file. This fixes bug #57047.
5950 2005-08-02 Marek Safar <marek.safar@seznam.cz>
5952 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
5953 New method, looking for lo-case imported cls type.
5955 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
5958 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
5960 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
5962 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
5964 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
5966 Optimized to save 3.5 MB for SWF compilation.
5968 2005-08-01 Marek Safar <marek.safar@seznam.cz>
5970 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
5971 (PartialContainer.Create): Moved logic AddToContainer.
5972 (PartialContainer.MarkForDuplicationCheck): Shares name.
5974 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
5977 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
5979 (Namespace.GetSignatureForError): New method.
5981 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
5982 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
5984 2005-08-01 Raja R Harinath <rharinath@novell.com>
5987 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
5988 member lookup rather than qualifier_type, since qualifier_type can
5991 2005-08-01 Marek Safar <marek.safar@seznam.cz>
5993 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
5996 2005-07-31 Miguel de Icaza <miguel@novell.com>
5998 * statement.cs: Copy the local exception into the exception
5999 captured local. Fixes 75674
6001 2005-07-31 Raja R Harinath <harinath@gmail.com>
6004 * expression.cs (Invocation.OverloadResolve): Don't report error
6005 CS1501 if error CS1502 has been reported.
6006 (New.DoResolve): Delegate CS1501 reporting to
6007 Invocation.OverloadResolve.
6010 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
6011 invariant-meaning-in-block property in an enclosing block if
6014 2005-07-29 Marek Safar <marek.safar@seznam.cz>
6016 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
6017 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
6018 (Switch.CheckSwitch): Just save 50kb for SWF.
6020 2005-07-27 Martin Baulig <martin@ximian.com>
6022 * anonymous.cs (CaptureContext.AddField): Added
6023 `AnonymousContainer am' argument; compute its toplevel scope if
6024 it's not already computed. Fixes #75649.
6026 2005-07-26 Raja R Harinath <rharinath@novell.com>
6029 * class.cs (Constructor.Emit): Reset block to null if the block
6032 2005-07-25 Marek Safar <marek.safar@seznam.cz>
6034 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
6036 2005-07-25 Marek Safar <marek.safar@seznam.cz>
6038 * class.cs (MethodData.Define): Check whether accessor implementing
6039 interface is public.
6041 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
6043 2005-07-22 Marek Safar <marek.safar@seznam.cz>
6046 * namespace.cs (LookupType): Moved same type check to...
6048 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
6051 2005-07-21 Raja R Harinath <rharinath@novell.com>
6053 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
6054 already found a typebuilder.
6055 * class.cs (MethodCore.IsDuplicateImplementation): Compare
6056 MemberNames, not strings.
6058 * const.cs (Error_ExpressionMustBeConst):
6059 Rename from Error_EpressionMustBeConst.
6060 * const.cs, class.cs, statement.cd: Update.
6062 2005-07-21 Marek Safar <marek.safar@seznam.cz>
6066 * const.cs (Const.LookupConstantValue): Report missing contant expression
6068 (Error_EpressionMustBeConstant): Only one error method.
6070 * class.cs, statement.c: Updated.
6072 2005-07-20 Raja R Harinath <rharinath@novell.com>
6074 * statement.cs (Block.Flags): Add back HasVarargs.
6075 (Block.flags): Make protected.
6076 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
6078 * typemanager.cs (types, typecontainers, user_types): Remove.
6079 (UserTypes, TypeContainers): Likewise.
6080 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
6081 (CleanUp, Reset): Update.
6082 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
6083 (GetNestedType): Use Type.GetNestedType.
6084 (CoreLookupType): Take two arguments, the namespace and the
6085 basename of the type. Update to use the Namespace.Lookup
6087 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
6088 (RealMemberLookup): Use IsNestedChildOf instead of playing with
6089 string concatenation and substring matches.
6090 * class.cs, enum.cs, delegate.cs: Update to changes.
6092 2005-07-20 Marek Safar <marek.safar@seznam.cz>
6094 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
6095 Expression and made virtual.
6097 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
6098 (ImplicitStandardConversionExists): Fixed `byte' typo ?
6100 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
6102 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
6105 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
6108 2005-07-18 Marek Safar <marek.safar@seznam.cz>
6111 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
6112 AssemblyCultureAttribute is not used on executable.
6115 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
6117 2005-07-16 Raja R Harinath <rharinath@novell.com>
6120 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
6121 New. Reports CS0252/CS0253.
6122 Mostly taken from preliminary patch by Duncak Mak.
6123 (Binary.DoResolveOperator): Store results of operator lookup.
6124 Use them to detect if we need to warn about unintended reference
6127 2005-07-15 Raja R Harinath <rharinath@novell.com>
6130 * namespace.cs (Namespace.Lookup): Add back location parameter.
6131 (Namespace.LookupType): Add CS0436 report. Add location parameter.
6132 * delegate.cs, ecore.cs, expression.cs: Update to changes.
6134 * codegen.cs (EmitContext.DeclSpace): Make readonly.
6135 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
6136 (Namespace.LookupType): ... this.
6137 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
6139 * typemanager.cs (LookupTypeReflection): Remove buggy code that
6140 purported to handle pointers.
6141 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
6144 2005-07-15 Marek Safar <marek.safar@seznam.cz>
6146 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
6149 2005-07-15 Raja R Harinath <rharinath@novell.com>
6151 * namespace.cs (Namespace.Lookup): Drop location parameter.
6152 (NamespaceEntry.LookupAlias): Remove. Merge into ...
6153 (NamespaceEntry.Lookup): ... this.
6154 (NamespaceEntry.Error_AmbiguousTypeReference):
6155 Move here from DeclSpace.
6156 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
6158 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
6159 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
6160 Move to NamespaceEntry.
6161 * delegate.cs, expression.cs: Update to changes.
6163 2005-07-14 Marek Safar <marek.safar@seznam.cz>
6165 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
6166 CheckAttributeType and refactored.
6167 (Attribute.ResolvePossibleAttributeType): Changed to reuse
6168 ResolveAsTypeTerminal error handling.
6169 (ResolveAsTypeTerminal): Introduced because of global attributes extra
6171 (GetSignatureForError): Print errors in same way.
6174 * codegen.cs: Reflect attribute GetSignatureForError change.
6177 * expression.cs: Add silent parameter to ResolveAsTypeStep.
6179 * namespace.cs (UsingEntry): Refactored to make fields private.
6182 statement.cs: Error_UnexpectedKind has extra parameter.
6184 2005-07-14 Raja R Harinath <rharinath@novell.com>
6186 * ecore.cs (IAlias): Remove.
6187 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
6188 that implement the interface.
6189 * namespace.cs (Namespace): Likewise.
6190 (Namespace.declspaces): Renamed from 'defined_names'.
6191 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
6192 DeclSpace instead of an IAlias.
6193 * tree.cs (Tree.AddDecl): Update.
6195 2005-07-12 Raja R Harinath <rharinath@novell.com>
6197 * statement.cs (Block.Flags); Remove HasVarargs.
6198 (Block.HasVarargs): Move to ToplevelBlock.
6199 (Block.ThisVariable, Block.AddThisVariable): Likewise.
6200 (Block.Variables): Make protected. Initialize variable hashtable
6202 (Block.AddVariable): Update.
6203 (Block.Resolve): Update to changes.
6204 (ToplevelBlock.HasVarargs): New boolean.
6205 (ToplevelBlock.ThisVariable): Move here from Block.
6206 (ToplevelBlock.AddThisVariable): Likewise.
6207 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
6208 * expression.cs (This.ResolveBase): Update to changes.
6209 (ArglistAccess.DoResolve): Likewise.
6211 2005-07-11 Marek Safar <marek.safar@seznam.cz>
6214 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
6216 * class.cs (TypeContainer.VerifyMembers): Distinguish between
6217 not used and not used & assigned.
6218 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
6220 2005-07-11 Marek Safar <marek.safar@seznam.cz>
6223 * expression.cs (Is.DoResolve): null is never provided type.
6225 2005-07-08 Marek Safar <marek.safar@seznam.cz>
6228 * cs-parser.jay: Less strict event error rule to catch more errors.
6230 2005-07-08 Martin Baulig <martin@ximian.com>
6232 Fix test-iter-10.cs - distinguish whether we `yield' in a property
6233 gettter (allowed) or setter (not allowed).
6235 * class.cs (Accessor): Implement IIteratorContainer.
6236 (Accessor.Yields): New public field.
6237 (PropertyBase.PropertyMethod.Define): Handle iterators on a
6241 (get_accessor_declaration, set_accessor_declaration): Set the
6242 `yields' flag on the accessor, not the property.
6243 (property_declaration): Do the iterators check on a per-accessor
6244 basis and not for the whole property.
6246 2005-07-08 Martin Baulig <martin@ximian.com>
6248 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
6249 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
6251 2005-07-07 Marek Safar <marek.safar@seznam.cz>
6254 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
6255 (ExtractSecurityPermissionSet): Cope with self referencing security
6256 attributes properly.
6258 * driver.cs (SetOutputFile): Made public property OutputFile.
6260 2005-07-07 Raja R Harinath <rharinath@novell.com>
6263 * class.cs (TypeContainer.first_nonstatic_field): Rename from
6264 has_nonstatic_fields. Make into a FieldBase pointer.
6265 (TypeContainer.AddField): Add CS0282 check.
6266 (TypeContainer.EmitType): Update.
6268 2005-07-06 Miguel de Icaza <miguel@novell.com>
6270 * cs-tokenizer.cs (consume_identifier): Do not create strings to
6271 compare if they start with __.
6273 2005-07-06 Raja R Harinath <rharinath@novell.com>
6275 * statement.cs (Switch.SwitchGoverningType): Only look at
6276 UserCasts that don't need implicit standard conversions to one of
6277 the allowed switch types (Fixes test-322.cs).
6278 (LocalInfo.Resolve): Re-enable sanity-test.
6280 2005-07-06 Marek Safar <marek.safar@seznam.cz>
6282 * cs-tokenizer.cs (consume_identifier): Detect double undescores
6284 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
6286 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
6288 2005-07-06 Raja R Harinath <rharinath@novell.com>
6291 * ecore.cs (SimpleName.GetSignatureForError): Add.
6292 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
6293 (MemberAccess.GetSignatureForError): Add.
6295 2005-07-05 Marek Safar <marek.safar@seznam.cz>
6297 The big error and warning messages review.
6327 * typemanager.cs: Updated.
6329 * class.cs: (MethodCore.SetYields): Moved here to share.
6330 (PropertyMethod.Define): Moved iterator setup here.
6332 * iterators.cs: Add orig_method to have full access to parent
6335 2005-07-05 Raja R Harinath <rharinath@novell.com>
6337 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
6338 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
6339 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
6340 variable of struct type.
6341 * expression.cs (Unary.ResolveOperator): Update to change.
6342 (Indirection.VerifyFixed): Likewise.
6343 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
6344 (ParameterReference.VerifyFixed): Value parameters are fixed.
6345 (This.VerifyFixed): Treat 'this' as a value parameter.
6346 * statement.cs (LocalInfo.IsFixed): Remove.
6348 2005-07-01 Martin Baulig <martin@ximian.com>
6350 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
6351 `ec.EmitThis ()' to get the correct scope.
6353 2005-07-01 Martin Baulig <martin@ximian.com>
6355 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
6356 instance is a ParameterReference; fixes #75299.
6358 2005-07-01 Martin Baulig <martin@ximian.com>
6360 Reverted Marek's latest patch (r46725):
6361 - it contains structural changes which are neither mentioned in
6362 the ChangeLog nor explained anywhere; for example the additional
6363 argument of EmitContext's and Iterator's .ctor's and the
6364 TypeContainer.DefineMembers() change.
6365 - structural changes like this should go in in seperate patches
6366 and not be hidden in a huge patch which just seems to affect
6367 warnings and errors.
6368 a big and hard to understand patch.
6369 - it breaks iterators and causes regressions, for instance in
6372 2005-06-30 Raja R Harinath <rharinath@novell.com>
6375 * expression.cs (Indexers.map): Remove.
6376 (Indexers.Append): Filter out inaccessible setters and getters.
6377 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
6380 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
6382 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
6383 (FieldExpr.Emit, PropertyExpr.Emit): Update.
6384 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
6385 * expression.cs (Invocation.EmitCall): Add CS0120 check.
6387 2005-06-30 Marek Safar <marek.safar@seznam.cz>
6390 * class.cs (FieldBase.GetInitializerExpression): One more field
6393 2005-06-28 Miguel de Icaza <miguel@novell.com>
6395 * pending.cs: Do not define a proxy if the base method is virtual,
6396 it will be picked up by the runtime (bug 75270).
6398 2005-06-08 Martin Baulig <martin@ximian.com>
6400 The big Iterators rewrite :-)
6402 * iterators.cs: Rewrite this to use the anonymous methods framework.
6404 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
6405 before the TypeContainers; see 2test-21.cs.
6408 (TypeContainer.DefineType): Don't create a new EmitContext if we
6409 already have one (this only happens if we're an Iterator).
6410 (TypeContainer.Define): Also call Define() on all our iterators.
6411 (Method.CreateEmitContext): Added support for iterators.
6414 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
6415 (AnonymousContainer.CreateMethodHost): Moved here from
6416 AnonymousMethod and made abstract.
6417 (AnonymousContainer.CreateScopeType): New abstract method.
6418 (AnonymousContainer.IsIterator): New public property.
6419 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
6420 get the ScopeTypeBuilder rather than manually defining it here.
6421 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
6424 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
6425 before RootContext.DefineTypes().
6427 * codegen.cs (EmitContext.RemapToProxy): Removed.
6428 (EmitContext.CurrentAnonymousMethod): Changed type from
6429 AnonymousMethod -> AnonymousContainer.
6430 (EmitContext.ResolveTopBlock): Protect from being called twice.
6431 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
6432 (EmitContext.EmitThis): Removed the iterators hacks; use the
6433 anonymous methods framework for that.
6436 (ToplevelBlock.Container): Make this a property, not a field.
6437 (ToplevelBlock.ReParent): New public method; move the
6438 ToplevelBlock into a new container.
6439 (Foreach.TemporaryVariable): Simplify.
6441 2005-06-05 Martin Baulig <martin@ximian.com>
6443 * statement.cs (LocalInfo.CompilerGenerated): New flag.
6444 (Block.AddTemporaryVariable): New public method; creates a new
6445 `LocalInfo' for a temporary variable.
6446 (Block.EmitMeta): Create the LocalBuilders for all the temporary
6448 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
6449 non-iterator variables.
6451 2005-06-05 Martin Baulig <martin@ximian.com>
6453 * statement.cs (Foreach.TemporaryVariable): Create the
6454 LocalBuilder in the Emit phase and not in Resolve since in some
6455 situations, we don't have an ILGenerator during Resolve; see
6456 2test-19.cs for an example.
6458 2005-06-04 Martin Baulig <martin@ximian.com>
6460 **** Merged r45395 from GCS ****
6462 The big Foreach rewrite - Part II.
6464 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
6465 with `PropertyInfo ienumerator_getcurrent'.
6467 * codegen.cs (VariableStorage): Removed.
6470 (Foreach): Derive from Statement, not ExceptionStatement.
6471 (Foreach.CollectionForeach): New nested class. Moved all the code
6472 dealing with collection foreach here.
6473 (Foreach.ForeachHelperMethods): Removed.
6474 (Foreach.TemporaryVariable): Implement IMemoryLocation.
6476 2005-05-23 Martin Baulig <martin@ximian.com>
6478 * statement.cs (Try.DoResolve): Don't create a `finally' if we
6479 don't need to. Fix #75014.
6481 2005-05-20 Martin Baulig <martin@ximian.com>
6483 Merged r44808 from GMCS.
6485 * class.cs (TypeContainer.CircularDepException): Removed.
6486 (TypeContainer.DefineType): Removed the `InTransit' stuff.
6487 (TypeContainer.CheckRecursiveDefinition): Check for circular class
6488 (CS0146) and interface (CS0529) dependencies here.
6490 2005-06-21 Raja R Harinath <rharinath@novell.com>
6492 * expression.cs (Invocation.EmitCall): Fix initialization
6493 'this_call' to reflect current behaviour. Fix indentation.
6495 * convert.cs (FindMostEncompassedType): Add two trivial special
6496 cases (number_of_types == 0 || number_of_types == 1).
6497 (FindMostEncompasingType): Likewise.
6499 2005-06-17 Raja R Harinath <rharinath@novell.com>
6501 Some cleanups preparing for the fix of #75283.
6502 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
6504 (EventExpr.InstanceResolve): Likewise.
6505 (EventExpr.DoResolve): Remove redundant checks.
6507 2005-06-10 Duncan Mak <duncan@novell.com>
6509 * cs-tokenizer.cs (process_directives): New flag for controlling
6510 the processing of preprocessor directives.
6511 (x_token): After seeing a '#', return Token.NONE instead of going
6512 to handle_preprocessing_directive() when not processing
6513 directives. This avoids unnecessary processing during the token peek in
6518 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
6519 the existing error reporting methods instead of Report.Error.
6521 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
6522 after Raja's rewrite.
6524 2005-06-08 Miguel de Icaza <miguel@novell.com>
6526 * class.cs: Small fix.
6528 2005-06-08 Raja R Harinath <rharinath@novell.com>
6531 * class.cs (GetPartialBases): Fix return value check of
6534 2005-06-07 Raja R Harinath <rharinath@novell.com>
6536 Ensure that partial classes are registered in their enclosing
6537 namespace. Initial part of fix of #75160.
6538 * tree.cs (Tree.RecordDecl): Add new namespace argument.
6539 Register declspace with namespace here, not in
6540 DeclSpace.RecordDecl.
6541 * cs-parser.jay: Pass namespace to RecordDecl.
6542 * class.cs (PartialContainer.Create): Likewise.
6543 (ClassPart.DefineType): New sanity-check. Throws an exception if
6545 * decl.cs (Declspace.RecordDecl): Remove.
6546 * namespace.cs (NamespaceEntry.DefineName): Remove.
6548 2005-06-06 Marek Safar <marek.safar@seznam.cz>
6550 * rootcontext.cs: Reset TargetExt as well.
6552 2005-06-03 Raja R Harinath <rharinath@novell.com>
6554 * ecore.cs (Expression.Resolve): Emit CS0654 error when
6557 2005-06-02 Raja R Harinath <rharinath@novell.com>
6559 Fix #75080, cs0119.cs.
6560 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
6562 (Expression.Resolve): ... this. Use it. Remove bogus code
6563 allowing ExprClass.Type and ExprClass.Namespace for
6564 ResolveFlags.VariableOrValue.
6565 (Expression.Resolve) [1-argument variant]: Change default resolve
6566 flags based on language version.
6567 (Expression.Error_UnexpectedKind): Use a simple string array
6568 rather than an ArrayList.
6569 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
6571 (TypeOfVoid.DoResolve): Likewise.
6572 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
6573 flags argument -- it always has the same value.
6575 2005-05-31 Raja R Harinath <rharinath@novell.com>
6578 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
6579 Use it in the error message.
6580 * assign.cs, expression.cs, statement.cs: Update.
6582 2005-05-30 Raja R Harinath <rharinath@novell.com>
6585 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
6586 the "almostMatchedMember" case too.
6587 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
6588 that failed the accessibility checks to 'almost_match'.
6590 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
6592 * attribute.cs: Use internal MethodBuilder methods to set
6593 ExactSpelling and SetLastError on PInvoke methods, instead
6594 of passing them via charset. Fixes #75060.
6596 2005-05-27 Raja R Harinath <rharinath@novell.com>
6598 * parameter.cs (Parameter): Remove TODO comment.
6599 (Parameter.DefineParameter): Remove Location parameter.
6600 (Parameters.LabelParameters): Likewise.
6601 * class.cs (Constructor.Emit): Update to change.
6602 (MethodData.Emit): Likewise.
6603 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
6604 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
6606 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
6609 Removed Parameters.Location and added Parameter.Location instead.
6610 Removed Location parameter from Emit() and GetSignature().
6617 Modified all related calls.
6619 2005-05-26 Raja R Harinath <rharinath@novell.com>
6621 Improve user-defined conversion handling.
6622 * convert.cs (GetConversionOperators): Rewrite. Return only the
6623 applicable operators.
6624 (AddConversionOperators): New. Helper for GetConversionOperators.
6625 (FindMostEncompassedType, FindMostEncompassingType): Verify that
6626 there is only one most encompassed/encompassing type.
6627 (FindMostSpecificSource, FindMostSpecificTarget): Remove
6628 "applicable operator" handling.
6629 (UserConversion): Move cache here from GetConversionOperators.
6630 Directly cache the chosen operator, rather than the whole
6632 (ExplicitNumericConversion): Fix buggy implementation of Decimal
6633 case. Allow conversion of decimal to sbyte and byte too.
6634 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
6635 New static methods. Used to avoid allocating EmptyExpressions in
6638 2005-05-24 Duncan Mak <duncan@novell.com>
6640 * ecore.cs (CastFromDecimal): New class for casting a decimal to
6641 another class, used in Convert.ExplicitNumericConversion.
6642 (CastToDecimal): New class, similar to above, but casts to
6643 System.Decimal, used in Convert.ImplicitNumericConversion and also
6644 in explicit convesion from double/float to decimal.
6646 * convert.cs (ImplicitNumericConversion): Handle implicit
6647 conversions to System.Decimal.
6648 (ExplicitNumericConversion): handle explicit conversions to
6653 2005-05-20 Miguel de Icaza <miguel@novell.com>
6655 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
6656 know the type at this stage, just break through. Fixes #75008
6658 2005-05-19 Martin Baulig <martin@ximian.com>
6661 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
6662 to disable error reporting.
6664 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
6665 here since we don't want to report an error; see the new test-336.cs.
6667 2005-05-19 Raja R Harinath <rharinath@novell.com>
6669 * statement.cs (ToplevelBlock.GetParameterReference)
6670 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
6671 Move here from class Block.
6672 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
6673 * expression.cs (ParameterReference.DoResolveBase): Likewise.
6675 2005-05-18 Martin Baulig <martin@ximian.com>
6680 (FlowBranching.Reachability): Add non-static public And() and Or()
6682 (FlowBranchingSwitch): New class; do the `break_origins' thing
6683 like in FlowBranchingLoop.
6684 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
6685 reachability, not just locals and parameters.
6686 (FlowBranching.MergeChild): Remove some of the hacks for loop and
6687 switch; MergeBreakOrigins() now takes care of that.
6689 2005-05-18 Martin Baulig <martin@ximian.com>
6691 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6692 a loop and may leave it, reset the barrier; fixes #74974.
6694 2005-05-17 Marek Safar <marek.safar@seznam.cz>
6696 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
6699 * cs-parser.jay: Catch more lexical errors.
6701 * report.cs: Add one more Error method.
6704 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
6706 2005-05-17 Martin Baulig <martin@ximian.com>
6708 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
6711 2005-05-16 Raja R Harinath <rharinath@novell.com>
6713 Fix test-382.cs. Emit values of decimal constants.
6714 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
6716 (TypeContainer.AddField): ... this.
6717 (TypeContainer.EmitFieldInitializers): Allow the list of fields
6718 with initializers to include 'Const's.
6719 (ClassPart.RegisterFieldForInitialization): Forward to
6721 * const.cs (Const.Const): Pass initializer to base class.
6722 (Const.Define): In case of decimal constants, register them for
6723 initialization in a static constructor.
6725 2005-05-14 Martin Baulig <martin@ximian.com>
6727 * statement.cs (Block.Resolve): Correctly handle unreachable code;
6728 do not call ResolveUnreachable() on unreachable statements in
6729 here, see the comment in the source code.
6731 2005-05-13 Raja R Harinath <rharinath@novell.com>
6734 * expression.cs (BinaryResolveOperator): If one of the operands of
6735 an equality comparison is 'null' and the other is a pointer type,
6736 convert the null to a NullPointer.
6737 * convert.cs (ImplicitReferenceConversion): If the expression is a
6738 NullLiteral and the target type is a pointer type, return a
6739 NullPointer instead.
6740 (ImplicitConversionStandard): Likewise.
6742 2005-05-13 Marek Safar <marek.safar@seznam.cz>
6744 * cs-parser.jay: Set readonly context based on special constructs.
6746 * expression.cs (LocalVariableReference.DoResolveBase): Improved
6747 readonly variable error handling.
6749 * rootcontext.cs (EmitCode): Don't verify members when error
6752 * statement.cs (LocalInfo): Add reaodnly context information.
6753 (SetReadOnlyContext, GetReadOnlyContext): New methods.
6755 2005-05-13 Raja R Harinath <rharinath@novell.com>
6757 * statement.cs (Block.Resolve): Revert change below. Modify fix
6758 for #74041 to initialize 'resolved' to false only for explicit
6759 blocks. Fixes #74873.
6761 2005-05-12 Raja R Harinath <harinath@gmail.com>
6764 * typemanager.cs (unmanaged_enclosing_types): New.
6765 (IsUnmanagedType): Avoid infloops by using
6766 'unmanaged_enclosing_types' to talk with recursive invocations.
6768 2005-05-13 Martin Baulig <martin@ximian.com>
6770 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
6771 instance variable, not a local. Fix #74873.
6772 (Block.ResolveUnreachable): Set it to true here.
6774 2005-05-11 Duncan Mak <duncan@novell.com>
6776 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
6777 continuing to process for 'arg'.
6778 (handle_preprocessing_directive): Check the argument of the #endif
6779 directive and report error CS1025 if there are any trailing
6782 According to the C# spec, having even whitespace after the #endif
6783 directive is illegal; however, because we call arg.TrimEnd ()
6784 beforehand, we have the same behavior as csc, allowing whitespace
6785 after the directive.
6789 2005-05-11 Marek Safar <marek.safar@seznam.cz>
6793 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
6794 (Constructor.GetObsoleteAttribute): Implemented correctly.
6796 2005-05-10 Martin Baulig <martin@ximian.com>
6798 * support.cs (ReflectionParameters.ParameterModifier): Use
6799 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
6800 and `ParameterAttributes.In'. Fixes #74884.
6802 2005-05-10 Marek Safar <marek.safar@seznam.cz>
6804 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
6806 * expression.cs (Argument.GetParameterModifier): Turned to property.
6807 (Invocation.Error_InvalidArguments): Add more descriptive errors.
6809 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
6812 2005-05-09 Raja R Harinath <rharinath@novell.com>
6815 * decl.cs (MemberCache.AddMethods): Register override methods,
6816 rather than non-override methods.
6817 * typemanager.cs (RegisterOverride): New.
6818 (IsOverride): Update.
6820 2005-05-09 Marek Safar <marek.safar@seznam.cz>
6824 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
6825 recursive declaration.
6827 * statement.cs (Block.ResolveMeta): Report any error in resolving.
6829 2005-05-06 Marek Safar <marek.safar@seznam.cz>
6831 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
6833 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
6835 2005-05-05 Raja R Harinath <rharinath@novell.com>
6838 * decl.cs (DeclSpace.FamilyAccessible):
6839 Use TypeManager.IsNestedFamilyAccessible.
6841 Fix reopened #64812.
6842 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
6845 2005-05-04 Raja R Harinath <rharinath@novell.com>
6846 Abin Thomas <projectmonokochi@rediffmail.com>
6847 Anoob V E <projectmonokochi@rediffmail.com>
6848 Harilal P R <projectmonokochi@rediffmail.com>
6851 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
6852 allow access to all static members.
6854 2005-05-04 Martin Baulig <martin@ximian.com>
6856 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
6858 2005-05-04 Martin Baulig <martin@ximian.com>
6862 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
6863 section at the end; make things work if `default' is not the last
6866 2005-05-04 Martin Baulig <martin@ximian.com>
6870 * statement.cs (Switch): Replaced the `got_default' field with a
6871 `default_section' one.
6872 (Switch.CheckSwitch): Set `default_section' here.
6873 (Switch.Resolve): If we're a constant switch and the constant is
6874 not found, use the default section.
6876 2005-05-03 Martin Baulig <martin@ximian.com>
6878 * expression.cs (ArrayAccess.EmitGetLength): New public method.
6880 * statement.cs (Foreach.ArrayForeach): New nested class.
6881 (Foreach.TemporaryVariable): New nested class.
6882 (Foreach.EmitArrayForeach): Removed; this is now in the new
6885 2005-05-03 Raja R Harinath <rharinath@novell.com>
6887 * pending.cs (BaseImplements): Move the #74773 fix here. This is
6889 (VerifyPendingMethods): Revert change below.
6891 * typemanager.cs (IsOverride, RegisterNonOverride): New.
6892 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
6893 that used to trigger warning -28. Remove warning -28.
6894 * expression.cs (Invocation.OverloadResolve): Use
6895 TypeManager.IsOverride to distinguish override methods.
6898 * pending.cs (VerifyPendingMethods): If a base type implements the
6899 requested interface, don't bother checking individual methods of
6900 the base type. As a side-effect, this prevents the creation of
6901 unnecessary proxies.
6903 2005-05-02 Martin Baulig <martin@ximian.com>
6907 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
6908 Also `And' the locals if the old vector is null.
6909 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
6910 null; in this case we basically reset all the variables.
6912 2005-05-02 Martin Baulig <martin@ximian.com>
6916 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
6917 Added `FlowBranching branching' argument; always `and' the
6918 variables instead of `or'ing them unless we're an infinite loop.
6920 * statement.cs (While.Resolve): Create a new sibling unless we're
6923 2005-05-02 Martin Baulig <martin@ximian.com>
6927 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
6928 arguments; use it instead of creating a new TopLevelBlock.
6929 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
6930 our ConstructorInitializer.
6933 (TopLevelBlock.TopLevelBranching): New public property.
6934 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
6935 and create our `TopLevelBranching'.
6937 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
6938 anonymous method host, use `block.TopLevelBranching' rather than
6939 creating a new branching.
6941 2005-04-20 Miguel de Icaza <miguel@novell.com>
6943 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
6944 a ScopeInfo, if any of the current children is a child of the new
6945 entry, move those children there.
6947 2005-04-30 Martin Baulig <martin@ximian.com>
6949 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
6950 at the beginning of a SwitchSection. Fix #73335.
6952 2005-04-27 Marek Safar <marek.safar@seznam.cz>
6955 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
6957 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
6958 (FieldExpr.DoResolve): Obsolete members are ignored for field
6961 2005-04-26 Marek Safar <marek.safar@seznam.cz>
6963 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
6964 of arrays detection.
6966 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
6968 (Field.VerifyClsCompliance): Volatile fields are not compliant.
6970 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
6973 2005-04-25 Ben Maurer <bmaurer@ximian.com>
6975 * cs-parser.jay: Use the prefered version of -unsafe in error
6978 2005-04-22 Marek Safar <marek.safar@seznam.cz>
6980 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
6983 2005-04-20 John Luke <john.luke@gmail.com>
6985 * driver.cs: fix typo in error message, --outout to --output
6987 2005-04-20 Marek Safar <marek.safar@seznam.cz>
6989 * codegen.cs (InRefOutArgumentResolving): New field.
6991 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
6992 fields outside contructor.
6994 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
6996 2005-04-19 Miguel de Icaza <miguel@novell.com>
6998 * anonymous.cs (CaptureContext.EmitParameterInstance): The
6999 parameter code was not completed ever, so it was not as up-to-date
7000 as local variables. Must finish it.
7002 The bug fix was to compare the Toplevel of the block, not the
7003 current block. Thanks for Ben for pointing this out.
7005 2005-04-19 Raja R Harinath <rharinath@novell.com>
7007 * decl.cs (AddMethods): Use the declaring type of the problem
7008 method to determine if we want to squash a warning.
7010 2005-04-19 Marek Safar <marek.safar@seznam.cz>
7012 * attribute.cs: Removed debug output.
7014 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
7016 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
7019 2005-04-18 Raja R Harinath <rharinath@novell.com>
7022 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
7023 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
7024 all null comparisons against reference types.
7026 2005-04-18 Marek Safar <marek.safar@seznam.cz>
7029 * class.cs (TypeContainer.CircularDepException) New nested
7031 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
7032 (TypeContainer.DefineType): Removed error, reset InTransit before
7034 (Class.DefineType): Throw exception when is in Transit.
7035 Catch exception and report error.
7036 (Struct.DefineType): Throw exception when is in Transit.
7037 Catch exception and report error.
7038 (Interface.DefineType): Throw exception when is in Transit.
7039 Catch exception and report error.
7041 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
7042 handle nested exception handlers.
7044 * flowanalysis.cs (InTryWithCatch): New method, search for try with
7047 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
7048 InFinally and InCatch storage.
7050 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
7051 (Catch.Resolve): Set and Restore ec.InCatch.
7052 (Try.Resolve): Set and Restore ec.InFinally.
7053 (Try.HasCatch): True when try has catch.
7055 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
7057 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
7058 for the same event member, so exclude such cases from warning 419.
7061 2005-04-16 Miguel de Icaza <miguel@novell.com>
7063 * expression.cs (Binary.ResolveOperator): Apply patch from John
7064 Luke to fix bug 59864: operators &, | and ^ on enumerations
7065 require that the same enum type on both sides.
7067 * driver.cs: Add warnings to old flag usage, this is to assist
7068 people who produce Makefiles and hope that the Makefiles will be
7071 * class.cs (TypeContainer.EmitType): Moved the definition of the
7072 special $PRIVATE$ field from the resolve phase to the Emit phase.
7073 During resolve we do not know if we are a struct with
7074 HasExplicitLayout, we know this only after the attributes for the
7077 Set the FieldOffset to zero on the dummy field that we create for
7078 the class. Fixes 74590.
7080 2005-04-16 Raja R Harinath <rharinath@novell.com>
7083 * ecore.cs (PropertyExpr.resolved): New.
7084 (DoResolve): Use it to handle a case of double resolution here.
7085 Handle a case of identical-name-and-type-name.
7086 * expression.cs (ArrayCreation.CheckIndices): Avoid double
7087 resolution by storing the results of expression resolution back
7088 into the "probes" array.
7090 2005-04-15 Raja R Harinath <rharinath@novell.com>
7092 Fix cs0208-7.cs and cs0208-8.cs.
7093 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
7094 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
7095 error reporting to point out the reason a struct is not unmanaged.
7097 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
7099 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
7100 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
7102 2005-04-13 Raja R Harinath <rharinath@novell.com>
7105 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
7106 IdenticalNameAndTypeName here.
7107 (EventExpr.InstanceResolve): Likewise.
7109 2005-04-13 Marek Safar <marek.safar@seznam.cz>
7111 C# 2.0 DefaultCharSetAttribute implementation
7113 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
7114 which allows us to set GlobalNamespace for every resolve.
7115 (Attribute.ResolveArguments): Cut from Resolve.
7116 (Attribute.GetCharSetValue): Returns CharSet named argument.
7117 (Attribute.DefinePInvokeMethod): Gets default charset from
7119 (GlobalAttribute.ResolveAsTypeStep): Override.
7120 (GlobalAttribute.ResolveArguments): Override.
7122 * class.cs (TypeAttr): Is protected.
7124 * codegen.cs (ModuleClass.DefaultCharSet): New member.
7125 (ModuleClass.DefaultCharSetType): New memeber.
7126 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
7128 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
7129 charset from module.
7131 * delegate.cs (TypeAttr): Override.
7132 (Delegate.DefineType): Use this TypeAttr.
7134 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
7135 at very early stage (before types are defined) to resolve model
7136 module attributes. It will probably not work with corlib but it
7139 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
7140 charset from module.
7142 * typemanager.cs (default_charset_type): New type.
7144 2005-04-13 Raja R Harinath <rharinath@novell.com>
7146 * decl.cs (MemberCache.AddMethods): Don't warn if
7147 System.Object.Finalize has buggy MethodAttributes.
7149 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
7152 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
7154 * doc.cs : detect ambiguous reference to overloaded members.
7155 Fixed bug #71603. MS 1.1 csc does not detect it.
7157 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
7159 * doc.cs : delegates must not be referenced with parameters.
7162 2005-04-12 Miguel de Icaza <miguel@novell.com>
7164 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
7166 2005-04-10 Miguel de Icaza <miguel@novell.com>
7168 * driver.cs (MainDriver): Stop processing if the CLS stage found
7171 (CompilerCallableEntryPoint.InvokeCompiler): Always
7172 reset after execution; Take a TextWriter argument for the
7175 * report.cs: Use the error stream instead of hardcoding stderr.
7177 2005-04-09 Miguel de Icaza <miguel@novell.com>
7179 * class.cs: Reduce code paths to test, too small of an
7180 optimization to make it worth the extra testing. Always perform
7183 2005-04-08 Raja R Harinath <rharinath@novell.com>
7186 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
7187 operators that had errors reported on them.
7189 2005-04-08 Marek Safar <marek.safar@seznam.cz>
7191 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
7193 (Attribute.Resolve): Add named argument type checking.
7195 * class.cs (FixedField.Define): Use IsPrimitiveType
7197 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
7199 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
7200 unsafe parameter types.
7202 * statement.cs (Using.ResolveExpression): Add better error description.
7204 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
7206 2005-04-08 Raja R Harinath <rharinath@novell.com>
7209 * attribute.cs (Attribute.GetAttributeUsage): Resolve
7210 AttributeUsageAttribute in the emitcontext of the attribute class,
7211 not in the emitcontext of the attributable entity it was attached to.
7212 * cs-parser.jay: Use 'current_class', not 'current_container',
7213 when creating a GlobalAttribute.
7215 2005-04-08 Alp Toker <alp@atoker.com>
7217 * pending.cs: The fix to #58413 failed to compile methods implementing
7218 interfaces with/without params modifiers and vice versa, even though
7219 params modifiers aren't part of the signature. Make the modifier check
7220 less strict as in csc.
7222 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
7223 Anoob V E <projectmonokochi@rediffmail.com>
7224 Harilal P R <projectmonokochi@rediffmail.com>
7227 * pending.cs (TypeAndMethods.mods): New. Store the parameter
7228 modifiers of pending methods.
7229 (PendingImplementation.PendingImplementation): Initialize it.
7230 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
7231 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
7232 with ParameterData. Add check for modifiers.
7233 * class.cs (MethodData.Define): Update to changes.
7235 2005-04-07 Raja R Harinath <rharinath@novell.com>
7237 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
7239 2005-04-07 Marek Safar <marek.safar@seznam.cz>
7241 * class.cs (PropertyMethod.Define): Check private accessor in abstract
7244 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
7247 * typemanager.cs: Registered RequiredAttributeAttribute.
7249 2005-04-06 Marek Safar <marek.safar@seznam.cz>
7251 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
7252 Warning CS0169 is back at level 3.
7253 (IMethodData.SetMemberIsUsed): New method.
7255 * decl.cs (IsUsed): New value; moved from FieldBase.Status
7256 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
7258 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
7260 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
7262 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
7265 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
7268 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
7269 to avoid the problems with nested types.
7271 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
7272 Anoob V.E <projectmonokochi@rediffmail.com>
7273 Harilal P.R <projectmonokochi@rediffmail.com>
7274 Raja R Harinath <rharinath@novell.com>
7277 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
7279 * typemanager (GetConstructor): Make public.
7281 2005-04-05 John Luke <john.luke@gmail.com>
7282 Raja R Harinath <rharinath@novell.com>
7285 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
7286 struct too. Return false quicker in a few cases.
7287 (VerifyUnManaged): Use it.
7289 2005-04-05 Raja R Harinath <rharinath@novell.com>
7292 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
7293 not 'unreachable_seen'.
7295 2005-04-04 Marek Safar <marek.safar@seznam.cz>
7297 * attribute.cs (Attribute.GetValue): Removed unused.
7299 * codegen.cs (CodeGen.TrimExt): Removed unused.
7301 * cs-parser.jay (output): Removed unused.
7303 * cs-tokenizer.cs (hex_digits): Removed unused.
7305 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
7307 * expression.cs (Indirection.LoadExprValue): Removed unused.
7308 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
7310 * iterators.cs (Iterator.param_types): Removed unused.
7312 * statement.cs (Goto.block): Removed unused.
7313 (ToplevelBlock.did): Removed unused.
7314 (Switch.ResolveConstantSwitch): Removed unused.
7316 2005-04-01 Ben Maurer <bmaurer@ximian.com>
7318 * rootcontext.cs: Allow mcs to bootstrap with the compilation
7321 2005-04-01 Raja R Harinath <rharinath@novell.com>
7323 Fix #74232 and cs0208-3.cs.
7324 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
7325 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
7326 unmanaged type. Don't use FieldBuilders when 't' is a
7327 TypeBuilder. Use ModFlags and MemberType fields.
7328 * class.cs (MemberBase.member_type): Rename from MemberType.
7329 (MemberBase.MemberType): New property. Determines member_type on
7331 (MemberBase.DoDefine): Don't initialize MemberType here.
7332 (FieldMember.Define): Likewise.
7334 2005-04-01 Marek Safar <marek.safar@seznam.cz>
7337 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
7338 Attributes are emitted there.
7340 2005-04-01 Raja R Harinath <rharinath@novell.com>
7342 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
7343 keyword in 'partial enum' too.
7344 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
7346 Report from Kamil Skalski <nazgul@omega.pl>.
7349 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
7350 have partial containers too.
7352 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
7353 in block' checks to Block.CheckInvariantMeaningInBlock.
7354 * statement.cs (Block.GetKnownVariableInfo): Make private.
7355 (Block.IsVariableUsedInChildBlock): Remove.
7356 (Block.IsVariableUsedInBlock): Likewise.
7357 (Block.CheckInvariantMeaningInBlock): New. Show location of
7358 conflicting declaration.
7359 (Block.AddVariable): Make error messages less long-winded and more
7360 specific. Show location of conflicting declaration.
7361 * parameter.cs (Parameters.Location): New readonly property.
7363 2005-03-31 Raja R Harinath <rharinath@novell.com>
7365 Clean up semantics of invoking ResolveMemberAccess.
7366 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
7367 can have an instance, ensure that we pass in a non-TypeExpression
7368 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
7369 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
7370 argument. Update to changes and simplify.
7371 (FieldExpr.Emitinstance): Remove CS0120 check.
7372 (PropertyExpr.EmitInstance): Likewise.
7373 * expression.cs (Argument.Resolve): Likewise.
7374 (Invocation.DoResolve): Update to changes in semantics of
7377 2005-03-31 Marek Safar <marek.safar@seznam.cz>
7380 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
7383 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
7385 2005-03-31 Raja R Harinath <rharinath@novell.com>
7387 Fix difference in behaviour with commandline invocation.
7388 * driver.cs (Driver.Reset): New.
7389 (CompilerCallableEntryPoint): Call it.
7391 * statement.cs (If.Resolve): Avoid spurious "uninitialized
7392 variable" warnings if the boolean expression failed to resolve.
7394 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
7396 * attribute.cs: Fix the union of several permissions when some of them
7397 are unrestricted (so the result isn't an unrestricted permission set).
7400 2005-03-30 Raja R Harinath <rharinath@novell.com>
7402 * ecore.cs (MemberExpr): New class. Convert from interface
7404 (MemberExpr.ResolveMemberAccess): Refactor and move here from
7405 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
7407 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
7408 (MethodGroupExpr.IsExplicitImpl): Remove.
7409 (Expression.GetFieldFromEvent): Remove.
7410 (SimpleName.MemberStaticCheck): Remove.
7411 (SimpleName.DoSimpleNameResolve): Update to changes.
7412 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
7413 (MemberAccess.IdenticalNameAndTypeName): Remove.
7414 (MemberAccess.error176): Move to MemberExpr.
7415 (MemberAccess.DoResolve): Update to changes.
7416 (BaseAccess.DoResolve): Likewise.
7418 2005-03-30 Marek Safar <marek.safar@seznam.cz>
7420 C# 2.0 Conditional attribute class implementation
7422 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
7423 Analyzes class whether it has attribute which has ConditionalAttribute
7424 and its condition is not defined.
7426 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
7427 (Class.IsExcluded): New method. Search for at least one defined
7428 condition in ConditionalAttribute of attribute class.
7430 2005-03-30 Raja R Harinath <rharinath@novell.com>
7432 * ecore.cs (PropertyExpr): Derive from Expression, not
7433 ExpressionStatement.
7434 (PropertyExpr.EmitStatement): Remove.
7436 2005-03-29 Raja R Harinath <rharinath@novell.com>
7439 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
7440 internal field "value__" of an enum be private. The examples for
7441 "value__" that I found on MSDN all used FieldAttributes.Private.
7443 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
7444 Don't mention IL method attribute names.
7446 Fix #47991. Remove a TODO.
7447 * statement.cs (Block.Toplevel): Make into a field.
7448 (Block.Parameters): Move into ToplevelBlock.
7449 (Block.known_variables): Rename from child_variable_names.
7450 (Block.Block): Remove variants that take Parameters. Initialize
7451 'Toplevel' with the immediately surrounding toplevel block.
7452 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
7453 LocalInfo parameter.
7454 (Block.GetKnownVariableInfo): New.
7455 (Block.IsVariableNameUsedInChildBlock): Update.
7456 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
7457 the block, even though it may not be in scope.
7458 (Block.AddVariable): Remove Parameters parameter. Use
7459 Toplevel.Parameters instead.
7460 (Block.AddConstant): Remove Parameters parameter.
7461 (Block.GetParameterReference): Update to use Toplevel.Parameters.
7462 (Block.IsParamaterReference): Likewise.
7463 (Block.IsLocalParameter): Likewise. Simplify a lot.
7464 (ToplevelBlock.Parameters): New. Moved from Block.
7465 (ToplevelBlock.ToplevelBlock): Update to changes. Always
7466 initialize Parameters to a non-null value.
7467 * cs-parser.jay: Update to changes.
7468 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
7469 simple names that mean different things in the same block. Use
7470 Block.IsVariableNameUsedInBlock.
7472 2005-03-28 Raja R Harinath <rharinath@novell.com>
7474 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
7475 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
7476 GetTypeHandle. It is possible for a reflected type to derive from
7477 a TypeBuilder (e.g., int[] derives from the TypeBuilder
7478 System.Array during mscorlib compilation).
7479 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
7480 contain a method_hash, don't create one either. Don't create a
7481 deep copy of the base cache's method_hash.
7482 (MemberCache.SetupCache): Rename back from DeepCopy.
7483 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
7484 already initialized. If we see an override function, add its
7485 underlying base virtual function to the member_hash too.
7487 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
7489 2005-03-26 Raja R Harinath <harinath@acm.org>
7492 * assign.cs (Assign.DoResolve): When the RHS of an assignment
7493 fails to resolve, ensure that the LHS is still resolved as an
7496 2005-03-25 Raja R Harinath <harinath@acm.org>
7498 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
7500 (Enum.current_ec): Remove.
7501 (Enum.LookupEnumValue): Remove EmitContext argument.
7502 Just uses the one created during DefineType.
7503 (Enum.FindMembers): Update.
7504 * expression.cs (MemberAccess.DoResolve): Update.
7506 2005-03-22 Marek Safar <marek.safar@seznam.cz>
7508 * assign.cs (Assign.DoResolve): Check for CS1717 when
7509 source and target are same (uses Equals).
7511 * expression.cs (LocalVariableReference, ParameterReference,
7512 This): Implemented Equals, GetHashCode.
7514 * statement.cs (Block.GetParameterReference): Removed useless
7517 2005-03-22 Raja R Harinath <rharinath@novell.com>
7520 * statement.cs (Block.AddVariable): Ensure that we skip implicit
7521 blocks before deciding whether the error is cs0136 or cs0128.
7523 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
7524 (using_alias_directive, using_namespace_directive): Pass
7525 MemberName, not an expression to Namespace.UsingAlias and
7527 (MakeName): Use the MemberName of the namespace.
7528 * namespace.cs (Namespace.MemberName): New.
7529 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
7530 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
7532 * decl.cs (MemberName.Name): Make readonly.
7533 (MemberName.FromDotted): New "constructor".
7534 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
7535 (MemberCore.Name): Compute from MemberName on demand.
7536 (MemberCore.SetMemberName): Provide a way to change the
7538 (MemberCore.AddToContainer): Don't take a fullname parameter.
7539 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
7540 fully qualified name of the container to the member name.
7541 (TypeContainer.AddToTypeContainer): Use a fully qualified name
7542 only if the type is a member of the root container.
7543 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
7544 MemberName.Left rather than searching for an embedded ".".
7545 (PartialContainer.CreatePart): Update to changes in RootContext.
7546 (MemberBase.ShortName): Turn into a property. Use
7547 MemberCore.SetMemberName.
7548 (MemberBase.ExplicitInterfaceName): Remove.
7549 (MemberBase.UpdateMemberName): Remove.
7550 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
7551 (PropertyBase.SetMemberName): New override.
7552 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
7553 (Tree.GetDecl): New.
7554 (Tree.AllDecls): Rename from Decls.
7555 * attribute.cs, enum.cs, report.cs: Update to changes.
7556 * driver.cs (MainDriver): Use MemberName.FromDotted on
7557 RootContext.MainClass.
7559 2005-03-21 Marek Safar <marek.safar@seznam.cz>
7561 * class.cs (FixedField.Define): Check for CS1664 and more sanity
7564 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
7566 2005-03-18 Marek Safar <marek.safar@seznam.cz>
7568 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
7569 property accessor modifiers.
7571 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
7572 fixed buffer attribute (CS1716).
7573 (PropertyMethod.HasCustomAccessModifier): When property accessor
7574 has custom modifier.
7576 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
7578 (PropertyExpr.DoResolveLValue): Add CS0272.
7580 2005-03-17 Miguel de Icaza <miguel@novell.com>
7582 * convert.cs: When converting to a pointer, use the proper Conv.U
7583 or Conv.I depending on the source data type.
7585 * cs-tokenizer.cs: Make the size for large decimal constants,
7588 2005-03-17 Martin Baulig <martin@ximian.com>
7590 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
7591 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
7593 2005-03-17 Martin Baulig <martin@ximian.com>
7595 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
7596 to bool so we can return an error condition.
7597 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
7600 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
7602 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
7605 2005-03-16 Raja R Harinath <rharinath@novell.com>
7607 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
7608 Refactor to avoid traversing the list of assemblies, and to avoid
7609 string concatenation.
7610 * typemanager.cs (guid_attr_type): Remove.
7611 (negative_hits, pointers, references): Remove hashes.
7613 (GetConstructedType): New. Uses type_hash to handle constructed
7614 types (arrays, references, pointers).
7615 (GetReferenceType, GetPointerType): Use it.
7616 (GetNestedType): New. Uses type_hash to handle nested types of
7618 (LookupType, LookupTypeDirect): Remove.
7619 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
7620 'types' hash and LookupTypeReflection directly.
7621 (params_string, params_object): Use GetConstructedType.
7622 * namespace.cs (Namespace.cached_types): New. Cache of reflected
7624 (Namespace.Lookup): Use cached_types.
7625 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
7626 provided by old TypeManager.LookupType.
7627 * rootcontext.cs (MakeFQN): Remove.
7628 * decl.cs (DeclSpace.MakeFQN): Likewise.
7629 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
7630 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
7631 TypeManager.GetConstructedType.
7632 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
7634 2005-03-15 Marek Safar <marek.safar@seznam.cz>
7636 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
7639 * cs-parser.jay: Reports CS1527 for any namespace element.
7641 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
7644 * expression.cs (ParameterReference.IsAssigned): Changed error to
7646 (Error_WrongNumArguments): Moved CS0245 detection here.
7648 * statement.cs (Return.Resolve): Add CS1622 report.
7650 2005-03-11 Marek Safar <marek.safar@seznam.cz>
7652 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
7654 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
7656 * attribute.cs expression.cs: Get rid of some allocations.
7658 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
7660 * doc.cs : just eliminate the latest change.
7662 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
7664 * doc.cs : commented out the latest change. It breaks xml-030.cs
7666 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
7668 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
7669 fail. So invoke CreateType() in FindDocumentedType().
7671 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
7673 * cs-tokenizer.cs : added IsKeyword().
7674 * doc.cs : Detect keyword incorrectly used as identifier.
7675 Allow identifiers prefixed by @.
7677 2005-03-10 Marek Safar <marek.safar@seznam.cz>
7679 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
7680 It caused exception in namespace resolving (again!).
7682 * class.cs (Class.ctor): Removed exit.
7683 (PropertyMethod.ctor): ditto.
7685 * codegen.cs (Codegen.Reset): Reset static data.
7686 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
7688 * cs-tokenizer.cs (Cleanup): Removed.
7690 * driver.cs (GetSystemDir): Rewrote to one line command.
7691 It caused problem with unloaded dynamic modules.
7692 (UnixParseOption): Removed Exit.
7693 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
7694 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
7695 Now can be mcs used as library.
7697 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
7700 * location.cs (Reset): Reset static data.
7702 * namespace.cs (Reset): Reset static data.
7704 * report.cs (Report.Reset): Reset static data.
7706 * rootcontext.cs (RootContext.Reset): Reset static data.
7708 * tree.cs (RootTypes.ctor): Use Location.Null
7710 * typemanager.cs (TypeManager.Reset): Reset static data.
7711 (CoreLookupType): Removed Exit.
7712 (TypeHandle.Reset): Reset static data.
7714 2005-03-10 Raja R Harinath <rharinath@novell.com>
7717 * typemanager.cs (ComputeNamespaces): Import namespaces from
7718 referenced modules too.
7720 2005-03-09 Raja R Harinath <rharinath@novell.com>
7722 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
7725 2005-03-09 Raja R Harinath <rharinath@novell.com>
7727 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
7728 enclosing DeclSpace. This ensures that a name-lookup populates
7729 more caches and there are fewer 'TypeExpression's. Carve out
7730 nested type lookup into ...
7731 (LookupNestedTypeInHierarchy): ... this.
7733 2005-03-09 Raja R Harinath <rharinath@novell.com>
7735 Clean up a few partial-class semantics.
7736 Fixes test-357.cs and cs1618-2.cs.
7737 * cs-parser.jay (struct_declaration): Use 'current_class' as
7738 parent of newly-created struct. Remove call to Register ().
7739 Use 'pop_current_class' to complete handing the current struct.
7740 (interface_declaration): Likewise.
7741 (class_declaration): Likewise.
7742 (enum_declaration): Use 'current_class' as parent of newly created
7744 (delegate_declaration): Likewise.
7745 (pop_current_class): New function. This is used to handle closing
7746 up the 'current_class' and 'current_container', and pointing them
7747 to the enclosing class/container.
7748 (CSharpParser): Initialize 'current_class' too.
7749 * decl.cs (MemberCore): Add check for invariant: a partial
7750 container is not a parsed entity, and thus does not enclose any
7752 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
7753 (DeclSpace.BaseTypeExpr): Use it.
7754 (DeclSpace.LookupType): Add check for invariant.
7755 * class.cs (TypeContainer): Add check for invariant: a nested
7756 class should have the same NamespaceEntry as its enclosing class.
7757 (TypeContainer.EmitFieldInitializers): Make virtual.
7758 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
7760 (TypeContainer.Register): Remove.
7761 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
7762 null. Use TypeResolveEmitContext for resolving base types and
7763 interfaces. Move initialization of Parts.TypeBuilder here from
7765 (TypeContainer.DefineNestedTypes): ... here.
7766 (PartialContainer): Take a Namespace not a NamespaceEntry.
7767 (PartialContainer.Create): Don't use Register. Call the
7768 appropriate Add... function directly.
7769 (ClassPart): Take both the PartialContainer and the enclosing
7770 class as constructor arguments.
7771 (ClassPart.EmitFieldInitializers): Override.
7772 (ClassPart.PartFindNestedTypes): Remove.
7773 (FieldBase.GetInitializerExpression): Resolve the initializer
7774 expression in the emit context of the enclosing class.
7775 * tree.cs (RootTypes): Remove Register ().
7777 2005-03-08 Marek Safar <marek.safar@seznam.cz>
7779 * cs-parser.jay: Removed CS0134.
7781 * driver.cs: Removed CS1901.
7783 * expression.cs (SizeOf.DoResolve): Don't report CS0233
7784 for predefined types.
7786 2005-03-07 Duncan Mak <duncan@novell.com>
7788 * codegen.cs (Save): Catch UnauthorizedAccessException as
7789 well. Fixes bug #73454.
7791 2005-03-07 Marek Safar <marek.safar@seznam.cz>
7793 * cs-tokenizer.cs (xtoken): Add CS1035.
7795 * class.cs (MethodData.Define): Add CS0683.
7796 (FieldMember.ctor): Add CS0681.
7798 2005-03-07 Raja R Harinath <rharinath@novell.com>
7800 * ecore.cs (SimpleName.DoResolve): Rename from
7801 SimpleName.DoResolveAllowStatic.
7802 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
7803 Pass 'intermediate' flag to MemberStaticCheck.
7804 (SimpleName.MemberStaticCheck): Skip "static check" only in case
7805 of "intermediate" lookups via MemberAccess.
7806 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
7807 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
7809 2005-03-07 Raja R Harinath <rharinath@novell.com>
7812 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
7813 slipped in because of variable names that are identical to a
7814 builtin type's BCL equivalent ('string String;', 'int Int32;').
7815 (PropertyExpr.EmitInstance): Likewise.
7817 2005-03-04 Marek Safar <marek.safar@seznam.cz>
7819 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
7821 * report.cs (warning_ignore_table): Made public.
7823 2005-03-04 Raja R Harinath <rharinath@novell.com>
7826 * class.cs (MethodData.Emit): Pass 'container' to
7827 container.GetObsoleteAttribute instead of 'container.Parent'.
7829 2005-03-03 Marek Safar <marek.safar@seznam.cz>
7831 * cs-parser.jay: Add 1534 error test.
7833 * iterators.cs (Yield.CheckContext): Add error 1629.
7834 (Iterator.ctor): Save unsafe modifier.
7835 (MoveNextMethod.DoEmit): Restore unsafe context.
7837 * namespace.cs (UsingAlias): Better error message.
7839 2005-03-03 Dan Winship <danw@novell.com>
7841 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
7842 the warning message [#73219]
7844 2005-03-03 Raja R Harinath <rharinath@novell.com>
7846 Fix compile with MCS 1.0.0.0.
7847 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
7848 w_restore to not depend on string constant folding.
7850 2005-03-03 Raja R Harinath <rharinath@novell.com>
7852 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
7853 CS0246 check to users who passed 'silent = false'.
7854 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
7856 (SimpleName.SimpleNameResolve): Update.
7857 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
7858 (MemberAccess.IdenticalNameAndTypeName): Update.
7859 * doc.cs (FindDocumentedTypeNonArray): Update.
7861 2005-03-03 Raja R Harinath <rharinath@novell.com>
7863 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
7864 * parameters.cs (ComputeAndDefineParameters): Remove.
7865 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
7866 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
7867 Use GetParameterInfo.
7869 2005-03-02 Marek Safar <marek.safar@seznam.cz>
7871 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
7873 2005-03-02 Raja R Harinath <rharinath@novell.com>
7875 Unify DeclSpace.LookupType and DeclSpace.FindType.
7876 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
7877 is in charge of defining nested types on demand.
7878 (DeclSpace.LookupType): Use it when the current_type is a
7879 TypeBuilder. Use LookupTypeDirect for reflected types.
7880 (DeclSpace.FindType): Remove.
7881 (DeclSpace.LookupInterfaceOrClass): Likewise.
7882 (DeclSpace.DefineTypeAndParents): Likewise.
7883 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
7884 DeclSpace.LookupType.
7885 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
7886 * typemanager.cs (LookupType): Simplify.
7887 (AddUserType): Remove type from negative_hits.
7888 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
7889 * class.cs (TypeContainer.FindMembers): Move handling of nested
7891 (TypeContainer.FindMembers_NestedTypes): ... here.
7892 (TypeContainer.FindNestedType): Implement override.
7893 (ClassPart.FindNestedType): Delegate to PartialContainer.
7894 (ClassPart.PartFindNestedType): Looks up the nested types of the
7897 2005-03-02 Martin Baulig <martin@ximian.com>
7899 * class.cs (TypeContainer.DoDefineMembers): We also need a default
7900 static constructor in static classes.
7902 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
7904 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
7905 sizeParamIndex is not specified.
7907 2005-03-01 Marek Safar <marek.safar@seznam.cz>
7910 * report.cs (WarningMessage.IsEnabled): Missing null check.
7912 2005-02-28 Marek Safar <marek.safar@seznam.cz>
7914 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
7915 in the fields and not in the properties.
7917 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
7919 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
7922 2005-02-28 Marek Safar <marek.safar@seznam.cz>
7924 * attribute.cs: Small refactoring (improved robustness).
7925 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
7926 (ValidateGuid): Removed.
7927 (Resolve): Removed referenced to above mentioned.
7928 (GetAttributeUsage): Made private and changed to work without
7930 (GetIndexerAttributeValue): Don't crash.
7931 (GetConditionalAttributeValue): Ditto.
7932 (GetClsCompliantAttributeValue): Ditto.
7933 (ExtractSecurityPermissionSet): All attributes exceptions are
7935 (GetPropertyValue): New helper.
7936 (GetMethodImplOptions): New method.
7937 (DefinePInvokeMethod): Reuse common code. Implemented handling of
7938 some missing properties.
7940 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
7941 (Method.ApplyAttributeBuilder): Updated.
7943 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
7946 2005-02-28 Raja R Harinath <rharinath@novell.com>
7949 * report.cs (Report.SymbolRelatedToPreviousError): Handle
7950 non-simple types (array, pointer, reference).
7952 2005-02-28 Marek Safar <marek.safar@seznam.cz>
7954 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
7956 * class.cs (MethodCore.IsDuplicateImplementation): Special error
7958 (Method.CheckBase): Catch wrong destructor here.
7959 (MethodData.Define): Add errors 550, 668.
7961 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
7963 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
7965 * pending.cs (VerifyPendingMethods): Add error 551.
7967 * typemanager.cs (CSharpName): Next error report helper.
7969 2005-02-25 Marek Safar <marek.safar@seznam.cz>
7971 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
7972 attributes. Removed useless attribute double check.
7973 It saves almost 2MBs for corlib.
7975 2005-02-25 Raja R Harinath <rharinath@novell.com>
7978 * statement.cs (ExpressionStatement.Resolve): Make robust to being
7979 called twice in case of error.
7981 2005-02-23 Chris Toshok <toshok@ximian.com>
7983 Fix compiler portions of #72827.
7984 * statement.cs (Block.Emit): call Begin/EndScope on the
7985 EmitContext instead of the ILGenerator.
7987 * codegen.cs (EmitContext.BeginScope): new method, call
7988 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
7990 (EmitContext.BeginScope): same, but EndScope and CloseScope
7992 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
7993 offset and call the superclass's OpenScope(int) with it.
7994 (SymbolWriter.CloseScope): get the current il
7995 offset and call superclass's CloseScope(int) with it.
7997 2005-02-23 Marek Safar <marek.safar@seznam.cz>
7999 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
8000 CS1677 for out and ref as well.
8002 * class.cs (Method.Define): Add error CS1599 detection.
8004 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
8006 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
8008 * delegate.cs (Delegate.Define): Add error CS1599 detection.
8010 * support.cs.cs (ModifierDesc): New helper method.
8012 2005-02-23 Raja R Harinath <rharinath@novell.com>
8013 Abin Thomas <projectmonokochi@rediffmail.com>
8014 Anoob V E <projectmonokochi@rediffmail.com>
8015 Harilal P R <projectmonokochi@rediffmail.com>
8018 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
8019 MemberLookup (used for error reporting) actually returns a result.
8020 Fix error report number (122, not 112).
8022 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
8023 Anoob V E <projectmonokochi@rediffmail.com>
8024 Harilal P R <projectmonokochi@rediffmail.com>
8027 * pending.cs (PendingImplementation.GetAbstractMethods):
8028 Find NonPublic members too.
8030 2005-02-22 Marek Safar <marek.safar@seznam.cz>
8032 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
8035 * class.cs (MethodCore.CheckMethodAgainstBase):
8036 Add error 239 report.
8038 2005-02-21 Raja R Harinath <rharinath@novell.com>
8041 * expression.cs (Invocation.IsApplicable): Make public.
8042 (Invocation.IsParamsMethodApplicable): Likewise.
8043 * delegate.cs (Delegate.VerifyApplicability): Don't use
8044 Invocation.VerifyArgumentCompat for parameter applicability
8045 testing. Use Invocation.IsApplicable and
8046 Invocation.IsParamsMethodApplicable.
8048 2005-02-21 Marek Safar <marek.safar@seznam.cz>
8050 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
8052 * class.cs (Operator.Define): Add error 217 report.
8054 2005-02-21 Raja R Harinath <rharinath@novell.com>
8056 * namespace.cs (UsingEntry.Resolve): Undo change below.
8058 2005-02-21 Raja R Harinath <rharinath@novell.com>
8061 * ecore.cs (Expression.MemberLookupFailed): Add argument to
8062 disable the error message when the extended MemberLookup also
8064 (Expression.MemberLookupFinal): Update.
8065 (SimpleName.DoSimpleNameResolve): Update.
8066 * expression.cs (MemberAccess.ResolveNamespaceOrType):
8067 Don't use MemberLookupFinal.
8068 (New.DoResolve): Update.
8069 (BaseAccess.CommonResolve): Update.
8071 2005-02-21 Raja R Harinath <rharinath@novell.com>
8074 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
8075 occured previously, don't resolve again.
8077 2005-02-21 Marek Safar <marek.safar@seznam.cz>
8080 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
8081 argument. Call ResolveAttributeUsage for unresolved.
8082 when types doesn't match ctor arguments.
8084 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
8085 for nested attribute classes.
8086 (Class.attribute_usage): Removed.
8087 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
8088 for attribute class.
8090 * ecore.cs (IsAttribute): Removed.
8092 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
8094 * rootcontext.cs (RegisterAttribute): Removed, attributes are
8096 (attribute_types): Removed.
8097 (EmitCode): Global attributes are emited as the latest.
8099 2005-02-18 Marek Safar <marek.safar@seznam.cz>
8101 * class.cs (EmitFieldInitializers): Don't emit field initializer
8102 for default values when optimilization is on.
8104 * constant.cs (Constant.IsDefaultValue): New property.
8106 * driver.cs: Add /optimize handling.
8110 * literal.cs: Implement new IsDefaultValue property.
8112 * rootcontext.cs (Optimize): New field, holds /optimize option.
8114 2005-02-18 Raja R Harinath <rharinath@novell.com>
8116 Fix crasher in re-opened #72347.
8117 * namespace.cs (Namespace.Lookup): Return null if
8118 DeclSpace.DefineType returns null.
8121 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
8123 2005-02-18 Raja R Harinath <rharinath@novell.com>
8125 Fix remainder of #63202. Change semantics of DoResolveLValue: it
8126 now returns null if it cannot resolve to an lvalue.
8127 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
8128 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
8129 returned null. Remove check for SimpleName.
8130 (EventExpr.DoResolveLValue): New.
8131 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
8132 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
8134 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
8136 (Unary.ResolveOperator): Move CS0211 check ...
8137 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
8139 (Unary.DoResolveLValue): Simplify.
8140 (AddressOf.DoResolveLValue): New.
8141 (ArrayAccess.DoResolveLValue): New.
8143 2005-02-16 Marek Safar <marek.safar@seznam.cz>
8145 * attribute.cs (Attribute.Resolve): Add arguments casting for
8146 when types doesn't match ctor arguments.
8148 2005-02-16 Raja R Harinath <rharinath@novell.com>
8150 Fix parts of #63202.
8151 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
8152 lookup of operator in base type. Ensure that all checks happen
8153 when the operator resolves to an "op_..." method.
8155 2005-02-15 Raja R Harinath <rharinath@novell.com>
8158 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
8159 'ignore_cs0104' parameter. Pass it to ...
8160 (NamespaceEntry.Lookup): ... this.
8161 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
8162 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
8163 (TypeLookupExpression.DoResolveAsTypeStep): Update.
8164 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
8165 Update. Request that cs0104 errors be ignored.
8166 (ComposedCast.ResolveAsTypeStep): Update.
8168 2005-02-14 Raja R Harinath <rharinath@novell.com>
8171 * expression.cs (Invocation.BetterFunction): Remove support for
8172 comparing virtual functions and their overrides.
8173 (Invocation.IsOverride): New.
8174 (Invocation.OverloadResolve): Don't consider 'override' functions
8175 during candidate selection. Store them in a lookaside list.
8176 If the selected method is a 'virtual' function, use the list to
8177 find any overrides that are closer to the LHS type.
8179 2005-02-14 Marek Safar <marek.safar@seznam.cz>
8181 * expression.cs (New.DoResolve): Add complex core type reduction.
8182 (New.Constantify): Converts complex core type syntax like 'new int ()'
8185 2005-02-14 Raja R Harinath <rharinath@novell.com>
8187 * decl.cs (EntryType.EntryType): New constructor to create an
8188 updated copy of a cache entry.
8189 (MemberCache.AddMethods): Use it.
8190 (MemberCache.ClearDeclaredOnly): Remove.
8191 (MemberCache.MemberCache): Update.
8193 2005-02-11 Miguel de Icaza <miguel@novell.com>
8195 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
8196 variable. This one is represents the actual low-level declaration
8197 of the method, as opposed to the semantic level `IsStatic'.
8199 An anonymous method which is hosted into a static method might be
8200 actually an instance method. IsStatic would reflect the
8201 container, while MethodIsStatic represents the actual code
8204 * expression.cs (ParameterReference): Use the new MethodIsStatic
8205 instead of IsStatic.
8207 * anonymous.cs (AnonymousMethod.Compatible): Pass the
8208 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
8209 set on the current EmitContext.
8211 * expression.cs (Cast): Overload DoResolveLValue so we can pass
8212 resolve our casted expression as an LValue. This triggers the
8213 proper LValue processing that is later required by Assign.
8217 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
8219 2005-02-11 Marek Safar <marek.safar@seznam.cz>
8221 C# 2.0 Fixed buffer implementation
8223 * anonymous.cs: Update after RegisterHelperClass renaming.
8225 * attribute.cs (AttributeTester.fixed_buffer_cache):
8226 Cache of external fixed buffers.
8227 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
8228 implementation if field is fixed buffer else null.
8231 (TypeContainer.AddField): Accept FieldMember instead of Field.
8232 (FieldBase.IsFieldClsCompliant): Extracted code from
8233 VerifyClsCompliance descendant customization.
8234 (FixedField): New class handles fixed buffer fields.
8235 (FixedFieldExternal): Keeps information about imported fixed
8237 (IFixedField): Make access to internal or external fixed buffer
8240 * cs-parser.jay: Add fixed buffer parsing.
8242 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
8245 * expression.cs (Indirection): Extended implementation to accept
8247 (PointerArithmetic.Emit): Get element from fixed buffer as well.
8248 (ElementAccess.MakePointerAccess): Get type as parameter.
8249 (DoResolve): Add fixed buffer field expression conversion.
8250 (DoResolveLValue): Ditto.
8251 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
8252 (ArrayPtr): Derives from FixedBufferPtr.
8253 (ArrayPtr.Emit): Add extra emit for array elements.
8255 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
8257 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
8258 for compiler generated types.
8259 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
8261 * statement.cs (Fixed): Refactored to be easier add fixed buffer
8262 and consume less memory.
8263 (Fixed.Resolve): Add fixed buffer case.
8265 * typemanager.cs (compiler_generated_attr_ctor,
8266 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
8267 (HasElementType): Add our own implementation to work on every
8270 2005-02-11 Miguel de Icaza <miguel@novell.com>
8272 * anonymous.cs (CaptureContext): Track whether `this' has been
8275 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
8276 only captured `this' if it was implicitly done (instance
8277 methods/variables were used).
8279 * codegen.cs (EmitContext.CaptureThis): New method to flag that
8280 `this' must be captured.
8282 2005-01-30 Miguel de Icaza <miguel@novell.com>
8284 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
8285 is null it means that there has been no need to capture anything,
8286 so we just create a sibling.
8288 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
8290 Just a partial fix. The other half is fairly elusive.
8292 2005-02-10 Raja R Harinath <rharinath@novell.com>
8294 Fix #52586, cs0121-4.cs.
8295 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
8296 and return a hashtable.
8297 (MemberCache.ClearDeclaredOnly): New.
8298 (MemberCache.MemberCache): Update to change. Make a deep copy of
8299 the method_hash of a base type too.
8300 (MemberCache.AddMethods): Adapt to having a deep copy of the base
8301 type methods. Overwrite entries with the same MethodHandle so
8302 that the ReflectedType is correct. The process leaves in base
8303 virtual functions and their overrides as distinct entries.
8304 (CacheEntry): Now a class instead of a struct. It shouldn't alter
8305 matters since it was boxed in a ArrayList before.
8306 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
8308 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
8309 case of a virtual function and its override (choose the overload
8311 (Invocation.OverloadResolve): Avoid 'override' members during
8312 'applicable_type' calculation.
8314 2005-02-09 Raja R Harinath <rharinath@novell.com>
8316 Combine two near-redundant caches.
8317 * typemanager.cs (method_params): Rename from method_internal_params.
8318 (TypeManager.GetParameterData): New. Replace
8319 Invocation.GetParameterData.
8320 (TypeManager.LookupParametersByBuilder): Remove.
8321 * expression.cs (Invocation.method_parameter_cache): Remove.
8322 (Invocation.GetParameterData): Remove.
8324 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
8327 2005-02-08 Raja R Harinath <rharinath@novell.com>
8330 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
8331 TypeManager.multicast_delegate_type is null, resolve it by looking
8332 up "System.MulticastDelegate".
8333 * rootcontext.cs (RootContext.ResolveCore): Simplify.
8335 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
8336 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
8337 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
8340 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
8341 (LabeledStatement.AddReference): New. Set 'referenced'.
8342 (Goto.Resolve): Use it.
8344 2005-02-05 John Luke <john.luke@gmail.com>
8346 * driver.cs: remove duplicate -doc line in Usage ()
8348 2005-02-04 Raja R Harinath <rharinath@novell.com>
8350 * location.cs (Location.AddFile): Fix CS2002 error report.
8352 2005-02-02 Martin Baulig <martin@ximian.com>
8354 * delegate.cs (Delegate.DefineType): Report an internal error if
8355 TypeManager.multicast_delegate_type is null. See bug #72015 for
8358 2005-02-02 Raja R Harinath <rharinath@novell.com>
8360 Fix a crasher in a variant of #31984.
8361 * const.cs (Constant.CheckBase): New override that defers the
8362 new-or-override check in case the base type hasn't been populated
8364 (Constant.Define): Ensure the new-or-override check is performed.
8366 2005-02-01 Duncan Mak <duncan@ximian.com>
8368 * const.cs (LookupConstantValue): Check that `ce' is not null
8369 before calling GetValue ().
8371 2005-02-01 Raja R Harinath <rharinath@novell.com>
8373 Fix test-334.cs (#69519).
8374 * cs-parser.jay (using_alias_directive): Pass in an expression to
8375 NamespaceEntry.UsingAlias.
8376 (using_namespace_directive): Pass in an expression to
8377 NamespaceEntry.Using.
8378 (namespace_name): Don't flatten to a string.
8379 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
8380 (NamespaceEntry.AliasEntry.Resolve): Lookup using
8382 (NamespaceEntry.UsingEntry): Likewise.
8383 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
8385 (NamespaceEntry.LookupForUsing): Remove.
8386 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
8388 (NamespaceEntry.Lookup): Remove support for dotted names.
8390 2005-02-01 Raja R Harinath <rharinath@novell.com>
8392 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
8394 (NamespaceEntry.ImplicitParent): Compute on demand.
8395 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
8396 parallels the current.
8397 (NamespaceEntry.LookupForUsing): Use it.
8398 (NamespaceEntry.Lookup): If the current namespace-entry is
8399 implicit, don't search aliases and using tables.
8401 2005-02-01 Raja R Harinath <rharinath@novell.com>
8404 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
8406 (TypeContainer.BaseCache): Compute on demand.
8407 (TypeContainer.FindMembers): Define constants and types if they're
8408 not already created.
8409 (FieldMember.Define): Move resetting of ec.InUnsafe before error
8411 * const.cs (Constant.Define): Make idempotent.
8413 2005-01-29 Miguel de Icaza <miguel@novell.com>
8415 * pending.cs: Produce better code (no nops produced by using Ldarg
8418 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
8419 i - 1' it should be arg + 1.
8423 2005-01-28 Raja R Harinath <rharinath@novell.com>
8425 * attribute.cs (Attribute.CheckAttributeType): Make private
8427 (Attribute.ResolveType): Make virtual.
8428 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
8429 handling of RootContext.Tree.Types.
8431 2005-01-27 Raja R Harinath <rharinath@novell.com>
8433 Update attribute-handling to use the SimpleName/MemberAccess
8435 * cs-parser.jay (attribute): Pass in an expression to the
8436 constructors of Attribute and GlobalAttribute.
8437 * attribute.cs (Attribute): Take an expression for the name.
8438 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
8439 passed in attribute name expression.
8440 (Attribute.CheckAttributeType): Use it.
8441 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
8442 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
8443 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
8444 argument to prevent error messages if the lookup fails.
8446 2005-01-27 Marek Safar <marek.safar@seznam.cz>
8448 * expression.cs (Indirection): Implemented IVariable interface
8449 to support indirection in AddressOf operator.
8450 (PointerArithmetic.Emit): Add optimalization for case where
8451 result can be precomputed.
8453 2005-01-26 Martin Baulig <martin@ximian.com>
8455 * class.cs (TypeContainer.AttributeTargets): Return the correct
8456 AttributeTargets depending on our `Kind' instead of throwing an
8457 exception; fixes #71632.
8459 2005-01-26 Marek Safar <marek.safar@seznam.cz>
8462 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
8465 2005-01-25 Raja R Harinath <rharinath@novell.com>
8468 * expression.cs (MemberAccess.DoResolve): Don't complain with
8469 cs0572 when the LHS of a member access has identical name and type
8472 2005-01-25 Marek Safar <marek.safar@seznam.cz>
8475 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
8477 Create custom PermissionSet only for PermissionSetAttribute.
8479 2005-01-24 Marek Safar <marek.safar@seznam.cz>
8482 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
8483 delegates in static class.
8485 2005-01-24 Martin Baulig <martin@ximian.com>
8487 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8488 merging an implicit block, just use its reachability.
8490 * statement.cs (Block.Resolve): Make the unreachable code check
8491 work wrt. implicit blocks; see test-337 from #63842.
8493 2005-01-21 Alp Toker <alp@atoker.com>
8495 * cs-parser.jay: destructor_declaration's container is PartialContainer
8496 not Class when partial types are used, so use Kind prop instead of
8499 2005-01-22 Miguel de Icaza <miguel@ximian.com>
8501 * cs-parser.jay: Improve error reporting when an interface
8504 2005-01-20 Dick Porter <dick@ximian.com>
8506 * support.cs: SeekableStreamReader fix from Sandor Dobos
8507 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
8508 chars are read. Fixes bug 70369.
8510 2005-01-20 Raja R Harinath <rharinath@novell.com>
8512 * cs-parser.jay (catch_clause): Simplify current_block handling
8515 2005-01-17 Miguel de Icaza <miguel@ximian.com>
8517 * convert.cs (ImplicitStandardConversionExists): Synchronize the
8518 code with ImplicitStandardConversion to handle the implicit
8519 conversion of method groups into valid delegate invocations.
8521 The problem is that in parameter handling we were using this code
8522 path. Fixes bug #64698
8524 2005-01-19 Raja R Harinath <rharinath@novell.com>
8526 * cs-parser.jay: Fix several infelicities.
8527 - Avoid assigning to the parser value stack. Code like
8528 '$3 = null' is unclean. Synthesize a value for the code block
8530 - Avoid using oob_stack for storing location information. Use ...
8531 (_mark_): ... this. New (empty) rule. Saves the current location
8533 (foreach_statement): Avoid using oob_stack for current_block
8534 handling. Use technique used in for_statement and
8535 using_statement. Synthesize a value for the code block to store
8536 additional intermediate information.
8538 2005-01-13 Miguel de Icaza <miguel@ximian.com>
8540 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
8541 of a different type is only allowed to private fields of a
8542 containing type, not on fields of a base class.
8544 See test-174.cs and error cs0122-9.cs
8546 2005-01-13 Raja R Harinath <rharinath@novell.com>
8548 Fix test-335.cs (bug #58126).
8549 * cs-parser.jay (argument): Split out non-expression parts of the
8550 rule into 'non_simple_argument'.
8551 (invocation_expression): Support parenthesized invocations with
8552 multiple arguments, and with single non-simple arguments.
8554 2005-01-13 Raja R Harinath <rharinath@novell.com>
8556 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
8559 2005-01-12 Raja R Harinath <rharinath@novell.com>
8561 Fix cs0038-1.cs, cs1640-6.cs.
8562 * ecore.cs (Expression.Resolve): Remove special-case for
8563 SimpleName in error-handling.
8564 (Expression.almostMatchedMembers): Relax access permission to
8566 (Expression.MemberLookupFailed): Handle duplicates in
8567 almostMatchedMembers list.
8568 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
8569 * expression.cs (New.DoResolve): Report CS1540 for more cases.
8570 * typemanager.cs (GetFullNameSignature): Use the MethodBase
8571 overload if the passed in MemberInfo is a MethodBase.
8573 2005-01-12 Marek Safar <marek.safar@seznam.cz>
8576 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
8577 for non-CAS & merge permission sets properly.
8579 2005-01-11 Raja R Harinath <rharinath@novell.com>
8581 Improve standard-compliance of simple name and member access
8582 resolution. Fixes bugs #52697, #57200, #67520, #69519.
8583 * ecore.cs (FullNamedExpression): New abstract base class
8584 for Namespaces and TypeExpressions.
8585 (ResolveFlags.SimpleName): Remove.
8586 (SimpleName): Remove support for dotted names.
8587 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
8588 DeclSpace.FindType and DeclSpace.LookupType.
8589 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
8590 (Expression.ExprClassName): Make member function.
8591 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
8592 a namespace. Remove creation of dotted "SimpleName"s.
8593 (MemberAccess.DoResolve): Likewise.
8594 * decl.cs (DeclSpace.Cache): Make private.
8595 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
8596 (DeclSpace.FindType): Update.
8597 (DeclSpace.LookupType): Move here from RootContext. Return a
8598 FullNamedExpression.
8599 * namespace.cs (Namespace): Derive from FullNamedExpression
8600 so that it can be part of expression resolution.
8601 (Namespace.Lookup): Return an FullNamedExpression.
8602 (NamespaceEntry.LookupAlias): Lookup aliases only in current
8604 * rootcontext.cs (NamespaceLookup): Remove.
8605 (LookupType): Move to DeclSpace.
8606 * attribute.cs (CheckAttributeType): Update.
8607 * doc.cs (FindDocumentedType): Remove allowAlias argument.
8608 (FindDocumentedTypeNonArray): Likewise.
8610 2005-01-11 Raja R Harinath <rharinath@novell.com>
8612 Fix cs0509.cs, cs1632.cs.
8613 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
8614 is the same as IsInterface.
8615 (TypeContainer.GetClassBases): Likewise.
8616 * statement.cs (LabeledStatement.ig): New field.
8617 (LabeledStatement.LabelTarget): Save ILGenerator which created the
8619 (LabeledStatement.DoEmit): Check that the label was created with
8620 the same ILGenerator.
8622 2005-01-10 Marek Safar <marek.safar@seznam.cz>
8625 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
8626 accessors to its properties.
8628 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
8629 from accessors to property.
8631 2005-01-10 Marek Safar <marek.safar@seznam.cz>
8634 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
8637 2005-01-08 Miguel de Icaza <miguel@ximian.com>
8639 * attribute.cs: Check for null and empty strings.
8641 I have lost another battle to Paolo.
8643 2005-01-07 Marek Safar <marek.safar@seznam.cz>
8646 * class.cs (PropertyMethod): Set Parent field in ctors.
8647 (SetMethod.InternalParameters): Add unsafe switch hack.
8648 Override MarkForDuplicationCheck where it is appropriate.
8650 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
8651 It says whether container allows members with the same name.
8653 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
8654 Removed is_method parameter.
8656 2005-01-06 Duncan Mak <duncan@ximian.com>
8658 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
8659 because the previous change led to incorrect reporting of CS1032
8660 ("Cannot define/undefine preprocessor symbols after first token in
8661 file"). Instead of using `tokens_seen' as the only flag that
8662 triggers CS1040, introduce `comments_seen'. This new flag is used
8663 to signify having seen comments on the current line, so it is
8664 unset after a newline.
8666 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
8668 * doc.cs : When searching for a type, find nested type too.
8669 This fixes bug #71040.
8671 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
8674 - Warn missing member comment on those classes which also does not
8675 have doc comments. Fixed bug #71041.
8676 - Don't warn missing doc comment on default constructor.
8679 2005-01-06 Duncan Mak <duncan@ximian.com>
8681 * cs-tokenizer.cs (xtoken): After handling traditional C-style
8682 comments, set `tokens_seen' to true. This allows us to detect
8683 misplaced preprocessor directives (i.e. not at the beginning of
8684 the a line, nor after whitespaces). In that case, report error
8685 CS1040. This fixes bug #56460.
8687 * cs-parser.jay (interface_member_declaration): Add checks for
8688 IsExplicitImpl, and report CS0541 error if an interface member is
8689 defined as an explicit interface declaration.
8691 2005-01-06 Marek Safar <marek.safar@seznam.cz>
8694 * class.cs (PropertyMethod): Set Parent field in ctors.
8695 (SetMethod.InternalParameters): Add unsafe switch hack.
8697 * decl.cs (MemberCore.Parent): Cannot be readonly.
8699 2005-01-06 Raja R Harinath <rharinath@novell.com>
8701 * decl.cs (DeclSpace.ResolveType): Remove.
8702 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
8703 Merge in code from ...
8704 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
8705 * class.cs, enum.cs: Update to changes.
8707 2005-01-06 Miguel de Icaza <miguel@ximian.com>
8709 * anonymous.cs: Ensure that we init the scope of our parent if it
8710 has not been initialized yet.
8712 2004-12-30 Duncan Mak <duncan@ximian.com>
8714 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
8715 if field.FieldBuilder is null. Fixes #70758.
8717 * convert.cs: Fixed some typos and updated some of the comments.
8718 (ImplicitStandardConversionExists):
8719 (TryImplicitIntConversion): If `target_type' is an interface and
8720 the type of `ic' implements this interface, return true or a new
8721 BoxedCast instead of null. This fixes #70468.
8723 2004-12-29 Duncan Mak <duncan@ximian.com>
8725 * expression.cs (Argument.Emit): Check that Expr is
8726 IMemoryLocation before casting to it, and report CS1510 otherwise.
8730 2004-12-21 Ben Maurer <bmaurer@ximian.com>
8732 * statement.cs (Block.ThisVariable): remove the recursion here, to
8733 make the --profile more sane.
8735 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
8737 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
8738 assembly, by JB Evain.
8740 2004-12-17 Raja R Harinath <rharinath@novell.com>
8742 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
8743 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
8744 "parent" refers to enclosing type/class. "base" refers to superclass.
8746 2004-12-17 Raja R Harinath <rharinath@novell.com>
8748 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
8749 Ensure that we only have GlobalAttributes.
8750 * attribute.cs (Attribute.Emit): Make non-virtual.
8751 (GlobalAttribute.Emit): Remove.
8752 (Attribute.Resolve): Make virtual.
8753 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
8754 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
8755 the argument. Don't create one.
8756 (Attribute.GetObsoleteAttribute): Likewise.
8757 (Attribute.GetClsCompliantAttributeValue): Likewise.
8758 * class.cs, decl.cs: Update to changes.
8760 2004-12-17 Marek Safar <marek.safar@seznam.cz>
8762 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
8764 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
8766 * statement.cs (Foreach.Resolve): Add error 186 report.
8768 2004-12-16 Marek Safar <marek.safar@seznam.cz>
8770 * expression.cs (Conditional.DoResolve): Add warning 429.
8772 * statement.cs (If.Resolve): Add warning 665.
8774 2004-12-16 Raja R Harinath <rharinath@novell.com>
8776 New invariant: RootContext.Tree.Types.NamespaceEntry == null
8777 except when in the parser, and in GlobalAttribute.
8778 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
8779 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
8780 RootContext.Tree.Types.NamespaceEntry once work is done.
8781 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
8782 and resets RootContext.Tree.Types.NamespaceEntry.
8784 2004-12-15 Marek Safar <marek.safar@seznam.cz>
8786 * cs-parser.jay: Don't create a block for every variable.
8788 2004-12-14 Miguel de Icaza <miguel@ximian.com>
8790 * location.cs: Provide extra information.
8792 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
8793 variables from the captured environment, it is the ldarg_0.
8795 2004-12-14 Marek Safar <marek.safar@seznam.cz>
8797 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
8800 * class.cs: Changed warning level for 169 to avoid developer
8801 displeasure from warning flooding. It will be changed back when they
8802 fix most of current BCL warnings.
8804 * RootContext.cs: Pushed default WarningLevel to 3.
8806 * statement.cs: Removed unused variable.
8808 2004-12-14 Marek Safar <marek.safar@seznam.cz>
8810 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
8811 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
8812 Add error 502 report.
8813 (StaticClass.DefineType): Add error 441 report.
8814 (Class.AllowedModifiersProp): New virtual property as temporary
8815 extension to AllowedModifiers.
8816 (Class.DefineType): Add error 418 report. Moved ModFlags check here
8817 to share implementation with StaticClass and don't call virtual
8820 * driver.cs (MainDriver): Add error 1558 test.
8822 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
8823 report. Moved error 36 test here.
8825 * statement.cs (Throw.Resolve): Add error 724 report.
8827 * typemanager.cs: Add out_attribute_type core type.
8829 2004-12-13 Marek Safar <marek.safar@seznam.cz>
8831 * class.cs (TypeContainer.VerifyClsCompliance): Add error
8833 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
8835 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
8838 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
8840 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
8841 Add error 3023 report.
8842 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
8844 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
8847 2004-12-12 John Luke <john.luke@gmail.com>
8849 * driver.cs (AddArgs): take -- into account when
8850 adding arguments, fixes bug 65710
8852 2004-12-12 Martin Baulig <martin@ximian.com>
8854 * expression.cs (Unary.TryReduceNegative): Added support for
8855 SByteConstant and ByteConstant.
8856 (Unary.Reduce): Check error values from TryReduceNegative().
8858 2004-12-10 Marek Safar <marek.safar@seznam.cz>
8860 * attributes.cs (Attribute.Resolve): Avoid multiple error report
8861 and report exception as error 182.
8863 2004-12-10 Raja R Harinath <rharinath@novell.com>
8865 * driver.cs (Main): Fix message when there are warnings.
8867 2004-12-09 Miguel de Icaza <miguel@ximian.com>
8869 * delegate.cs: Fixed my fix from yesterday, sorry about that.
8871 2004-12-09 Marek Safar <marek.safar@seznam.cz>
8873 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
8874 Reduced number of warnings.
8876 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
8878 2004-12-08 Miguel de Icaza <miguel@ximian.com>
8880 * driver.cs: Removed message.
8882 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
8884 2004-12-08 <vargaz@freemail.hu>
8886 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
8888 2004-12-08 Martin Baulig <martin@ximian.com>
8890 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
8891 instead of a CS3002 for properties and indexer.
8893 2004-12-08 Martin Baulig <martin@ximian.com>
8895 * decl.cs (MemberName.ToString): Make this work again.
8897 2004-12-08 Marek Safar <marek.safar@seznam.cz>
8899 * attribute.cs (Resolve): Add error 591 detection.
8901 * class.cs (FieldMember.Define): Add error 1547 detection.
8902 (Indexer.Define): Add error 620 detection.
8903 (Operator.Define): Add error 590 detection.
8905 * ecore.cs: Missing argument for error 79.
8907 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
8910 2004-12-07 Marek Safar <marek.safar@seznam.cz>
8913 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
8916 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
8918 * cs-parser.jay : handle doc comments on implicit/explicit operators.
8919 Some operator comments were suppressed.
8920 * doc.cs : Implicit/explicit operator name in doc comments are like
8921 "op_Explicit(type)~returnType", so added suffix handling.
8923 2004-12-07 Martin Baulig <martin@ximian.com>
8926 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
8927 (MemberCore.GetClsCompliantAttributeValue): Likewise.
8928 (DeclSpace.ec): New protected field; store the EmitContext here.
8929 (DeclSpace.EmitContext): New public property; moved here from
8931 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
8934 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
8935 (Enum.Emit): Don't create a new EmitContext.
8937 * delegate.cs (Delegate.DefineType): Always create the
8940 * iterators.cs (Iterators.DefineIterator): Create a new
8941 EmitContext and store it in `ec'.
8943 2004-08-24 Martin Baulig <martin@ximian.com>
8946 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
8947 this for accessibility checks.
8948 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
8949 IsNestedFamilyAccessible.
8950 (TypeManager.IsSubclassOf): New method, do what the name actually
8953 2004-12-06 Raja R Harinath <rharinath@novell.com>
8955 Fix crash on cs0657-17.cs.
8956 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
8957 Use RootContext.Tree.Types, not 'new RootTypes ()'.
8958 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
8959 the case where the NamespaceEntry gets overwritten.
8961 2004-12-06 Marek Safar <marek.safar@seznam.cz>
8963 Fixed #69195, #56821
8964 * ecore.cs (ResolveBoolean): Tiny refactoring.
8966 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
8967 of right expression resolving when left is false constant and
8968 operator is LogicalAnd OR true constant and operator is LogicalOr.
8970 * statement.cs (ResolveUnreachable): Always reports warning.
8972 2004-12-05 Miguel de Icaza <miguel@ximian.com>
8974 * class.cs: Distinguish between 1721 and 1722 (just a little help
8975 for the programmer).
8977 2004-12-03 Miguel de Icaza <miguel@ximian.com>
8979 * delegate.cs: Only allow this on new versions of the language.
8981 2004-12-02 Duncan Mak <duncan@ximian.com>
8983 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
8985 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
8986 here as a static method. Take an additional bool out parameter
8987 `must_do_cs1540_check' for signaling to InstanceResolve.
8988 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
8989 member field from PropertyExpr class and made it an argument of
8991 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
8992 check for MarshalByRefObject, and report CS0122 instead of CS1540.
8993 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
8994 and `remove_accessor' as well as InstanceResolve: report CS0122
8999 2004-12-03 Raja R Harinath <rharinath@novell.com>
9001 Fix test-327.cs, test-328.cs, and put in early infrastructure
9002 for eventually fixing #52697.
9003 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
9004 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
9006 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
9007 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
9008 (VerifyUsing, error246): Update.
9009 * rootcontext.cs (RootContext.NamespaceLookup): Just use
9010 'NamespaceEntry.LookupNamespaceOrType'.
9012 2004-12-03 Martin Baulig <martin@ximian.com>
9014 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
9015 method as our child, call AnonymousMethod.Compatible() on it.
9017 2004-12-03 Raja R Harinath <rharinath@novell.com>
9019 Disable XML documentation support in 'basic' profile.
9020 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
9021 Redirect XmlElement to System.Object.
9022 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
9023 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
9024 * mcs.exe.sources: Add doc-bootstrap.cs.
9025 * doc-bootstrap.cs: New file. Contains empty stub implementation
9028 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
9030 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
9031 comments are allowed.
9033 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
9035 * delegate.cs: Add checks for subtypes in paramaters and return values
9036 in VerifyMethod () to add support for Covariance/Contravariance
9039 2004-12-02 Miguel de Icaza <miguel@ximian.com>
9041 * report.cs: Remove extra closing parenthesis.
9043 * convert.cs (Error_CannotImplicitConversion): If the name of the
9044 types are the same, provide some extra information.
9046 * class.cs (FieldBase): Use an unused bit field from the field to
9047 encode the `has_offset' property from the FieldMember. This saves
9048 a couple of Ks on bootstrap compilation.
9050 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
9051 method as our child, return the AnonymousMethod resolved
9054 * expression.cs (New.DoResolve): Allow return values from
9055 NewDelegate to also include AnonymousMethods.
9059 2004-12-02 Marek Safar <marek.safar@seznam.cz>
9062 * attribute.cs (Resolve): Improved implementation of params
9063 attribute arguments.
9065 * support.cs (ParameterData): Add HasParams to be faster.
9067 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
9069 all things are for /doc support:
9071 * doc.cs: new file that supports XML documentation generation.
9072 * mcs.exe.sources: added doc.cs.
9074 Handle /doc command line option.
9075 Report error 2006 instead of 5 for missing file name for /doc.
9076 Generate XML documentation when required, after type resolution.
9078 Added support for picking up documentation (/// and /** ... */),
9079 including a new XmlCommentState enumeration.
9081 Added lines to fill Documentation element for field, constant,
9082 property, indexer, method, constructor, destructor, operator, event
9083 and class, struct, interface, delegate, enum.
9084 Added lines to warn incorrect comment.
9086 Added Documentation field (passed only when /doc was specified).
9088 Added DocComment, DocCommentHeader, GenerateDocComment() and
9089 OnGenerateDocComment() and some supporting private members for
9090 /doc feature to MemberCore.
9092 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
9094 Added overriden DocCommentHeader.
9096 Added overriden DocCommentHeader and GenerateDocComment().
9098 2004-12-01 Miguel de Icaza <miguel@ximian.com>
9100 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
9101 unwrapping the enumeration values, chain to
9102 DoConstantNumericPromotions again, so we can promote things to the
9103 fundamental types (takes care of enums that are bytes, sbytes).
9107 2004-12-01 Raja R Harinath <rharinath@novell.com>
9109 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
9110 Fix long-standing bug in type-lookup. Use FindType instead of
9111 LookupType when ec.ResolvingTypeTree.
9112 (Attribute.ResolveType, Attribute.Resolve)
9113 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
9115 (Attributes.Search): Remove internal version. Update.
9116 (Attributes.SearchMulti): Update.
9117 (Attributes.GetClsCompliantAttribute): Remove.
9118 (Attributes.GetIndexerNameAttribute): Remove.
9119 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
9120 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
9121 * class.cs (Indexer.Define): Likewise.
9123 2004-12-01 Marek Safar <marek.safar@seznam.cz>
9126 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
9127 MarshallByReference members access.
9129 * expression.cs: Use CheckMarshallByRefAccess;
9130 Better error CS0197 message.
9132 * report.cs: Print whole related error message.
9134 2004-11-30 Raja R Harinath <rharinath@novell.com>
9136 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
9137 the current directory to help debugging.
9139 2004-11-29 Marek Safar <marek.safar@seznam.cz>
9141 * class (GetClassBases): Better error 60 report.
9142 (EventProperty): Disabled warning 67 detection.
9144 2004-11-29 Marek Safar <marek.safar@seznam.cz>
9147 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
9149 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
9152 2004-11-29 Marek Safar <marek.safar@seznam.cz>
9155 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
9157 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
9159 2004-11-26 Miguel de Icaza <miguel@ximian.com>
9161 * attribute.cs (Attribute.Resolve): Refine error reporting and
9162 report a cs0117 if the identifier does not exist, to distinguish
9163 from 0617 which is a miss-use of the actual identifier.
9165 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
9166 between cs0070 and cs0079.
9168 * class.cs (MemberBase.DoDefine): When reporting a wrong
9169 accessibility level, we use MethodCore to compare instead of
9170 Method (this was a regression in some refactoring effort).
9172 So now we correctly report cs0056 again.
9174 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
9175 testing the target_type (which was known to be object_type) and
9176 not the source type (which is anonymous_method).
9178 Fixed reporting of error cs1660.
9180 * expression.cs (UserCast.Source): Expose the underlying cast.
9182 * statement.cs (Switch.SwitchGoverningType): Sort the list of
9183 allowed types to find a match to int32 first (most common).
9185 In addition, it ignores any ImplicitUserConversions that did an
9186 internal implicit conversion (as the switch statement allows only
9187 one integral conversion to exist).
9189 * class.cs (PartialContainer.Create): rename `name' to
9190 `member_name' for clarity. Then replace the string calls with a
9191 call to MemberName.GetPartialName, as now using
9192 MemberName.ToString is an error (this is due to the side effects
9193 it had, that were fixed in the past).
9195 This will restore the error reporting on a number of partial class
9196 errors that were missusing this (and getting an exception as a
9197 results, which is now just a plain textual warning, because
9198 yyparse debug output would crash otherwise).
9200 2004-11-26 Raja R Harinath <rharinath@novell.com>
9202 * Makefile (PROGRAM_INSTALL_DIR): Remove.
9204 2004-11-25 Ben Maurer <bmaurer@ximian.com>
9206 * rootcontext.cs (LookupType): Make sure to cache lookups that
9207 don't give us a negative result. This saves about 5% of corlib
9210 2004-11-25 Miguel de Icaza <miguel@ximian.com>
9212 * report.cs (AbstractMessage.Print): messages are sent to stderr
9214 * class.cs (TypeContainer.GetClassBases): It is an error to have a
9215 non-interface in the list of interfaces (at this point, either
9216 parent was properly set, or a base class is being listed in the
9217 interfaces section).
9219 This flags error 1722, and resolves the crash from bug 69259.
9221 2004-11-25 Ben Maurer <bmaurer@ximian.com>
9223 * statement.cs (Using.EmitExpressionFinally): make this work right
9224 for valuetypes. Fixes 69926.
9226 2004-11-25 Miguel de Icaza <miguel@ximian.com>
9228 * const.cs (Const.ChangeType): Cope with the "0 literal can be
9229 converted to an enum" here, before we try to change the underlying
9230 type. This code exists, but it is a different code path than the
9231 one used while encoding constants.
9233 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
9234 old bug: when converting from the null literal to a pointer,
9235 return an EmptyCast, not the NullLiteral.
9237 This fixes #69921, the recent null_type changes probably made this
9240 (ImplicitReferenceConversionExists): In addition, resynchronized
9241 the code here, so it matches the same code in
9242 ImplicitReferenceConversionExists for the `from any class-type S
9243 to any interface-type T'.
9246 2004-11-25 Marek Safar <marek.safar@seznam.cz>
9248 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
9250 2004-11-24 Miguel de Icaza <miguel@ximian.com>
9252 * cs-parser.jay: Use verbosity accordingly.
9254 2004-11-24 Marek Safar <marek.safar@seznam.cz>
9256 * expression.cs (Unary.ResolveOperator): Do not report warning;
9257 AddressOf reads from variable.
9259 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
9261 2004-11-24 Marek Safar <marek.safar@seznam.cz>
9265 * attribute.cs (Attributable): Removed CheckTargets.
9266 (Attributes.Emit): Explicit attribute targets are tested here.
9268 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
9269 not enabled for interfaces.
9271 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
9272 (GetAssemblyName): Ouch next bug there.
9274 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
9276 * expression.cs: Error 275 added.
9278 2004-11-23 Marek Safar <marek.safar@seznam.cz>
9280 Fix bug #69177 (Implemented decimal constant support)
9282 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
9283 (BinaryFold): Add DecimalConstant.
9285 * const.cs (Define): Decimal constant
9287 (ChangeType): Add decimal type handling.
9288 (LookupConstantValue): Don't set value for decimal type but
9289 emit DecimalConstantAttribute. Needed for constant optimization.
9291 * constant.cs (ToDecimal): New method.
9292 (ConvertToDecimal): New method.
9293 (IntConstant): Implemented ConvertToDecimal.
9294 (DecimalConstant.Emit): Emit optimized version for decimals in
9297 * expression.cs (ResolveOperator): Changed order of constant
9298 reduction to work correctly with native types which have
9299 overloaded operators.
9300 (ResolveMemberAccess): Extract constant value from attribute
9303 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
9305 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
9306 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
9307 (ChangeType): Decimal is special.
9308 (TypeToCoreType): Add decimal type.
9310 2004-11-22 Marek Safar <marek.safar@seznam.cz>
9312 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
9315 2004-11-22 Marek Safar <marek.safar@seznam.cz>
9317 * class.cs (EventField.ApplyAttributeBuilder): Fix error
9320 2004-11-19 Marek Safar <marek.safar@seznam.cz>
9322 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
9324 * pending.cs (PendingImplementation): Grab only interfaces.
9326 2004-11-19 Marek Safar <marek.safar@seznam.cz>
9328 * statement.cs (ForeachHelperMethods): Add location member and
9329 error 202 detection.
9331 2004-11-19 Raja R Harinath <rharinath@novell.com>
9333 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
9334 automatically handled by executable.make.
9335 (PROGRAM): Make profile-specific.
9337 2004-11-18 Marek Safar <marek.safar@seznam.cz>
9339 * expression.cs (DoResolveBase): Fixed wrong warning for out
9342 2004-11-18 Martin Baulig <martin@ximian.com>
9344 Merged latest changes into gmcs. Please keep this comment in
9345 here, it makes it easier for me to see what changed in MCS since
9346 the last time I merged.
9348 2004-11-17 Raja R Harinath <rharinath@novell.com>
9350 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
9351 (TypeHandle.GetMemberCache): New.
9352 (TypeHandle.TypeHandle): Update.
9353 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
9354 (TypeManager.LookupParentInterfacesCache):
9355 Rename from LookupInterfaceCache. Optimize slightly.
9356 (TypeManager.MemberLookup_FindMembers): Update.
9357 * decl.cs (MemberCache.MemberCache): Set Container to null in the
9359 (AddCacheContents): Rename from AddHashtable.
9360 * class.cs (TypeContainer.parent_container): Remove.
9361 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
9362 (TypeContainer.DoDefineMembers): Don't initialize it.
9363 Update to name changes.
9365 2004-11-17 Miguel de Icaza <miguel@ximian.com>
9367 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
9368 that factors the code to check access modifiers on override.
9370 (PropertyBase): Use the code here.
9372 Patch from Lluis S'anchez, fixes bug #69361.
9374 2004-11-15 Miguel de Icaza <miguel@ximian.com>
9376 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
9377 routine that is used to report the use of a captured variable
9378 whose address has been taken.
9380 There are two checks: one when variables are being captured and
9381 the other check is when the address of a variable is taken.
9383 (because an anonymous methods might be resolved before *or* after
9384 the address has been taken) and
9386 * expression.cs (Conditional.DoResolve): Remove the special
9387 casing that Martin added to trueExpr and falseExpr being both
9388 NullLiteral. We get the right behavior now just by introducing
9389 the null_type into the compiler.
9391 * convert.cs (ExplicitConversion): Change the code to use
9392 null_type instead of testing `expr is NullLiteral'.
9393 (ImplicitConversionStandard): use null_type too.
9394 (ImplicitReferenceConversionExists): use null_type too.
9395 (ImplicitReferenceConversion): use null_type too.
9397 * literal.cs: The type of `NullLiteral' is now null_type instead
9399 (Resolve): Set the type here.
9401 * typemanager.cs: Introduce null_type.
9403 2004-11-17 Martin Baulig <martin@ximian.com>
9405 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
9406 direction, like FindMembers() does. Fixes #69546, testcase is in
9409 2004-11-16 Martin Baulig <martin@ximian.com>
9411 This is based on a patch from Marek Safar, see bug #69082.
9412 Fixes bugs #63705 and #67130.
9414 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
9415 method; create a MemberCache for an interface type and cache the
9418 * decl.cs (IMemberContainer.ParentContainer): Removed.
9419 (IMemberContainer.ParentCache): New property.
9420 (MemberCache.SetupCacheForInterface): Removed.
9421 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
9422 to create a cache for an interface's "parent".
9424 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
9427 2004-11-16 Martin Baulig <martin@ximian.com>
9429 Merged back from gmcs; these changes already went into gmcs a
9430 couple of weeks ago.
9433 (TypeManager.AddUserType): Removed the `ifaces' argument.
9434 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
9436 (TypeManager.AddUserInterface): Removed.
9437 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
9439 (TypeManager.GetInterfaces): Likewise.
9440 (TypeManager.GetExplicitInterfaces): Likewise.
9442 * ecore.cs (TypeExpr.GetInterfaces): Removed.
9444 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
9445 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
9447 2004-11-14 Ben Maurer <bmaurer@ximian.com>
9449 * statement.cs: Avoid adding bools to a hashtable.
9451 2004-11-07 Miguel de Icaza <miguel@ximian.com>
9453 * expression.cs (Invocation.OverloadResolve): Flag error if we are
9454 calling an unsafe method from a safe location.
9456 2004-11-06 Marek Safar <marek.safar@seznam.cz>
9459 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
9461 2004-11-06 Miguel de Icaza <miguel@ximian.com>
9463 * namespace.cs (VerifyUsing): use GetPartialName instead of
9466 2004-11-05 Miguel de Icaza <miguel@ximian.com>
9468 * statement.cs (Return.Resolve): Fix regression in typo: if
9469 `in_exc', we have to request a NeedReturnLabel, this was a typo
9470 introduced in the anonymous method check-in. Fixes #69131.
9472 * Indexers were using the ShortName when defining themselves,
9473 causing a regression in the compiler bootstrap when applying the
9474 patch from 2004-11-02 (first part), now they use their full name
9475 and the bug is gone.
9477 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
9479 * driver.cs: Strip the path from the names of embedded resources. Fixes
9482 2004-11-04 Raja R Harinath <rharinath@novell.com>
9484 Fix error message regression: cs0104-2.cs.
9485 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
9486 (AliasEntry.Resolve): Update.
9487 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
9489 (RootContext.LookupType): Update.
9491 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
9493 * cs-parser.jay: Add support for handling accessor modifiers
9494 * class: Add support port accessor modifiers and error checking,
9495 define PropertyMethod.Define as virtual (not abstract anymore)
9496 * ecore.cs: Add checking for proeprties access with access modifiers
9497 * iterators.cs: Modify Accessor constructor call based in the modified
9499 2004-11-02 Ben Maurer <bmaurer@ximian.com>
9501 * expression.cs (StringConcat): Handle being called twice,
9502 as when we have a concat in a field init with more than two
9505 2004-11-02 Miguel de Icaza <miguel@ximian.com>
9507 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
9508 special case explicit implementations, we should always produce
9509 the .property or .event declaration.
9511 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
9512 since it will not return correct data if people use this
9513 unresolved in the presence of using statements (see test-313).
9515 * class.cs (MethodData.Define): If we are an explicit interface
9516 implementation, set the method name to the full name of the
9517 interface plus the name of the method.
9519 Notice that using the method.MethodName.GetFullName() does not
9520 work, as it will only contain the name as declared on the source
9521 file (it can be a shorthand in the presence of using statements)
9522 and not the fully qualifed type name, for example:
9526 class D : ICloneable {
9527 object ICloneable.Clone () {
9531 Would produce a method called `ICloneable.Clone' instead of
9532 `System.ICloneable.Clone'.
9534 * namespace.cs (Alias.Resolve): Use GetPartialName.
9536 2004-11-01 Marek Safar <marek.safar@seznam.cz>
9538 * cs-parser.jay: Add error 1055 report.
9540 2004-11-01 Miguel de Icaza <miguel@ximian.com>
9542 * assign.cs (Assign.DoResolve): Only do the transform of
9543 assignment into a New if the types are compatible, if not, fall
9544 through and let the implicit code deal with the errors and with
9545 the necessary conversions.
9547 2004-11-01 Marek Safar <marek.safar@seznam.cz>
9549 * cs-parser.jay: Add error 1031 report.
9551 * cs-tokenizer.cs: Add location for error 1038.
9553 2004-10-31 Marek Safar <marek.safar@seznam.cz>
9555 * cs-parser.jay: Add error 1016 report.
9557 2004-10-31 Marek Safar <marek.safar@seznam.cz>
9559 * cs-parser.jay: Add errors 1575,1611 report.
9561 2004-10-31 Marek Safar <marek.safar@seznam.cz>
9563 * cs-parser.jay: Add error 1001 report.
9565 2004-10-31 Marek Safar <marek.safar@seznam.cz>
9568 * attribute.cs (GetMarshal): Add method argument for
9569 caller identification.
9571 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
9572 agument for GetMarshal and RuntimeMissingSupport.
9574 2004-10-31 Marek Safar <marek.safar@seznam.cz>
9576 * attribute.cs (ExtractSecurityPermissionSet): Removed
9577 TypeManager.code_access_permission_type.
9579 * typemanager.cs: Removed TypeManager.code_access_permission_type.
9581 2004-10-27 Miguel de Icaza <miguel@ximian.com>
9583 * expression.cs (LocalVariableReference.DoResolveLValue): Check
9584 for obsolete use of a variable here. Fixes regression on errors
9585 cs0619-25 and cs0619-26.
9587 2004-10-27 Marek Safar <marek.safar@seznam.cz>
9589 Fix #62358, implemented security attribute encoding.
9591 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
9592 Tests permitted SecurityAction for assembly or other types.
9593 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
9594 data from SecurityPermissionAttribute to PermisionSet class.
9596 * class.cs (ApplyAttributeBuilder): Added special handling
9597 for System.Security.Permissions.SecurityAttribute based types.
9599 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
9600 special handling for System.Security.Permissions.SecurityAttribute
9603 * enum.cs (ApplyAttributeBuilder): Added special handling
9604 for System.Security.Permissions.SecurityAttribute based types.
9606 * parameter.cs (ApplyAttributeBuilder): Added special handling
9607 for System.Security.Permissions.SecurityAttribute based types.
9609 * rootcontext.cs: Next 2 core types.
9611 * typemanager.cs (TypeManager.security_permission_attr_type):
9612 Built in type for the SecurityPermission Attribute.
9613 (code_access_permission_type): Build in type.
9615 2004-10-17 Miguel de Icaza <miguel@ximian.com>
9617 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
9618 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
9619 all of this information into
9620 EmitContext.EmitCapturedVariableInstance.
9622 * codegen.cs (EmitCapturedVariableInstance): move here the
9623 funcionality of emitting an ldarg.0 in the presence of a
9624 remapping. This centralizes the instance emit code.
9626 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
9627 then emit a load of this: it means that we have reached the
9628 topmost ScopeInfo: the one that contains the pointer to the
9629 instance of the class hosting the anonymous method.
9631 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
9632 captures to the topmost CaptureContext.
9634 2004-10-12 Miguel de Icaza <miguel@ximian.com>
9636 * expression.cs (LocalVariableReference): Move the knowledge about
9637 the iterators into codegen's EmitCapturedVariableInstance.
9639 2004-10-11 Miguel de Icaza <miguel@ximian.com>
9641 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
9642 all code paths return a value from an anonymous method (it is the
9643 same as the 161 error, but for anonymous methods).
9645 2004-10-08 Miguel de Icaza <miguel@ximian.com>
9647 The introduction of anonymous methods in the compiler changed
9648 various ways of doing things in the compiler. The most
9649 significant one is the hard split between the resolution phase
9650 and the emission phases of the compiler.
9652 For instance, routines that referenced local variables no
9653 longer can safely create temporary variables during the
9654 resolution phase: they must do so from the emission phase,
9655 since the variable might have been "captured", hence access to
9656 it can not be done with the local-variable operations from the runtime.
9660 (Block.Flags): New flag `IsTopLevel' to indicate that this block
9661 is a toplevel block.
9663 (ToplevelBlock): A new kind of Block, these are the blocks that
9664 are created by the parser for all toplevel method bodies. These
9665 include methods, accessors and anonymous methods.
9667 These contain some extra information not found in regular blocks:
9668 A pointer to an optional CaptureContext (for tracking captured
9669 local variables and parameters). A pointer to the parent
9672 (Return.Resolve): Catch missmatches when returning a value from an
9673 anonymous method (error 1662).
9674 Invoke NeedReturnLabel from the Resolve phase instead of the emit
9677 (Break.Resolve): ditto.
9679 (SwitchLabel): instead of defining the labels during the
9680 resolution phase, we now turned the public ILLabel and ILLabelCode
9681 labels into methods called GetILLabelCode() and GetILLabel() that
9682 only define the label during the Emit phase.
9684 (GotoCase): Track the SwitchLabel instead of the computed label
9685 (its contained therein). Emit the code by using
9686 SwitchLabel.GetILLabelCode ().
9688 (LocalInfo.Flags.Captured): A new flag has been introduce to track
9689 whether the Local has been captured or not.
9691 (LocalInfo.IsCaptured): New property, used to tell whether the
9692 local has been captured.
9694 * anonymous.cs: Vastly updated to contain the anonymous method
9697 The main classes here are: CaptureContext which tracks any
9698 captured information for a toplevel block and ScopeInfo used to
9699 track the activation frames for various local variables.
9701 Each toplevel block has an optional capture context associated
9702 with it. When a method contains an anonymous method both the
9703 toplevel method and the anonymous method will create a capture
9704 context. When variables or parameters are captured, they are
9705 recorded on the CaptureContext that owns them, for example:
9709 MyDelegate d = delegate {
9714 Here `a' will be recorded as captured on the toplevel
9715 CapturedContext, the inner captured context will not have anything
9716 (it will only have data if local variables or parameters from it
9717 are captured in a nested anonymous method.
9719 The ScopeInfo is used to track the activation frames for local
9720 variables, for example:
9722 for (int i = 0; i < 10; i++)
9723 for (int j = 0; j < 10; j++){
9724 MyDelegate d = delegate {
9729 At runtime this captures a single captured variable `i', but it
9730 captures 10 different versions of the variable `j'. The variable
9731 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
9732 recorded on a child.
9734 The toplevel ScopeInfo will also track information like the `this'
9735 pointer if instance variables were referenced (this is necessary
9736 as the anonymous method lives inside a nested class in the host
9737 type of the method).
9739 (AnonymousMethod): Expanded to track the Toplevel, implement
9740 `AnonymousMethod.Compatible' to tell whether an anonymous method
9741 can be converted to a target delegate type.
9743 The routine now also produces the anonymous method content
9745 (AnonymousDelegate): A helper class that derives from
9746 DelegateCreation, this is used to generate the code necessary to
9747 produce the delegate for the anonymous method that was created.
9749 * assign.cs: API adjustments for new changes in
9750 Convert.ImplicitStandardConversionExists.
9752 * class.cs: Adjustments to cope with the fact that now toplevel
9753 blocks are of type `ToplevelBlock'.
9755 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
9756 insteda of standard blocks.
9758 Flag errors if params arguments are passed to anonymous methods.
9760 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
9761 `CurrentAnonymousMethod' which points to the current Anonymous
9762 Method. The variable points to the AnonymousMethod class that
9763 holds the code being compiled. It is set in the new EmitContext
9764 created for the anonymous method.
9766 (EmitContext.Phase): Introduce a variable and an enumeration to
9767 assist in enforcing some rules about when and where we are allowed
9768 to invoke certain methods (EmitContext.NeedsReturnLabel is the
9769 only one that enfonces this right now).
9771 (EmitContext.HaveCaptureInfo): new helper method that returns
9772 whether we have a CapturedContext initialized.
9774 (EmitContext.CaptureVariable): New method used to register that a
9775 LocalInfo must be flagged for capturing.
9777 (EmitContext.CapturedParameter): New method used to register that a
9778 parameters must be flagged for capturing.
9780 (EmitContext.CapturedField): New method used to register that a
9781 field must be flagged for capturing.
9783 (EmitContext.HaveCapturedVariables,
9784 EmitContext.HaveCapturedFields): Return whether there are captured
9785 variables or fields.
9787 (EmitContext.EmitMethodHostInstance): This is used to emit the
9788 instance for the anonymous method. The instance might be null
9789 (static methods), this (for anonymous methods that capture nothing
9790 and happen to live side-by-side with the current method body) or a
9791 more complicated expression if the method has a CaptureContext.
9793 (EmitContext.EmitTopBlock): Routine that drives the emission of
9794 code: it will first resolve the top block, then emit any metadata
9795 and then emit the code. The split is done so that we can extract
9796 any anonymous methods and flag any captured variables/parameters.
9798 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
9799 during this phase, the ILGenerator should not be used as labels
9800 and local variables declared here might not be accessible to any
9801 code that is part of an anonymous method.
9803 Exceptions to this include the temporary variables that are
9804 created by some statements internally for holding temporary
9807 (EmitContext.EmitMeta): New routine, in charge of emitting all the
9810 (EmitContext.TemporaryReturn): This method is typically called
9811 from the Emit phase, and its the only place where we allow the
9812 ReturnLabel to be defined other than the EmitMeta. The reason is
9813 that otherwise we would have to duplicate a lot of logic in the
9814 Resolve phases of various methods that today is on the Emit
9817 (EmitContext.NeedReturnLabel): This no longer creates the label,
9818 as the ILGenerator is not valid during the resolve phase.
9820 (EmitContext.EmitThis): Extended the knowledge in this class to
9821 work in anonymous methods in addition to iterators.
9823 (EmitContext.EmitCapturedVariableInstance): This emits whatever
9824 code is necessary on the stack to access the instance to a local
9825 variable (the variable will be accessed as a field).
9827 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
9828 EmitContext.EmitAddressOfParameter): Routines to support
9829 parameters (not completed at this point).
9831 Removals: Removed RemapLocal and RemapLocalLValue. We probably
9832 will also remove the parameters.
9834 * convert.cs (Convert): Define a `ConstantEC' which points to a
9835 null. This is just to prefity some code that uses
9836 ImplicitStandardConversion code and do not have an EmitContext
9839 The idea is to flag explicitly that at that point in time, it is
9840 known that the conversion will not trigger the delegate checking
9841 code in implicit conversions (which requires a valid
9844 Everywhere: pass new EmitContext parameter since
9845 ImplicitStandardConversionExists now requires it to check for
9846 anonymous method conversions.
9848 (Convert.ImplicitStandardConversionExists): If the type of an
9849 expression is the anonymous_method_type, and the type is a
9850 delegate, we invoke the AnonymousMethod.Compatible method to check
9851 whether an implicit conversion is possible.
9853 (Convert.ImplicitConversionStandard): Only do implicit method
9854 group conversions if the language level is not ISO_1.
9856 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
9857 MethodInfo for the Invoke method. used by Delegate and
9860 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
9861 method conversions if the target type is a delegate.
9863 Removed extra debugging nops.
9865 (LocalVariableReference): Turn the `local_info' into a public
9868 Add `prepared' field, the same hack used for FieldExprs to cope
9869 with composed assignments, as Local variables do not necessarily
9870 operate purely on the stack as they used to: they can be captured
9873 Add `temp' for a temporary result, like fields.
9875 Refactor DoResolve and DoResolveLValue into DoResolveBase.
9877 It now copes with Local variables that are captured and emits the
9878 proper instance variable to load it from a field in the captured
9881 (ParameterReference.DoResolveBase): During the resolve phase,
9882 capture parameters if we are in an anonymous method.
9884 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
9885 anonymous method, use the EmitContext helper routines to emit the
9886 parameter reference.
9888 * iterators.cs: Set RemapToProxy to true/false during the
9891 * parameters.cs (GetParameterByName): New helper method.
9893 * typemanager.cs (anonymous_method_type) a new type that
9894 represents an anonyous method. This is always an internal type,
9895 used as a fencepost to test against the anonymous-methodness of an
9898 2004-10-20 Marek Safar <marek.safar@seznam.cz>
9900 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
9902 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
9904 2004-10-18 Martin Baulig <martin@ximian.com>
9906 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
9907 `Type' directly, but call ResolveType() on it.
9908 (Catch.Resolve): Likewise.
9909 (Foreach.Resolve): Likewise.
9911 2004-10-18 Martin Baulig <martin@ximian.com>
9913 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
9914 `Type' directly, but call ResolveType() on it.
9915 (Probe.DoResolve): Likewise.
9916 (ArrayCreation.LookupType): Likewise.
9917 (TypeOf.DoResolve): Likewise.
9918 (SizeOf.DoResolve): Likewise.
9920 2004-10-18 Martin Baulig <martin@ximian.com>
9922 * expression.cs (Invocation.BetterFunction): Put back
9923 TypeManager.TypeToCoreType().
9925 2004-10-18 Raja R Harinath <rharinath@novell.com>
9927 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
9930 2004-10-18 Martin Baulig <martin@ximian.com>
9932 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
9933 `Type' directly, but call ResolveType() on it.
9935 2004-10-18 Martin Baulig <martin@ximian.com>
9937 * class.cs (FieldMember.Define): Don't access the TypeExpr's
9938 `Type' directly, but call ResolveType() on it.
9939 (MemberBase.DoDefine): Likewise.
9941 * expression.cs (New.DoResolve): Don't access the TypeExpr's
9942 `Type' directly, but call ResolveType() on it.
9943 (ComposedCast.DoResolveAsTypeStep): Likewise.
9945 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
9946 `Type' directly, but call ResolveType() on it.
9948 2004-10-17 John Luke <john.luke@gmail.com>
9950 * class.cs (Operator.GetSignatureForError): use CSharpName
9952 * parameter.cs (Parameter.GetSignatureForError): Returns
9953 correct name even if was not defined.
9955 2004-10-13 Raja R Harinath <rharinath@novell.com>
9958 * class.cs (TypeContainer.EmitContext): New property.
9959 (DefineNestedTypes): Create an emitcontext for each part.
9960 (MethodCore.DoDefineParameters): Use container's emitcontext.
9961 Pass type array to InternalParameters.
9962 (MemberBase.DoDefine): Use container's emitcontext.
9963 (FieldMember.Define): Likewise.
9964 (Event.Define): Likewise.
9965 (SetMethod.GetParameterInfo): Change argument to EmitContext.
9966 Pass type array to InternalParameters.
9967 (SetIndexerMethod.GetParameterInfo): Likewise.
9968 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
9969 * delegate.cs (Define): Pass emitcontext to
9970 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
9971 array to InternalParameters.
9972 * expression.cs (ParameterReference.DoResolveBase): Pass
9973 emitcontext to GetParameterInfo.
9974 (ComposedCast.DoResolveAsTypeStep): Remove check on
9975 ec.ResolvingTypeTree.
9976 * parameter.cs (Parameter.Resolve): Change argument to
9977 EmitContext. Use ResolveAsTypeTerminal.
9978 (Parameter.GetSignature): Change argument to EmitContext.
9979 (Parameters.ComputeSignature): Likewise.
9980 (Parameters.ComputeParameterTypes): Likewise.
9981 (Parameters.GetParameterInfo): Likewise.
9982 (Parameters.ComputeAndDefineParameterTypes): Likewise.
9983 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
9984 * support.cs (InternalParameters..ctor): Remove variant that takes
9986 * typemanager.cs (system_intptr_expr): New.
9987 (InitExpressionTypes): Initialize it.
9989 2004-10-12 Chris Toshok <toshok@ximian.com>
9991 * cs-parser.jay: fix location for try_statement and catch_clause.
9993 2004-10-11 Martin Baulig <martin@ximian.com>
9995 * report.cs: Don't make --fatal abort on warnings, we have
9996 -warnaserror for that.
9998 2004-10-07 Raja R Harinath <rharinath@novell.com>
10000 More DeclSpace.ResolveType avoidance.
10001 * decl.cs (MemberCore.InUnsafe): New property.
10002 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
10003 with newly created EmitContext.
10004 (FieldMember.Define): Likewise.
10005 * delegate.cs (Delegate.Define): Likewise.
10006 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
10007 only if normal name-lookup fails.
10008 (TypeExpr.DoResolve): Enable error-checking.
10009 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
10010 (SizeOf.DoResolve): Likewise.
10011 (ComposedCast.DoResolveAsTypeStep): Likewise.
10012 (StackAlloc.DoResolve): Likewise.
10013 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
10014 (Block.Unsafe): New property.
10015 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
10016 (Unsafe): Set 'unsafe' flag of contained block.
10017 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
10018 (Fixed.Resolve): Likewise.
10019 (Catch.Resolve): Likewise.
10020 (Using.ResolveLocalVariableDecls): Likewise.
10021 (Foreach.Resolve): Likewise.
10023 2004-10-05 John Luke <john.luke@gmail.com>
10025 * cs-parser.jay: add location to error CS0175
10027 2004-10-04 Miguel de Icaza <miguel@ximian.com>
10029 * ecore.cs (Expression.Constantity): Add support for turning null
10032 * const.cs (Const.Define): Allow constants to be reference types
10033 as long as the value is Null.
10035 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
10037 * namespace.cs (NamespaceEntry.Using): No matter which warning
10038 level is set, check if this namespace name has already been added.
10040 2004-10-03 Ben Maurer <bmaurer@ximian.com>
10042 * expression.cs: reftype [!=]= null should always use br[true,false].
10045 2004-10-03 Marek Safar <marek.safar@seznam.cz>
10048 * attribute.cs: Enum conversion moved to
10049 GetAttributeArgumentExpression to be applied to the all
10052 2004-10-01 Raja R Harinath <rharinath@novell.com>
10054 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
10055 * class.c (TypeContainer.DefineType): Flag error if
10056 base types aren't accessible due to access permissions.
10057 * decl.cs (DeclSpace.ResolveType): Move logic to
10058 Expression.ResolveAsTypeTerminal.
10059 (DeclSpace.ResolveTypeExpr): Thin layer over
10060 Expression.ResolveAsTypeTerminal.
10061 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
10062 Refactor code into NestedAccess. Use it.
10063 (DeclSpace.NestedAccess): New.
10064 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
10065 argument to silence errors. Check access permissions.
10066 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
10067 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
10068 (Cast.DoResolve): Likewise.
10069 (New.DoResolve): Likewise.
10070 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
10071 (TypeOf.DoResolve): Likewise.
10073 * expression.cs (Invocation.BetterConversion): Return the Type of
10074 the better conversion. Implement section 14.4.2.3 more faithfully.
10075 (Invocation.BetterFunction): Make boolean. Make correspondence to
10076 section 14.4.2.2 explicit.
10077 (Invocation.OverloadResolve): Update.
10078 (Invocation): Remove is_base field.
10079 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
10080 (Invocation.Emit): Likewise.
10082 2004-09-27 Raja R Harinath <rharinath@novell.com>
10084 * README: Update to changes.
10086 2004-09-24 Marek Safar <marek.safar@seznam.cz>
10088 * cs-parser.jay: Reverted 642 warning fix.
10090 2004-09-23 Marek Safar <marek.safar@seznam.cz>
10093 * decl.cs (FindMemberWithSameName): Indexer can have more than
10096 2004-09-23 Marek Safar <marek.safar@seznam.cz>
10098 * expression.cs (LocalVariableReference.DoResolveLValue):
10099 Do not report warning 219 for out values.
10100 (EmptyExpression.Null): New member to avoid extra allocations.
10102 2004-09-23 Marek Safar <marek.safar@seznam.cz>
10104 * cs-parser.jay: Fix wrong warning 642 report.
10106 * cs-tokenizer.cs (CheckNextToken): New helper;
10107 Inspect next character if is same as expected.
10109 2004-09-23 Martin Baulig <martin@ximian.com>
10111 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
10112 (Convert.ImplicitReferenceConversionExists): Likewise.
10114 2004-09-23 Marek Safar <marek.safar@seznam.cz>
10116 * class.cs (Operator.Define): Add error 448 and 559 report.
10118 2004-09-22 Marek Safar <marek.safar@seznam.cz>
10120 * class.cs (MemberBase.IsTypePermitted): New protected
10121 method for checking error CS0610.
10123 2004-09-22 Marek Safar <marek.safar@seznam.cz>
10125 * class.cs (TypeContainer.HasExplicitLayout): New property
10126 Returns whether container has StructLayout attribute set Explicit.
10127 (FieldMember): New abstract class for consts and fields.
10128 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
10129 (Field): Reuse FieldMember.
10131 * const.cs (Const): Reuse FieldMember.
10133 * rootcontext.cs: EmitConstants call moved to class.
10135 2004-09-22 Martin Baulig <martin@ximian.com>
10137 Thanks to Peter Sestoft for this bug report.
10139 * expression.cs (Conditional): If both the `trueExpr' and the
10140 `falseExpr' is a NullLiteral, return a NullLiteral.
10142 2004-09-22 Martin Baulig <martin@ximian.com>
10144 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
10145 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
10146 for the "get_Current" call.
10148 2004-09-22 Martin Baulig <martin@ximian.com>
10150 Marek and me just fixed one of our oldest bugs: #28562 :-)
10152 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
10154 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
10155 we're an EnumConstant, just return that.
10156 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
10157 an EnumConstant. In this case, we need to use GetValueAsEnumType()
10158 to get the value which'll actually be written into the attribute.
10159 However, we have to use GetValue() to access the attribute's value
10162 2004-09-22 Marek Safar <marek.safar@seznam.cz>
10164 * constant.cs (Constant.IsNegative): New abstract property
10167 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
10168 (StackAlloc.DoResolve): Reused IsNegative.
10170 2004-09-21 Martin Baulig <martin@ximian.com>
10172 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
10173 if we're used in an iterator, we may be called from different
10176 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
10177 we actually have an exception block.
10179 2004-09-20 John Luke <jluke@cfl.rr.com>
10181 * class.cs, cs-parser.jay: Improve the error report for 1520:
10182 report the actual line where the error happens, not where the
10183 class was declared.
10185 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
10186 Pass location information that was available elsewhere.
10188 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
10190 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
10191 runtime to delay sign assemblies.
10193 2004-09-19 Miguel de Icaza <miguel@ximian.com>
10195 * cs-parser.jay: Do not report the stack trace, this is barely
10198 2004-08-22 John Luke <john.luke@gmail.com>
10200 * driver.cs : check that a resource id is not already used
10201 before adding it, report CS1508 if it is, bug #63637
10203 2004-09-19 Miguel de Icaza <miguel@ximian.com>
10205 * ecore.cs: Removed dead code.
10207 2004-09-18 Marek Safar <marek.safar@seznam.cz>
10209 * class.cs: Do not report warning CS0067 on the interfaces.
10211 2004-09-16 Marek Safar <marek.safar@seznam.cz>
10213 * cs-parser.jay: Add error 504 report.
10215 2004-09-16 Marek Safar <marek.safar@seznam.cz>
10217 * rootcontext.cs: WarningLevel is 4 by default now.
10219 * statement.cs (Fixed.Resolve): Do not null
10222 2004-09-16 Marek Safar <marek.safar@seznam.cz>
10225 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
10226 deep search when property is not virtual.
10227 (PropertyExpr.ResolveAccessors): Make one call for both
10230 2004-09-15 Marek Safar <marek.safar@seznam.cz>
10233 * statement.cs: Error 152 report constains also location.
10235 2004-09-15 Marek Safar <marek.safar@seznam.cz>
10238 * const.cs: Explicitly set constant as static.
10240 2004-09-15 Marek Safar <marek.safar@seznam.cz>
10243 * cs-parser.jay: Add error 1017 report.
10245 2004-09-15 Marek Safar <marek.safar@seznam.cz>
10247 Fixed bug #59980, #64224
10248 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
10250 * typemanager.cs (IsSpecialMethod): Simplified
10252 2004-09-14 Marek Safar <marek.safar@seznam.cz>
10254 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
10255 condition with better params.
10257 2004-09-14 Marek Safar <marek.safar@seznam.cz>
10260 * attribute.cs (Resolve): Property has to have both
10263 2004-09-14 Martin Baulig <martin@ximian.com>
10265 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
10267 2004-09-14 Marek Safar <marek.safar@seznam.cz>
10270 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
10271 called and is obsolete then this member suppress message
10272 when call is inside next [Obsolete] method or type.
10274 * expression.cs: Use TestObsoleteMethodUsage member.
10276 2004-09-14 Martin Baulig <martin@ximian.com>
10278 * cs-parser.jay: Sync a bit with the GMCS version.
10280 2004-09-14 Martin Baulig <martin@ximian.com>
10282 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
10283 (CSharpParser.yacc_verbose_flag): New public field.
10285 * genericparser.cs: Removed.
10287 2004-09-14 Raja R Harinath <rharinath@novell.com>
10289 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
10291 2004-09-13 Marek Safar <marek.safar@seznam.cz>
10293 * class.cs (MethodCore.CheckBase): Fix bug #65757.
10295 2004-09-10 Martin Baulig <martin@ximian.com>
10297 Backported my MemberName changes from GMCS into MCS.
10299 - we are now using a special `MemberName' class instead of using
10300 strings; in GMCS, the `MemberName' also contains the type
10303 - changed the grammar rules a bit:
10304 * the old `member_name' is now a `namespace_or_type_name':
10305 The rule is that we use `namespace_or_type_name' everywhere
10306 where we expect either a "member name" (GetEnumerator) or a
10307 "member name" with an explicit interface name
10308 (IEnumerable.GetEnumerator).
10309 In GMCS, the explicit interface name may include type arguments
10310 (IEnumerable<T>.GetEnumerator).
10311 * we use `member_name' instead of just `IDENTIFIER' for
10313 The rule is that we use `member_name' wherever a member may
10314 have type parameters in GMCS.
10316 * decl.cs (MemberName): New public class.
10317 (MemberCore.MemberName): New public readonly field.
10318 (MemberCore.ctor): Take a `MemberName' argument, not a string.
10319 (DeclSpace): Likewise.
10321 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
10322 * enum.cs (Enum.ctor): Likewise.
10324 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
10326 (AliasEntry.ctor): Take a MemberName, not an Expression.
10327 (AliasEntry.UsingAlias): Likewise.
10329 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
10330 (IMethodData.MemberName): Changed type from string to MemberName.
10331 (MemberBase.ExplicitInterfaceName): Likewise.
10332 (AbstractPropertyEventMethod.SetupName): Make this private.
10333 (AbstractPropertyEventMethod.ctor): Added `string prefix'
10334 argument; compute the member name here.
10335 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
10336 on the `member.MemberName' and the `prefix'.
10338 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
10340 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
10341 thus, we get a `MemberName' instead of a `string'. These
10342 declarations may have type parameters in GMCS.
10343 (interface_method_declaration, delegate_declaration): Likewise.
10344 (class_declaration, interface_declaration): Likewise.
10345 (method_header): Use `namespace_or_type_name' instead of
10346 `member_name'. We may be an explicit interface implementation.
10347 (property_declaration, event_declaration): Likewise.
10348 (member_name): This is now just an `IDENTIFIER', not a
10349 `namespace_or_type_name'.
10350 (type_name, interface_type): Removed.
10351 (namespace_or_type_name): Return a MemberName, not an Expression.
10352 (primary_expression): Use `member_name' instead of `IDENTIFIER';
10353 call GetTypeExpression() on the MemberName to get an expression.
10354 (IndexerDeclaration.interface_type): Changed type from string to
10356 (MakeName): Operate on MemberName's instead of string's.
10358 2004-09-13 Raja R Harinath <rharinath@novell.com>
10361 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
10362 (NamespaceEntry.Lookup): Add new argument to flag if we want the
10363 lookup to avoid symbols introduced by 'using'.
10364 * rootcontext.cs (NamespaceLookup): Update.
10366 2004-09-12 Marek Safar <marek.safar@seznam.cz>
10368 * class.cs (TypeContainer.DoDefineMembers): Do not call
10369 DefineDefaultConstructor for static classes.
10371 2004-09-12 Marek Safar <marek.safar@seznam.cz>
10373 * attribute.cs (Attribute.Resolve): Add error 653 report.
10375 * class.cs (Class.ApplyAttributeBuilder): Add error 641
10377 (Method.ApplyAttributeBuilder): Add error 685 report.
10378 (Operator.Define): Add error 564 report.
10380 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
10382 * expression.cs (Invocation.DoResolve): Add error
10383 245 and 250 report.
10385 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
10388 2004-09-11 Marek Safar <marek.safar@seznam.cz>
10390 * class.cs (ConstructorInitializer.Resolve):
10391 Wrong error number (515->516).
10393 2004-09-11 Marek Safar <marek.safar@seznam.cz>
10395 * class.cs (Indexer.Define): Add error 631 report.
10397 2004-09-11 Marek Safar <marek.safar@seznam.cz>
10399 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
10401 2004-09-11 Marek Safar <marek.safar@seznam.cz>
10403 * expression.cs (Probe.DoResolve): Add error CS0241 report.
10405 2004-09-10 Marek Safar <marek.safar@seznam.cz>
10407 * cs-parser.jay: Added error CS0241 report.
10409 2004-09-10 Raja R Harinath <rharinath@novell.com>
10411 * cs-parser.jay (fixed_statement): Introduce a scope for the
10412 declaration in the 'fixed' statement.
10414 2004-09-09 Marek Safar <marek.safar@seznam.cz>
10416 * cs-parser.jay: Added CS0230 error report.
10418 2004-09-09 Marek Safar <marek.safar@seznam.cz>
10420 * cs-parser.jay: Added errors CS0231 and CS0257 report.
10422 2004-09-09 Marek Safar <marek.safar@seznam.cz>
10424 * expression.cs (Argument.Resolve): Added error CS0192 and
10427 2004-09-09 Marek Safar <marek.safar@seznam.cz>
10429 C# 2.0 #pragma warning feature
10431 * cs-tokenizer.cs (PreProcessPragma): New method;
10432 Handles #pragma directive.
10434 * report.cs (WarningRegions): New class; Support
10435 class for #pragma warning directive. It tests whether
10436 warning is enabled for a given line.
10438 2004-09-08 Miguel de Icaza <miguel@ximian.com>
10440 * const.cs: Add more descriptive error report, tahnks to
10443 2004-09-08 Marek Safar <marek.safar@seznam.cz>
10445 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
10447 2004-09-07 Miguel de Icaza <miguel@ximian.com>
10449 * expression.cs: Apply patch from Ben: Remove dead code from
10450 ArrayCreation, and remove the TurnintoConstant call in const.cs,
10451 as that code just threw an exception anwyays.
10453 * const.cs: Remove the call to the turnintoconstant, for details
10456 * literal.cs: The type of the null-literal is the null type; So
10457 we use a placeholder type (literal.cs:System.Null, defined here)
10460 * expression.cs (Conditional.DoResolve): Remove some old code that
10461 is no longer needed, conversions have been fixed.
10463 (ArrayCreationExpression.DoResolve): Return false if we fail to
10464 resolve the inner expression.
10466 2004-09-07 Raja R Harinath <rharinath@novell.com>
10469 * cs-parser.jay (delegate_declaration): Record a delegate
10470 declaration as a type declaration.
10471 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
10473 2004-09-06 Miguel de Icaza <miguel@ximian.com>
10475 * parameter.cs: Do not crash if the type can not be resolved.
10477 * expression.cs: Report errors with unsafe pointers, fixes #64896
10479 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
10481 * expression.cs: Pointer arith always needs to do a conv.i
10482 if the operand is a long. fix 65320
10484 2004-09-04 Marek Safar <marek.safar@seznam.cz>
10486 Fixed cs0619-37.cs, cs0619-38.cs
10488 * enum.cs (GetObsoleteAttribute): Removed.
10490 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
10491 on Enum member is double staged. The first is tested member
10494 2004-09-04 Marek Safar <marek.safar@seznam.cz>
10496 Fixed #56986, #63631, #65231
10498 * class.cs: (TypeContainer.AddToMemberContainer): New method,
10499 adds member to name container.
10500 (TypeContainer.AddToTypeContainer): New method, adds type to
10502 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
10503 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
10504 AddOperator): Simplified by reusing AddToMemberContainer.
10505 (TypeContainer.UserDefinedStaticConstructor): Changed to property
10507 (Method.CheckForDuplications): Fixed implementation to test all
10509 (MemberBase): Detection whether member is explicit interface
10510 implementation is now in constructor.
10511 (MemberBase.UpdateMemberName): Handles IndexerName.
10512 (Accessor): Changed to keep also location information.
10513 (AbstractPropertyEventMethod): Is derived from MemberCore.
10514 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
10515 will be emited or not.
10516 (PropertyBase.AreAccessorsDuplicateImplementation):
10517 Tests whether accessors are not in collision with some method.
10518 (Operator): Is derived from MethodCore to simplify common
10521 * decl.cs (Flags.TestMethodDuplication): Test for duplication
10523 (DeclSpace.AddToContainer): Adds the member to defined_names
10524 table. It tests for duplications and enclosing name conflicts.
10526 * enum.cs (EnumMember): Clean up to reuse the base structures
10528 2004-09-03 Martin Baulig <martin@ximian.com>
10530 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
10531 into TypeContainer, to make partial classes work again.
10533 2004-09-03 Martin Baulig <martin@ximian.com>
10535 * rootcontext.cs (RootContext.V2): Removed.
10537 2004-03-23 Martin Baulig <martin@ximian.com>
10539 * expression.cs (Invocation.OverloadResolve): Added `bool
10540 may_fail' argument and use it instead of the Location.IsNull() hack.
10542 2004-09-03 Martin Baulig <martin@ximian.com>
10544 Merged latest changes into gmcs. Please keep this comment in
10545 here, it makes it easier for me to see what changed in MCS since
10546 the last time I merged.
10548 2004-09-03 Raja R Harinath <rharinath@novell.com>
10551 * expression.cs (BetterConversion): Don't allow either conversion
10552 to be null. Remove redundant implicit conversion test when 'q ==
10553 null' -- when this function is invoked, we already know that the
10554 implicit conversion exists.
10555 (BetterFunction): Assume that 'best' is non-null. Remove
10556 redundant reimplementation of IsApplicable when 'best' is null.
10557 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
10558 number of arguments.
10559 (IsAncestralType): Extract from OverloadResolve.
10560 (OverloadResolve): Make robust to the MethodGroupExpr being
10561 unsorted. Implement all the logic of Section 14.5.5.1, and
10562 support overloading of methods from multiple applicable types.
10563 Clean up logic somewhat. Don't pass null methods to BetterFunction.
10565 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
10566 (RealError, Warning): Append type of report to related symbol.
10568 2004-09-03 Marek Safar <marek.safar@seznam.cz>
10570 * enum.cs: Fixed CLS-Compliance checks for enum members.
10571 Error tests cs3008-8.cs, cs3014-8.cs
10573 2004-09-02 Marek Safar <marek.safar@seznam.cz>
10575 Fixed bug #62342, #63102
10576 * class.cs: ImplementIndexer uses member.IsExplicitImpl
10577 like ImplementMethod.
10579 2004-09-02 Marek Safar <marek.safar@seznam.cz>
10581 * attribute.cs (Attribute.GetAttributeArgumentExpression):
10584 2004-09-02 Martin Baulig <martin@ximian.com>
10586 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
10587 TypeManager.GetArgumentTypes() rather than calling GetParameters()
10590 2004-09-01 Marek Safar <marek.safar@seznam.cz>
10592 C# 2.0 Static classes implemented
10594 * class.cs (TypeContainer): instance_constructors,
10595 initialized_fields, initialized_static_fields,
10596 default_constructor, base_inteface_types are protected to be
10597 accessible from StaticClass.
10598 (TypeContainer.DefineDefaultConstructor): New virtual method
10599 for custom default constructor generating
10600 (StaticClass): New class to handle "Static classes" feature.
10602 * cs-parser.jay: Handle static keyword on class like instance
10605 * driver.cs: Added "/langversion" command line switch with two
10606 options (iso-1, default).
10608 2004-08-31 Marek Safar <marek.safar@seznam.cz>
10610 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
10612 2004-08-31 Miguel de Icaza <miguel@ximian.com>
10614 * delegate.cs: Style.
10616 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
10618 * delegate.cs: Add seperate instance expr field for miguel.
10620 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
10622 * PointerArithmetic (Resolve): make sure we are not doing
10623 pointer arith on void*. Also, make sure we are resolved
10624 by not setting eclass until resolve.
10626 All callers: Make sure that PointerArithmetic gets resolved.
10628 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
10630 * ArrayCreation (LookupType): If the type does not resolve
10631 to an array, give an error.
10633 2004-08-27 Marek Safar <marek.safar@seznam.cz>
10635 * statement.cs (Try.Resolve): Fixed bug #64222
10637 2004-08-27 Martin Baulig <martin@ximian.com>
10640 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
10643 2004-08-26 Marek Safar <marek.safar@seznam.cz>
10645 * ecore.cs (Constantify): Get underlying type via
10646 System.Enum.GetUnderlyingType to avoid StackOverflow on the
10647 Windows in special cases.
10649 2004-08-26 Marek Safar <marek.safar@seznam.cz>
10651 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
10652 for obtaining also private methods.
10653 (GetRemoveMethod): Used GetRemoveMethod (true)
10654 for obtaining also private methods.
10656 2004-08-24 Martin Baulig <martin@ximian.com>
10658 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
10659 MethodAttributes.HideBySig for operators.
10661 2004-08-23 Martin Baulig <martin@ximian.com>
10663 Back to the old error reporting system :-)
10665 * report.cs (Message): Removed.
10666 (Report.MessageData, ErrorData, WarningData): Removed.
10667 (Report.Error, Warning): Back to the old system.
10669 2004-08-23 Martin Baulig <martin@ximian.com>
10671 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
10673 * class.cs (TypeContainer.ParentContainer): New public virtual
10674 method; replaces the explicit interface implementation.
10675 (ClassPart.ParentContainer): Override.
10677 2004-08-23 Martin Baulig <martin@ximian.com>
10679 * statement.cs (Switch): Added support for constant switches; see
10680 #59428 or test-285.cs.
10682 2004-08-22 Marek Safar <marek.safar@seznam.cz>
10685 * statement.cs (GetEnumeratorFilter): Removed useless
10686 logic because C# specs is strict. GetEnumerator must be
10689 2004-08-22 Martin Baulig <martin@ximian.com>
10691 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
10692 a switch and may break, reset the barrier. Fixes #59867.
10694 2004-08-22 Marek Safar <marek.safar@seznam.cz>
10696 CLS-Compliance speed up (~5% for corlib)
10698 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
10699 New method. Tests container for CLS-Compliant names
10701 * class.cs (TypeContainer.VerifyClsName): New method.
10702 Checks whether container name is CLS Compliant.
10703 (Constructor): Implements IMethodData.
10705 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
10706 low-case table for CLS Compliance test.
10707 (MemberCache.VerifyClsParameterConflict): New method.
10708 Checks method parameters for CS3006 error.
10710 * enum.cs (EnumMember): Is derived from MemberCore.
10711 (Enum.VerifyClsName): Optimized for better performance.
10713 2004-08-06 Marek Safar <marek.safar@seznam.cz>
10715 * report.cs: Renamed Error_T to Error and changed all
10718 2004-08-06 Marek Safar <marek.safar@seznam.cz>
10720 * class.cs (TypeContainer.IndexerArrayList): New inner class
10721 container for indexers.
10722 (TypeContainer.DefaultIndexerName): New constant for default
10723 indexer name. Replaced all "Item" with this constant.
10724 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
10726 * typemanager.cs (TypeManager.default_member_ctor): Cache here
10727 DefaultMemberAttribute constructor.
10729 2004-08-05 Martin Baulig <martin@ximian.com>
10731 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
10734 2004-08-05 Marek Safar <marek.safar@seznam.cz>
10736 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
10737 multi platforms problem.
10739 * compiler.csproj: Included shared files.
10741 2004-08-04 Marek Safar <marek.safar@seznam.cz>
10743 Fix bug 60333, 55971 in the more general way
10744 * attribute.cs (Attribute.GetAttributeArgumentExpression):
10745 Added arg_type argument for constant conversion.
10746 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
10748 2004-08-04 Marek Safar <marek.safar@seznam.cz>
10751 * class.cs (TypeContainer ): New inner classes MethodArrayList,
10752 OperatorArrayList, MethodCoreArrayList for typecontainer
10753 containers. Changed class member types to these new types.
10754 (MethodArrayList.DefineMembers): Added test for CS0659.
10756 2004-08-04 Miguel de Icaza <miguel@ximian.com>
10758 * cfold.cs: Synchronize the folding with the code in expression.cs
10759 Binary.DoNumericPromotions for uint operands.
10761 * attribute.cs: Revert patch from Raja, it introduced a regression
10762 while building Blam-1.2.1 (hard to isolate a test case).
10764 2004-08-04 Marek Safar <marek.safar@seznam.cz>
10768 (TypeContainer.Define): Renamed to DefineContainerMembers because of
10770 (MethodCore.parent_method): New member. The method we're overriding
10771 if this is an override method.
10772 (MethodCore.CheckBase): Moved from Method class and made common.
10773 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
10775 (MethodCore.CheckForDuplications): New abstract method. For custom
10776 member duplication search in a container
10777 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
10778 method and its return type.
10779 (Event.conflict_symbol): New member. Symbol with same name in the
10783 (MemberCache.FindMemberWithSameName): New method. The method
10784 is looking for conflict with inherited symbols.
10786 2004-08-04 Martin Baulig <martin@ximian.com>
10788 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
10790 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
10792 2004-08-03 Marek Safar <marek.safar@seznam.cz>
10794 * report.cs (Message): New enum for better error, warning reference in
10796 (MessageData): New inner abstract class. It generally handles printing of
10797 error and warning messages.
10798 Removed unused Error, Warning, Message methods.
10800 2004-08-03 Marek Safar <marek.safar@seznam.cz>
10802 Fix for cs0592-8.cs test
10804 (Attributable.ValidAttributeTargets): Made public.
10805 (Attribute.ExplicitTarget): New member for explicit target value.
10806 (Attribute.CheckTargets): Now we translate explicit attribute
10807 target to Target here.
10809 2004-08-03 Ben Maurer <bmaurer@ximian.com>
10811 * ecore.cs (MethodGroupExpr): new IsBase property.
10813 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
10815 * delegate.cs (DelegateCreation): store a MethodGroupExpr
10816 rather than an instance expr.
10818 (DelegateCreation.Emit): Use the method group rather than
10819 the instance expression. Also, if you have base.Foo as the
10820 method for a delegate, make sure to emit ldftn, not ldftnvirt.
10822 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
10824 (NewDelegate.DoResolve): Only check for the existance of Invoke
10825 if the method is going to be needed. Use MethodGroupExpr.
10827 (NewDelegate.Emit): Remove, DelegateCreation implements this.
10829 * expression.cs: For pointer arith., make sure to use
10830 the size of the type, not the size of the pointer to
10833 2004-08-03 Marek Safar <marek.safar@seznam.cz>
10836 * class.cs (Class): Added error CS0502 test.
10838 2004-08-03 John Luke <jluke@cfl.rr.com>
10839 Raja R Harinath <rharinath@novell.com>
10842 * attribute.cs (Attribute.complained_before): New flag.
10843 (Attribute.ResolveType, Attribute.Resolve),
10844 (Attribute.DefinePInvokeMethod): Set it.
10845 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
10847 2004-08-03 Martin Baulig <martin@ximian.com>
10849 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
10850 use a user-defined operator; we still need to do numeric
10851 promotions in case one argument is a builtin type and the other
10852 one has an implicit conversion to that type. Fixes #62322.
10854 2004-08-02 Martin Baulig <martin@ximian.com>
10856 * statement.cs (LocalInfo.Flags): Added `IsThis'.
10857 (LocalInfo.IsThis): New public property.
10858 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
10860 2004-08-01 Martin Baulig <martin@ximian.com>
10862 * class.cs (TypeContainer.GetClassBases): Don't set the default
10863 here since we may get called from GetPartialBases().
10864 (TypeContainer.DefineType): If GetClassBases() didn't return a
10865 parent, use the default one.
10867 2004-07-30 Duncan Mak <duncan@ximian.com>
10869 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
10871 2004-07-30 Martin Baulig <martin@ximian.com>
10873 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
10875 * class.cs (SourceMethod): New public class, derive from the
10876 symbol writer's ISourceMethod.
10877 (Method): Use the new symbol writer API.
10879 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
10880 as argument and use the new symbol writer.
10883 (SourceFile): Implement the symbol writer's ISourceFile.
10884 (Location.SymbolDocument): Removed.
10885 (Location.SourceFile): New public property.
10887 * symbolwriter.cs: Use the new symbol writer API.
10889 2004-07-30 Raja R Harinath <rharinath@novell.com>
10891 * Makefile (install-local): Remove. Functionality moved to
10894 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
10896 * Makefile: Install mcs.exe.config file together with mcs.exe.
10897 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
10898 correct runtime version.
10900 2004-07-25 Martin Baulig <martin@ximian.com>
10903 (TypeContainer.RegisterOrder): Removed, this was unused.
10904 (TypeContainer, interface_order): Removed.
10905 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
10906 TypeContainer as argument since we can also be called with a
10907 `PartialContainer' for a partial class/struct/interface.
10908 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
10909 of checking whether we're an `Interface' - we could be a
10910 `PartialContainer'.
10911 (PartialContainer.Register): Override; call
10912 AddClass()/AddStruct()/AddInterface() on our parent.
10914 * cs-parser.jay (interface_member_declaration): Add things to the
10915 `current_container', not the `current_class'.
10917 * rootcontext.cs (RegisterOrder): The overloaded version which
10918 takes an `Interface' was unused, removed.
10920 * typemanager.cs (TypeManager.LookupInterface): Return a
10921 `TypeContainer', not an `Interface'.
10922 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
10923 contain a `PartialContainer' for an interface, so check it's
10924 `Kind' to figure out what it is.
10926 2004-07-25 Martin Baulig <martin@ximian.com>
10928 * class.cs (Class.DefaultTypeAttributes): New public constant.
10929 (Struct.DefaultTypeAttributes): Likewise.
10930 (Interface.DefaultTypeAttributes): Likewise.
10931 (PartialContainer.TypeAttr): Override this and add the
10932 DefaultTypeAttributes.
10934 2004-07-25 Martin Baulig <martin@ximian.com>
10936 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
10937 we can just use the `Parent' field instead.
10939 2004-07-25 Martin Baulig <martin@ximian.com>
10941 * class.cs (TypeContainer.Emit): Renamed to EmitType().
10943 2004-07-25 Martin Baulig <martin@ximian.com>
10945 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
10946 our parts before defining any methods.
10947 (TypeContainer.VerifyImplements): Make this virtual.
10948 (ClassPart.VerifyImplements): Override and call VerifyImplements()
10949 on our PartialContainer.
10951 2004-07-25 Martin Baulig <martin@ximian.com>
10953 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
10955 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
10956 argument, we can just use the `Parent' field instead.
10959 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
10960 (MemberBase.DoDefine): Likewise.
10962 2004-07-24 Martin Baulig <martin@ximian.com>
10964 * decl.cs (MemberCore.Parent): New public field.
10965 (DeclSpace.Parent): Moved to MemberCore.
10967 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
10968 (MemberBase.ctor): Added TypeContainer argument, pass it to our
10970 (FieldBase, Field, Operator): Likewise.
10971 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
10972 (EventField, Event): Likewise.
10974 2004-07-23 Martin Baulig <martin@ximian.com>
10976 * class.cs (PartialContainer): New public class.
10977 (ClassPart): New public class.
10978 (TypeContainer): Added support for partial classes.
10979 (TypeContainer.GetClassBases): Splitted some of the functionality
10980 out into GetNormalBases() and GetPartialBases().
10982 * cs-tokenizer.cs (Token.PARTIAL): New token.
10983 (Tokenizer.consume_identifier): Added some hacks to recognize
10984 `partial', but only if it's immediately followed by `class',
10985 `struct' or `interface'.
10987 * cs-parser.jay: Added support for partial clases.
10989 2004-07-23 Martin Baulig <martin@ximian.com>
10991 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
10992 a `DeclSpace' and also made it readonly.
10993 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
10994 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
10995 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
10997 * cs-parser.jay: Pass the `current_class', not the
10998 `current_container' (at the moment, this is still the same thing)
10999 to a new Method, Property, Event, Indexer or Constructor.
11001 2004-07-23 Martin Baulig <martin@ximian.com>
11003 * cs-parser.jay (CSharpParser): Added a new `current_class' field
11004 and removed the `current_interface' one.
11005 (struct_declaration, class_declaration, interface_declaration):
11006 Set `current_class' to the newly created class/struct/interface;
11007 set their `Bases' and call Register() before parsing their body.
11009 2004-07-23 Martin Baulig <martin@ximian.com>
11011 * class.cs (Kind): New public enum.
11012 (TypeContainer): Made this class abstract.
11013 (TypeContainer.Kind): New public readonly field.
11014 (TypeContainer.CheckDef): New public method; moved here from
11016 (TypeContainer.Register): New public abstract method.
11017 (TypeContainer.GetPendingImplementations): New public abstract
11019 (TypeContainer.GetClassBases): Removed the `is_class' and
11020 `is_iface' parameters.
11021 (TypeContainer.DefineNestedTypes): Formerly known as
11023 (ClassOrStruct): Made this class abstract.
11025 * tree.cs (RootTypes): New public type.
11027 2004-07-20 Martin Baulig <martin@ximian.com>
11029 * tree.cs (Tree.RecordNamespace): Removed.
11030 (Tree.Namespaces): Removed.
11032 * rootcontext.cs (RootContext.IsNamespace): Removed.
11034 * cs-parser.jay (namespace_declaration): Just create a new
11035 NamespaceEntry here.
11037 2004-07-20 Martin Baulig <martin@ximian.com>
11039 * statement.cs (ExceptionStatement): New abstract class. This is
11040 now used as a base class for everyone who's using `finally'.
11041 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
11042 our local variables before using them.
11044 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
11045 virtual method. This is used by Yield.Resolve() to "steal" an
11046 outer block's `finally' clauses.
11047 (FlowBranchingException): The .ctor now takes an ExceptionStatement
11050 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
11051 version which takes an ExceptionStatement. This version must be
11052 used to create exception branchings.
11055 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
11056 (Iterator.EmitMoveNext): Added exception support; protect the
11057 block with a `fault' clause, properly handle 'finally' clauses.
11058 (Iterator.EmitDispose): Run all the `finally' clauses here.
11060 2004-07-20 Martin Baulig <martin@ximian.com>
11062 * iterator.cs: This is the first of a set of changes in the
11063 iterator code. Match the spec more closely: if we're an
11064 IEnumerable, then GetEnumerator() must be called. The first time
11065 GetEnumerator() is called, it returns the current instance; all
11066 subsequent invocations (if any) must create a copy.
11068 2004-07-19 Miguel de Icaza <miguel@ximian.com>
11070 * expression.cs: Resolve the constant expression before returning
11073 2004-07-19 Martin Baulig <martin@ximian.com>
11075 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
11076 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
11077 the return type of the new EmitContext.
11079 2004-07-18 Martin Baulig <martin@ximian.com>
11081 * class.cs (Property.Define): Fix iterators.
11083 * iterators.cs (Iterator.Define): Moved the
11084 `container.AddInterator (this)' call here from the .ctor; only do
11085 it if we resolved successfully.
11087 2004-07-17 Miguel de Icaza <miguel@ximian.com>
11089 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
11090 `true' for preprocessing directives that we parse. The return
11091 value indicates whether we should return to regular tokenizing or
11092 not, not whether it was parsed successfully.
11094 In the past if we were in: #if false ... #line #endif, we would
11095 resume parsing after `#line'. See bug 61604.
11097 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
11098 building: IsEnumType should return true only for enums, not for
11099 enums or System.Enum itself. This fixes #61593.
11101 Likely what happened is that corlib was wrong: mcs depended on
11102 this bug in some places. The bug got fixed, we had to add the
11103 hack, which caused bug 61593.
11105 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
11106 that was a workaround for the older conditions.
11108 2004-07-16 Ben Maurer <bmaurer@ximian.com>
11110 * assign.cs: IAssignMethod has a new interface, as documented
11111 inline. All assignment code now uses this new api.
11113 * ecore.cs, expression.cs: All classes which implement
11114 IAssignMethod now use the new interface.
11116 * expression.cs (Invocation): add a hack to EmitCall so that
11117 IndexerAccess can be the target of a compound assignment without
11118 evaluating its arguments twice.
11120 * statement.cs: Handle changes in Invocation api.
11122 2004-07-16 Martin Baulig <martin@ximian.com>
11124 * iterators.cs: Rewrote this. We're now using one single Proxy
11125 class for both the IEnumerable and the IEnumerator interface and
11126 `Iterator' derives from Class so we can use the high-level API.
11128 * class.cs (TypeContainer.AddIterator): New method.
11129 (TypeContainer.DoDefineType): New protected virtual method, which
11130 is called from DefineType().
11131 (TypeContainer.DoDefineMembers): Call DefineType() and
11132 DefineMembers() on all our iterators.
11133 (TypeContainer.Emit): Call Emit() on all our iterators.
11134 (TypeContainer.CloseType): Call CloseType() on all our iterators.
11136 * codegen.cs (EmitContext.CurrentIterator): New public field.
11138 2004-07-15 Martin Baulig <martin@ximian.com>
11141 (TypeManager.not_supported_exception_type): New type.
11143 2004-07-14 Martin Baulig <martin@ximian.com>
11145 * iterators.cs: Use real error numbers.
11147 2004-07-14 Martin Baulig <martin@ximian.com>
11149 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
11150 requires this to be a System.Collection.IEnumerable and not a
11151 class implementing that interface.
11152 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
11154 2004-07-13 Marek Safar <marek.safar@seznam.cz>
11156 * class.cs: Fixed previous fix, it broke some error tests.
11158 2004-07-12 Martin Baulig <martin@ximian.com>
11160 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
11163 2004-07-09 Miguel de Icaza <miguel@ximian.com>
11165 * assign.cs (LocalTemporary): Add new argument: is_address,If
11166 `is_address' is true, then the value that we store is the address
11167 to the real value, and not the value itself.
11169 * ecore.cs (PropertyExpr): use the new local temporary
11170 stuff to allow us to handle X.Y += z (where X is a struct)
11172 2004-07-08 Martin Baulig <martin@ximian.com>
11174 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
11175 not always return, just like we're doing in Using.Resolve().
11177 2004-07-07 Miguel de Icaza <miguel@ximian.com>
11179 * cs-parser.jay (fixed_statement): flag this as Pinned.
11181 2004-07-06 Miguel de Icaza <miguel@ximian.com>
11183 * typemanager.cs (TypeManager): Removed MakePinned method, this
11184 mechanism is replaced with the .NET 2.x compatible mechanism of
11185 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
11187 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
11188 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
11189 `IsFixed' property which has a different meaning.
11191 2004-07-02 Raja R Harinath <rharinath@novell.com>
11193 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
11194 visible from inside a nested class, not just the names of the
11195 immediately enclosing class.
11196 Fix for bug #60730.
11198 2004-06-24 Raja R Harinath <rharinath@novell.com>
11200 * expression.cs (BetterConversion): Remove buggy special-case
11201 handling of "implicit constant expression conversions". At this
11202 point, we already know that the conversion is possible -- we're
11203 only checking to see which is better.
11205 2004-06-24 Marek Safar <marek.safar@seznam.cz>
11207 * cs-parser.jay: Added error CS0210 test.
11209 2004-06-24 Marek Safar <marek.safar@seznam.cz>
11211 * cs-parser.jay: Added error CS0134 test.
11213 2004-06-24 Marek Safar <marek.safar@seznam.cz>
11216 * cs-parser.jay: Added error CS0145 test.
11218 2004-06-24 Marek Safar <marek.safar@seznam.cz>
11220 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
11222 2004-06-23 Ben Maurer <bmaurer@ximian.com>
11224 * expression.cs (StackAlloc.Resolve): The argument may not
11225 be a constant; deal with this case.
11227 2004-06-23 Marek Safar <marek.safar@seznam.cz>
11229 * attribute.cs (IndexerName_GetIndexerName): Renamed to
11230 GetIndexerAttributeValue.
11231 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
11233 * class.cs (Indexer.Define): Added error tests for CS0415,
11236 2004-06-23 Miguel de Icaza <miguel@ximian.com>
11238 * attribute.cs (Attribute.Resolve): Keep field code in sync with
11241 2004-06-23 Martin Baulig <martin@ximian.com>
11243 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
11244 neither return nor throw, reset the barrier as well. Fixes #60457.
11246 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
11248 * class.cs : EventAttributes is now set to None by default.
11249 This fixes bug #60459.
11251 2004-06-18 Marek Safar <marek.safar@seznam.cz>
11254 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
11255 Don't throw exception but return null (it's sufficient now).
11257 2004-06-18 Marek Safar <marek.safar@seznam.cz>
11259 * typemanager.cs (GetArgumentTypes): Faster implementation.
11261 2004-06-18 Martin Baulig <martin@ximian.com>
11263 * attribute.cs (Attribute.Resolve): Check whether we're an
11264 EmptyCast which a Constant child. Fixes #60333.
11266 2004-06-17 Ben Maurer <bmaurer@ximian.com>
11268 * statement.cs (EmitCollectionForeach): Account for the fact that
11269 not all valuetypes are in areas which we can take the address of.
11270 For these variables, we store to a temporary variable. Also, make
11271 sure that we dont emit a `callvirt' on a valuetype method.
11273 2004-06-15 Marek Safar <marek.safar@seznam.cz>
11275 * expression.cs (StackAlloc.DoReSolve): Added test for
11276 negative parameter (CS0247).
11278 2004-06-15 Marek Safar <marek.safar@seznam.cz>
11281 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
11283 2004-06-15 Marek Safar <marek.safar@seznam.cz>
11286 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
11289 2004-06-14 Marek Safar <marek.safar@seznam.cz>
11291 Fix bug #58254 & cs1555.cs, cs1556.cs
11292 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
11294 2004-06-14 Marek Safar <marek.safar@seznam.cz>
11296 * cs-parser.jay: Added error CS1669 test for indexers.
11298 2004-06-11 Martin Baulig <martin@ximian.com>
11300 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
11301 call this twice: for params and varargs methods.
11303 2004-06-11 Marek Safar <marek.safar@seznam.cz>
11306 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
11308 2004-06-11 Marek Safar <marek.safar@seznam.cz>
11310 * attribute.cs (Attribute.GetValidTargets): Made public.
11313 (AbstractPropertyEventMethod): New class for better code sharing.
11314 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
11316 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
11318 2004-06-11 Raja R Harinath <rharinath@novell.com>
11321 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
11322 that the call to Resolve is part of a MemberAccess.
11323 (Expression.Resolve): Use it for SimpleName resolution.
11324 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
11325 Add 'intermediate' boolean argument.
11326 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
11327 error message when the SimpleName can be resolved ambiguously
11328 between an expression and a type.
11329 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
11331 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
11332 call on the left-side.
11334 2004-06-11 Marek Safar <marek.safar@seznam.cz>
11337 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
11339 2004-06-11 Marek Safar <marek.safar@seznam.cz>
11341 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
11343 2004-06-11 Martin Baulig <martin@ximian.com>
11345 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
11346 varargs methods if applicable.
11348 2004-06-11 Martin Baulig <martin@ximian.com>
11350 * expression.cs (Invocation.EmitCall): Don't use
11351 `method.CallingConvention == CallingConventions.VarArgs' since the
11352 method could also have `CallingConventions.HasThis'.
11354 2004-06-11 Marek Safar <marek.safar@seznam.cz>
11356 * class.cs (Event.GetSignatureForError): Implemented.
11357 Fixed crash in error test cs3010.cs
11359 2004-06-10 Miguel de Icaza <miguel@ximian.com>
11361 * cs-tokenizer.cs: Change the way we track __arglist to be
11362 consistent with the other keywords.
11364 2004-06-09 Miguel de Icaza <miguel@ximian.com>
11366 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
11369 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
11371 * codegen.cs: Check that all referenced assemblies have a strongname
11372 before strongnaming the compiled assembly. If not report error CS1577.
11373 Fix bug #56563. Patch by Jackson Harper.
11374 * typemanager.cs: Added a method to return all referenced assemblies.
11375 Fix bug #56563. Patch by Jackson Harper.
11377 2004-06-08 Marek Safar <marek.safar@seznam.cz>
11380 (Method.ApplyAttributeBuilder): Moved and added conditional
11381 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
11384 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
11386 2004-06-08 Marek Safar <marek.safar@seznam.cz>
11389 * class.cs: (EventField.attribute_targets): Changed default target.
11391 2004-06-08 Martin Baulig <martin@ximian.com>
11393 * expression.cs (Invocation.EmitCall): Enable varargs methods.
11395 2004-06-08 Martin Baulig <martin@ximian.com>
11397 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
11399 2004-06-07 Martin Baulig <martin@ximian.com>
11401 Added support for varargs methods.
11403 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
11406 * cs-parser.jay: Added support for `__arglist'.
11408 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
11410 * expression.cs (Argument.AType): Added `ArgList'.
11411 (Invocation): Added support for varargs methods.
11412 (ArglistAccess): New public class.
11413 (Arglist): New public class.
11415 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
11417 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
11418 a method's top-level block if the method has varargs.
11420 * support.cs (ReflectionParameters, InternalParameters): Added
11421 support for varargs methods.
11423 2004-06-07 Miguel de Icaza <miguel@ximian.com>
11425 * class.cs: Provide location in indexer error report.
11427 * driver.cs: Use standard names.
11429 * namespace.cs: Catch the use of using after a namespace has been
11430 declared also on using aliases.
11432 2004-06-03 Raja R Harinath <rharinath@novell.com>
11435 * typemanager.cs (closure_private_ok, closure_invocation_type)
11436 (closure_qualifier_type, closure_invocation_assembly)
11437 (FilterWithClosure): Move to ...
11438 (Closure): New internal nested class.
11439 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
11440 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
11441 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
11442 (MemberLookup, MemberLookupFailed): Use it.
11443 * expression.cs (New.DoResolve): Treat the lookup for the
11444 constructor as being qualified by the 'new'ed type.
11445 (Indexers.GetIndexersForTypeOrInterface): Update.
11447 2004-06-03 Marek Safar <marek.safar@seznam.cz>
11450 (GetConditionalAttributeValue): New method. Returns
11451 condition of ConditionalAttribute.
11452 (SearchMulti): New method. Returns all attributes of type 't'.
11453 Use it when attribute is AllowMultiple = true.
11454 (IsConditionalMethodExcluded): New method.
11457 (Method.IsExcluded): Implemented. Returns true if method has conditional
11458 attribute and the conditions is not defined (method is excluded).
11459 (IMethodData): Extended interface for ConditionalAttribute support.
11460 (PropertyMethod.IsExcluded): Implemented.
11463 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
11466 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
11469 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
11471 * expression.cs (ArrayCreationExpression): Make this just an
11472 `expression'. It can't be a statement, so the code here was
11475 2004-06-02 Marek Safar <marek.safar@seznam.cz>
11478 * typemanager.cs (GetFullNameSignature): New method for
11481 2004-06-02 Marek Safar <marek.safar@seznam.cz>
11484 * class.cs (MemberBase.GetSignatureForError): New virtual method.
11485 Use this method when MethodBuilder is null.
11486 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
11487 Added test for error CS0626 (MONO reports error for this situation).
11488 (IMethodData.GetSignatureForError): Extended interface.
11490 2004-06-01 Marek Safar <marek.safar@seznam.cz>
11493 (AttributeTester.GetObsoleteAttribute): Returns instance of
11494 ObsoleteAttribute when type is obsolete.
11497 (TypeContainer.VerifyObsoleteAttribute): Override.
11498 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
11499 (MethodCode.VerifyObsoleteAttribute): Override.
11500 (MemberBase.VerifyObsoleteAttribute): Override.
11503 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
11504 and report proper error.
11507 Delegate.VerifyObsoleteAttribute): Override.
11510 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
11511 and report proper error.
11512 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
11515 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
11519 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
11520 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
11521 Added test for ObsoleteAttribute.
11524 (Catch): Derived from Statement.
11526 2004-06-01 Marek Safar <marek.safar@seznam.cz>
11528 Fixed bug #59071 & cs0160.cs
11530 * statement.cs (Try.Resolve): Check here whether order of catch
11531 clauses matches their dependencies.
11533 2004-05-31 Miguel de Icaza <miguel@ximian.com>
11535 * Reverted patch to namespace.cs (Use lookuptypedirect). This
11536 caused a regression: #59343. Referencing nested classes from an
11537 assembly stopped working.
11539 2004-05-31 Martin Baulig <martin@ximian.com>
11541 MCS is now frozen for beta 2.
11543 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
11545 * convert.cs: add a trivial cache for overload operator resolution.
11547 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
11549 * decl.cs: If possible, use lookuptypedirect here. We can only do
11550 this if there is no `.' after the namespace. Avoids using
11551 LookupType, which does lots of slow processing.
11552 (FindNestedType) New method, does what it says :-).
11553 * namespace.cs: use LookupTypeDirect.
11554 * rootcontext.cs: use membercache, if possible.
11555 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
11557 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
11560 According to the spec,
11562 In a member access of the form E.I, if E is a single identifier,
11563 and if the meaning of E as a simple-name (§7.5.2) is a constant,
11564 field, property, localvariable, or parameter with the same type as
11565 the meaning of E as a type-name (§3.8), then both possible
11566 meanings of E are permitted.
11568 We did not check that E as a simple-name had the same type as E as
11571 This trivial check gives us 5-7% on bootstrap time.
11573 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
11575 * expression.cs (Invocation.OverloadResolve): Avoid the
11576 use of hashtables and boxing here by allocating on demand.
11578 2004-05-30 Martin Baulig <martin@ximian.com>
11580 * rootcontext.cs (RootContext.LookupType): Don't cache things if
11581 we're doing a silent lookup. Don't try to lookup nested types in
11582 TypeManager.object_type (thanks to Ben Maurer).
11584 2004-05-30 Martin Baulig <martin@ximian.com>
11586 Committing a patch from Ben Maurer.
11588 * rootcontext.cs (RootContext.LookupType): Cache negative results.
11590 2004-05-29 Martin Baulig <martin@ximian.com>
11592 * class.cs (IMethodData.ShouldIgnore): New method.
11594 * typemanager.cs (TypeManager.MethodFlags): Don't take a
11595 `Location' argument, we don't need it anywhere. Use
11596 `IMethodData.ShouldIgnore ()' instead of
11597 `MethodData.GetMethodFlags ()'.
11598 (TypeManager.AddMethod): Removed.
11599 (TypeManager.AddMethod2): Renamed to AddMethod.
11601 2004-05-29 Martin Baulig <martin@ximian.com>
11603 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
11605 * convert.cs (Convert.ImplicitReferenceConversion): If we're
11606 converting from a class type S to an interface type and we already
11607 have an object on the stack, don't box it again. Fixes #52578.
11609 2004-05-29 Martin Baulig <martin@ximian.com>
11611 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
11612 Added support for `params' parameters. Fixes #59267.
11614 2004-05-29 Martin Baulig <martin@ximian.com>
11616 * literal.cs (NullPointer): Provide a private .ctor which sets
11617 `type' to TypeManager.object_type. Fixes #59048.
11619 2004-05-29 Martin Baulig <martin@ximian.com>
11621 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
11622 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
11624 * ecore.cs (EventExpr.instance_expr): Make the field private.
11626 2004-05-26 Marek Safar <marek.safar@seznam.cz>
11628 Fixed bug #50080 & cs0214-2.cs
11629 * expression.cs (Cast.DoResolve): Check unsafe context here.
11631 * statement.cs (Resolve.DoResolve): Likewise.
11633 2004-05-26 Martin Baulig <martin@ximian.com>
11635 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
11637 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
11638 (RootContext.LookupType): Pass down the `silent' flag.
11640 2004-05-25 Martin Baulig <martin@ximian.com>
11643 (MethodGroupExpr.IdenticalTypeName): New public property.
11644 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
11645 expression actually refers to a type.
11647 2004-05-25 Martin Baulig <martin@ximian.com>
11649 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
11650 for #56176 and made it actually work.
11652 2004-05-25 Martin Baulig <martin@ximian.com>
11654 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
11655 (FieldExpr, PropertyExpr): Override and implement
11656 CacheTemporaries. Fixes #52279.
11658 2004-05-25 Miguel de Icaza <miguel@ximian.com>
11660 * location.cs: In the new compiler listing a file twice is a
11661 warning, not an error.
11663 2004-05-24 Martin Baulig <martin@ximian.com>
11665 * enum.cs (Enum.DefineType): For the `BaseType' to be a
11666 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
11668 2004-05-24 Martin Baulig <martin@ximian.com>
11670 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
11671 walking the `using' list. Fixes #53921.
11673 2004-05-24 Martin Baulig <martin@ximian.com>
11675 * const.cs (Const.LookupConstantValue): Added support for
11676 EmptyCast's; fixes #55251.
11678 2004-05-24 Martin Baulig <martin@ximian.com>
11680 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
11681 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
11682 which does the CS0135 check. The reason is that we first need to
11683 check whether the variable actually exists.
11685 2004-05-24 Martin Baulig <martin@ximian.com>
11687 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
11688 than RootContext.LookupType() to find the explicit interface
11689 type. Fixes #58584.
11691 2004-05-24 Raja R Harinath <rharinath@novell.com>
11693 * Makefile: Simplify. Use executable.make.
11694 * mcs.exe.sources: New file. List of sources of mcs.exe.
11696 2004-05-24 Anders Carlsson <andersca@gnome.org>
11700 Use the invariant culture when doing String.Compare for CLS case
11703 2004-05-23 Martin Baulig <martin@ximian.com>
11705 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
11706 don't have any dots. Fixes #52622, added cs0246-8.cs.
11708 * namespace.cs (NamespaceEntry.Lookup): Likewise.
11710 2004-05-23 Marek Safar <marek.safar@seznam.cz>
11712 * class.cs (MemberBase.Define): Reuse MemberType member for
11713 resolved type. Other methods can use it too.
11715 2004-05-23 Martin Baulig <martin@ximian.com>
11717 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
11718 the variable also exists in the current block (otherwise, we need
11719 to report a CS0103). Fixes #58670.
11721 2004-05-23 Martin Baulig <martin@ximian.com>
11723 * flowanalysis.cs (Reachability.Reachable): Compute this
11724 on-the-fly rather than storing it as a field.
11726 2004-05-23 Martin Baulig <martin@ximian.com>
11728 * flowanalysis.cs (Reachability.And): Manually compute the
11729 resulting `barrier' from the reachability.
11731 2004-05-23 Marek Safar <marek.safar@seznam.cz>
11734 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
11735 instance of ObsoleteAttribute when symbol is obsolete.
11738 (IMethodData): Extended interface for ObsoleteAttribute support.
11740 2004-05-22 Marek Safar <marek.safar@seznam.cz>
11742 * attribute.cs: Fix bug #55970
11744 2004-05-22 Marek Safar <marek.safar@seznam.cz>
11748 (GetObsoleteAttribute): New method. Creates the instance of
11750 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
11751 ObsoleteAttribute when member is obsolete.
11752 (AttributeTester.Report_ObsoleteMessage): Common method for
11753 Obsolete error/warning reporting.
11756 (TypeContainer.base_classs_type): New member for storing parent type.
11759 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
11760 for this MemberCore.
11762 2004-05-21 Marek Safar <marek.safar@seznam.cz>
11764 * attribute.cs, const.cs: Fix bug #58590
11766 2004-05-21 Martin Baulig <martin@ximian.com>
11768 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
11769 out parameters if the end of the method is unreachable. Fixes
11772 2004-05-21 Marek Safar <marek.safar@seznam.cz>
11774 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
11775 Hari was right, why extra method.
11777 2004-05-21 Marek Safar <marek.safar@seznam.cz>
11779 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
11781 2004-05-20 Martin Baulig <martin@ximian.com>
11783 Merged this back from gmcs to keep the differences to a minumum.
11785 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
11786 instead of a Declspace.
11787 (Attribute.ResolveType): Likewise.
11788 (Attributes.Search): Likewise.
11789 (Attributes.Contains): Likewise.
11790 (Attributes.GetClsCompliantAttribute): Likewise.
11792 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
11794 (MethodData.ApplyAttributes): Take an EmitContext instead of a
11797 2004-05-19 Marek Safar <marek.safar@seznam.cz>
11799 Fix bug #58688 (MCS does not report error when the same attribute
11802 * attribute.cs (Attribute.Emit): Distinction between null and default.
11804 2004-05-19 Raja R Harinath <rharinath@novell.com>
11806 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
11807 of a top-level attribute without an attribute target.
11808 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
11810 (Attribute.Conditional_GetConditionName),
11811 (Attribute.Obsolete_GetObsoleteMessage): Update.
11812 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
11813 part of ScanForIndexerName.
11814 (Attribute.CanIgnoreInvalidAttribute): New function.
11815 (Attribute.ScanForIndexerName): Move to ...
11816 (Attributes.ScanForIndexerName): ... here.
11817 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
11818 (Attributes.Search): New internal variant that can choose not to
11819 complain if types aren't resolved. The original signature now
11821 (Attributes.GetClsCompliantAttribute): Use internal variant, with
11822 complaints suppressed.
11823 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
11824 only if it not useful.
11825 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
11826 top-level for attributes that are shared between the assembly
11827 and a top-level class.
11828 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
11829 * class.cs: Update to reflect changes.
11830 (DefineIndexers): Fuse loops.
11831 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
11832 a couple more variants of attribute names.
11834 2004-05-18 Marek Safar <marek.safar@seznam.cz>
11836 Fix bug #52585 (Implemented explicit attribute declaration)
11839 (Attributable.ValidAttributeTargets): New abstract method. It gets
11840 list of valid attribute targets for explicit target declaration.
11841 (Attribute.Target): It holds target itself.
11842 (AttributeSection): Removed.
11843 (Attribute.CheckTargets): New method. It checks whether attribute
11844 target is valid for the current element.
11847 (EventProperty): New class. For events that are declared like
11848 property (with add and remove accessors).
11849 (EventField): New class. For events that are declared like field.
11852 * cs-parser.jay: Implemented explicit attribute target declaration.
11854 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
11855 Override ValidAttributeTargets.
11858 (ReturnParameter): Class for applying custom attributes on
11860 (ParameterAtribute): New class. Class for applying custom
11861 attributes on the parameter type.
11863 2004-05-17 Miguel de Icaza <miguel@ximian.com>
11865 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
11868 (Method): Allow UNSAFE here.
11870 * modifiers.cs: Support unsafe reporting.
11872 2004-05-17 Marek Safar <marek.safar@seznam.cz>
11874 * decl.cs: Fix bug #58478.
11876 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11878 * statement.cs: When checking for unreachable code on an EmptyStatement,
11879 set the location. Fixes bug #58488.
11881 2004-05-13 Miguel de Icaza <miguel@ximian.com>
11883 * driver.cs: Add -pkg handling.
11885 From Gonzalo: UseShelLExecute=false
11887 2004-05-12 Marek Safar <marek.safar@seznam.cz>
11890 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
11892 (Attribute.IsClsCompliaceRequired): Moved to base for better
11894 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
11895 when attribute is AttributeUsageAttribute.
11896 (Attribute.GetValidTargets): Simplified.
11897 (Attribute.GetAttributeUsage): New method returns AttributeUsage
11898 attribute for this type.
11899 (Attribute.ApplyAttributes): Method renamed to Emit and make
11901 (GlobalAttributeSection): New class for special handling of global
11902 attributes (assembly, module).
11903 (AttributeSection.Emit): New method.
11905 * class.cs: Implemented Attributable abstract methods.
11906 (MethodCore.LabelParameters): Moved to Parameter class.
11907 (Accessor): Is back simple class.
11908 (PropertyMethod): Implemented Attributable abstract class.
11909 (DelegateMethod): Implemented Attributable abstract class.
11910 (Event): New constructor for disctintion between normal Event
11911 and Event with accessors.
11913 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
11915 * codegen.cs, const.cs, decl.cs, delegate.cs:
11916 (CommonAssemblyModulClass): Implemented Attributable abstract class
11919 * enum.cs: Implement IAttributeSupport interface.
11920 (EnumMember): New class for emum members. Implemented Attributable
11924 (ParameterBase): Is abstract.
11925 (ReturnParameter): New class for easier [return:] attribute handling.
11927 * typemanager.cs: Removed builder_to_attr.
11929 2004-05-11 Raja R Harinath <rharinath@novell.com>
11932 * attribute.cs (Attribute.GetPositionalValue): New function.
11933 * class.cs (TypeContainer.VerifyMembers): New function.
11934 (TypeContainer.Emit): Use it.
11935 (ClassOrStruct): New base class for Class and Struct.
11936 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
11937 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
11939 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
11940 then each non-static field should have a FieldOffset attribute.
11941 Otherwise, none of the fields should have a FieldOffset attribute.
11942 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
11943 and FieldOffset attributes.
11944 * typemanager.cs (TypeManager.struct_layout_attribute_type)
11945 (TypeManager.field_offset_attribute_type): New core types.
11946 (TypeManager.InitCoreTypes): Initialize them.
11948 2004-05-11 Michal Moskal <malekith@pld-linux.org>
11950 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
11951 Return correct type.
11954 2004-05-09 Miguel de Icaza <miguel@ximian.com>
11956 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
11957 be implicitly converted to ulong.
11959 * expression.cs: The logic for allowing operator &, | and ^ worked
11960 was wrong, it worked before because we did not report an error in
11961 an else branch. Fixes 57895.
11963 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
11964 allow volatile fields to be reference types.
11966 2004-05-07 Miguel de Icaza <miguel@ximian.com>
11968 * driver.cs: Add support for /debug-
11970 2004-05-07 Raja R Harinath <rharinath@novell.com>
11972 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
11973 Add a 'complain' parameter to silence errors.
11974 (Attribute.Resolve): Update to changes. Put in sanity check to catch
11975 silently overlooked type-resolutions.
11976 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
11977 to reflect changes.
11978 (Attributes.Search): New function.
11979 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
11980 (Attributes.GetAttributeFullName): Remove hack.
11981 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
11982 Update to reflect changes.
11983 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
11984 Use Attributes.Search instead of nested loops.
11986 2004-05-07 Marek Safar <marek.safar@seznam.cz>
11989 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
11990 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
11991 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
11993 * report.cs: (Report.Warning): Renamed to Warning_T because of
11994 parameter collision.
11996 2004-05-05 Raja R Harinath <rharinath@novell.com>
11998 * expression.cs (MemberAccess.ResolveMemberAccess):
11999 Exit with non-zero status after Report.Error.
12000 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
12002 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
12004 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
12006 * support.cs: Don't hang when the file is empty.
12008 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
12010 * support.cs: In SeekableStreamReader, compute the preamble size of the
12011 underlying stream. Position changes should take into account that initial
12014 2004-05-03 Todd Berman <tberman@sevenl.net>
12016 * driver.cs: remove unused GetSysVersion function.
12018 2004-05-03 Todd Berman <tberman@sevenl.net>
12020 * driver.cs: Remove the hack from saturday, as well as the hack
12021 from jackson (LoadAssemblyFromGac), also adds the CWD to the
12022 link_paths to get that bit proper.
12024 2004-05-01 Todd Berman <tberman@sevenl.net>
12026 * driver.cs: Try a LoadFrom before a Load, this checks the current
12027 path. This is currently a bug in mono that is be fixed, however, this
12028 provides a workaround for now. This will be removed when the bug
12031 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
12033 * CryptoConvert.cs: Updated to latest version. Fix issue with
12034 incomplete key pairs (#57941).
12036 2004-05-01 Todd Berman <tberman@sevenl.net>
12038 * driver.cs: Remove '.' from path_chars, now System.* loads properly
12041 2004-04-30 Jackson Harper <jackson@ximian.com>
12043 * codegen.cs: Open keys readonly.
12045 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12047 * typemanager.cs: don't report cyclic struct layout when a struct
12048 contains 2 or more fields of the same type. Failed for Pango.AttrShape
12049 which has 2 Pango.Rectangle fields.
12051 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
12053 * expression.cs: Handle IntPtr comparisons with IL code
12054 rather than a method call.
12056 2004-04-29 Martin Baulig <martin@ximian.com>
12058 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
12059 the list of PropertyInfo's in class hierarchy and find the
12060 accessor. Fixes #56013.
12062 2004-04-29 Martin Baulig <martin@ximian.com>
12064 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
12066 2004-04-29 Martin Baulig <martin@ximian.com>
12068 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
12070 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
12072 2004-04-29 Martin Baulig <martin@ximian.com>
12074 * class.cs (ConstructorInitializer.Resolve): Check whether the
12075 parent .ctor is accessible. Fixes #52146.
12077 2004-04-29 Martin Baulig <martin@ximian.com>
12079 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
12081 * statement.cs (Using.EmitLocalVariableDecls): Use
12082 TypeManager.idisposable_type, not typeof (IDisposable).
12083 (Foreach.EmitCollectionForeach): Added support for valuetypes.
12085 2004-04-29 Martin Baulig <martin@ximian.com>
12087 * class.cs (Event.Define): Don't emit the field and don't set
12088 RTSpecialName and SpecialName for events on interfaces. Fixes
12091 2004-04-29 Raja R Harinath <rharinath@novell.com>
12093 Refactor Attribute.ApplyAttributes.
12094 * attribute.cs (Attributable): New base class for objects that can
12095 have Attributes applied on them.
12096 (Attribute): Make AttributeUsage fields public.
12097 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
12098 (Attribute.IsInternalCall): New property.
12099 (Attribute.UsageAttr): Convert to a public read-only property.
12100 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
12101 (Attribute.ResolveType, Attribute.Resolve)
12102 (Attribute.ScanForIndexerName): Update to reflect changes.
12103 (Attribute.CheckAttributeTarget): Re-format.
12104 (Attribute.ApplyAttributes): Refactor, to various
12105 Attributable.ApplyAttributeBuilder methods.
12106 * decl.cs (MemberCore): Make Attributable.
12107 * class.cs (Accessor): Make Attributable.
12108 (MethodData.ApplyAttributes): Use proper attribute types, not
12110 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
12111 (TypeContainer.ApplyAttributeBuilder)
12112 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
12113 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
12114 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
12115 (Operator.ApplyAttributeBuilder): New factored-out methods.
12116 * const.cs (Const.ApplyAttributeBuilder): Likewise.
12117 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
12118 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
12119 * parameter.cs (ParameterBase): New Attributable base class
12120 that can also represent Return types.
12121 (Parameter): Update to the changes.
12123 2004-04-29 Jackson Harper <jackson@ximian.com>
12125 * driver.cs: Prefer the corlib system version when looking for
12126 assemblies in the GAC. This is still a hack, but its a better hack
12129 2004-04-29 Marek Safar <marek.safar@seznam.cz>
12131 * decl.cs, enum.cs: Improved error 3005 reporting.
12133 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
12134 (related_symbols): New private member for list of symbols
12135 related to reported error/warning.
12137 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
12139 2004-04-29 Martin Baulig <martin@ximian.com>
12141 * ecore.cs (Expression.Constantify): If we're an enum and
12142 TypeManager.TypeToCoreType() doesn't give us another type, use
12143 t.UnderlyingSystemType. Fixes #56178.
12145 2004-04-29 Martin Baulig <martin@ximian.com>
12147 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
12148 interfaces and for each interface, only add members directly
12149 declared in that interface. Fixes #53255.
12151 2004-04-28 Martin Baulig <martin@ximian.com>
12153 * expression.cs (ConditionalLogicalOperator): Use a temporary
12154 variable for `left' to avoid that we evaluate it more than once;
12157 2004-04-28 Martin Baulig <martin@ximian.com>
12159 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
12162 2004-04-28 Martin Baulig <martin@ximian.com>
12164 * statement.cs (LocalInfo.Resolve): Check whether the type is not
12167 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
12168 whether the type is not void (CS1547).
12170 2004-04-28 Martin Baulig <martin@ximian.com>
12172 * expression.cs (Unary.DoResolveLValue): Override this and report
12173 CS0131 for anything but Operator.Indirection.
12175 2004-04-28 Martin Baulig <martin@ximian.com>
12177 Committing a patch from Ben Maurer; see bug #50820.
12179 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
12182 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
12185 2004-04-28 Martin Baulig <martin@ximian.com>
12187 Committing a patch from Ben Maurer; see bug #50820.
12189 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
12192 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
12195 2004-04-28 Martin Baulig <martin@ximian.com>
12197 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
12198 (Block.AddLabel): Call DoLookupLabel() to only search in the
12201 2004-04-28 Martin Baulig <martin@ximian.com>
12203 * cfold.cs (ConstantFold.BinaryFold): Added special support for
12204 comparing StringConstants and NullLiterals in Equality and Inequality.
12206 2004-04-28 Jackson Harper <jackson@ximian.com>
12208 * driver.cs: Attempt to load referenced assemblies from the
12209 GAC. This is the quick and dirty version of this method that
12210 doesnt take into account versions and just takes the first
12211 canidate found. Will be good enough for now as we will not have more
12212 then one version installed into the GAC until I update this method.
12214 2004-04-28 Martin Baulig <martin@ximian.com>
12216 * typemanager.cs (TypeManager.CheckStructCycles): New public
12217 static method to check for cycles in the struct layout.
12219 * rootcontext.cs (RootContext.PopulateTypes): Call
12220 TypeManager.CheckStructCycles() for each TypeContainer.
12221 [Note: We only need to visit each type once.]
12223 2004-04-28 Martin Baulig <martin@ximian.com>
12225 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
12227 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
12228 success and added `out object value'. Use a `bool resolved' field
12229 to check whether we've already been called rather than
12230 `ConstantValue != null' since this breaks for NullLiterals.
12232 2004-04-28 Raja R Harinath <rharinath@novell.com>
12234 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
12235 setting of this flag, since the 'set' method may be non-public.
12237 2004-04-28 Raja R Harinath <rharinath@novell.com>
12239 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
12240 check on current_vector.Block.
12242 2004-04-27 Martin Baulig <martin@ximian.com>
12244 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
12245 a field initializer. Fixes #56459.
12247 2004-04-27 Martin Baulig <martin@ximian.com>
12249 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
12250 we're not attempting to use an indexer. Fixes #52154.
12252 2004-04-27 Martin Baulig <martin@ximian.com>
12254 * statement.cs (Return): Don't create a return label if we don't
12255 need it; reverts my change from January 20th. Thanks to Ben
12258 2004-04-27 Martin Baulig <martin@ximian.com>
12260 According to the spec, `goto' can only leave a nested scope, but
12263 * statement.cs (Block.LookupLabel): Only lookup in the current
12264 block, don't recurse into parent or child blocks.
12265 (Block.AddLabel): Check in parent and child blocks, report
12266 CS0140/CS0158 if we find a duplicate.
12267 (Block): Removed this indexer for label lookups.
12268 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
12269 this already does the error reporting for us.
12272 (FlowBranching.UsageVector.Block): New public variable; may be null.
12273 (FlowBranching.CreateSibling): Added `Block' argument.
12274 (FlowBranching.LookupLabel): New public virtual method. Lookup a
12275 label for the target of a `goto' and check whether we're not
12276 leaving a `finally'.
12278 2004-04-27 Martin Baulig <martin@ximian.com>
12280 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
12281 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
12284 2004-04-27 Martin Baulig <martin@ximian.com>
12286 * statement.cs (Block.AddLabel): Also check for implicit blocks
12287 and added a CS0158 check.
12289 2004-04-27 Martin Baulig <martin@ximian.com>
12291 * flowanalysis.cs (FlowBranchingLoop): New class.
12292 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
12293 UsageVector's instead of an ArrayList.
12294 (FlowBranching.Label): Likewise.
12295 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
12296 (FlowBranching.AddBreakVector): New method.
12298 2004-04-27 Miguel de Icaza <miguel@ximian.com>
12300 * attribute.cs: Small regression fix: only convert the type if we
12301 the type is different, fixes System.Drawing build.
12303 2004-04-27 Martin Baulig <martin@ximian.com>
12305 * attribute.cs (Attribute.Resolve): If we have a constant value
12306 for a named field or property, implicity convert it to the correct
12309 2004-04-27 Raja R Harinath <rharinath@novell.com>
12311 * statement.cs (Block.Block): Implicit blocks share
12312 'child_variable_names' fields with parent blocks.
12313 (Block.AddChildVariableNames): Remove.
12314 (Block.AddVariable): Mark variable as "used by a child block" in
12315 every surrounding block.
12316 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
12317 been used in a child block, complain about violation of "Invariant
12318 meaning in blocks" rule.
12319 * cs-parser.jay (declare_local_variables): Don't use
12320 AddChildVariableNames.
12321 (foreach_statement): Don't create an implicit block: 'foreach'
12322 introduces a scope.
12324 2004-04-23 Miguel de Icaza <miguel@ximian.com>
12326 * convert.cs (ImplicitNumericConversion): 0 is also positive when
12327 converting from 0L to ulong. Fixes 57522.
12329 2004-04-22 Marek Safar <marek.safar@seznam.cz>
12331 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
12332 derived class hides via 'new' keyword field from base class (test-242.cs).
12333 TODO: Handle this in the more general way.
12335 * class.cs (CheckBase): Ditto.
12337 2004-04-22 Marek Safar <marek.safar@seznam.cz>
12339 * decl.cs (caching_flags): New member for storing cached values
12341 (MemberCore.Flags): New enum where bit flags for caching_flags
12343 (MemberCore.cls_compliance): Moved to caching_flags.
12344 (DeclSpace.Created): Moved to caching_flags.
12346 * class.cs: Use caching_flags instead of DeclSpace.Created
12348 2004-04-21 Miguel de Icaza <miguel@ximian.com>
12350 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
12351 if we are only a derived class, not a nested class.
12353 * typemanager.cs: Same as above, but do this at the MemberLookup
12354 level (used by field and methods, properties are handled in
12355 PropertyExpr). Allow for the qualified access if we are a nested
12358 2004-04-21 Marek Safar <marek.safar@seznam.cz>
12360 * class.cs: Refactoring.
12361 (IMethodData): New inteface; Holds links to parent members
12362 to avoid member duplication (reduced memory allocation).
12363 (Method): Implemented IMethodData interface.
12364 (PropertyBase): New inner classes for get/set methods.
12365 (PropertyBase.PropertyMethod): Implemented IMethodData interface
12366 (Event): New inner classes for add/remove methods.
12367 (Event.DelegateMethod): Implemented IMethodData interface.
12369 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
12370 EmitContext (related to class.cs refactoring).
12372 2004-04-21 Raja R Harinath <rharinath@novell.com>
12374 * delegate.cs (Delegate.VerifyApplicability): If the number of
12375 arguments are the same as the number of parameters, first try to
12376 verify applicability ignoring any 'params' modifier on the last
12380 2004-04-16 Raja R Harinath <rharinath@novell.com>
12382 * class.cs (TypeContainer.AddIndexer): Use
12383 'ExplicitInterfaceName' to determine if interface name was
12384 explicitly specified. 'InterfaceType' is not initialized at this time.
12385 (TypeContainer.DefineIndexers): Remove use of temporary list. The
12386 Indexers array is already in the required order. Initialize
12387 'IndexerName' only if there are normal indexers.
12388 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
12389 (TypeContainer.Emit): Emit DefaultMember attribute only if
12390 IndexerName is initialized.
12393 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
12395 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
12398 2004-04-15 Raja R Harinath <rharinath@novell.com>
12400 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
12404 * attribute.cs (Attribute.Resolve): Check for duplicate named
12408 2004-04-15 Miguel de Icaza <miguel@ximian.com>
12410 * iterators.cs (MarkYield): track whether we are in an exception,
12411 and generate code accordingly. Use a temporary value to store the
12412 result for our state.
12414 I had ignored a bit the interaction of try/catch with iterators
12415 since their behavior was not entirely obvious, but now it is
12416 possible to verify that our behavior is the same as MS .NET 2.0
12420 2004-04-14 Miguel de Icaza <miguel@ximian.com>
12422 * iterators.cs: Avoid creating temporaries if there is no work to
12425 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
12426 Enumerations, use TypeManager.EnumToUnderlying and call
12429 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
12432 (This.Emit): Use EmitContext.EmitThis to emit our
12435 (This.EmitAssign): Ditto.
12437 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
12438 codepaths, we will move all the functionality into
12441 (FieldExpr.EmitAssign): Ditto.
12443 This fixes several hidden bugs that I uncovered while doing a code
12444 review of this today.
12446 * codegen.cs (EmitThis): reworked so the semantics are more clear
12447 and also support value types "this" instances.
12449 * iterators.cs: Changed so that for iterators in value types, we
12450 do not pass the value type as a parameter.
12452 Initialization of the enumerator helpers is now done in the caller
12453 instead of passing the parameters to the constructors and having
12454 the constructor set the fields.
12456 The fields have now `assembly' visibility instead of private.
12458 2004-04-11 Miguel de Icaza <miguel@ximian.com>
12460 * expression.cs (Argument.Resolve): Check if fields passed as ref
12461 or out are contained in a MarshalByRefObject.
12463 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
12464 another compiler type.
12466 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
12468 * class.cs (Indexer.Define): use the new name checking method.
12469 Also, return false on an error.
12470 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
12471 (is_identifier_[start/part]_character): make static.
12473 2004-04-10 Miguel de Icaza <miguel@ximian.com>
12475 * expression.cs (Binary.ResolveOperator): Do no append strings
12476 twice: since we can be invoked more than once (array evaluation)
12477 on the same concatenation, take care of this here. Based on a fix
12478 from Ben (bug #56454)
12480 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
12482 * codegen.cs: Fix another case where CS1548 must be reported (when
12483 delay-sign isn't specified and no private is available #56564). Fix
12484 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
12485 error when MCS is used on the MS runtime and we need to delay-sign
12486 (which seems unsupported by AssemblyBuilder - see #56621).
12488 2004-04-08 Marek Safar <marek.safar@seznam.cz>
12490 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
12491 (TypeManager.ComputeNamespaces): Faster implementation for
12494 * compiler.csproj: Updated AssemblyName to mcs.
12496 2004-04-07 Miguel de Icaza <miguel@ximian.com>
12498 * rootcontext.cs: Add new types to the boot resolution.
12500 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
12501 MulticastDelegate is not allowed.
12503 * typemanager.cs: Add new types to lookup: System.TypedReference
12506 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
12507 check for TypedReference or ArgIterator, they are not allowed.
12509 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
12510 makes us properly catch 1510 in some conditions (see bug 56016 for
12513 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
12515 * CryptoConvert.cs: update from corlib version
12518 2004-04-05 Miguel de Icaza <miguel@ximian.com>
12520 * class.cs (Indexer.Define): Check indexername declaration
12522 2004-04-05 Marek Safar <marek.safar@seznam.cz>
12524 * attribute.cs (IsClsCompliant): Fixed problem with handling
12525 all three states (compliant, not-compliant, undetected).
12527 2004-03-30 Marek Safar <marek.safar@seznam.cz>
12529 * attribute.cs (Attribute): Location is now public.
12530 (Resolve): Store resolved arguments (pos_values) in attribute class.
12531 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
12532 (GetClsCompliantAttributeValue): New method that gets
12533 CLSCompliantAttribute value.
12534 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
12535 if exists else null.
12536 (AttributeTester): New class for CLS-Compliant verification routines.
12538 * class.cs (Emit): Add CLS-Compliant verification.
12539 (Method.GetSignatureForError): Implemented.
12540 (Constructor.GetSignatureForError): Implemented
12541 (Constructor.HasCompliantArgs): Returns if constructor has
12542 CLS-Compliant arguments.
12543 (Constructor.Emit): Override.
12544 (Construcor.IsIdentifierClsCompliant): New method; For constructors
12545 is needed to test only parameters.
12546 (FieldBase.GetSignatureForError): Implemented.
12547 (TypeContainer): New member for storing base interfaces.
12548 (TypeContainer.FindMembers): Search in base interfaces too.
12550 * codegen.cs (GetClsComplianceAttribute): New method that gets
12551 assembly or module CLSCompliantAttribute value.
12552 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
12554 (ModuleClass.Emit): Add error 3012 test.
12556 * const.cs (Emit): Override and call base for CLS-Compliant tests.
12558 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
12559 state for all decl types.
12560 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
12561 if CLS-Compliant tests are required.
12562 (IsClsCompliaceRequired): New method. Analyze whether code
12563 must be CLS-Compliant.
12564 (IsExposedFromAssembly): New method. Returns true when MemberCore
12565 is exposed from assembly.
12566 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
12567 value or gets cached value.
12568 (HasClsCompliantAttribute): New method. Returns true if MemberCore
12569 is explicitly marked with CLSCompliantAttribute.
12570 (IsIdentifierClsCompliant): New abstract method. This method is
12571 used to testing error 3005.
12572 (IsIdentifierAndParamClsCompliant): New method. Common helper method
12573 for identifier and parameters CLS-Compliant testing.
12574 (VerifyClsCompliance): New method. The main virtual method for
12575 CLS-Compliant verifications.
12576 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
12577 null. I don't know why is null (too many public members !).
12578 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
12579 and get value of first CLSCompliantAttribute that found.
12581 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
12582 (VerifyClsCompliance): Override and add extra tests.
12584 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
12585 clscheck- disable CLS-Compliant verification event if assembly is has
12586 CLSCompliantAttribute(true).
12588 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
12589 ApllyAttribute is now called in emit section as in the other cases.
12590 Possible future Emit integration.
12591 (IsIdentifierClsCompliant): New override.
12592 (VerifyClsCompliance): New override.
12593 (GetEnumeratorName): Returns full enum name.
12595 * parameter.cs (GetSignatureForError): Implemented.
12597 * report.cs (WarningData): New struct for Warning message information.
12598 (LocationOfPreviousError): New method.
12599 (Warning): New method. Reports warning based on the warning table.
12600 (Error_T): New method. Reports error based on the error table.
12602 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
12603 verifications are done here.
12605 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
12607 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
12608 CLSCompliantAttribute.
12609 (all_imported_types): New member holds all imported types from other
12611 (LoadAllImportedTypes): New method fills static table with exported types
12612 from all referenced assemblies.
12613 (Modules): New property returns all assembly modules.
12615 2004-03-30 Miguel de Icaza <miguel@ximian.com>
12617 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
12618 throwing a parser error.
12620 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
12621 which removes the hardcoded get_/set_ prefixes for properties, as
12622 IL allows for the properties to be named something else.
12626 * expression.cs: Do not override operand before we know if it is
12627 non-null. Fix 56207
12629 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
12631 * typemanager.cs: support for pinned variables.
12633 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
12635 * decl.cs, typemanager.cs: Avoid using an arraylist
12636 as a buffer if there is only one result set.
12638 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
12640 * expression.cs: Make sure you cant call a static method
12641 with an instance expression, bug #56174.
12643 2004-03-29 Miguel de Icaza <miguel@ximian.com>
12645 * class.cs (IsDuplicateImplementation): Improve error reporting to
12646 flag 663 (method only differs in parameter modifier).
12648 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
12649 in preprocessor directives.
12651 * location.cs (LookupFile): Allow for the empty path.
12653 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
12654 better approach for some of that patch, but its failing with the
12655 CharSet enumeration. For now try/catch will do.
12657 * typemanager.cs: Do not crash if a struct does not have fields.
12660 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
12662 * expression.cs: cs0213, cant fix a fixed expression.
12665 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
12667 * cs-parser.jay: detect invalid embeded statements gracefully.
12670 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
12672 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
12675 the invocation type may not be a subclass of the tye of the item/
12676 The type of the item must be a subclass of the invocation item.
12681 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
12683 * attribute.cs: Added methods to get a string and a bool from an
12684 attribute. Required to information from AssemblyKeyFileAttribute,
12685 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
12686 * codegen.cs: Modified AssemblyName creation to include support for
12687 strongnames. Catch additional exceptions to report them as CS1548.
12688 * compiler.csproj: Updated include CryptoConvert.cs.
12689 * compiler.csproj.user: Removed file - user specific configuration.
12690 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
12691 Mono.Security assembly. The original class is maintained and tested in
12692 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
12693 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
12694 like CSC 8.0 (C# v2) supports.
12695 * Makefile: Added CryptoConvert.cs to mcs sources.
12696 * rootcontext.cs: Added new options for strongnames.
12698 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
12700 * driver.cs: For --expect-error, report error code `2'
12701 if the program compiled with no errors, error code `1' if
12702 it compiled with an error other than the one expected.
12704 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
12706 * compiler.csproj: Updated for Visual Studio .NET 2003.
12707 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
12708 * compiler.sln: Updated for Visual Studio .NET 2003.
12710 2004-03-24 Ravi Pratap M <ravi@ximian.com>
12712 * expression.cs: Fix bug #47234. We basically need to apply the
12713 rule that we prefer the conversion of null to a reference type
12714 when faced with a conversion to 'object' (csc behaviour).
12716 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
12718 * statement.cs: Shorter form for foreach, eliminates
12719 a local variable. r=Martin.
12721 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
12723 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
12724 checks if we can use brtrue/brfalse to test for 0.
12725 * expression.cs: use the above in the test for using brtrue/brfalse.
12726 cleanup code a bit.
12728 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
12730 * expression.cs: Rewrite string concat stuff. Benefits:
12732 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
12733 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
12734 rather than a concat chain.
12736 * typemanager.cs: Add lookups for more concat overloads.
12738 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
12740 * expression.cs: Emit shorter il code for array init.
12757 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
12759 * statement.cs: Before, two switch blocks would be merged if the
12760 total size of the blocks (end_item - begin_item + 1) was less than
12761 two times the combined sizes of the blocks.
12763 Now, it will only merge if after the merge at least half of the
12768 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
12770 * class.cs : csc build fix for GetMethods(). See bug #52503.
12772 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
12774 * expression.cs: Make sure fp comparisons work with NaN.
12775 This fixes bug #54303. Mig approved this patch a long
12776 time ago, but we were not able to test b/c the runtime
12779 2004-03-19 Miguel de Icaza <miguel@ximian.com>
12781 * ecore.cs (TypExpr.GetHashCode): implement this overload.
12783 2004-03-19 Martin Baulig <martin@ximian.com>
12785 * class.cs (MemberCore.IsDuplicateImplementation): Report the
12786 error here and not in our caller.
12788 2004-03-19 Martin Baulig <martin@ximian.com>
12790 * interface.cs: Completely killed this file.
12791 (Interface): We're now a TypeContainer and live in class.cs.
12793 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
12794 argument; we're now also called for interfaces.
12795 (TypeContainer.DefineMembers): Allow this method being called
12797 (TypeContainer.GetMethods): New public method; formerly known as
12798 Interface.GetMethod(). This is used by PendingImplementation.
12799 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
12800 it's now private and non-static.
12801 (Interface): Moved this here; it's now implemented similar to
12803 (Method, Property, Event, Indexer): Added `bool is_interface'
12804 argument to their .ctor's.
12805 (MemberBase.IsInterface): New public field.
12807 * cs-parser.jay: Create normal Method, Property, Event, Indexer
12808 instances instead of InterfaceMethod, InterfaceProperty, etc.
12809 (opt_interface_base): Removed; we now use `opt_class_base' instead.
12810 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
12812 2004-03-19 Martin Baulig <martin@ximian.com>
12814 * class.cs (MethodCore.IsDuplicateImplementation): New private
12815 method which does the CS0111 checking.
12816 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
12817 Use IsDuplicateImplementation().
12819 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
12821 * decl.cs (FindMemberToOverride): New method to find the correct
12822 method or property to override in the base class.
12824 - Make Method/Property use the above method to find the
12825 version in the base class.
12826 - Remove the InheritableMemberSignatureCompare as it is now
12829 This patch makes large code bases much faster to compile, as it is
12830 O(n) rather than O(n^2) to do this validation.
12832 Also, it fixes bug 52458 which is that nested classes are not
12833 taken into account when finding the base class member.
12835 Reviewed/Approved by Martin.
12837 2004-03-17 Marek Safar <marek.safar@seznam.cz>
12839 * interface.cs: In all interface classes removed redundant
12840 member initialization.
12842 2004-03-16 Martin Baulig <martin@ximian.com>
12844 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
12846 2004-03-15 Miguel de Icaza <miguel@ximian.com>
12848 * decl.cs (DefineTypeAndParents): New helper method to define a
12849 type's containers before the type itself is defined; This is a
12850 bug exposed by the recent changes to Windows.Forms when an
12851 implemented interface was defined inside a class that had not been
12854 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
12856 (Check): Loop correctly to report errors modifiers
12857 (UNSAFE was not in the loop, since it was the same as TOP).
12859 * interface.cs: Every interface member now takes a ModFlags,
12860 instead of a "is_new" bool, which we set on the base MemberCore.
12862 Every place where we called "UnsafeOk" in the interface, now we
12863 call the proper member (InterfaceMethod.UnsafeOK) instead to get
12864 the unsafe settings from the member declaration instead of the
12865 container interface.
12867 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
12869 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
12870 `set_indexer_name' to the pending bits (one per type).
12872 We fixed a bug today that was picking the wrong method to
12873 override, since for properties the existing InterfaceMethod code
12874 basically ignored the method name. Now we make sure that the
12875 method name is one of the valid indexer names.
12877 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
12879 * support.cs (SeekableStreamReader): Keep track of stream byte
12880 positions and don't mix them with character offsets to the buffer.
12882 Patch from Gustavo Giráldez
12884 2004-03-15 Marek Safar <marek.safar@seznam.cz>
12886 * interface.cs (InterfaceSetGetBase): Removed double member
12887 initialization, base class does it as well.
12889 2004-03-13 Martin Baulig <martin@ximian.com>
12891 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
12892 when compiling corlib.
12894 2004-03-13 Miguel de Icaza <miguel@ximian.com>
12896 * convert.cs (ExplicitConversion): We were reporting an error on
12897 certain conversions (object_type source to a value type, when the
12898 expression was `null') before we had a chance to pass it through
12899 the user defined conversions.
12901 * driver.cs: Replace / and \ in resource specifications to dots.
12904 * class.cs: Add check for duplicate operators. Fixes 52477
12906 2004-03-11 Miguel de Icaza <miguel@ximian.com>
12908 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
12909 that are in the middle of the statements, not only at the end.
12912 * class.cs (TypeContainer.AddField): No longer set the
12913 `HaveStaticConstructor' flag, now we call it
12914 `UserDefineStaticConstructor' to diferentiate the slightly
12915 semantic difference.
12917 The situation is that we were not adding BeforeFieldInit (from
12918 Modifiers.TypeAttr) to classes that could have it.
12919 BeforeFieldInit should be set to classes that have no static
12924 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
12926 And most importantly Zoltan's comment:
12928 http://bugzilla.ximian.com/show_bug.cgi?id=44229
12930 "I think beforefieldinit means 'it's ok to initialize the type sometime
12931 before its static fields are used', i.e. initialization does not need
12932 to be triggered by the first access to the type. Setting this flag
12933 helps the JIT to compile better code, since it can run the static
12934 constructor at JIT time, and does not need to generate code to call it
12935 (possibly lots of times) at runtime. Unfortunately, mcs does not set
12936 this flag for lots of classes like String.
12938 csc sets this flag if the type does not have an explicit static
12939 constructor. The reasoning seems to be that if there are only static
12940 initalizers for a type, and no static constructor, then the programmer
12941 does not care when this initialization happens, so beforefieldinit
12944 This bug prevents the AOT compiler from being usable, since it
12945 generates so many calls to mono_runtime_class_init that the AOT code
12946 is much slower than the JITted code. The JITted code is faster,
12947 because it does not generate these calls if the vtable is type is
12948 already initialized, which is true in the majority of cases. But the
12949 AOT compiler can't do this."
12951 2004-03-10 Miguel de Icaza <miguel@ximian.com>
12953 * class.cs (MethodData.Emit): Refactor the code so symbolic
12954 information is generated for destructors; For some reasons we
12955 were taking a code path that did not generate symbolic information
12958 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
12960 * class.cs: Create a Constructor.CheckBase method that
12961 takes care of all validation type code. The method
12962 contains some code that was moved from Define.
12964 It also includes new code that checks for duplicate ctors.
12965 This fixes bug #55148.
12967 2004-03-09 Joshua Tauberer <tauberer@for.net>
12969 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
12970 a { ... }-style array creation invokes EmitStaticInitializers
12971 which is not good for reference-type arrays. String, decimal
12972 and now null constants (NullCast) are not counted toward
12973 static initializers.
12975 2004-03-05 Martin Baulig <martin@ximian.com>
12977 * location.cs (SourceFile.HasLineDirective): New public field;
12978 specifies whether the file contains or is referenced by a "#line"
12980 (Location.DefineSymbolDocuments): Ignore source files which
12981 either contain or are referenced by a "#line" directive.
12983 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
12985 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
12986 direct access to our parent, so check the method inline there.
12988 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
12990 * expression.cs (Invocation.EmitCall): Miguel's last commit
12991 caused a regression. If you had:
12996 In Foo the implict this would be null.
12998 2004-02-27 Miguel de Icaza <miguel@ximian.com>
13000 * expression.cs (Invocation.EmitCall): If the method is not
13001 virtual, do not emit a CallVirt to it, use Call.
13003 * typemanager.cs (GetFullNameSignature): Improve the method to
13004 cope with ".ctor" and replace it with the type name.
13006 * class.cs (ConstructorInitializer.Resolve): Now the method takes
13007 as an argument the ConstructorBuilder where it is being defined,
13008 to catch the recursive constructor invocations.
13010 2004-02-26 Miguel de Icaza <miguel@ximian.com>
13012 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
13013 routines to check if a type is an enumerable/enumerator allow
13014 classes that implement the IEnumerable or IEnumerator interfaces.
13016 * class.cs (Property, Operator): Implement IIteratorContainer, and
13017 implement SetYields.
13019 (Property.Define): Do the block swapping for get_methods in the
13020 context of iterators. We need to check if Properties also
13021 include indexers or not.
13023 (Operator): Assign the Block before invoking the
13024 OperatorMethod.Define, so we can trigger the Iterator code
13027 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
13028 Property and Operator classes are not created when we parse the
13029 declarator but until we have the block completed, so we use a
13030 singleton SimpleIteratorContainer.Simple to flag whether the
13031 SetYields has been invoked.
13033 We propagate this setting then to the Property or the Operator to
13034 allow the `yield' to function.
13036 2004-02-25 Marek Safar <marek.safar@seznam.cz>
13038 * codegen.cs: Implemented attribute support for modules.
13039 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
13040 Assembly/Module functionality.
13042 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
13043 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
13044 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
13046 2004-02-16 Marek Safar <marek.safar@seznam.cz>
13048 * interface.cs (FindMembers): The operation is performed on all base
13049 interfaces and not only on the first. It is required for future CLS Compliance patch.
13051 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
13053 * statement.cs, codegen.cs:
13054 This patch deals with patterns such as:
13056 public class List : IEnumerable {
13058 public MyEnumerator GetEnumerator () {
13059 return new MyEnumerator(this);
13062 IEnumerator IEnumerable.GetEnumerator () {
13066 public struct MyEnumerator : IEnumerator {
13071 Before, there were a few things we did wrong:
13072 1) we would emit callvirt on a struct, which is illegal
13073 2) we emited ldarg when we needed to emit ldarga
13074 3) we would mistakenly call the interface methods on an enumerator
13075 type that derived from IEnumerator and was in another assembly. For example:
13077 public class MyEnumerator : IEnumerator
13079 Would have the interface methods called, even if there were public impls of the
13080 method. In a struct, this lead to invalid IL code.
13082 2004-02-11 Marek Safar <marek.safar@seznam.cz>
13084 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
13087 * delegate.cs (Define): Fixed crash when delegate type is undefined.
13089 2004-02-11 Miguel de Icaza <miguel@ximian.com>
13091 * cs-parser.jay: Fix small regression: we were not testing V2
13092 compiler features correctly.
13094 * interface.cs: If the emit context is null, then create one
13096 2004-02-09 Marek Safar <marek.safar@seznam.cz>
13098 * decl.cs (GetSignatureForError): New virtual method to get full name
13099 for error messages.
13101 * attribute.cs (IAttributeSupport): New interface for attribute setting.
13102 Now it is possible to rewrite ApplyAttributes method to be less if/else.
13104 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
13105 Duplicated members and code in these classes has been removed.
13106 Better encapsulation in these classes.
13108 2004-02-07 Miguel de Icaza <miguel@ximian.com>
13110 * assign.cs (Assign.DoResolve): When dealing with compound
13111 assignments, there is a new rule in ECMA C# 2.4 (might have been
13112 there before, but it is documented here) that states that in:
13116 If b is of type int, and the `op' is a shift-operator, then the
13117 above is evaluated as:
13121 * expression.cs (Binary.ResolveOperator): Instead of testing for
13122 int/uint/long/ulong, try to implicitly convert to any of those
13123 types and use that in pointer arithmetic.
13125 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
13126 method to print information for from the type, not from the
13127 null-method we were given.
13129 2004-02-01 Duncan Mak <duncan@ximian.com>
13131 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
13132 parsing for cmd, fixes bug #53694.
13134 2004-02-04 Marek Safar <marek.safar@seznam.cz>
13136 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
13137 in the member name duplication tests. Property and operator name duplication
13138 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
13140 2004-02-03 Marek Safar <marek.safar@seznam.cz>
13142 * interface.cs (PopulateMethod): Fixed crash when interface method
13143 returns not existing type (error test cs0246-3.cs).
13145 2004-02-02 Ravi Pratap M <ravi@ximian.com>
13147 * cs-parser.jay (interface_accessors): Re-write actions to also
13148 store attributes attached to get and set methods. Fix spelling
13151 (inteface_property_declaration): Modify accordingly.
13153 (InterfaceAccessorInfo): New helper class to store information to pass
13154 around between rules that use interface_accessors.
13156 * interface.cs (Emit): Apply attributes on the get and set
13157 accessors of properties and indexers too.
13159 * attribute.cs (ApplyAttributes): Modify accordingly to use the
13160 right MethodBuilder when applying attributes to the get and set accessors.
13162 2004-01-31 Miguel de Icaza <miguel@ximian.com>
13164 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
13166 2004-01-26 Miguel de Icaza <miguel@ximian.com>
13168 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
13170 2004-01-25 Miguel de Icaza <miguel@ximian.com>
13172 * cs-parser.jay: Remove YIELD token, instead use the new grammar
13173 changes that treat `yield' specially when present before `break'
13174 or `return' tokens.
13176 * cs-tokenizer.cs: yield is no longer a keyword.
13178 2004-01-23 Marek Safar <marek.safar@seznam.cz>
13180 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
13181 setting for default constructors.
13182 For default constructors are almost every time set wrong Modifier. The
13183 generated IL code has been alright. But inside mcs this values was
13184 wrong and this was reason why several of my CLS Compliance tests
13187 2004-01-22 Martin Baulig <martin@ximian.com>
13189 * cs-parser.jay (namespace_or_type_name): Return an Expression,
13190 not a QualifiedIdentifier. This is what `type_name_expression'
13191 was previously doing.
13192 (type_name_expression): Removed; the code is now in
13193 `namespace_or_type_name'.
13194 (qualified_identifier): Removed, use `namespace_or_type_name'
13196 (QualifiedIdentifier): Removed this class.
13198 2004-01-22 Martin Baulig <martin@ximian.com>
13200 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
13201 not a string as alias name.
13203 2004-01-21 Miguel de Icaza <miguel@ximian.com>
13205 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
13206 #52730 bug, and instead compute correctly the need to use a
13207 temporary variable when requesting an address based on the
13208 static/instace modified of the field and the constructor.
13210 2004-01-21 Martin Baulig <martin@ximian.com>
13212 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
13213 class and namespace before looking up aliases. Fixes #52517.
13215 2004-01-21 Martin Baulig <martin@ximian.com>
13217 * flowanalysis.cs (UsageVector.Merge): Allow variables being
13218 assinged in a 'try'; fixes exception4.cs.
13220 2004-01-21 Marek Safar <marek.safar@seznam.cz>
13221 * class.cs : Implemented parameter-less constructor for TypeContainer
13223 * decl.cs: Attributes are now stored here. New property OptAttributes
13225 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
13227 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
13229 2004-01-21 Marek Safar <marek.safar@seznam.cz>
13231 * typemanager.cs (CSharpSignature): Now reports also inner class name.
13232 (CSharpSignature): New method for indexer and property signature.
13234 2004-01-21 Marek Safar <marek.safar@seznam.cz>
13236 * pending.cs (IsVirtualFilter): Faster implementation.
13238 2004-01-21 Marek Safar <marek.safar@seznam.cz>
13240 * typemanager.cs: Avoid inclusion of same assembly more than once.
13242 2004-01-21 Marek Safar <marek.safar@seznam.cz>
13244 * cs-parser.jay: Fixed problem where the last assembly attribute
13245 has been applied also to following declaration (class, struct, etc.)
13247 2004-01-21 Marek Safar <marek.safar@seznam.cz>
13249 * class.cs: Added error CS0538, CS0539 reporting.
13250 Fixed crash on Microsoft runtime when field type is void.
13252 * cs-parser.jay: Added error CS0537 reporting.
13254 * pending.cs: Added error CS0535 reporting.
13255 Improved error report for errors CS0536, CS0534.
13257 2004-01-20 Miguel de Icaza <miguel@ximian.com>
13259 Merge a few bits from the Anonymous Method MCS tree.
13261 * statement.cs (ToplevelBlock): New class for toplevel methods,
13262 will hold anonymous methods, lifted variables.
13264 * cs-parser.jay: Create toplevel blocks for delegates and for
13265 regular blocks of code.
13267 2004-01-20 Martin Baulig <martin@ximian.com>
13269 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
13270 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
13271 and `NeedExplicitReturn'; added `IsLastStatement'.
13272 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
13273 have a `ReturnLabel' or we're not unreachable.
13275 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
13276 child's reachability; don't just override ours with it. Fixes
13277 #58058 (lluis's example).
13278 (FlowBranching): Added public InTryOrCatch(), InCatch(),
13279 InFinally(), InLoop(), InSwitch() and
13280 BreakCrossesTryCatchBoundary() methods.
13282 * statement.cs (Return): Do all error checking in Resolve().
13283 Unless we are the last statement in a top-level block, always
13284 create a return label and jump to it.
13285 (Break, Continue): Do all error checking in Resolve(); also make
13286 sure we aren't leaving a `finally'.
13287 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
13288 statement in a top-level block.
13289 (Block.Flags): Added `IsDestructor'.
13290 (Block.IsDestructor): New public property.
13292 2004-01-20 Martin Baulig <martin@ximian.com>
13294 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
13296 2004-01-20 Martin Baulig <martin@ximian.com>
13298 * statement.cs (Statement.ResolveUnreachable): New public method.
13299 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
13300 (Block.Resolve): Resolve unreachable statements.
13302 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
13304 * expression.cs: We need to fix the case where we do
13305 not have a temp variable here.
13307 * assign.cs: Only expression compound assignments need
13308 temporary variables.
13310 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
13312 * flowanalysis.cs: Reduce memory allocation in a few ways:
13313 - A block with no variables should not allocate a bit
13315 - A method with no out parameters does not need any tracking
13316 for assignment of the parameters, so we need not allocate
13319 public readonly Type[] VariableTypes;
13320 public readonly string[] VariableNames;
13321 Are redundant. The data is already stored in the variable
13322 map, so we need not allocate another array for it.
13323 - We need to add alot of checks for if (params | locals) == null
13324 due to the first two changes.
13326 2004-01-18 Miguel de Icaza <miguel@ximian.com>
13328 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
13329 implement IMemoryLocation, we store a copy on a local variable and
13330 take the address of it. Patch from Benjamin Jemlich
13332 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
13333 to use a special "type_name_expression" rule which reduces the
13334 number of "QualifiedIdentifier" classes created, and instead
13335 directly creates MemberAccess expressions.
13337 2004-01-17 Miguel de Icaza <miguel@ximian.com>
13339 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
13340 that fixes #52853. Null literal assignment to ValueType
13342 * class.cs (MethodData.Emit): Instead of checking the name of the
13343 method to determine if its a destructor, create a new derived
13344 class from Method called Destructor, and test for that.
13346 * cs-parser.jay: Create a Destructor object instead of a Method.
13348 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
13352 2004-01-16 Miguel de Icaza <miguel@ximian.com>
13354 * expression.cs (Binary.ResolveOperator): Perform an implicit
13355 conversion from MethodGroups to their delegate types on the
13356 Addition operation.
13358 * delegate.cs: Introduce a new class DelegateCreation that is the
13359 base class for `NewDelegate' and `ImplicitDelegateCreation',
13360 factor some code in here.
13362 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
13363 conversion from MethodGroups to compatible delegate types.
13365 * ecore.cs (Expression.Resolve): Do not flag error 654
13366 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
13367 we allow conversions from MethodGroups to delegate types now.
13369 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
13370 assignments in v2 either.
13372 2004-01-10 Miguel de Icaza <miguel@ximian.com>
13374 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
13375 static read-only fields in ctors.
13377 Applied patch from Benjamin Jemlich
13379 * expression.cs (UnaryMutator): Avoid leaking local variables.
13381 2004-01-09 Miguel de Icaza <miguel@ximian.com>
13383 * cs-tokenizer.cs (IsCastToken): Allow the various native types
13384 here to return true, as they can be used like this:
13386 (XXX) int.MEMBER ()
13388 Fixed 49836 and all the other dups
13390 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
13392 * driver.cs: Implement /win32res and /win32icon.
13394 2004-01-08 Miguel de Icaza <miguel@ximian.com>
13396 * cs-parser.jay: Add a rule to improve error handling for the
13397 common mistake of placing modifiers after the type.
13399 2004-01-07 Miguel de Icaza <miguel@ximian.com>
13401 * cs-parser.jay (interface_event_declaration): Catch
13402 initialization of events on interfaces, and report cs0068
13404 * cs-parser.jay (interface_event_declaration): Catch
13405 initialization of events.
13407 * ecore.cs: Better report missing constructors.
13409 * expression.cs (Binary.ResolveOperator): My previous bug fix had
13410 the error reporting done in the wrong place. Fix.
13412 * expression.cs (Binary.ResolveOperator): Catch the
13413 operator + (E x, E y) error earlier, and later allow for implicit
13414 conversions in operator +/- (E e, U x) from U to the underlying
13417 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
13418 52596, if the container class is abstract, the default constructor
13419 is protected otherwise its public (before, we were always public).
13421 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
13424 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
13425 Jemlich that fixes bug #52597, MCS was generating invalid code for
13426 idisposable structs. Thanks to Ben for following up with this
13429 2004-01-06 Miguel de Icaza <miguel@ximian.com>
13431 * driver.cs: Allow assemblies without code to be generated, fixes
13434 2004-01-07 Nick Drochak <ndrochak@gol.com>
13436 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
13438 2004-01-05 Miguel de Icaza <miguel@ximian.com>
13440 * cs-parser.jay: Add rules to improve error reporting if fields or
13441 methods are declared at the namespace level (error 116)
13443 * Add rules to catch event add/remove
13445 2004-01-04 David Sheldon <dave-mono@earth.li>
13447 * expression.cs: Added matching ")" to error message for
13450 2004-01-03 Todd Berman <tberman@gentoo.org>
13452 * ecore.cs, attribute.cs:
13453 Applying fix from #52429.
13455 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
13457 * ecore.cs, expression.cs, statement.cs:
13458 Total rewrite of how we handle branching. We
13459 now handle complex boolean expressions with fewer
13460 jumps. As well if (x == 0) no longer emits a ceq.
13462 if (x is Foo) is much faster now, because we generate
13465 Overall, we get a pretty big improvement on our benchmark
13466 tests. The code we generate is smaller and more readable.
13468 I did a full two-stage bootstrap. The patch was reviewed
13469 by Martin and Miguel.
13471 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
13473 * cs-parser.jay: Make primary_expression not take a QI.
13474 we dont need this because the member_access rule covers
13475 us here. So we replace the rule with just IDENTIFIER.
13477 This has two good effects. First, we remove a s/r conflict.
13478 Second, we allocate many fewer QualifiedIdentifier objects.
13480 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
13482 * attribute.cs: Handle MarshalAs attributes as pseudo, and
13483 set the correct information via SRE. This prevents
13484 hanging on the MS runtime. Fixes #29374.
13486 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
13488 * convert.cs: correctly handle conversions to value types
13489 from Enum and ValueType as unboxing conversions.
13491 Fixes bug #52569. Patch by Benjamin Jemlich.
13493 2004-01-02 Ravi Pratap <ravi@ximian.com>
13495 * expression.cs (BetterConversion): Prefer int -> uint
13496 over int -> ulong (csc's behaviour). This fixed bug #52046.
13498 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
13500 * decl.cs (MemberCache.FindMembers): now returns a
13503 * typemanager.cs: In general, go with with ^^.
13504 (CopyNewMethods): take an IList.
13505 (RealMemberLookup): Only allocate an arraylist
13506 if we copy from two sets of methods.
13508 This change basically does two things:
13509 1) Fewer array lists allocated due to CopyNewMethods.
13510 2) the explicit cast in MemberList costed ALOT.
13512 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
13514 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
13515 a hashtable to avoid needless string allocations when an identifier is
13516 used more than once (the common case).
13518 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
13520 * pending.cs: MS's TypeBuilder.GetInterfaces ()
13521 is broken, it will not return anything. So, we
13522 have to use the information we have in mcs to
13525 * typemanager.cs: Add a cache for GetInterfaces,
13526 since this will now be used more often (due to ^^)
13528 (GetExplicitInterfaces) New method that gets the
13529 declared, not effective, interfaces on a type
13530 builder (eg, if you have interface IFoo, interface
13531 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
13534 This patch makes MCS able to bootstrap itself on
13537 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
13539 * expression.cs: Remove the Nop's that Miguel put
13542 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
13544 * report.cs, codegen.cs: Give the real stack trace to
13545 the error when an exception is thrown.
13547 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
13549 * decl.cs: only allocate hashtables for ifaces if
13552 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
13554 * expression.cs: fix the error from cs0121-2.cs
13555 (a parent interface has two child interfaces that
13556 have a function with the same name and 0 params
13557 and the function is called through the parent).
13559 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
13561 * class.cs, rootcontext.cs, typmanager.cs: do not
13564 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
13566 * codegen.cs: remove stack for the ec flow branching.
13567 It is already a linked list, so no need.
13569 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
13571 * Makefile: Allow custom profiler here.
13573 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
13575 * typemanager.cs (LookupType):
13576 - Use a static char [], because split takes
13577 a param array for args, so it was allocating
13579 - Do not store true in a hashtable, it boxes.
13581 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
13583 * flowanalysis.cs: bytify common enums.
13585 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
13587 * modifiers.cs: Add a new set of flags for the
13588 flags allowed on explicit interface impls.
13589 * cs-parser.jay: catch the use of modifiers in
13590 interfaces correctly.
13591 * class.cs: catch private void IFoo.Blah ().
13593 All related to bug #50572.
13595 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
13597 * decl.cs: Rewrite the consistant accessability checking.
13598 Accessability is not linear, it must be implemented in
13599 a tableish way. Fixes #49704.
13601 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
13603 * expression.cs: Handle negation in a checked context.
13604 We must use subtraction from zero. Fixes #38674.
13606 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
13608 * class.cs: Ignore static void main in DLLs.
13609 * rootcontext.cs: Handle the target type here,
13610 since we are have to access it from class.cs
13611 * driver.cs: account for the above.
13613 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
13615 * report.cs: Give line numbers and files if available.
13617 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
13619 * driver.cs: Implement /addmodule.
13621 * typemanager.cs: Change 'modules' field so it now contains Modules not
13624 2003-12-20 Martin Baulig <martin@ximian.com>
13626 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
13627 (FieldBase.IsAssigned): Removed this field.
13628 (FieldBase.SetAssigned): New public method.
13629 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
13631 2003-12-20 Martin Baulig <martin@ximian.com>
13633 * expression.cs (LocalVariableReference.DoResolve): Don't set
13634 `vi.Used' if we're called from DoResolveLValue().
13636 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
13637 returns the usage vector it just merged into the current one -
13638 pass this one to UsageWarning().
13639 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
13640 of the `EmitContext', don't call this recursively on our children.
13642 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
13644 * driver.cs: Implement /target:module.
13646 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
13648 * support.cs (CharArrayHashtable): New helper class.
13650 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
13651 char arrays, not strings, so we can avoid creating a string in
13652 consume_identifier if the identifier is a keyword.
13654 2003-12-16 Martin Baulig <martin@ximian.com>
13656 * statement.cs (LocalInfo.Assigned): Removed this property.
13657 (LocalInfo.Flags): Removed `Assigned'.
13658 (LocalInfo.IsAssigned): New public method; takes the EmitContext
13659 and uses flow analysis.
13660 (Block.UsageWarning): Made this method private.
13661 (Block.Resolve): Call UsageWarning() if appropriate.
13663 * expression.cs (LocalVariableReference.DoResolve): Always set
13664 LocalInfo.Used here.
13666 2003-12-13 Martin Baulig <martin@ximian.com>
13668 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
13669 any value here; we're now using flow analysis to figure out
13670 whether a statement/block returns a value.
13672 2003-12-13 Martin Baulig <martin@ximian.com>
13674 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
13676 (FlowBranching.MergeFinally): Don't call
13677 `branching.CheckOutParameters()' here, this is called in
13679 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
13680 when adding the `finally' vector.
13682 2003-12-13 Martin Baulig <martin@ximian.com>
13685 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
13686 actually work and also fix #48962.
13688 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
13690 * decl.cs: Do not check System.Object for nested types,
13691 since we know it does not have any. Big bang for buck:
13694 Run 1: 8.35 seconds
13695 Run 2: 8.32 seconds
13696 corlib: 17.99 seconds
13698 Run 1: 8.17 seconds
13699 Run 2: 8.17 seconds
13700 corlib: 17.39 seconds
13702 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
13704 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
13705 time we are returning 0 members, so we save alot here.
13707 2003-12-11 Martin Baulig <martin@ximian.com>
13709 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
13710 `MergeChild()', also just take the `FlowBranching' as argument;
13711 call Merge() on it and return the result.
13712 (FlowBranching.Merge): We don't need to do anything if we just
13715 2003-12-11 Martin Baulig <martin@ximian.com>
13717 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
13718 them in an `ArrayList' to reduce memory usage. Thanks to Ben
13719 Maurer for this idea.
13721 2003-12-11 Martin Baulig <martin@ximian.com>
13723 * flowanalysis.cs (MergeResult): This class is now gone; we now
13724 use the `UsageVector' for this. The reason for this is that if a
13725 branching just has one sibling, we don't need to "merge" them at
13726 all - that's the next step to do.
13727 (FlowBranching.Merge): We now return a `UsageVector' instead of a
13730 2003-12-11 Martin Baulig <martin@ximian.com>
13732 Reworked flow analyis and made it more precise and bug-free. The
13733 most important change is that we're now using a special `Reachability'
13734 class instead of having "magic" meanings of `FlowReturns'. I'll
13735 do some more cleanups and optimizations and also add some more
13736 documentation this week.
13738 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
13739 largely reworked this class.
13740 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
13741 the new `Reachability' class instead of having "magic" values here.
13742 (FlowBranching): We're now using an instance of `Reachability'
13743 instead of having separate `Returns', `Breaks' etc. fields.
13745 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
13746 based on flow analysis; ignore the return value of block.Emit ().
13748 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
13750 * driver.cs typemanager.cs: Find the mono extensions to corlib even
13751 if they are private.
13753 2003-12-09 Martin Baulig <martin@ximian.com>
13755 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
13756 call them directly on the UsageVector.
13758 2003-12-09 Martin Baulig <martin@ximian.com>
13760 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
13761 Changed return type from `FlowReturns' to `Reachability'.
13763 2003-12-09 Martin Baulig <martin@ximian.com>
13765 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
13766 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
13767 `Reachable' fields with a single `Reachability' one.
13769 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
13771 * class.cs (FindMembers): Remove foreach's.
13776 Run 1: 8.74 seconds
13777 Run 2: 8.71 seconds
13780 Run 1: 8.64 seconds
13781 Run 2: 8.58 seconds
13784 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
13789 This patch does a few things:
13790 1. EmptyStatement is now a singleton, so it is never reallocated.
13791 2. All blah is EmptyStatement constructs have been changed to
13792 blah == EmptyStatement.Value, which is much faster and valid
13793 now that EmptyStatement is a singleton.
13794 3. When resolving a block, rather than allocating a new array for
13795 the non-empty statements, empty statements are replaced with
13796 EmptyStatement.Value
13797 4. Some recursive functions have been made non-recursive.
13798 Mainly the performance impact is from (3), however (1) and (2) are needed for
13799 this to work. (4) does not make a big difference in normal situations, however
13800 it makes the profile look saner.
13805 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13806 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13807 Total memory allocated: 56397 KB
13810 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
13811 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
13812 Total memory allocated: 55666 KB
13814 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
13816 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
13817 than the hashtable in a hashtable version
13819 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
13820 we always end up concating a string. This results in a huge perf
13821 loss, because many strings have to be tracked by the GC. In this
13822 patch, we first use a hashtable that works with two keys, so that
13823 the strings do not need to be concat'ed.
13827 Run 1: 8.74 seconds
13828 Run 2: 8.71 seconds
13831 Run 1: 8.65 seconds
13832 Run 2: 8.56 seconds
13834 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
13836 * Makefile: Add a new target `do-time' that does a quick and simple
13837 profile, leaving easy to parse output.
13839 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
13841 * codegen.cs (Init): Create the dynamic assembly with
13842 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
13844 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
13846 * support.cs: Make the PtrHashtable use only one
13847 instance of its comparer.
13849 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
13851 * typemanager.cs: Fix lookup of GetNamespaces.
13853 2003-11-29 Miguel de Icaza <miguel@ximian.com>
13855 * expression.cs: Removed redundant line.
13857 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
13858 ArrayLists, use for loops with bounds.
13860 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
13863 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
13864 arraylists, use for loop with bounds.
13866 The above three changes give us a 0.071 second performance
13867 improvement out of 3.294 seconds down to 3.223. On my machine
13868 the above changes reduced the memory usage by 1,387 KB during
13869 compiler bootstrap.
13871 * cs-parser.jay (QualifiedIdentifier): New class used to represent
13872 QualifiedIdentifiers. Before we created a new string through
13873 concatenation, and mostly later on, the result would be
13874 manipulated by DecomposeQI through string manipulation.
13876 This reduced the compiler memory usage for bootstrapping from
13877 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
13878 compile times in 0.05 seconds.
13880 2003-11-28 Dick Porter <dick@ximian.com>
13882 * support.cs: Do string compares with the Invariant culture.
13890 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
13891 the comparison is done with the Invariant culture.
13893 2003-11-27 Miguel de Icaza <miguel@ximian.com>
13895 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
13896 GetEnumerator method.
13898 (ProbeCollectionType): Iterate starting at the most specific type
13899 upwards looking for a GetEnumerator
13901 * expression.cs: Shift count can be up to 31 for int/uint and 63
13904 2003-11-26 Miguel de Icaza <miguel@ximian.com>
13906 * statement.cs (Block.LookupLabel): Also look for the label on the
13907 children blocks. Use a hash table to keep track of visited
13910 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
13911 we actually did transform the other operand, otherwise fall back
13912 to the common codepath that casts to long.
13914 * cs-tokenizer.cs: Use the same code pattern as the int case.
13915 Maybe I should do the parsing myself, and avoid depending on the
13916 Parse routines to get this done.
13918 2003-11-25 Miguel de Icaza <miguel@ximian.com>
13920 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
13921 which fixes bug 51347. This time test it.
13923 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
13924 attributes for example can not tell the difference between these.
13925 The difference was only a syntax feature of the language.
13927 * attribute.cs: Apply attributes to delegates.
13929 * delegate.cs: Call the apply attributes method.
13931 2003-11-24 Miguel de Icaza <miguel@ximian.com>
13933 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
13934 comparing 0 vs Byte.MinValue, not the value
13936 (ImplicitConversionRequired): When reporting a conversion error,
13937 use error 31 to print out the constant error instead of the
13940 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
13941 which fixes bug 51347.
13943 2003-11-22 Miguel de Icaza <miguel@ximian.com>
13945 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
13946 which fixes the -warnaserror command line option.
13948 2003-11-21 Miguel de Icaza <miguel@ximian.com>
13950 * cfold.cs (DoNumericPromotions): During constant folding of
13951 additions on UIntConstant, special case intconstants with
13952 IntConstants like we do on the expression binary operator.
13954 2003-11-12 Miguel de Icaza <miguel@ximian.com>
13956 * convert.cs (ImplicitReferenceConversion): We were missing a case
13957 (System.Enum are not value types or class types, so we need to
13958 classify them separatedly).
13960 * driver.cs: We do not support error 2007.
13962 2003-11-12 Jackson Harper <jackson@ximian.com>
13964 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
13965 system directory. Also use the full file name so users can
13966 libraries names mscorlib-o-tron.dll in a non system dir.
13968 2003-11-10 Martin Baulig <martin@ximian.com>
13970 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
13971 (TypeManager.InitCoreTypes): Initialize them here, but instead of
13972 calling `ResolveType()' on them, directly assign their `Type'.
13974 2003-11-08 Martin Baulig <martin@ximian.com>
13976 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
13977 return value and the `out parent' parameter.
13978 (TypeContainer.DefineType): Moved the CS0644 check into
13979 GetClassBases(). Don't pass the interface types to the
13980 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
13981 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
13983 * ecore.cs (TypeExpr.IsAttribute): New property.
13984 (TypeExpr.GetInterfaces): New method.
13986 * interface.cs (Interface.GetInterfaceTypeByName): Return a
13987 TypeExpr instead of a Type.
13988 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
13989 (Interface.DefineType): Don't pass the interface types to the
13990 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
13991 them later and then call `TypeBulider.AddInterfaceImplementation()'.
13993 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
13994 instead of a `Type[]'.
13995 (TypeManager.RegisterBuilder): Likewise.
13996 (TypeManager.AddUserInterface): Likewise.
13997 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
13998 `Type[]' and also return a `TypeExpr[]'.
13999 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
14001 2003-11-08 Martin Baulig <martin@ximian.com>
14003 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
14006 2003-11-08 Martin Baulig <martin@ximian.com>
14008 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
14009 TypeManager.ResolveExpressionTypes().
14011 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
14012 instead of an Expression.
14013 (TypeExpr): This is now an abstract base class for `TypeExpression'.
14014 (TypeExpression): New public class; formerly known as `TypeExpr'.
14016 * expression.cs (ComposedCast): Derive from TypeExpr.
14018 * typemanager.cs (TypeManager.system_*_expr): These are now
14019 TypExpr's instead of Expression's.
14020 (TypeManager.ResolveExpressionTypes): New public static function;
14021 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
14024 2003-11-06 Miguel de Icaza <miguel@ximian.com>
14026 * expression.cs (New.DoResolve): Do not dereference value that
14027 might be a null return.
14029 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
14030 sure that the constant value has the right type. Fixes an
14031 unreported bug, similar to 50425.
14033 * const.cs (Const.LookupConstantValue): Call
14034 ImplicitStandardConversionExists before doing a conversion to
14035 avoid havng the TypeManager.ChangeType do conversions.
14037 Reduced the number of casts used
14039 (Const.ChangeType): New routine to enable reuse of the constant
14040 type changing code from statement.
14042 * typemanager.cs (ChangeType): Move common initialization to
14043 static global variables.
14047 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
14048 every value type to go through, even if it was void. Fix that.
14050 * cs-tokenizer.cs: Use is_identifier_start_character on the start
14051 character of the define, and the is_identifier_part_character for
14052 the rest of the string.
14054 2003-11-05 Miguel de Icaza <miguel@ximian.com>
14056 * expression.cs (UnaryMutator.EmitCode): When I updated
14057 LocalVariableReference.DoResolve, I overdid it, and dropped an
14058 optimization done on local variable references.
14060 2003-11-04 Miguel de Icaza <miguel@ximian.com>
14062 * ecore.cs: Convert the return from Ldlen into an int.
14064 2003-10-20 Miguel de Icaza <miguel@ximian.com>
14066 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
14067 the accessibility, this is a special case for toplevel non-public
14068 classes (internal for instance).
14070 2003-10-20 Nick Drochak <ndrochak@gol.com>
14072 * ecore.cs: Fix typo and build. Needed another right paren.
14074 2003-10-19 Miguel de Icaza <miguel@ximian.com>
14076 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
14077 `internal' case regular and protected, but not allowing protected
14078 to be evaluated later. Bug 49840
14080 2003-10-15 Miguel de Icaza <miguel@ximian.com>
14082 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
14083 to kb.Nlast, and not the kb.nFirst to isolate the switch
14086 Extract the underlying type, so enumerations of long/ulong are
14087 treated like long/ulong.
14089 2003-10-14 Miguel de Icaza <miguel@ximian.com>
14091 * expression.cs (New): Overload the meaning of RequestedType to
14092 track the possible creation of the NewDelegate type, since
14093 DoResolve is invoked more than once for new constructors on field
14096 See bugs: #48800 and #37014
14098 * cs-parser.jay (declare_local_constants): Take an arraylist
14099 instead of a single constant.
14101 (local_constant_declaration): It should take a
14102 constant_declarators, not a constant_declarator. Fixes 49487
14104 * convert.cs: Fix error report.
14106 2003-10-13 Jackson Harper <jackson@ximian.com>
14108 * typemanager.cs (TypeToCoreType): Add float and double this fixes
14111 2003-10-09 Martin Baulig <martin@ximian.com>
14113 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
14115 (MethodCore.DoDefineParameters): Removed the TypeContainer
14116 argument; use the DeclSpace which was passed to the .ctor instead.
14117 (MethodCore.CheckParameter): Take a DeclSpace instead of a
14118 TypeContainer; we only need a DeclSpace here.
14120 2003-10-09 Martin Baulig <martin@ximian.com>
14122 * class.cs (MethodData): Added additional `DeclSpace ds' argument
14124 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
14125 EmitContext's .ctor.
14127 2003-10-09 Martin Baulig <martin@ximian.com>
14129 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
14130 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
14131 AsAccessible(), moved them as well.
14133 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
14135 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
14137 * cs-parser.jay : Renamed yyName to yyNames related to jay.
14139 2003-10-07 Miguel de Icaza <miguel@ximian.com>
14141 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
14142 generation for >=, as spotted by Paolo, bug 48679.
14143 Patch from David Waite.
14145 * cs-tokenizer.cs: Add handling for #pragma.
14147 * cs-parser.jay: Allow for both yield and yield return in the
14148 syntax. The anti-cobolization of C# fight will go on!
14150 * class.cs (TypeBuilder.DefineType): Catch error condition here
14151 (Parent.DefineType erroring out and returning null).
14153 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
14154 coping with enumerations variables, we were mistakenly processing
14155 them as a regular value type instead of built-in types. Fixes the
14158 * typemanager.cs (IsBuiltinOrEnum): New method.
14160 2003-09-30 Miguel de Icaza <miguel@ximian.com>
14162 * cs-parser.jay: Upgrade: yield now needs the return clause.
14164 2003-09-19 Martin Baulig <martin@ximian.com>
14166 * decl.cs (MemberCache.SetupCacheForInterface): Take a
14167 `MemberCache parent' argument. Normally, an interface doesn't
14168 have a parent type except System.Object, but we use this in gmcs
14169 for generic type parameters.
14171 2003-09-18 Martin Baulig <martin@ximian.com>
14173 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
14174 on `type.IsInterface'; don't check whether the type has a parent
14175 to determine whether it's an interface.
14177 2003-09-15 Martin Baulig <martin@ximian.com>
14179 * class.cs (TypeContainer.DefineType): Added an error flag to
14180 avoid reporting duplicate CS0146's ("class definition is
14183 * driver.cs (Driver.MainDriver): Abort if
14184 RootContext.ResolveTree() reported any errors.
14186 2003-09-07 Martin Baulig <martin@ximian.com>
14188 * report.cs (Error, Warning): Added overloaded versions which take
14189 a `params object[] args' and call String.Format().
14191 2003-09-07 Martin Baulig <martin@ximian.com>
14193 * decl.cs (DeclSpace..ctor): Don't call
14194 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
14195 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
14196 (DeclSpace.RecordDecl): New method.
14198 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
14200 2003-09-02 Ravi Pratap <ravi@ximian.com>
14202 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
14203 value attributes to be applied to ParameterBuilders.
14205 * class.cs (MethodCore.LabelParameters): Make static and more
14206 generic so that it can be used from other places - like interface
14207 methods, for instance.
14209 * interface.cs (Interface.Emit): Call LabelParameters before
14210 emitting attributes on the InterfaceMethod.
14212 2003-08-26 Martin Baulig <martin@ximian.com>
14214 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
14215 resolving aliases; fixes #47927.
14217 2003-08-26 Martin Baulig <martin@ximian.com>
14219 * statement.cs (Using.DoResolve): This is internally emitting a
14220 try/finally clause, so we need to set ec.NeedExplicitReturn if we
14221 do not always return. Fixes #47681.
14223 2003-08-26 Martin Baulig <martin@ximian.com>
14225 * decl.cs (MemberCore): Moved WarningNotHiding(),
14226 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
14228 (AdditionResult): Make this nested in DeclSpace.
14229 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
14230 argument; call NamespaceEntry.Define() unless we're nested in a
14233 * namespace.cs (Namespace.DefineName): New public function. This
14234 is called from DeclSpace's .ctor to add
14235 (Namespace.Lookup): Include DeclSpaces in the lookup.
14237 * class.cs (Operator): Derive from MemberBase, not MemberCore.
14239 * const.cs (Const): Derive from MemberBase, not MemberCore.
14241 2003-08-25 Martin Baulig <martin@ximian.com>
14243 * convert.cs (Convert.ExplicitReferenceConversion): When
14244 converting from an interface type to a class, unbox if the target
14245 type is a struct type. Fixes #47822.
14247 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14249 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
14252 2003-08-22 Martin Baulig <martin@ximian.com>
14254 * class.cs (TypeManager.DefineType): When defining a nested type,
14255 call DefineType() on our parent; fixes #47801.
14257 2003-08-22 Martin Baulig <martin@ximian.com>
14259 * class.cs (MethodData.Define): While checking if a method is an
14260 interface implementation, improve the test a bit more to fix #47654.
14262 2003-08-22 Martin Baulig <martin@ximian.com>
14264 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
14265 correctly; fixes #47722.
14267 2003-08-22 Martin Baulig <martin@ximian.com>
14269 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
14270 LocalVariableReference, ensure it's not read-only. Fixes #47536.
14272 * statement.cs (Fixed.DoResolve): Make all variables read-only.
14274 2003-08-22 Martin Baulig <martin@ximian.com>
14276 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
14277 can only be assigned in static constructors. Fixes #47161.
14279 2003-08-22 Martin Baulig <martin@ximian.com>
14281 Rewrote and improved the flow analysis code.
14283 * flowbranching.cs (FlowBranching): Make this class abstract.
14284 (FlowBranching.CreateBranching): New static function to create a
14285 new flow branching.
14286 (FlowBranchingBlock, FlowBranchingException): New classes.
14287 (FlowBranching.UsageVector.Type): New public readonly field.
14288 (FlowBranching.UsageVector.Breaks): Removed the setter.
14289 (FlowBranching.UsageVector.Returns): Removed the setter.
14290 (FlowBranching.UsageVector): Added Break(), Return(),
14291 NeverReachable() and Throw() methods to modify the reachability.
14292 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
14293 done by FlowBranching.Merge().
14294 (FlowBranching.UsageVector.MergeChild): New method; merges the
14295 merge result into the current vector.
14296 (FlowBranching.Merge): New abstract method to merge a branching.
14298 2003-08-12 Martin Baulig <martin@ximian.com>
14300 * expression.cs (Indirection.CacheTemporaries): Create the
14301 LocalTemporary with the pointer type, not its element type.
14303 2003-08-10 Miguel de Icaza <miguel@ximian.com>
14305 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
14306 token was a keyword or not.
14308 Add `error' options where an IDENTIFIER was expected; Provide
14309 CheckToken and CheckIdentifierToken convenience error reporting
14312 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
14314 * decl.cs: Rename `NamespaceEntry Namespace' public field into
14315 NameSpaceEntry NameSpaceEntry.
14317 (LookupInterfaceOrClass): Avoid creating a full qualified name
14318 from namespace and name: avoid doing lookups when we know the
14319 namespace is non-existant. Use new Tree.LookupByNamespace which
14320 looks up DeclSpaces based on their namespace, name pair.
14322 * driver.cs: Provide a new `parser verbose' to display the
14323 exception thrown during parsing. This is turned off by default
14324 now, so the output of a failure from mcs is more graceful.
14326 * namespace.cs: Track all the namespaces defined in a hashtable
14329 (IsNamespace): New method
14331 2003-08-09 Miguel de Icaza <miguel@ximian.com>
14333 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
14334 we know that we need to concatenate (full typename can never be
14339 * statement.cs: Use a bitfield; Do not initialize to null things
14340 which are done by the constructor by default.
14342 * cs-parser.jay: bug fix, parameter was 4, not 3.
14344 * expression.cs: Just use the property;
14346 * statement.cs: No need for GetVariableInfo method.
14348 2003-08-08 Martin Baulig <martin@ximian.com>
14350 * flowanalysis.cs (FlowReturns): This is now nested in the
14351 `FlowBranching' class.
14352 (MyBitVector): Moved this here from statement.cs.
14353 (FlowBranching.SiblingType): New enum type.
14354 (FlowBranching.CreateSibling): Added `SiblingType' argument.
14356 2003-08-07 Martin Baulig <martin@ximian.com>
14358 * flowanalysis.cs (FlowBranchingType): This is now nested in the
14359 `FlowBranching' class and called `BranchingType'.
14361 2003-08-07 Martin Baulig <martin@ximian.com>
14363 * flowanalysis.cs: Moved all the control flow analysis code into
14366 2003-08-07 Martin Baulig <martin@ximian.com>
14368 * assign.cs (Assign.DoResolve): `target' must either be an
14369 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
14372 2003-08-07 Miguel de Icaza <miguel@ximian.com>
14374 * expression.cs (BinaryMethod): This kind of expression is created by the
14375 Binary class if it determines that the operator has to be handled
14378 (BinaryDelegate): This kind of expression is created if we are
14379 dealing with a + or - operator on delegates.
14381 (Binary): remove method, argumetns, and DelegateOperator: when
14382 dealing with methods,
14384 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
14386 * statement.cs (Block): use bitfields for the three extra booleans
14387 we had in use. Remove unused topblock parameter.
14389 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
14391 * assign.cs: Drop extra unneeded tests.
14393 2003-08-06 Miguel de Icaza <miguel@ximian.com>
14395 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
14397 * statement.cs (Foreach): Use VariableStorage instead of
14400 * codegen.cs (VariableStorage): New class used by clients that
14401 require a variable stored: locals or fields for variables that
14402 need to live across yield.
14404 Maybe provide a convenience api for EmitThis+EmitLoad?
14406 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
14409 2003-08-05 Miguel de Icaza <miguel@ximian.com>
14411 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
14412 RemapParameterLValue): New methods that are used to turn a
14413 precomputed FieldInfo into an expression like this:
14417 The idea is to use this instead of making LocalVariableReference
14418 have more than one meaning.
14420 * cs-parser.jay: Add error production to BASE.
14422 * ecore.cs: Deal with TypeManager.GetField returning null, which
14423 is now a valid return value.
14425 (FieldExprNoAddress): New expression for Fields whose address can
14428 * expression.cs (LocalVariableReference): During the resolve
14429 phases, create new expressions if we are in a remapping context.
14430 Remove code that dealt with remapping here.
14432 (ParameterReference): same.
14434 (ProxyInstance): New expression, like the `This' expression, but
14435 it is born fully resolved. We know what we are doing, so remove
14436 the errors that are targeted to user-provided uses of `this'.
14438 * statement.cs (Foreach): our variable is now stored as an
14439 Expression; During resolution, follow the protocol, dont just
14440 assume it will return this.
14442 2003-08-06 Martin Baulig <martin@ximian.com>
14444 * support.cs (SeekableStreamReader.cs): New public class.
14446 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
14447 SeekableStreamReader instead of the normal StreamReader.
14449 2003-08-04 Martin Baulig <martin@ximian.com>
14451 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
14452 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
14453 deambiguate casts and delegate invocations.
14454 (parenthesized_expression): Use the new tokens to ensure this is
14455 not a cast of method invocation.
14457 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
14458 when reading a `)' and Deambiguate_CloseParens () was previously
14461 * expression.cs (ParenthesizedExpression): New class. This is
14462 just used for the CS0075 test.
14463 (Binary.DoResolve): Check for CS0075.
14465 2003-07-29 Ravi Pratap <ravi@ximian.com>
14467 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
14468 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
14469 reference comparison.
14471 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
14472 examine the ReturnType for equality - this is necessary in the
14473 cases of implicit and explicit operators whose signature also
14474 includes the return type.
14476 2003-07-26 Miguel de Icaza <miguel@ximian.com>
14478 * namespace.cs: Cache the result of the namespace computation,
14479 instead of computing it every time.
14481 2003-07-24 Miguel de Icaza <miguel@ximian.com>
14483 * decl.cs: Use a global arraylist that we reuse over invocations
14484 to avoid excesive memory consumption. Reduces memory usage on an
14485 mcs compile by one meg (45 average).
14487 * typemanager.cs (LookupTypeReflection): In .NET pointers are
14488 private, work around that.
14490 2003-07-23 Miguel de Icaza <miguel@ximian.com>
14492 * literal.cs (IntLiteral): Define Zero and One static literals.
14494 * cs-parser.jay (integer_literal): use static literals to reduce
14495 memory usage for the most used literals (0, 1 and -1). 211kb
14496 reduced in memory usage.
14498 Replace all calls to `new ArrayList' with `new
14499 ArrayList(4)' which is a good average number for most allocations,
14500 and also requires only 16 bytes of memory for its buffer by
14503 This reduced MCS memory usage in seven megabytes for the RSS after
14506 2003-07-28 Ravi Pratap <ravi@ximian.com>
14508 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
14509 handle params methods the correct way by forming only one
14510 applicable set with params and normal methods in them. Earlier we
14511 were looking at params methods only if we found no normal methods
14512 which was not the correct thing to do.
14514 (Invocation.BetterFunction): Take separate arguments indicating
14515 when candidate and the best method are params methods in their
14518 This fixes bugs #43367 and #46199.
14520 * attribute.cs: Documentation updates.
14522 (CheckAttribute): Rename to CheckAttributeTarget.
14523 (GetValidPlaces): Rename to GetValidTargets.
14525 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
14526 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
14530 2003-07-28 Martin Baulig <martin@ximian.com>
14532 * class.cs (TypeContainer.DefineMembers): Use the base type's full
14533 name when looking up the base class of a nested class. Fixes #46977.
14535 2003-07-26 Martin Baulig <martin@ximian.com>
14537 * expression.cs (Indexers.Indexer): New nested struct; contains
14538 getter, setter and the indexer's type.
14539 (Indexers.Properties): This is now an ArrayList of
14540 Indexers.Indexer's.
14541 (IndexerAccess.DoResolveLValue): Correctly set the type if the
14542 indexer doesn't have any getters.
14544 * assign.cs (Assign.DoResolve): Also do the implicit conversions
14545 for embedded property and indexer assignments.
14547 2003-07-26 Martin Baulig <martin@ximian.com>
14549 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
14550 preprocessor directive is not the first non-whitespace character
14553 2003-07-26 Martin Baulig <martin@ximian.com>
14555 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
14556 namespace parsing, follow the spec more closely.
14558 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
14559 NamespaceEntry.Lookup().
14561 2003-07-25 Martin Baulig <martin@ximian.com>
14563 * MethodCore.cs (OverridesSomething): New public field; it's set
14564 from TypeContainer.DefineMembers if this method overrides
14565 something (which doesn't need to be a method). Fix #39462.
14567 2003-07-25 Ravi Pratap <ravi@ximian.com>
14569 * typemanager.cs (GetMembers): Ensure that the list of members is
14570 reversed. This keeps things in sync.
14572 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
14573 find an AttributeUsage attribute.
14575 * expression.cs (Invocation.OverloadResolve): Perform the check
14576 which disallows Invoke to be directly called on a Delegate.
14578 (Error_InvokeOnDelegate): Report error cs1533.
14580 2003-07-25 Martin Baulig <martin@ximian.com>
14582 * expression.cs (Indexers.GetIndexersForType): Only look in the
14583 interface hierarchy if the requested type is already an
14584 interface. Fixes #46788 while keeping #46502 fixed.
14586 2003-07-25 Martin Baulig <martin@ximian.com>
14588 * class.cs (TypeContainer.DefineMembers): Check whether all
14589 readonly fields have been assigned and report warning CS0649 if
14592 * statement.cs (LocalInfo.IsFixed): Always return true if this is
14595 2003-07-24 Ravi Pratap <ravi@ximian.com>
14597 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
14598 returned from GetMethods to make things consistent with the
14599 assumptions MCS makes about ordering of methods.
14601 This should comprehensively fix bug #45127 and it does :-)
14603 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
14604 ordering is actually reverse.
14606 * Clean up some debug messages I left lying around.
14608 * interface.cs (Populate*): Get rid of code which emits attributes
14609 since the stage in which we emit attributes is the 'Emit' stage,
14610 not the define stage.
14612 (Emit): Move attribute emission for interface members here.
14614 2003-07-22 Ravi Pratap <ravi@ximian.com>
14616 * expression.cs (Invocation.OverloadResolve): Follow the spec more
14617 closely: we eliminate methods in base types when we have an
14618 applicable method in a top-level type.
14620 Please see section 14.5.5.1 for an exact description of what goes
14623 This fixes bug #45127 and a host of other related to corlib compilation.
14625 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
14626 array is the method corresponding to the top-level type (this is
14627 because of the changes made to icall.c) so we change this
14630 (MethodGroupExpr.Name): This too.
14632 * typemanager.cs (GetElementType): New method which does the right
14633 thing when compiling corlib.
14635 * everywhere: Make use of the above in the relevant places.
14637 2003-07-22 Martin Baulig <martin@ximian.com>
14639 * cs-parser.jay (invocation_expression): Moved
14640 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
14641 `cast_expression', but create a InvocationOrCast which later
14642 resolves to either an Invocation or a Cast.
14644 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
14645 method; call this before EmitStatement() to make sure that this
14646 expression can be used as a statement.
14648 * expression.cs (InvocationOrCast): New class; resolves to either
14649 an Invocation or a Cast.
14651 * statement.cs (StatementExpression): Call ResolveStatement() on
14652 the ExpressionStatement before emitting it.
14654 2003-07-21 Martin Baulig <martin@ximian.com>
14656 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
14657 `ref' and `out' attributes match; fixes #46220.
14658 (MemberAccess.ResolveMemberAccess): You can't reference a type
14659 through an expression; fixes #33180.
14660 (Indexers.GetIndexersForType): Don't return the indexers from
14661 interfaces the class implements; fixes #46502.
14663 2003-07-21 Martin Baulig <martin@ximian.com>
14665 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
14666 CS0661 checks; fixes bug #30442.
14668 2003-07-21 Martin Baulig <martin@ximian.com>
14670 * decl.cs (AdditionResult): Added `Error'.
14672 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
14674 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
14675 makes cs0031.cs actually work.
14677 2003-07-20 Martin Baulig <martin@ximian.com>
14679 * namespace.cs: Fixed that bug which caused a crash when compiling
14680 the debugger's GUI.
14682 2003-07-20 Miguel de Icaza <miguel@ximian.com>
14684 * typemanager.cs (LookupTypeReflection): Never expose types which
14685 are NotPublic, NestedPrivate, NestedAssembly, or
14686 NestedFamANDAssem. We used to return these, and later do a check
14687 that would report a meaningful error, but the problem is that we
14688 would not get the real match, if there was a name override.
14690 2003-07-18 Miguel de Icaza <miguel@ximian.com>
14692 * namespace.cs (Namespace, Name): Do not compute the namespace
14693 name dynamically, compute it in the constructor. This reduced
14694 memory usage by 1697 KB.
14696 * driver.cs: Use --pause to pause at the end.
14698 2003-07-17 Peter Williams <peter@newton.cx>
14700 * Makefile: Change the name of the test target so that it doesn't
14701 conflict with the recursive test target.
14703 2003-07-17 Miguel de Icaza <miguel@ximian.com>
14705 * expression.cs (LocalVariableReference.Emit, EmitAssign,
14706 AddressOf): Do not use EmitThis, that was wrong, use the actual
14709 2003-07-15 Miguel de Icaza <miguel@ximian.com>
14711 * class.cs (MethodData.Define): While checking if a method is an
14712 interface implementation, improve the test: If we are not public
14713 (use new test here: use the computed MethodAttributes directly,
14714 instead of the parsed modifier flags) check if the `implementing'
14715 method comes from an interface or not.
14717 * pending.cs (VerifyPendingMethods): Slightly better error
14720 * makefile: add test target that does the mcs bootstrap.
14722 2003-07-16 Ravi Pratap <ravi@ximian.com>
14724 * interface.cs (Define): Do nothing here since there are no
14725 members to populate etc. Move the attribute emission out of here
14726 since this was just totally the wrong place to put it. Attribute
14727 application happens during the 'Emit' phase, not in the 'Define'
14730 (Emit): Add this method and move the attribute emission here
14732 * rootcontext.cs (EmitCode): Call the Emit method on interface
14735 2003-07-14 Ravi Pratap M <ravi@ximian.com>
14737 * expression.cs (OverloadResolve): Report error only if Location
14738 is not 'Null' which means that there was a probe going on.
14740 2003-07-14 Martin Baulig <martin@ximian.com>
14742 * expression.cs (ConditionalLogicalOperator): New public class to
14743 implement user defined conditional logical operators.
14744 This is section 14.11.2 in the spec and bug #40505.
14746 2003-07-14 Martin Baulig <martin@ximian.com>
14748 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
14750 2003-07-14 Martin Baulig <martin@ximian.com>
14752 * codegen.cs (EmitContext.InFixedInitializer): New public field.
14754 * ecore.cs (IVariable.VerifyFixed): New interface method.
14756 * expression.cs (Unary.ResolveOperator): When resolving the `&'
14757 operator, check whether the variable is actually fixed. Fixes bug
14758 #36055. Set a variable definitely assigned when taking its
14759 address as required by the spec.
14761 * statement.cs (LocalInfo.IsFixed): New field.
14762 (LocalInfo.MakePinned): Set `IsFixed' to true.
14764 2003-07-14 Ravi Pratap M <ravi@ximian.com>
14766 * attribute.cs (Attribute.Resolve): While doing a Member lookup
14767 for .ctors, ensure that we only ask for members declared in the
14768 attribute type (BindingFlags.DeclaredOnly).
14772 * expression.cs (Error_WrongNumArguments): Report error 1501
14773 correctly the way CSC does.
14775 2003-07-13 Martin Baulig <martin@ximian.com>
14777 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
14778 lookup on the fully qualified name, to make things like "X.X" work
14779 where "X.X" is a fully qualified type name, but we also have a
14780 namespace "X" in the using list. Fixes #41975.
14782 2003-07-13 Martin Baulig <martin@ximian.com>
14784 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
14785 function. If we're a CompoundAssign, we need to create an embedded
14786 CompoundAssign, not an embedded Assign.
14787 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
14790 2003-07-13 Martin Baulig <martin@ximian.com>
14792 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
14793 work to fix bug #46088.
14795 2003-07-13 Ravi Pratap <ravi@ximian.com>
14797 * class.cs (Operator.Emit): Do not emit attributes here - it is
14798 taken care of by the Method class that we delegate too. This takes
14799 care of bug #45876.
14801 2003-07-10 Martin Baulig <martin@ximian.com>
14803 * expression.cs (TypeOfVoid): New class.
14804 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
14806 2003-07-10 Martin Baulig <martin@ximian.com>
14808 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
14811 2003-07-10 Martin Baulig <martin@ximian.com>
14813 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
14814 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
14816 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
14818 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
14820 2003-07-10 Martin Baulig <martin@ximian.com>
14822 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
14823 of decimal. Fixes #42850.
14825 NOTE: I also fixed the created byte blob, but this doesn't work on
14826 the MS runtime and csc never produces any byte blobs for decimal
14829 2003-07-10 Martin Baulig <martin@ximian.com>
14831 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
14832 structs; fixes #32068.
14833 (Block.AddChildVariableNames): Fixed #44302.
14835 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14837 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
14839 2003-07-07 Miguel de Icaza <miguel@ximian.com>
14841 * attribute.cs: And this test is onger needed.
14843 2003-07-08 Martin Baulig <martin@ximian.com>
14845 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
14846 inaccessible types. Fixes #36313.
14848 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
14850 * namespace.cs (NamespaceEntry): Create implicit entries for all
14851 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
14852 implicit entries for N1.N2 and N1.
14854 2003-07-08 Martin Baulig <martin@ximian.com>
14856 Rewrote the handling of namespaces to fix a lot of the issues
14857 wrt. `using' aliases etc.
14859 * namespace.cs (Namespace): Splitted this class into a
14860 per-assembly `Namespace' and a per-file `NamespaceEntry'.
14862 * typemanager.cs (TypeManager.IsNamespace): Removed.
14863 (TypeManager.ComputeNamespaces): Only compute namespaces from
14864 loaded assemblies here, not the namespaces from the assembly we're
14865 currently compiling.
14867 2003-07-08 Martin Baulig <martin@ximian.com>
14869 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
14871 2003-07-07 Miguel de Icaza <miguel@ximian.com>
14873 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
14876 I thought about the memory savings here, but LookupTypeReflection
14877 is used under already very constrained scenarios. Compiling
14878 corlib or mcs only exposes one hit, so it would not really reduce
14879 any memory consumption.
14881 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14883 * typemanager.cs: fixes bug #45889 by only adding public types from
14884 other assemblies to the list of known types.
14886 2003-07-07 Miguel de Icaza <miguel@ximian.com>
14888 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
14889 on the type we resolved.
14891 2003-07-05 Martin Baulig <martin@ximian.com>
14893 * pending.cs (PendingImplementation.ParentImplements): Don't
14894 create the proxy if the parent is abstract.
14896 * class.cs (TypeContainer.DefineIndexers): Process explicit
14897 interface implementations first. Fixes #37714.
14899 2003-07-04 Miguel de Icaza <miguel@ximian.com>
14901 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
14902 defined recursively; but since we modify the input parameters
14903 (left is set to `this' temporarily), we reset this value if the
14904 left_is_explicit is false, which gives the original semantics to
14907 * literal.cs (NullPointer): new class used to represent a null
14908 literal in a pointer context.
14910 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
14911 type is a pointer, use a NullPointer object instead of a
14912 NullLiteral. Closes 43687
14914 (ExplicitConversion): Convert pointer values using
14915 the conv opcode to the proper type.
14917 * ecore.cs (New): change ValueTypeVariable property into a method,
14918 that returns whether the valuetype is suitable for being used.
14920 * expression.cs (Binary.DoNumericPromotions): Only return if we
14921 the int constant was a valid uint, and we can return both left and
14922 right as uints. If not, we continue processing, to trigger the
14923 type conversion. This fixes 39018.
14925 * statement.cs (Block.EmitMeta): During constant resolution, set
14926 the CurrentBlock property on the emitcontext, so that we resolve
14927 constants propertly.
14929 2003-07-02 Martin Baulig <martin@ximian.com>
14931 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
14932 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
14934 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
14935 than emitting it here.
14937 * statement.cs: Fixed some more flow analysis bugs.
14939 2003-07-02 Martin Baulig <martin@ximian.com>
14941 * class.cs (MethodData.Define): When implementing interface
14942 methods, set Final unless we're Virtual.
14944 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
14945 check work for interface methods.
14947 2003-07-01 Martin Baulig <martin@ximian.com>
14949 * ecore.cs (EmitContext.This): Replaced this property with a
14950 GetThis() method which takes a Location argument. This ensures
14951 that we get the correct error location for a CS0188.
14953 2003-07-01 Miguel de Icaza <miguel@ximian.com>
14955 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
14956 ImplicitStandardConversion.
14958 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
14960 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
14962 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
14965 2003-06-30 Miguel de Icaza <miguel@ximian.com>
14967 * class.cs (Constructor.Define): Turn off initlocals for unsafe
14970 (MethodData.Define): Turn off initlocals for unsafe methods.
14972 2003-06-29 Miguel de Icaza <miguel@ximian.com>
14974 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
14975 complete; Fixes #37521.
14977 * delegate.cs: Use Modifiers.TypeAttr to compute the
14978 TypeAttributes, instead of rolling our own. This makes the flags
14979 correct for the delegates.
14981 2003-06-28 Miguel de Icaza <miguel@ximian.com>
14983 * class.cs (Constructor.Define): Set the private flag for static
14984 constructors as well.
14986 * cs-parser.jay (statement_expression): Set the return value to
14987 null, to avoid a crash when we catch an error.
14989 2003-06-24 Miguel de Icaza <miguel@ximian.com>
14991 * cs-parser.jay: Applied patch from Jackson that adds support for
14992 extern and unsafe modifiers to destructor declarations.
14994 * expression.cs: Report error 21 if the user is trying to index a
14997 * driver.cs: Add an error message, suggested by the bug report.
14999 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
15000 if we do not have a ": this ()" constructor initializer. Fixes 45149
15002 2003-06-14 Miguel de Icaza <miguel@ximian.com>
15004 * namespace.cs: Add some information to reduce FAQs.
15006 2003-06-13 Miguel de Icaza <miguel@ximian.com>
15008 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
15009 underlying enumeration types. Fixes #43915.
15011 * expression.cs: Treat ushort/short as legal values to be used in
15012 bitwise operations.
15014 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
15016 * delegate.cs: transfer custom attributes for paramenters from
15017 the delegate declaration to Invoke and BeginInvoke.
15019 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
15021 * attribute.cs: handle custom marshalers and emit marshal info
15024 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
15026 * makefile.gnu: Added anonymous.cs to the compiler sources.
15028 2003-05-28 Miguel de Icaza <miguel@ximian.com>
15030 * iterators.cs: Change the name of the proxy class to include two
15033 * cs-parser.jay: Update grammar to include anonymous methods.
15035 * anonymous.cs: new file.
15037 2003-05-27 Miguel de Icaza <miguel@ximian.com>
15039 * class.cs (Field.Define): Add missing test for pointers and
15042 2003-05-27 Ravi Pratap <ravi@ximian.com>
15044 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
15045 we use the stobj opcode.
15047 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
15048 since it wasn't the correct fix.
15050 It still is puzzling that we are required to use stobj for IntPtr
15051 which seems to be a ValueType.
15053 2003-05-26 Miguel de Icaza <miguel@ximian.com>
15055 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
15056 during regular simple name resolution. Now, the trick is that
15057 instead of returning for processing the simplename, we do a
15058 TypeManager.LookupType (ie, a rooted lookup as opposed to a
15059 contextual lookup type). If a match is found, return that, if
15060 not, return for further composition.
15062 This fixes long-standing 30485.
15064 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
15065 using the address to initialize an object, do an Stobj instead of
15066 using the regular Stelem.
15068 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
15069 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
15070 Because if we are a BaseIndexerAccess that value will be true.
15073 * statement.cs (GotoCase.Resolve): Return after reporting an
15074 error, do not attempt to continue.
15076 * expression.cs (PointerArithmetic.Emit): If our operand is a
15077 long, convert our constants to match the operand before
15078 multiplying. Convert to I type before adding. Fixes 43670.
15080 2003-05-14 Ravi Pratap <ravi@ximian.com>
15082 * enum.cs (ImplicitConversionExists) : Rename to
15083 ImplicitEnumConversionExists to remove ambiguity.
15085 * ecore.cs (NullCast): New type of cast expression class which
15086 basically is very similar to EmptyCast with the difference being
15087 it still is a constant since it is used only to cast a null to
15089 (eg. (string) null)
15091 * convert.cs (ImplicitReferenceConversion): When casting a null
15092 literal, we return a NullCast.
15094 * literal.cs (NullLiteralTyped): Remove - I don't see why this
15095 should be around anymore.
15097 The renaming (reported was slightly wrong). Corrections:
15099 ConvertImplicitStandard -> ImplicitConversionStandard
15100 ConvertExplicitStandard -> ExplicitConversionStandard
15102 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
15103 before passing them in !
15105 * convert.cs (ImplicitConversionStandard): When comparing for
15106 equal expr and target types, ensure that expr is not a
15109 In general, we must not be checking (expr_type ==
15110 target_type) in the top level conversion methods
15111 (ImplicitConversion, ExplicitConversion etc). This checking is
15112 done in the methods that they delegate to.
15114 2003-05-20 Miguel de Icaza <miguel@ximian.com>
15116 * convert.cs: Move Error_CannotConvertType,
15117 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
15118 ImplicitNumericConversion, ImplicitConversionExists,
15119 ImplicitUserConversionExists, StandardConversionExists,
15120 FindMostEncompassedType, FindMostSpecificSource,
15121 FindMostSpecificTarget, ImplicitUserConversion,
15122 ExplicitUserConversion, GetConversionOperators,
15123 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
15124 TryImplicitIntConversion, Error_CannotConvertImplicit,
15125 ConvertImplicitRequired, ConvertNumericExplicit,
15126 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
15127 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
15130 Perform the following renames:
15132 StandardConversionExists -> ImplicitStandardConversionExists
15133 ConvertImplicit -> ImplicitConversion
15134 ConvertImplicitStandard -> ImplicitStandardConversion
15135 TryImplicitIntConversion -> ImplicitIntConversion
15136 ConvertImplicitRequired -> ImplicitConversionRequired
15137 ConvertNumericExplicit -> ExplicitNumericConversion
15138 ConvertReferenceExplicit -> ExplicitReferenceConversion
15139 ConvertExplicit -> ExplicitConversion
15140 ConvertExplicitStandard -> ExplicitStandardConversion
15142 2003-05-19 Martin Baulig <martin@ximian.com>
15144 * statement.cs (TypeInfo.StructInfo): Made this type protected.
15145 (TypeInfo): Added support for structs having structs as fields.
15147 * ecore.cs (FieldExpr): Implement IVariable.
15148 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
15149 VariableInfo for the field.
15151 2003-05-18 Martin Baulig <martin@ximian.com>
15153 * expression.cs (This.DoResolve): Report a CS0027 if we're
15154 emitting a field initializer.
15156 2003-05-18 Martin Baulig <martin@ximian.com>
15158 * expression.cs (This.ResolveBase): New public function.
15159 (This.DoResolve): Check for CS0188.
15161 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
15164 * ecore.cs (MethodGroupExpr.DoResolve): Set the
15165 `instance_expression' to null if we don't have any non-static
15168 2003-05-18 Martin Baulig <martin@ximian.com>
15170 Reworked the way how local variables and parameters are handled by
15171 the flow analysis code.
15173 * statement.cs (TypeInfo, VariableMap): New public classes.
15174 (VariableInfo): New public class. This is now responsible for
15175 checking whether a variable has been assigned. It is used for
15176 parameters and local variables.
15177 (Block.EmitMeta): Take the InternalParameters as argument; compute
15178 the layout of the flow vectors here.
15179 (Block.LocalMap, Block.ParameterMap): New public properties.
15180 (FlowBranching): The .ctor doesn't get the InternalParameters
15181 anymore since Block.EmitMeta() now computes the layout of the flow
15183 (MyStructInfo): This class is now known as `StructInfo' and nested
15184 in `TypeInfo'; we don't access this directly anymore.
15186 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
15187 property and removed IsAssigned(), IsFieldAssigned(),
15188 SetAssigned() and SetFieldAssigned(); we now call them on the
15189 VariableInfo so we don't need to duplicate this code everywhere.
15191 * expression.cs (ParameterReference): Added `Block block' argument
15193 (LocalVariableReference, ParameterReference, This): The new
15194 VariableInfo class is now responsible for all the definite
15197 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
15198 IsParameterAssigned, SetParameterAssigned): Removed.
15200 2003-05-18 Martin Baulig <martin@ximian.com>
15202 * typemanager.cs (InitCoreTypes): Try calling
15203 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
15204 the 3-args-version. Corlib now also needs our `void_type'.
15205 (GetMethod): Added overloaded version which takes an optional
15206 `bool report_errors' to allow lookups of optional methods.
15208 2003-05-12 Martin Baulig <martin@ximian.com>
15210 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
15211 only used for locals and not for parameters.
15213 2003-05-12 Miguel de Icaza <miguel@ximian.com>
15215 * support.cs (InternalParameters.ParameterType): Return the
15216 ExternalType of the parameter.
15218 * parameter.cs (Parameter.ExternalType): drop the two arguments,
15221 2003-05-11 Miguel de Icaza <miguel@ximian.com>
15223 * class.cs (MethodData.Define): Do not set the `newslot' on
15224 interface members, if they are also flagged as "override".
15226 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
15227 better code for ++i and i++. This only works for static fields
15228 and local variables.
15230 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
15231 want to pull the DeclSpace out of the builder_to_declspace instead
15232 of the TypeBuilder (like in TypeContainer.FindMembers).
15234 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
15235 instead of LookupTypeContainer. Fixes the crash on .NET for
15236 looking up interface members.
15238 * const.cs: Create our own emit context during the Definition
15239 stage, so that constants are evaluated in the proper context, when
15240 a recursive definition happens.
15242 2003-05-11 Martin Baulig <martin@ximian.com>
15244 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
15245 new block for a switch section.
15246 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
15247 the adding/lookup in the switch block. Fixes #39828.
15249 2003-05-09 Miguel de Icaza <miguel@ximian.com>
15251 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
15252 functionality: I needed to convert the data after I had performed
15253 the add/sub operation into the operands type size.
15255 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
15256 pass the type for the box operation, otherwise the resulting
15257 object would have been of type object.
15259 (BoxedCast): Add constructor to specify the type to box as.
15261 2003-05-07 Miguel de Icaza <miguel@ximian.com>
15263 * iterators.cs: I was reusing the `count' variable inadvertently,
15264 take steps to not allow this to happen.
15266 2003-05-06 Miguel de Icaza <miguel@ximian.com>
15268 * attribute.cs (Attribute.Resolve): Params attributes are encoded
15269 by creating an array at the point where the params starts and
15270 putting all those arguments there, then adjusting the size of the
15273 2003-05-05 Miguel de Icaza <miguel@ximian.com>
15275 * expression.cs (New.AddressOf): Implement interface
15276 IMemoryLocation. This is used when the `new' operator is used in
15277 the context of an invocation to a method on a value type.
15279 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
15282 * namespace.cs: Also check the using aliases here.
15284 * driver.cs: Move the test for using validity after the types have
15285 been entered, so we do a single pass that also includes the using
15288 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
15289 in the regular case. CreateSiblingForFinally is doing extra
15292 * attribute.cs (GetAttributeArgumentExpression): Store the result
15293 on an out value, and use the return value to indicate failure
15294 instead of using null (which is a valid return for Constant.GetValue).
15296 * statement.cs: Perform the analysis flow for the increment
15297 portion after the statement, because this will be the real flow of
15298 execution. Fixes #42385
15300 * codegen.cs (EmitContext.EmitArgument,
15301 EmitContext.EmitStoreArgument): New helper functions when the
15302 RemapToProxy flag is set.
15304 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
15307 Add support for remapping parameters.
15309 * iterators.cs: Propagate parameter values; Store parameter
15310 values in the proxy classes.
15312 2003-05-04 Miguel de Icaza <miguel@ximian.com>
15314 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
15315 need a proxy reference; I do not know what I was thinking
15317 * cs-parser.jay (constructor_initializer): catch another error,
15318 and display nice message.
15320 (field_declaration): catch void field declaration
15321 to flag a better error.
15323 * class.cs (MemberBase.CheckBase): Report an error instead of a
15324 warning if a new protected member is declared in a struct.
15325 (Field.Define): catch the error of readonly/volatile.
15327 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
15329 (FieldExpr.AddressOf): ditto. Catch error where the address of a
15330 volatile variable is taken
15332 2003-05-02 Miguel de Icaza <miguel@ximian.com>
15334 * statement.cs (Fixed.Resolve): Report an error if we are not in
15337 2003-05-01 Miguel de Icaza <miguel@ximian.com>
15339 * typemanager.cs: reuse the code that handles type clashes for
15340 delegates and enumerations.
15342 * class.cs (Report28): Always report.
15344 * expression.cs (EncodeAsAttribute): Allow nulls here.
15346 2003-04-28 Miguel de Icaza <miguel@ximian.com>
15348 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
15349 the functionality for testing whether an expression is valid for
15350 an attribute here. Also handle the case of arrays of elements
15353 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
15354 encoding a linear array into an array of objects that are suitable
15355 to be passed to an CustomAttributeBuilder.
15357 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
15359 * ecore.cs: (FieldExpr): Handle field remapping here.
15361 * iteratators.cs: Pass the instance variable (if the method is an
15362 instance method) to the constructors, so we can access the field
15363 variables on the class.
15365 TODO: Test this with structs. I think the THIS variable on
15366 structs might have to be a pointer, and not a refenrece
15368 2003-04-27 Miguel de Icaza <miguel@ximian.com>
15370 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
15371 local variables to fields in a proxy class.
15373 * iterators.cs (PopulateProxy): Rename our internal fields to
15375 Create a <THIS> field if we are an instance method, so we can
15376 reference our parent container variables.
15377 (MapVariable): Called back from the EmitContext code to enter a
15378 new variable to field mapping into the proxy class (we just create
15382 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
15383 for using the remapped locals to fields.
15385 I placed the code here, because that gives the same semantics to
15386 local variables, and only changes the Emit code.
15388 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
15389 statements inside iterators.
15390 (VariableInfo): Add a FieldBuilder for the cases when we are
15391 remapping local variables to fields in a proxy class
15393 * ecore.cs (SimpleNameResolve): Avoid testing two times for
15394 current_block != null.
15396 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
15397 not cope with strings, as it has been moved to the
15398 TableSwitchEmit. Fixed bug in switch generation.
15400 * expression.cs (New.DoResolve): Provide more context for the user
15401 when reporting an error.
15403 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
15406 * expression.cs (MemberAccess.DoResolve): When we get a type back,
15407 check the permissions for it. Note than in a type-resolution
15408 context the check was already present in DeclSpace.ResolveType,
15409 but was missing from the MemberAccess.
15411 (ArrayCreation.CheckIndices): warn if the user has
15412 more nested levels of expressions, but there are no more
15413 dimensions specified. Avoids crash on bug 41906.
15415 2003-04-26 Miguel de Icaza <miguel@ximian.com>
15417 * statement.cs (Block): replace Implicit bool, for a generic
15419 New flag: `Unchecked'. This is used during the EmitMeta phase
15420 (which is out-of-line with the regular Resolve/Emit process for a
15421 statement, as this is done ahead of time, but still gets a chance
15422 to call constant resolve).
15424 (Block.Flags): new enum for adding a new flag.
15426 (Block.EmitMeta): track the state of unchecked.
15428 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
15429 to enable constant resolution to work there as well.
15431 2003-04-22 Miguel de Icaza <miguel@ximian.com>
15433 * typemanager.cs (ienumerable_type): Also look up
15434 System.Collections.IEnumerable.
15436 2003-04-21 Miguel de Icaza <miguel@ximian.com>
15438 TODO: Test more than one conditional per method.
15440 * class.cs (Indexer.Define): Report the location where the user is
15441 referencing the unsupported feature.
15443 (MethodData): Overload the use of `conditionals' to
15444 minimize the creation of needless ArrayLists. This saves roughly
15445 212kb on my machine.
15447 (Method): Implement the new IIteratorContainer interface.
15448 (Method.SetYields): Implement the method by setting the ModFlags
15449 to contain METHOD_YIELDS.
15451 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
15452 which just got set to null.
15454 * iterators.cs: New file.
15456 (Yield, YieldBreak): New statements.
15458 * statement.cs (Return.Resolve): Flag an error if we are used in
15459 an iterator method.
15461 * codegen.cs (InIterator): New flag set if the code is being
15462 compiled in an iterator method.
15464 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
15465 internal modifier, and we just use it to avoid adding extra
15466 fields, as this is seldom used.
15468 * cs-parser.jay: Add yield_statement (yield and yield break).
15470 * driver.cs: New flag -v2 to turn on version 2 features.
15472 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
15473 hashtable when v2 is enabled.
15475 2003-04-20 Miguel de Icaza <miguel@ximian.com>
15477 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
15478 there is already a namespace defined with this name.
15480 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
15481 people upgraded their corlibs.
15483 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
15484 always use fully qualified types, no need to use the compiler
15487 (TypeManager.IsNamespace): Use binarysearch.
15489 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
15490 AddDelegate): I did not quite use the new IsValid API properly: I
15491 have to pass the short-name and the fullname. I was passing only
15492 the basename instead of the fullname sometimes.
15494 (TypeContainer.DefineType): call NamespaceClash.
15496 * interface.cs (Interface.DefineType): use NamespaceClash before
15499 * delegate.cs (Delegate.DefineType): use NamespaceClash before
15502 * enum.cs: (Enum.DefineType): use NamespaceClash before
15505 * typemanager.cs (: 3-line patch that gives us some tasty 11%
15506 speed increase. First, use the negative_hits cache when we get a
15507 negative. Second, add the type with its full original name
15508 instead of the new . and + encoded name (reflection uses + to
15509 separate type from a nested type). Use LookupTypeReflection
15510 directly which bypasses the type->name hashtable (that we already
15511 know does not contain the type.
15513 * decl.cs (DeclSpace.ResolveTypeExpr): track the
15514 location/container type.
15516 * driver.cs: When passing utf8, use directly the UTF8Encoding.
15518 2003-04-19 Miguel de Icaza <miguel@ximian.com>
15520 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
15522 * delegate.cs (NewDelegate.Resolve): Test whether an instance
15523 method is being referenced in the method group from a static
15524 context, and report error 120 if so.
15526 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
15529 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
15530 is created, we create the A namespace).
15532 * cs-parser.jay: A namespace also introduces a DeclarationFound.
15535 2003-04-18 Miguel de Icaza <miguel@ximian.com>
15537 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
15538 invocation to ModuleBuilder.GetType with the same values will
15539 return a new type instance, so we need to cache its return
15542 * expression.cs (Binary.ResolveOperator): Only allow the compare
15543 operators on enums if they are of the same type.
15545 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
15546 types of ValueType on their own case. Before we were giving them
15547 the same treatment as objects.
15549 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
15550 fullname. Short name is used to compare against container name.
15551 Fullname is used to check against defined namespace names.
15553 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
15554 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
15556 (Method.CheckBase): Call parent.
15557 (MemberBase.CheckBase): Check for protected members on sealed
15559 (PropertyBase.CheckBase): Call parent.
15560 (Field.Define): Call parent.
15562 * report.cs: Negative error codes are now mapped to 8000 - code,
15563 so that the display is render more nicely.
15565 * typemanager.cs: Do not use try/catch, instead report a regular
15568 (GetPointerType, GetReferenceType): These methods provide
15569 mechanisms to obtain the T* and T& from a T. We had the code
15570 previously scattered around the code base, and it also used
15571 TypeManager.LookupType that would go through plenty of caches.
15572 This one goes directly to the type source.
15574 In some places we did the Type.GetType followed by
15575 ModuleBuilder.GetType, but not in others, so this unifies the
15576 processing as well.
15578 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
15579 statements now that we have namespace information.
15581 * typemanager.cs (IsNamespace): New method, returns whether the
15582 string presented is a namespace or not.
15584 (ComputeNamespaces): New public entry point, computes the list of
15585 available namespaces, using the GetNamespaces API call in Mono, or
15586 the slower version in MS.NET.
15588 Now before we start the semantic analysis phase, we have a
15589 complete list of namespaces including everything that the user has
15592 Deleted old code to cache namespaces in .nsc files.
15594 2003-04-17 Miguel de Icaza <miguel@ximian.com>
15596 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
15597 class/struct location definition Location for the implicit
15598 constructor location.
15600 (Operator.Define): Use the location of the operator for the
15601 implicit Method definition.
15603 (Constructor.Emit): use the constructor location for the implicit
15604 base initializer constructor.
15606 * ecore.cs: Remove ITypeExpression. This interface is now gone,
15607 and the Expression class now contains two new methods:
15609 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
15610 isolate type lookup from the rest of the resolution process.
15612 Since we use Expressions to hold type definitions due to the way
15613 we parse the input we have historically overloaded Resolve to
15614 perform the Type lookups if a special flag is passed. Now this is
15615 eliminated and two methods take their place.
15617 The differences in the two methods between xStep and xTerminal is
15618 that xStep is involved in our current lookup system that uses
15619 SimpleNames to compose a name, while xTerminal is used just to
15620 catch the case where the simplename lookup failed.
15622 2003-04-16 Miguel de Icaza <miguel@ximian.com>
15624 * expression.cs (ResolveMemberAccess): Remove redundant code.
15625 TypeExpr expressions are always born fully resolved.
15627 * interface.cs (PopulateMethod): Do not lookup the types twice.
15628 We were doing it once during SemanticAnalysis and once during
15631 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
15632 in local variable type definitions, were being returned as a
15633 SimpleName (we decomposed everything into a string), that is
15634 because primary_expression was being used instead of a type in the
15635 grammar (reduce/reduce conflicts).
15637 The part that was wrong is that we converted the expression into a
15638 string (an oversimplification in one hand, compounded with primary
15639 expressions doing string concatenation).
15645 Would return "A.B.C[]" as a SimpleName. This stopped things like
15646 using clauses from working on this particular context. And a type
15647 was being matched directly against "A.B.C[]".
15649 We now use the correct approach, and allow for ComposedCast to be
15650 part of the unary expression. So the "A.B.C []" become a composed
15651 cast of "A.B.C" (as a nested group of MemberAccess with a
15652 SimpleName at the end) plus the rank composition "[]".
15656 2003-04-10 Miguel de Icaza <miguel@ximian.com>
15658 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
15659 for the access level checking.
15661 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
15662 `TypeContainer container', because I kept getting confused when I
15663 was debugging this code.
15665 * expression.cs (Indexers): Instead of tracking getters/setters,
15666 we now track them in parallel. We create one arraylist less, but
15667 most importantly it is possible now for the LValue code to find a
15668 matching get for a set.
15670 (IndexerAccess.DoResolveLValue): Update the code.
15671 GetIndexersForType has been modified already to extract all the
15672 indexers from a type. The code assumed it did not.
15674 Also make the code set the correct return type for the indexer.
15675 This was fixed a long time ago for properties, but was missing for
15676 indexers. It used to be void_type.
15678 (Binary.Emit): Test first for doubles instead of
15679 floats, as they are more common.
15681 (Binary.EmitBranchable): Use the .un version of the branch opcodes
15682 when dealing with floats and the <=, >= operators. This fixes bug
15685 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
15686 to load the array value by emitting a load on the foreach variable
15687 type. This was incorrect.
15689 We now emit the code to load an element using the the array
15690 variable type, and then we emit the conversion operator.
15694 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
15696 * attribute.cs: Avoid allocation of ArrayLists in the common case.
15698 2003-04-09 Miguel de Icaza <miguel@ximian.com>
15700 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
15701 test for protection before we test for signatures.
15703 (MethodSignature.ToString): implement.
15705 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
15706 to the case where we reduced into a LongConstant.
15708 * decl.cs (CheckAccessLevel): If the type is an array, we can not
15709 depend on whether the information is acurrate, because the
15710 Microsoft runtime will always claim that the array type is public,
15711 regardless of the real state.
15713 If the type is a pointer, another problem happens: the type is
15714 reported as non-public in Microsoft.
15716 In both cases we have to call CheckAccessLevel recursively with
15717 the underlying type as the argument to be tested.
15719 2003-04-08 Miguel de Icaza <miguel@ximian.com>
15721 * assign.cs (Assign.Emit): If we are dealing with a compound
15722 assignment expression, we should use the code path that stores the
15723 intermediate result in a temporary value. This fixes #40903.
15725 *expression.cs (Indirection.ToString): Provide ToString method for
15728 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
15730 * class.cs: Null out fields holding references to Block objects so
15731 they can be garbage collected.
15733 * expression.cs (OverloadResolve): Remove unused local.
15735 2003-04-07 Martin Baulig <martin@ximian.com>
15737 * codegen.cs (EmitContext.CurrentFile): New public field.
15738 (EmitContext.Mark): Use the CurrentFile to check whether the
15739 location is in the correct file.
15740 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
15742 2003-04-07 Martin Baulig <martin@ximian.com>
15744 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
15746 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
15747 location. [FIXME: The location argument which gets passed to this
15748 method is sometimes wrong!]
15750 2003-04-07 Nick Drochak <ndrochak@gol.com>
15752 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
15754 2003-04-07 Miguel de Icaza <miguel@ximian.com>
15756 * expression.cs (Indirection.EmitAssign): We were using the
15757 temporary, but returning immediately instead of continuing the
15760 2003-04-06 Martin Baulig <martin@ximian.com>
15762 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
15763 if it's a nested child, but also deriving from the outer class.
15766 * typemanager.cs (IsNestedChildOf): Make this work if it's a
15767 nested child, but also deriving from the outer class. See
15769 (FilterWithClosure): We may access private members of the outer
15770 class if we're a nested child and deriving from the outer class.
15771 (RealMemberLookup): Only set `closure_private_ok' if the
15772 `original_bf' contained BindingFlags.NonPublic.
15774 2003-04-05 Martin Baulig <martin@ximian.com>
15776 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
15778 2003-04-02 Miguel de Icaza <miguel@ximian.com>
15780 * class.cs (Event.Define): Do not allow abstract events to have
15783 2003-04-01 Miguel de Icaza <miguel@ximian.com>
15785 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
15786 block in event declarations.
15788 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
15789 value type, get its address.
15791 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
15792 leaving a class on the stack instead of a boolean value (int
15793 0/1). Change the code so we compare against null, and then the
15794 result against zero.
15796 * class.cs (TypeContainer.GetClassBases): We were checking for the
15797 parent class being sealed too late.
15799 * expression.cs (Binary.Emit): For <= and >= when dealing with
15800 floating point values, use cgt.un and clt.un instead of cgt and
15803 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
15805 * statement.cs: Apply the same optimization as MS: skip the
15806 GetEnumerator returning an IEnumerator, and use the one returning a
15807 CharEnumerator instead. This allows us to avoid the try-finally block
15810 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
15812 * cs-parser.jay: Attributes cannot be applied to
15813 namespaces. Fixes #40473
15815 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15818 (Add*): check if the name is valid using the full name for constants,
15819 fields, properties and events.
15821 2003-03-28 Miguel de Icaza <miguel@ximian.com>
15823 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
15824 char constants to be part of the enumeration.
15826 * expression.cs (Conditional.DoResolve): Add support for operator
15827 true. Implements the missing functionality from 14.12
15829 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
15830 operator true/false as required by the spec.
15832 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
15833 implicit conversion to boolean.
15835 * statement.cs (Statement.ResolveBoolean): A boolean expression is
15836 also one where the type implements `operator true'.
15838 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
15839 get an expression that will invoke operator true based on an
15842 (GetConversionOperators): Removed the hack that called op_True
15845 (Expression.ResolveBoolean): Move this from Statement.
15847 2003-03-17 Miguel de Icaza <miguel@ximian.com>
15849 * ecore.cs (FieldExpr): do not allow initialization of initonly
15850 fields on derived classes
15852 2003-03-13 Martin Baulig <martin@ximian.com>
15854 * statement.cs (Block.Emit): Call ig.BeginScope() and
15855 ig.EndScope() when compiling with debugging info; call
15856 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
15858 2003-03-08 Miguel de Icaza <miguel@ximian.com>
15860 * expression.cs (Indexers): Do not construct immediately, allow
15861 for new members to be appended as we go. Fixes 38143
15863 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15865 * expression.cs: save/restore context when resolving an unchecked
15868 2003-03-05 Miguel de Icaza <miguel@ximian.com>
15870 * cfold.cs: Catch division by zero in modulus operator during
15873 2003-03-03 Miguel de Icaza <miguel@ximian.com>
15875 * interface.cs (Interface.DefineMembers): Avoid defining members
15878 2003-02-27 Miguel de Icaza <miguel@ximian.com>
15880 * driver.cs: handle the +/- options for -noconfig
15882 * statement.cs (Unckeched.Resolve): Also track the state of
15883 unchecked in the Resolve phase.
15885 2003-02-27 Martin Baulig <martin@ximian.com>
15887 * ecore.cs (Expression.MemberLookup): Don't create a
15888 MethodGroupExpr for something which is not a method. Fixes #38291.
15890 2003-02-25 Miguel de Icaza <miguel@ximian.com>
15892 * class.cs (MemberBase.CheckParameters): Also check that the type
15893 is unmanaged if it is a pointer.
15895 * expression.cs (SizeOf.Resolve): Add location information.
15897 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
15898 a managed type is declared.
15900 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
15901 parameter modifiers as well. Fixes bug 38606
15903 * class.cs: Very sad. Am backing out the speed up changes
15904 introduced by the ArrayList -> Array in the TypeContainer, as they
15905 were not actually that much faster, and introduced a bug (no error
15906 reports on duplicated methods).
15908 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
15909 source first, this will guarantee that we have a valid expression
15910 before calling in lower levels functions that will require a
15911 resolved object. Then use this original_source in the
15912 target.ResolveLValue instead of the original source that was
15915 Another change. Use target.Resolve instead of LValueResolve.
15916 Although we are resolving for LValues, we will let the Assign code
15917 take care of that (it will be called again from Resolve). This
15918 basically allows code like this:
15920 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
15921 class Y { void A (X x) { x [0] += o; }
15923 The problem was that the indexer was trying to resolve for
15924 set_Item (idx, object o) and never finding one. The real set_Item
15925 was set_Item (idx, X). By delaying the process we get the right
15930 2003-02-23 Martin Baulig <martin@ximian.com>
15932 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
15933 while calling DoEmit ().
15935 * codegen.cs (EmitContext.Mark): Don't mark locations in other
15936 source files; if you use the #line directive inside a method, the
15937 compiler stops emitting line numbers for the debugger until it
15938 reaches the end of the method or another #line directive which
15939 restores the original file.
15941 2003-02-23 Martin Baulig <martin@ximian.com>
15943 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
15945 2003-02-23 Martin Baulig <martin@ximian.com>
15947 * statement.cs (Block.AddChildVariableNames): We need to call this
15948 recursively, not just for our immediate children.
15950 2003-02-23 Martin Baulig <martin@ximian.com>
15952 * class.cs (Event.Define): Always make the field private, like csc does.
15954 * typemanager.cs (TypeManager.RealMemberLookup): Make events
15955 actually work, fixes bug #37521.
15957 2003-02-23 Miguel de Icaza <miguel@ximian.com>
15959 * delegate.cs: When creating the various temporary "Parameters"
15960 classes, make sure that we call the ComputeAndDefineParameterTypes
15961 on those new parameters (just like we do with the formal ones), to
15962 allow them to be resolved in the context of the DeclSpace.
15964 This fixes the bug that Dick observed in Bugzilla #38530.
15966 2003-02-22 Miguel de Icaza <miguel@ximian.com>
15968 * expression.cs (ResolveMemberAccess): When resolving a constant,
15969 do not attempt to pull a constant if the value was not able to
15970 generate a valid constant.
15972 * const.cs (LookupConstantValue): Do not report more errors than required.
15974 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15976 * expression.cs: fixes bug #38328.
15978 2003-02-18 Miguel de Icaza <miguel@ximian.com>
15980 * class.cs: Changed all the various members that can be part of a
15981 class from being an ArrayList to be an Array of the right type.
15982 During the DefineType type_list, interface_list, delegate_list and
15983 enum_list are turned into types, interfaces, delegates and enums
15986 And during the member population, indexer_list, event_list,
15987 constant_list, field_list, instance_constructor_list, method_list,
15988 operator_list and property_list are turned into their real arrays.
15990 Although we could probably perform this operation earlier, for
15991 good error reporting we need to keep the lists and remove the
15992 lists for longer than required.
15994 This optimization was triggered by Paolo profiling the compiler
15995 speed on the output of `gen-sample-program.pl' perl script.
15997 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
15998 not crash in methods like MemberLookupFailed that use this field.
16000 This problem arises when the compiler fails to resolve a type
16001 during interface type definition for example.
16003 2003-02-18 Miguel de Icaza <miguel@ximian.com>
16005 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
16006 inherit from System.Object, so we have to stop at null, not only
16007 when reaching System.Object.
16009 2003-02-17 Miguel de Icaza <miguel@ximian.com>
16011 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
16012 DeclaredOnly because the parent indexer might have had a different
16013 name, but did not loop until the top of the hierarchy was reached.
16015 The problem this one fixes is 35492: when a class implemented an
16016 indexer from an interface, we were getting the interface method
16017 (which was abstract) and we were flagging an error (can not invoke
16020 This also keeps bug 33089 functioning, and test-148 functioning.
16022 * typemanager.cs (IsSpecialMethod): The correct way of figuring
16023 out if a method is special is to see if it is declared in a
16024 property or event, or whether it is one of the predefined operator
16025 names. This should fix correctly #36804.
16027 2003-02-15 Miguel de Icaza <miguel@ximian.com>
16029 The goal here is to remove the dependency on EmptyCast.Peel ().
16030 Killing it completely.
16032 The problem is that currently in a number of places where
16033 constants are expected, we have to "probe" for an EmptyCast, and
16034 Peel, which is not the correct thing to do, as this will be
16035 repetitive and will likely lead to errors.
16037 The idea is to remove any EmptyCasts that are used in casts that
16038 can be reduced to constants, so we only have to cope with
16041 This bug hunt was triggered by Bug 37363 and the desire to remove
16042 the duplicate pattern where we were "peeling" emptycasts to check
16043 whether they were constants. Now constants will always be
16046 * ecore.cs: Use an enumconstant here instead of wrapping with
16049 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
16050 throwing me off. By handling this we can get rid of a few hacks.
16052 * statement.cs (Switch): Removed Peel() code.
16054 2003-02-14 Miguel de Icaza <miguel@ximian.com>
16056 * class.cs: Location information for error 508
16058 * expression.cs (New.DoResolve): Add a guard against double
16059 resolution of an expression.
16061 The New DoResolve might be called twice when initializing field
16062 expressions (see EmitFieldInitializers, the call to
16063 GetInitializerExpression will perform a resolve on the expression,
16064 and later the assign will trigger another resolution
16066 This leads to bugs (#37014)
16068 * delegate.cs: The signature for EndInvoke should contain any ref
16069 or out parameters as well. We were not doing this in the past.
16071 * class.cs (Field.Define): Do not overwrite the type definition
16072 inside the `volatile' group. Turns out that volatile enumerations
16073 were changing the type here to perform a validity test, which
16076 2003-02-12 Miguel de Icaza <miguel@ximian.com>
16078 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
16079 and structs, we do not want to load the instance variable
16081 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
16082 enum_type has to be handled like an object reference (implicit
16083 conversions exists from this to object), but the regular IsClass
16084 and IsValueType tests will never return true for this one.
16086 Also we use TypeManager.IsValueType instead of type.IsValueType,
16087 just for consistency with the rest of the code (this is only
16088 needed if we ever use the construct exposed by test-180.cs inside
16089 corlib, which we dont today).
16091 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
16093 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
16096 2003-02-09 Martin Baulig <martin@ximian.com>
16098 * namespace.cs (Namespace..ctor): Added SourceFile argument.
16099 (Namespace.DefineNamespaces): New static public method; this is
16100 called when we're compiling with debugging to add all namespaces
16101 to the symbol file.
16103 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
16104 pass it to the Namespace's .ctor.
16106 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
16107 and MethodBase arguments; pass the namespace ID to the symwriter;
16108 pass the MethodBase instead of the token to the symwriter.
16109 (SymbolWriter.DefineNamespace): New method to add a namespace to
16112 2003-02-09 Martin Baulig <martin@ximian.com>
16114 * symbolwriter.cs: New file. This is a wrapper around
16115 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
16116 methods here in near future.
16118 2003-02-09 Martin Baulig <martin@ximian.com>
16120 * codegen.cs (EmitContext.Mark): Just pass the arguments to
16121 ILGenerator.MarkSequencePoint() which are actually used by the
16124 2003-02-09 Martin Baulig <martin@ximian.com>
16126 * location.cs (SourceFile): New public sealed class. This
16127 contains the name and an index which is used in the location's token.
16128 (Location): Reserve an appropriate number of bits in the token for
16129 the source file instead of walking over that list, this gives us a
16130 really huge performance improvement when compiling with debugging.
16132 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
16133 `SourceFile' argument instead of a string.
16134 (Driver.ProcessFile): Add all the files via Location.AddFile(),
16135 but don't parse/tokenize here, we need to generate the list of all
16136 source files before we do that.
16137 (Driver.ProcessFiles): New static function. Parses/tokenizes all
16140 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
16141 instead of a string.
16143 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
16146 2003-02-09 Martin Baulig <martin@ximian.com>
16148 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
16149 filename on `#line default'.
16151 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
16153 * statement.cs: don't clear the pinned var when the fixed statement
16154 returns from the method (fixes bug#37752).
16156 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
16158 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
16161 2003-02-07 Martin Baulig <martin@ximian.com>
16163 * driver.cs: Removed the `--debug-args' command line argument.
16165 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
16166 automatically by the AsssemblyBuilder.
16167 (CodeGen.InitializeSymbolWriter): We don't need to call any
16168 initialization function on the symbol writer anymore. This method
16169 doesn't take any arguments.
16171 2003-02-03 Miguel de Icaza <miguel@ximian.com>
16173 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
16174 from referenced assemblies as well.
16176 2003-02-02 Martin Baulig <martin@ximian.com>
16178 * class.cs (MethodData.Emit): Generate debugging info for external methods.
16180 2003-02-02 Martin Baulig <martin@ximian.com>
16182 * class.cs (Constructor.Emit): Open the symbol writer before
16183 emitting the constructor initializer.
16184 (ConstructorInitializer.Emit): Call ec.Mark() to allow
16185 single-stepping through constructor initializers.
16187 2003-01-30 Miguel de Icaza <miguel@ximian.com>
16189 * class.cs: Handle error 549: do not allow virtual methods in
16192 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
16194 * decl.cs: Check access levels when resolving types
16196 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
16198 * statement.cs: Add parameters and locals set in catch blocks that might
16199 return to set vector
16201 2003-01-29 Miguel de Icaza <miguel@ximian.com>
16203 * class.cs (Operator): Set the SpecialName flags for operators.
16205 * expression.cs (Invocation.DoResolve): Only block calls to
16206 accessors and operators on SpecialName methods.
16208 (Cast.TryReduce): Handle conversions from char constants.
16211 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
16213 * statement.cs: small memory and time optimization in FlowBranching.
16215 2003-01-28 Pedro Mart <yoros@wanadoo.es>
16217 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
16218 problem that the last fix but in the other sid (Set).
16220 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
16221 access when there is no indexer in the hierarchy.
16223 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
16225 * class.cs: Combine some if statements.
16227 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16229 * driver.cs: fixed bug #37187.
16231 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
16233 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
16234 any indexer, it's needed to build a list with all the indexers in the
16235 hierarchy (AllGetters), else we have problems. Fixes #35653.
16237 2003-01-23 Miguel de Icaza <miguel@ximian.com>
16239 * class.cs (MethodData.Define): It is wrong for an interface
16240 implementation to be static in both cases: explicit and implicit.
16241 We were only handling this in one case.
16243 Improve the if situation there to not have negations.
16245 * class.cs (Field.Define): Turns out that we do not need to check
16246 the unsafe bit on field definition, only on usage. Remove the test.
16248 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16250 * driver.cs: use assembly.Location instead of Codebase (the latest
16251 patch made mcs fail when using MS assemblies).
16253 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
16255 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
16256 get the path to *corlib.dll.
16258 2003-01-21 Nick Drochak <ndrochak@gol.com>
16262 * typemanager.cs: Remove compiler warnings
16264 2003-01-20 Duncan Mak <duncan@ximian.com>
16266 * AssemblyInfo.cs: Bump the version number to 0.19.
16268 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16270 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
16272 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
16274 * class.cs (Constructor::Emit): Emit debugging info for constructors.
16276 2003-01-17 Miguel de Icaza <miguel@ximian.com>
16278 * cs-parser.jay: Small fix: we were not comparing the constructor
16279 name correctly. Thanks to Zoltan for the initial pointer.
16281 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
16283 * cs-tokenizer.cs: Set file name when specified with #line
16285 2003-01-15 Miguel de Icaza <miguel@ximian.com>
16287 * cs-parser.jay: Only perform the constructor checks here if we
16288 are named like the class; This will help provider a better
16289 error. The constructor path is taken when a type definition is
16290 not found, but most likely the user forgot to add the type, so
16291 report that rather than the constructor error.
16293 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
16295 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
16298 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
16300 * cs-parser.jay: Add cleanup call.
16302 2003-01-13 Duncan Mak <duncan@ximian.com>
16304 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
16305 consistent with other methods.
16307 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
16309 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
16311 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
16313 * attribute.cs: only set GuidAttr to true when we have a
16316 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16320 * typemanager.cs: fixes to allow mcs compile corlib with the new
16321 Type.IsSubclassOf fix.
16323 2003-01-08 Miguel de Icaza <miguel@ximian.com>
16325 * expression.cs (LocalVariableReference.DoResolve): Classify a
16326 constant as a value, not as a variable. Also, set the type for
16329 * cs-parser.jay (fixed_statement): take a type instead of a
16330 pointer_type, so we can produce a better error message later.
16332 * statement.cs (Fixed.Resolve): Flag types that are not pointers
16335 (For.DoEmit): Make inifinite loops have a
16336 non-conditional branch back.
16338 (Fixed.DoEmit): First populate the pinned variables, then emit the
16339 statement, then clear the variables. Before I was emitting the
16340 code once for each fixed piece.
16343 2003-01-08 Martin Baulig <martin@ximian.com>
16345 * statement.cs (FlowBranching.MergeChild): A break in a
16346 SWITCH_SECTION does not leave a loop. Fixes #36155.
16348 2003-01-08 Martin Baulig <martin@ximian.com>
16350 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
16351 lives in the same number space than `param_map'. Fixes #36154.
16353 2003-01-07 Miguel de Icaza <miguel@ximian.com>
16355 * cs-parser.jay (constructor_declaration): Set the
16356 Constructor.ModFlags before probing for it. This makes the
16357 compiler report 514, 515 and 132 (the code was there, but got
16360 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
16361 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
16362 (GotoCase.Resolve): Set `Returns' to ALWAYS.
16364 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
16366 * enum.cs: create the enum static fields using the enum type.
16368 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
16370 * class.cs: don't try to create the ParamBuilder for the return
16371 type if it's not needed (and handle it breaking for the ms runtime
16374 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
16376 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
16378 2002-12-29 Miguel de Icaza <miguel@ximian.com>
16380 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
16381 the command. This showed up while compiling the JANET source
16382 code, which used \r as its only newline separator.
16384 2002-12-28 Miguel de Icaza <miguel@ximian.com>
16386 * class.cs (Method.Define): If we are an operator (because it
16387 reuses our code), then set the SpecialName and HideBySig. #36128
16389 2002-12-22 Miguel de Icaza <miguel@ximian.com>
16391 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
16392 exception, report error 120 `object reference required'.
16394 * driver.cs: Add --pause option, used during to measure the size
16395 of the process as it goes with --timestamp.
16397 * expression.cs (Invocation.DoResolve): Do not allow methods with
16398 SpecialName to be invoked.
16400 2002-12-21 Miguel de Icaza <miguel@ximian.com>
16402 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
16403 number before adding it.
16405 2002-12-21 Ravi Pratap <ravi@ximian.com>
16407 * ecore.cs (StandardImplicitConversion): When in an unsafe
16408 context, we allow conversion between void * to any other pointer
16409 type. This fixes bug #35973.
16411 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
16413 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
16414 is not thrown when extensionless outputs are used
16416 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16418 * rootcontext.cs: fixed compilation of corlib.
16420 2002-12-19 Miguel de Icaza <miguel@ximian.com>
16422 * attribute.cs (Attributes.Contains): Add new method.
16424 * class.cs (MethodCore.LabelParameters): if the parameter is an
16425 `out' parameter, check that no attribute `[In]' has been passed.
16427 * enum.cs: Handle the `value__' name in an enumeration.
16429 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
16431 * decl.cs: Added special case to allow overrides on "protected
16434 2002-12-18 Ravi Pratap <ravi@ximian.com>
16436 * attribute.cs (Attributes.AddAttributeSection): Rename to this
16437 since it makes much more sense.
16439 (Attributes.ctor): Don't require a Location parameter.
16441 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
16443 * attribute.cs (ApplyAttributes): Remove extra Location parameters
16444 since we already have that information per attribute.
16446 * everywhere : make appropriate changes.
16448 * class.cs (LabelParameters): Write the code which actually
16449 applies attributes to the return type. We can't do this on the MS
16450 .NET runtime so we flag a warning in the case an exception is
16453 2002-12-18 Miguel de Icaza <miguel@ximian.com>
16455 * const.cs: Handle implicit null conversions here too.
16457 2002-12-17 Ravi Pratap <ravi@ximian.com>
16459 * class.cs (MethodCore.LabelParameters): Remove the extra
16460 Type [] parameter since it is completely unnecessary. Instead
16461 pass in the method's attributes so that we can extract
16462 the "return" attribute.
16464 2002-12-17 Miguel de Icaza <miguel@ximian.com>
16466 * cs-parser.jay (parse): Use Report.Error to flag errors instead
16467 of ignoring it and letting the compile continue.
16469 * typemanager.cs (ChangeType): use an extra argument to return an
16470 error condition instead of throwing an exception.
16472 2002-12-15 Miguel de Icaza <miguel@ximian.com>
16474 * expression.cs (Unary.TryReduce): mimic the code for the regular
16475 code path. Perform an implicit cast in the cases where we can
16476 implicitly convert to one of the integral types, and then reduce
16477 based on that constant. This fixes bug #35483.
16479 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16481 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
16483 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16485 * namespace.cs: fixed bug #35489.
16487 2002-12-12 Miguel de Icaza <miguel@ximian.com>
16489 * class.cs: Remove some dead code.
16491 * cs-parser.jay: Estimate the number of methods needed
16492 (RootContext.MethodCount);
16494 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
16495 numbers instead of StringBuilders.
16497 * support.cs (PtrHashtable): Add constructor with initial size;
16498 We can now reduce reallocations of the method table.
16500 2002-12-10 Ravi Pratap <ravi@ximian.com>
16502 * attribute.cs (ApplyAttributes): Keep track of the emitted
16503 attributes on a per-target basis. This fixes bug #35413.
16505 2002-12-10 Miguel de Icaza <miguel@ximian.com>
16507 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
16508 default to the Windows 1252 encoding.
16510 (UnixParseOption): Support version, thanks to Alp for the missing
16513 * AssemblyInfo.cs: Add nice assembly information.
16515 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
16518 * cs-parser.jay: Allow a trailing comma before the close bracked
16519 in the attribute_section production.
16521 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
16522 address of the instance was being taken, I will take this out,
16523 because we take the address of the object immediately here.
16525 2002-12-09 Ravi Pratap <ravi@ximian.com>
16527 * typemanager.cs (AreMultipleAllowed): Take care of the most
16528 obvious case where attribute type is not in the current assembly -
16531 2002-12-08 Miguel de Icaza <miguel@ximian.com>
16533 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
16534 definitions, instead of doing that afterwards.
16536 Also we use a nice little hack, depending on the constructor, we
16537 know if we are a "composed" name or a simple name. Hence, we
16538 avoid the IndexOf test, and we avoid
16540 * codegen.cs: Add code to assist in a bug reporter to track down
16541 the source of a compiler crash.
16543 2002-12-07 Ravi Pratap <ravi@ximian.com>
16545 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
16546 types have been emitted for a given element and flag an error
16547 if something which does not have AllowMultiple set is used more
16550 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
16551 attribute types and their corresponding AllowMultiple properties
16553 (AreMultipleAllowed): Check the property for a given type.
16555 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
16556 property in the case we have a TypeContainer.
16558 (Attributes.AddAttribute): Detect duplicates and just skip on
16559 adding them. This trivial fix catches a pretty gross error in our
16560 attribute emission - global attributes were being emitted twice!
16562 Bugzilla bug #33187 is now fixed.
16564 2002-12-06 Miguel de Icaza <miguel@ximian.com>
16566 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
16567 instead of pp_and).
16569 * expression.cs (Binary.ResolveOperator): I can only use the
16570 Concat (string, string, string) and Concat (string, string,
16571 string, string) if the child is actually a concatenation of
16574 2002-12-04 Miguel de Icaza <miguel@ximian.com>
16576 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
16577 context where we need a 2-character lookahead.
16579 * pending.cs (PendingImplementation): Rework so we can keep track
16580 of interface types all the time, and flag those which were
16581 implemented by parents as optional.
16583 2002-12-03 Miguel de Icaza <miguel@ximian.com>
16585 * expression.cs (Binary.ResolveOperator): Use
16586 String.Concat(string,string,string) or
16587 String.Concat(string,string,string,string) when possible.
16589 * typemanager: More helper methods.
16592 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
16594 * pending.cs: remove the bogus return from GetMissingInterfaces()
16595 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
16597 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16599 * namespace.cs: avoid duplicated 'using xxx' being added to
16600 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
16601 when we get more than one 'using' statement for the same namespace.
16602 Report a CS0105 warning for it.
16604 2002-11-30 Miguel de Icaza <miguel@ximian.com>
16606 * cs-tokenizer.cs (consume_identifier): use read directly, instead
16607 of calling getChar/putback, uses internal knowledge of it.
16609 (xtoken): Reorder tokenizer so most common patterns are checked
16610 first. This reduces the compilation time in another 5% (from 8.11s
16611 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
16613 The parsing time is 22% of the compilation in mcs, and from that
16614 64% is spent on the tokenization process.
16616 I tried using a binary search for keywords, but this is slower
16617 than the hashtable. Another option would be to do a couple of
16620 * Not use a StringBuilder, instead use an array of chars,
16621 with a set value. Notice that this way we could catch
16622 the 645 error without having to do it *afterwards*.
16624 * We could write a hand-parser to avoid the hashtable
16625 compares altogether.
16627 The identifier consumption process takes 37% of the tokenization
16628 time. Another 15% is spent on is_number. 56% of the time spent
16629 on is_number is spent on Int64.Parse:
16631 * We could probably choose based on the string length to
16632 use Int32.Parse or Int64.Parse and avoid all the 64-bit
16635 Another 3% is spend on wrapping `xtoken' in the `token' function.
16637 Handle 0xa0 as whitespace (#34752)
16639 2002-11-26 Miguel de Icaza <miguel@ximian.com>
16641 * typemanager.cs (IsCLRType): New routine to tell whether a type
16642 is one of the builtin types.
16644 Maybe it needs to use TypeCodes to be faster. Maybe we could use
16645 typecode in more places instead of doing pointer comparissions.
16646 We could leverage some knowledge about the way the typecodes are
16649 New code to cache namespaces in assemblies, it is currently not
16650 invoked, to be used soon.
16652 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
16654 * expression.cs (Binary.ResolveOperator): specially handle
16655 strings, and do not perform user-defined operator overloading for
16658 2002-11-24 Miguel de Icaza <miguel@ximian.com>
16660 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
16661 internalcall as it is a pretty simple operation; Avoid whenever
16662 possible to call Char.IsLetter.
16664 (consume_identifier): Cut by half the number of
16665 hashtable calls by merging the is_keyword and GetKeyword behavior.
16667 Do not short-circuit, because if we do, we
16668 report errors (ie, #if false && true would produce an invalid
16672 2002-11-24 Martin Baulig <martin@ximian.com>
16674 * expression.cs (Cast.TryReduce): If we're in checked syntax,
16675 check constant ranges and report a CS0221. Fixes #33186.
16677 2002-11-24 Martin Baulig <martin@ximian.com>
16679 * cs-parser.jay: Make this work for uninitialized variable
16680 declarations in the `for' initializer. Fixes #32416.
16682 2002-11-24 Martin Baulig <martin@ximian.com>
16684 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
16685 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
16687 2002-11-24 Martin Baulig <martin@ximian.com>
16689 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
16690 argument; if true, we also check for user-defined conversions.
16691 This is only needed if both arguments are of a user-defined type.
16692 Fixes #30443, added test-175.cs.
16693 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
16695 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
16697 2002-11-24 Martin Baulig <martin@ximian.com>
16699 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
16700 function to get the store opcode.
16701 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
16702 only emit the Ldelema if the store opcode is Stobj. You must run
16703 both test-34 and test-167 to test this. Fixes #34529.
16705 2002-11-23 Martin Baulig <martin@ximian.com>
16707 * ecore.cs (Expression.MemberLookup): Added additional
16708 `qualifier_type' argument which is used when we're being called
16709 from MemberAccess.DoResolve() and null if we're called from a
16711 (Expression.MemberLookupFailed): New method to report errors; this
16712 does the CS1540 check and reports the correct error message.
16714 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
16715 argument for the CS1540 check and redone the way how we're dealing
16716 with private members. See the comment in the source code for details.
16717 (FilterWithClosure): Reverted this back to revision 1.197; renamed
16718 `closure_start_type' to `closure_qualifier_type' and check whether
16719 it's not null. It was not this filter being broken, it was just
16720 being called with the wrong arguments.
16722 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
16723 and pass it the correct `qualifier_type'; this also does the error
16726 2002-11-22 Miguel de Icaza <miguel@ximian.com>
16728 * expression.cs (Invocation.EmitParams): If the we are dealing
16729 with a non-built-in value type, load its address as well.
16731 (ArrayCreation): Use a a pretty constant instead
16732 of the hardcoded value 2. Use 6 instead of 2 for the number of
16733 static initializers.
16735 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
16736 because they are not really value types, just glorified integers.
16738 * driver.cs: Do not append .exe, the CSC compiler does not do it.
16740 * ecore.cs: Remove redundant code for enumerations, make them use
16741 the same code path as everything else, fixes the casting issue
16742 with enumerations in Windows.Forms.
16744 * attribute.cs: Do only cast to string if it is a string, the
16745 validation happens later.
16747 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
16748 people upgrade their corlibs.
16750 * ecore.cs: Oops, enumerations were not following the entire code path
16752 2002-11-21 Miguel de Icaza <miguel@ximian.com>
16754 * typemanager.cs (FilterWithClosure): Commented out the test for
16755 1540 in typemanager.cs, as it has problems when accessing
16756 protected methods from a parent class (see test-174.cs).
16758 * attribute.cs (Attribute.ValidateGuid): new method.
16759 (Attribute.Resolve): Use above.
16761 2002-11-19 Miguel de Icaza <miguel@ximian.com>
16763 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
16765 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
16766 handling for enumerations, as we only needed the TypeContainer
16767 functionality to begin with (this is required for the fix below to
16768 work for enums that reference constants in a container class for
16771 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
16773 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
16774 a valid TypeBuilder to perform lookups on.o
16776 * class.cs (InheritableMemberSignatureCompare): Use true in the
16777 call to GetGetMethod and GetSetMethod, because we are comparing
16778 the signature, and we need to get the methods *even* if they are
16781 (PropertyBase.CheckBase): ditto.
16783 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
16784 GotoCase.Resolve): Use Peel on EmpytCasts.
16786 * ecore.cs (EmptyCast): drop child, add Peel method.
16788 2002-11-17 Martin Baulig <martin@ximian.com>
16790 * ecore.cs (EmptyCast.Child): New public property.
16792 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
16793 label resolved to an EmptyCast. Fixes #34162.
16794 (GotoCase.Resolve): Likewise.
16795 (Block.EmitMeta): Likewise.
16797 2002-11-17 Martin Baulig <martin@ximian.com>
16799 * expression.cs (Invocation.BetterConversion): Prefer int over
16800 uint; short over ushort; long over ulong for integer literals.
16801 Use ImplicitConversionExists instead of StandardConversionExists
16802 since we also need to check for user-defined implicit conversions.
16803 Fixes #34165. Added test-173.cs.
16805 2002-11-16 Martin Baulig <martin@ximian.com>
16807 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
16808 with the `true' and `false' literals. Fixes #33151.
16810 2002-11-16 Martin Baulig <martin@ximian.com>
16812 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
16813 October 22nd; don't do the cs1540 check for static members.
16815 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
16816 now using our own filter here and doing the cs1540 check again.
16818 2002-11-16 Martin Baulig <martin@ximian.com>
16820 * support.cs (InternalParameters): Don't crash if we don't have
16821 any fixed parameters. Fixes #33532.
16823 2002-11-16 Martin Baulig <martin@ximian.com>
16825 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
16826 when looking up static methods to make this work on Windows.
16829 2002-11-16 Martin Baulig <martin@ximian.com>
16831 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
16832 a setter rather than using PropertyInfo.CanWrite.
16834 2002-11-15 Nick Drochak <ndrochak@gol.com>
16836 * class.cs: Allow acces to block member by subclasses. Fixes build
16839 2002-11-14 Martin Baulig <martin@ximian.com>
16841 * class.cs (Constructor.Emit): Added the extern/block check.
16844 2002-11-14 Martin Baulig <martin@ximian.com>
16846 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
16847 iteration while looking for indexers, this is needed because the
16848 indexer may have a different name in our base classes. Fixed the
16849 error reporting (no indexers at all, not get accessor, no
16850 overloaded match). Fixes bug #33089.
16851 (IndexerAccess.DoResolveLValue): Likewise.
16853 2002-11-14 Martin Baulig <martin@ximian.com>
16855 * class.cs (PropertyBase.CheckBase): Make this work for multiple
16856 indexers. Fixes the first part of bug #33089.
16857 (MethodSignature.InheritableMemberSignatureCompare): Added support
16860 2002-11-13 Ravi Pratap <ravi@ximian.com>
16862 * attribute.cs (Attribute.Resolve): Catch the
16863 NullReferenceException and report it since it isn't supposed to
16866 2002-11-12 Miguel de Icaza <miguel@ximian.com>
16868 * expression.cs (Binary.EmitBranchable): Also handle the cases for
16869 LogicalOr and LogicalAnd that can benefit from recursively
16870 handling EmitBranchable. The code now should be nice for Paolo.
16872 2002-11-08 Miguel de Icaza <miguel@ximian.com>
16874 * typemanager.cs (LookupType): Added a negative-hit hashtable for
16875 the Type lookups, as we perform quite a number of lookups on
16876 non-Types. This can be removed once we can deterministically tell
16877 whether we have a type or a namespace in advance.
16879 But this might require special hacks from our corlib.
16883 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
16884 and double which avoids a conversion from an integer to a double.
16886 * expression.cs: tiny optimization, avoid calling IsConstant,
16887 because it effectively performs the lookup twice.
16889 2002-11-06 Miguel de Icaza <miguel@ximian.com>
16891 But a bogus return here to keep the semantics of the old code
16892 until the Mono runtime is fixed.
16894 * pending.cs (GetMissingInterfaces): New method used to remove all
16895 the interfaces that are already implemented by our parent
16896 classes from the list of pending methods.
16898 * interface.cs: Add checks for calls after ResolveTypeExpr.
16900 2002-11-05 Miguel de Icaza <miguel@ximian.com>
16902 * class.cs (Class.Emit): Report warning 67: event not used if the
16903 warning level is beyond 3.
16905 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
16906 being a NullLiteral.
16908 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
16911 * class.cs (TypeContainer.GetClassBases): Cover a missing code
16912 path that might fail if a type can not be resolved.
16914 * expression.cs (Binary.Emit): Emit unsigned versions of the
16917 * driver.cs: use error 5.
16919 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
16921 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
16923 2002-11-01 Miguel de Icaza <miguel@ximian.com>
16925 * cs-parser.jay (switch_section): A beautiful patch from Martin
16926 Baulig that fixed 33094.
16928 2002-10-31 Miguel de Icaza <miguel@ximian.com>
16930 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
16931 Check whether the base is abstract and report an error if so.
16933 * expression.cs (IndexerAccess.DoResolveLValue,
16934 IndexerAccess.DoResolve): ditto.
16936 (Invocation.DoResolve): ditto.
16938 (Invocation.FullMethodDesc): Improve the report string.
16940 * statement.cs (Block): Eliminate IsVariableDefined as it is
16941 basically just a wrapper for GetVariableInfo.
16943 * ecore.cs (SimpleName): Use new
16945 * support.cs (ReflectionParamter.ParameterType): We unwrap the
16946 type, as we return the actual parameter ref/unref state on a
16949 2002-10-30 Miguel de Icaza <miguel@ximian.com>
16951 * support.cs: Return proper flags REF/OUT fixing the previous
16954 * expression.cs: Reverted last patch, that was wrong. Is_ref is
16955 not used to mean `ref' but `ref or out' in ParameterReference
16957 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
16958 full type signature instead of calling TypeManger.CSharpName
16961 * support.cs (InternalParameters.ParameterDesc): Do not compare
16962 directly to the modflags, because REF/OUT will actually be bitsets
16965 * delegate.cs (VerifyMethod): Check also the modifiers.
16967 * cs-tokenizer.cs: Fix bug where floating point values with an
16968 exponent where a sign was missing was ignored.
16970 * driver.cs: Allow multiple assemblies to be specified in a single
16973 2002-10-28 Miguel de Icaza <miguel@ximian.com>
16975 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
16976 because identifiers after a parenthesis would end up in this kind
16977 of production, and we needed to desamiguate it for having casts
16980 (UserDefinedType *) xxx
16982 2002-10-24 Miguel de Icaza <miguel@ximian.com>
16984 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
16985 we should set on the Bindingflags.NonPublic, but not turn on
16986 private_ok. private_ok controls whether a Private member is
16987 returned (this is chekced on the filter routine), while the
16988 BindingFlags.NonPublic just controls whether private/protected
16989 will be allowed. This fixes the problem part of the problem of
16990 private properties being allowed to be used in derived classes.
16992 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
16993 so we can call the children DoResolveLValue method (this will
16994 properly signal errors on lvalue assignments to base properties)
16996 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
16997 getter are null, and we have a property info, we know that this
16998 happened because the lookup failed, so we report an error 122 for
16999 protection level violation.
17001 We also silently return if setter and getter are null in the
17002 resolve functions, this condition only happens if we have flagged
17003 the error before. This is the other half of the problem.
17005 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
17006 not have accessibility information, that is why we were returning
17007 true in the filter function in typemanager.cs.
17009 To properly report 122 (property is inaccessible because of its
17010 protection level) correctly, we report this error in ResolveAccess
17011 by failing if both the setter and the getter are lacking (ie, the
17014 DoResolve and DoLResolve have been modified to check for both
17015 setter/getter being null and returning silently, the reason being
17016 that I did not want to put the knowledge about this error in upper
17019 int old = Report.Errors;
17020 x = new PropertyExpr (...);
17021 if (old != Report.Errors)
17026 So the property expr is returned, but it is invalid, so the error
17027 will be flagged during the resolve process.
17029 * class.cs: Remove InheritablePropertySignatureCompare from the
17030 class, as we no longer depend on the property signature to compute
17031 whether it is possible to implement a method or not.
17033 The reason is that calling PropertyInfo.GetGetMethod will return
17034 null (in .NET, in Mono it works, and we should change this), in
17035 cases where the Get Method does not exist in that particular
17040 class X { public virtual int A { get { return 1; } } }
17042 class Z : Y { public override int A { get { return 2; } } }
17044 Would fail in Z because the parent (Y) would not have the property
17045 defined. So we avoid this completely now (because the alternative
17046 fix was ugly and slow), and we now depend exclusively on the
17049 (PropertyBase.CheckBase): Use a method-base mechanism to find our
17050 reference method, instead of using the property.
17052 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
17053 routines are gone now.
17055 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
17056 names, they were incorrectly named.
17058 * cs-tokenizer.cs: Return are more gentle token on failure.
17060 * pending.cs (PendingImplementation.InterfaceMethod): This routine
17061 had an out-of-sync index variable, which caused it to remove from
17062 the list of pending methods the wrong method sometimes.
17064 2002-10-22 Miguel de Icaza <miguel@ximian.com>
17066 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
17067 CanWrite, because those refer to this particular instance of the
17068 property, and do not take into account the fact that we can
17069 override single members of a property.
17071 Constructor requires an EmitContext. The resolution process does
17072 not happen here, but we need to compute the accessors before,
17073 because the resolution does not always happen for properties.
17075 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
17076 subclass, before we did not update this flag, but we did update
17079 (GetAccessors): Drop this routine, as it did not work in the
17080 presence of partially overwritten set/get methods.
17082 Notice that this broke the cs1540 detection, but that will require
17085 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17089 * driver.cs: issue a warning instead of an error if we don't support
17090 debugging for the platform. Also ignore a couple of errors that may
17091 arise when trying to write the symbols. Undo my previous patch.
17093 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17095 * driver.cs: ignore /debug switch except for Unix platforms.
17097 2002-10-23 Nick Drochak <ndrochak@gol.com>
17099 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
17101 2002-10-21 Miguel de Icaza <miguel@ximian.com>
17103 * driver.cs: Do not make mcs-debug conditional, so we do not break
17104 builds that use it.
17106 * statement.cs (UsageVector.MergeChildren): I would like Martin to
17107 review this patch. But basically after all the children variables
17108 have been merged, the value of "Breaks" was not being set to
17109 new_breaks for Switch blocks. I think that it should be set after
17110 it has executed. Currently I set this to the value of new_breaks,
17111 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
17112 conservative, but I do not understand this code very well.
17114 I did not break anything in the build, so that is good ;-)
17116 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
17118 2002-10-20 Mark Crichton <crichton@gimp.org>
17120 * cfold.cs: Fixed compile blocker. Really fixed it this time.
17122 2002-10-20 Nick Drochak <ndrochak@gol.com>
17124 * cfold.cs: Fixed compile blocker.
17126 2002-10-20 Miguel de Icaza <miguel@ximian.com>
17128 * driver.cs: I was chekcing the key, not the file.
17130 2002-10-19 Ravi Pratap <ravi@ximian.com>
17132 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
17133 message that we were generating - we just need to silently return
17136 2002-10-19 Miguel de Icaza <miguel@ximian.com>
17138 * class.cs (Event.Define): Change my previous commit, as this
17139 breaks the debugger. This is a temporary hack, as it seems like
17140 the compiler is generating events incorrectly to begin with.
17142 * expression.cs (Binary.ResolveOperator): Added support for
17143 "U operator - (E x, E y)"
17145 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
17148 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
17149 init-only variables, but this path did not take into account that
17150 there might be also instance readonly variables. Correct this
17153 This fixes bug 32253
17155 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
17158 * driver.cs: Change the extension for modules to `netmodule'
17160 * cs-parser.jay: Improved slightly the location tracking for
17161 the debugger symbols.
17163 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
17164 modifiers that were specified instead of the hardcoded value
17165 (FamAndAssem). This was basically ignoring the static modifier,
17166 and others. Fixes 32429.
17168 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
17169 fixed a bug in the process (32476)
17171 * expression.cs (ArrayAccess.EmitAssign): Patch from
17172 hwang_rob@yahoo.ca that fixes bug 31834.3
17174 2002-10-18 Miguel de Icaza <miguel@ximian.com>
17176 * driver.cs: Make the module extension .netmodule.
17178 2002-10-16 Miguel de Icaza <miguel@ximian.com>
17180 * driver.cs: Report an error if the resource file is not found
17181 instead of crashing.
17183 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
17184 false, like Emit does.
17186 2002-10-16 Nick Drochak <ndrochak@gol.com>
17188 * typemanager.cs: Remove unused private member. Also reported mcs
17189 bug to report this as a warning like csc.
17191 2002-10-15 Martin Baulig <martin@gnome.org>
17193 * statement.cs (Statement.Emit): Made this a virtual method; emits
17194 the line number info and calls DoEmit().
17195 (Statement.DoEmit): New protected abstract method, formerly knows
17196 as Statement.Emit().
17198 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
17200 2002-10-11 Miguel de Icaza <miguel@ximian.com>
17202 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
17203 have fixed a remaining problem: not every AddXXXX was adding a
17204 fully qualified name.
17206 Now everyone registers a fully qualified name in the DeclSpace as
17207 being defined instead of the partial name.
17209 Downsides: we are slower than we need to be due to the excess
17210 copies and the names being registered this way.
17212 The reason for this is that we currently depend (on the corlib
17213 bootstrap for instance) that types are fully qualified, because
17214 we dump all the types in the namespace, and we should really have
17215 types inserted into the proper namespace, so we can only store the
17216 basenames in the defined_names array.
17218 2002-10-10 Martin Baulig <martin@gnome.org>
17220 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
17221 from bug #31834, see the bug report for a testcase which is
17224 2002-10-10 Martin Baulig <martin@gnome.org>
17226 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
17227 flow analysis code for this.
17229 * statement.cs (Do, While, For): Tell the flow analysis code about
17231 (FlowBranching.UsageVector): Added support for infinite loops.
17232 (Block.Resolve): Moved the dead code elimination here and use flow
17235 2002-10-09 Miguel de Icaza <miguel@ximian.com>
17237 * class.cs (Field.Define): Catch cycles on struct type
17240 * typemanager.cs (IsUnmanagedtype): Do not recursively check
17241 fields if the fields are static. We only need to check instance
17244 * expression.cs (As.DoResolve): Test for reference type.
17246 * statement.cs (Using.ResolveExpression): Use
17247 ConvertImplicitRequired, not ConvertImplicit which reports an
17249 (Using.ResolveLocalVariableDecls): ditto.
17251 * expression.cs (Binary.ResolveOperator): Report errors in a few
17252 places where we had to.
17254 * typemanager.cs (IsUnmanagedtype): Finish implementation.
17256 2002-10-08 Miguel de Icaza <miguel@ximian.com>
17258 * expression.cs: Use StoreFromPtr instead of extracting the type
17259 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
17261 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
17262 an enumeration value to a System.Enum, but System.Enum is not a
17263 value type, but an class type, so we need to box.
17265 (Expression.ConvertExplicit): One codepath could return
17266 errors but not flag them. Fix this. Fixes #31853
17268 * parameter.cs (Resolve): Do not allow void as a parameter type.
17270 2002-10-06 Martin Baulig <martin@gnome.org>
17272 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
17273 if it's a class type and not a struct. Fixes #31815.
17275 2002-10-06 Martin Baulig <martin@gnome.org>
17277 * statement.cs: Reworked the flow analysis code a bit to make it
17278 usable for dead code elimination.
17280 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17282 * cs-parser.jay: allow empty source files. Fixes bug #31781.
17284 2002-10-04 Miguel de Icaza <miguel@ximian.com>
17286 * expression.cs (ComposedCast.DoResolveType): A quick workaround
17287 to fix the test 165, will investigate deeper.
17289 2002-10-04 Martin Baulig <martin@gnome.org>
17291 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
17292 finally blocks actually work.
17293 (Try.Resolve): We don't need to create a sibling for `finally' if
17294 there is no finally block.
17296 2002-10-04 Martin Baulig <martin@gnome.org>
17298 * class.cs (Constructor.Define): The default accessibility for a
17299 non-default constructor is private, not public.
17301 2002-10-04 Miguel de Icaza <miguel@ximian.com>
17303 * class.cs (Constructor): Make AllowedModifiers public, add
17306 * cs-parser.jay: Perform the modifiers test here, as the
17307 constructor for the Constructor class usually receives a zero
17308 because of the way we create it (first we create, later we
17309 customize, and we were never checking the modifiers).
17311 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
17312 is a version of LookupTypeReflection that includes the type-name
17313 cache. This can be used as a fast path for functions that know
17314 the fully qualified name and are only calling into *.GetType() to
17315 obtain a composed type.
17317 This is also used by TypeManager.LookupType during its type
17320 (LookupType): We now also track the real type name, as sometimes
17321 we can get a quey for the real type name from things like
17322 ComposedCast. This fixes bug 31422.
17324 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
17325 complete type fullname, it does not have to go through the type
17326 resolution system to obtain the composed version of the type (for
17327 obtaining arrays or pointers).
17329 (Conditional.Emit): Use the EmitBoolExpression to
17330 generate nicer code, as requested by Paolo.
17332 (ArrayCreation.CheckIndices): Use the patch from
17333 hwang_rob@yahoo.ca to validate the array initializers.
17335 2002-10-03 Miguel de Icaza <miguel@ximian.com>
17337 * class.cs (ConstructorInitializer.Emit): simplify code by using
17338 Invocation.EmitCall, and at the same time, fix the bugs in calling
17339 parent constructors that took variable arguments.
17341 * ecore.cs (Expression.ConvertNumericExplicit,
17342 Expression.ImplicitNumericConversion): Remove the code that
17343 manually wrapped decimal (InternalTypeConstructor call is now gone
17346 * expression.cs (Cast.TryReduce): Also handle decimal types when
17347 trying to perform a constant fold on the type.
17349 * typemanager.cs (IsUnmanagedtype): Partially implemented.
17351 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
17352 that only turned off an error report, and did nothing else.
17354 2002-10-02 Miguel de Icaza <miguel@ximian.com>
17356 * driver.cs: Handle and ignore /fullpaths
17358 2002-10-01 Miguel de Icaza <miguel@ximian.com>
17360 * expression.cs (Binary.ResolveOperator): Catch the case where
17361 DoNumericPromotions returns true,
17363 (Binary.DoNumericPromotions): Simplify the code, and the tests.
17365 2002-09-27 Miguel de Icaza <miguel@ximian.com>
17367 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
17370 2002-09-26 Miguel de Icaza <miguel@ximian.com>
17372 * ecore.cs (ConvertNumericExplicit): It is not enough that the
17373 conversion exists, but it is also required that the conversion be
17374 performed. This manifested in "(Type64Enum) 2".
17376 * class.cs (TypeManager.AddMethod): The fix is not to change
17377 AddEnum, because that one was using a fully qualified name (every
17378 DeclSpace derivative does), but to change the AddMethod routine
17379 that was using an un-namespaced name. This now correctly reports
17380 the duplicated name.
17382 Revert patch until I can properly fix it. The issue
17383 is that we have a shared Type space across all namespaces
17384 currently, which is wrong.
17386 Options include making the Namespace a DeclSpace, and merge
17387 current_namespace/current_container in the parser.
17389 2002-09-25 Miguel de Icaza <miguel@ximian.com>
17391 * cs-parser.jay: Improve error reporting when we get a different
17392 kind of expression in local_variable_type and
17393 local_variable_pointer_type.
17395 Propagate this to avoid missleading errors being reported.
17397 * ecore.cs (ImplicitReferenceConversion): treat
17398 TypeManager.value_type as a target just like object_type. As
17403 Is valid, and needs to result in the int 1 being boxed before it
17404 is assigned to the value type v.
17406 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
17407 to validate the enumeration name.
17409 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
17410 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
17411 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
17413 * ecore.cs (TryImplicitIntConversion): When doing an
17414 implicit-enumeration-conversion, check if the type is 64-bits and
17415 perform a conversion before passing to EnumConstant.
17417 2002-09-23 Miguel de Icaza <miguel@ximian.com>
17419 * decl.cs (Error_AmbiguousTypeReference); New routine used to
17420 report ambiguous type references. Unlike the MS version, we
17421 report what the ambiguity is. Innovation at work ;-)
17423 (DeclSpace.FindType): Require a location argument to
17424 display when we display an ambiguous error.
17426 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
17428 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
17430 * expression.cs (EmitDynamicInitializers): Apply patch from
17431 hwang_rob@yahoo.ca that fixes the order in which we emit our
17434 2002-09-21 Martin Baulig <martin@gnome.org>
17436 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
17437 delegate takes no arguments.
17439 2002-09-20 Miguel de Icaza <miguel@ximian.com>
17441 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
17444 * expression.cs: Extract the underlying type.
17446 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
17448 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
17450 2002-09-19 Miguel de Icaza <miguel@ximian.com>
17452 * class.cs (TypeContainer.DefineType): We can not use the nice
17453 PackingSize with the size set to 1 DefineType method, because it
17454 will not allow us to define the interfaces that the struct
17457 This completes the fixing of bug 27287
17459 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
17460 means also structs. This fixes part of the problem.
17461 (Expresion.ImplicitReferenceConversionExists): ditto.
17463 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
17464 error if there were no errors reported during the type lookup
17465 process, to avoid duplicates or redundant errors. Without this
17466 you would get an ambiguous errors plus a type not found. We have
17467 beaten the user enough with the first error.
17469 (DeclSparce.FindType): Emit a warning if we have an ambiguous
17472 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
17473 during the resolution process, stop the lookup, this avoids
17474 repeated error reports (same error twice).
17476 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
17478 * typemanager.cs (LookupType): Redo the type lookup code to match
17479 the needs of System.Reflection.
17481 The issue is that System.Reflection requires references to nested
17482 types to begin with a "+" sign instead of a dot. So toplevel
17483 types look like: "NameSpace.TopLevelClass", and nested ones look
17484 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
17487 2002-09-19 Martin Baulig <martin@gnome.org>
17489 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
17490 says that a method always returns or always throws an exception,
17491 don't report the CS0161.
17493 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
17494 set `Returns = new_returns'.
17496 2002-09-19 Martin Baulig <martin@gnome.org>
17498 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
17499 to an enum constant, check for a CS0176.
17501 2002-09-18 Miguel de Icaza <miguel@ximian.com>
17503 * class.cs (TypeContainer.CheckPairedOperators): Now we check
17504 for operators that must be in pairs and report errors.
17506 * ecore.cs (SimpleName.DoResolveType): During the initial type
17507 resolution process, when we define types recursively, we must
17508 check first for types in our current scope before we perform
17509 lookups in the enclosing scopes.
17511 * expression.cs (MakeByteBlob): Handle Decimal blobs.
17513 (Invocation.VerifyArgumentsCompat): Call
17514 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
17515 I thought we were supposed to always call this, but there are a
17516 few places in the code where we dont do it.
17518 2002-09-17 Miguel de Icaza <miguel@ximian.com>
17520 * driver.cs: Add support in -linkres and -resource to specify the
17521 name of the identifier.
17523 2002-09-16 Miguel de Icaza <miguel@ximian.com>
17525 * ecore.cs (StandardConversionExists): Sync with the conversion
17526 code: allow anything-* to void* conversions.
17528 (FindMostSpecificSource): Use an Expression argument
17529 instead of a Type, because we might be handed over a Literal which
17530 gets a few more implicit conversions that plain types do not. So
17531 this information was being lost.
17533 Also, we drop the temporary type-holder expression when not
17536 2002-09-17 Martin Baulig <martin@gnome.org>
17538 * class.cs (PropertyBase.CheckBase): Don't check the base class if
17539 this is an explicit interface implementation.
17541 2002-09-17 Martin Baulig <martin@gnome.org>
17543 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
17544 different `IndexerName' attributes.
17546 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
17547 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
17548 virtual CommonResolve().
17550 2002-09-16 Miguel de Icaza <miguel@ximian.com>
17552 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
17553 and convert that to the UnderlyingType.
17555 * statement.cs (Foreach.Resolve): Indexers are just like variables
17556 or PropertyAccesses.
17558 * cs-tokenizer.cs (consume_string): Track line numbers and columns
17559 inside quoted strings, we were not doing this before.
17561 2002-09-16 Martin Baulig <martin@gnome.org>
17563 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
17564 resolve it. This is needed for the definite assignment check of the
17565 instance expression, fixes bug #29846.
17566 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
17568 2002-09-16 Nick Drochak <ndrochak@gol.com>
17570 * parameter.cs: Fix compile error. Cannot reference static member
17571 from an instance object. Is this an mcs bug?
17573 2002-09-14 Martin Baulig <martin@gnome.org>
17575 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
17576 multiple times. Fixes bug #30295, added test-166.cs.
17578 2002-09-14 Martin Baulig <martin@gnome.org>
17580 * statement.cs (Block.Emit): Don't emit unreachable code.
17581 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
17582 `break' statements.
17583 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
17585 2002-09-14 Martin Baulig <martin@gnome.org>
17587 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
17590 2002-09-14 Martin Baulig <martin@gnome.org>
17592 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
17593 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
17594 be false on the ms runtime.
17596 2002-09-13 Martin Baulig <martin@gnome.org>
17598 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
17599 the CS0038 error message.
17601 2002-09-12 Miguel de Icaza <miguel@ximian.com>
17603 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
17604 constant inside, return it.
17606 2002-09-12 Martin Baulig <martin@gnome.org>
17608 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
17609 implicit conversion can be done between enum types.
17611 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
17612 check whether an implicit conversion to the current enum's UnderlyingType
17613 exists and report an error if not.
17615 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
17616 without debugging support.
17618 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
17619 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
17621 2002-09-12 Martin Baulig <martin@gnome.org>
17623 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
17625 * ecore.cs (IMemberExpr.DeclaringType): New property.
17626 (SimpleName.SimpleNameResolve): Check whether we're accessing a
17627 nonstatic member of an outer type (CS0038).
17629 2002-09-11 Miguel de Icaza <miguel@ximian.com>
17631 * driver.cs: Activate the using-error detector at warning level
17632 4 (at least for MS-compatible APIs).
17634 * namespace.cs (VerifyUsing): Small buglett fix.
17636 * pending.cs (PendingImplementation): pass the container pointer.
17638 * interface.cs (GetMethods): Allow for recursive definition. Long
17639 term, I would like to move every type to support recursive
17640 definitions, not the current ordering mechanism that we have right
17643 The situation is this: Attributes are handled before interfaces,
17644 so we can apply attributes to interfaces. But some attributes
17645 implement interfaces, we will now handle the simple cases
17646 (recursive definitions will just get an error).
17648 * parameter.cs: Only invalidate types at the end if we fail to
17651 2002-09-09 Martin Baulig <martin@gnome.org>
17653 * ecore.cs (PropertyExpr.Emit): Also check for
17654 TypeManager.system_int_array_get_length so this'll also work when
17655 compiling corlib. Fixes #30003.
17657 2002-09-09 Martin Baulig <martin@gnome.org>
17659 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
17660 and throw an exception if we can't get the type's size. Fixed #30040,
17663 2002-09-09 Martin Baulig <martin@gnome.org>
17665 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
17667 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
17668 context. Fixes bug #30027.
17670 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
17671 virtual functions. Fixes bug #30043, added test-164.cs.
17673 2002-09-08 Ravi Pratap <ravi@ximian.com>
17675 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
17677 2002-09-08 Nick Drochak <ndrochak@gol.com>
17679 * driver.cs: Use an object to get the windows codepage since it's not a
17682 2002-09-08 Miguel de Icaza <miguel@ximian.com>
17684 * statement.cs (For.Emit): for infinite loops (test == null)
17685 return whether there is a break inside, not always "true".
17687 * namespace.cs (UsingEntry): New struct to hold the name of the
17688 using definition, the location where it is defined, and whether it
17689 has been used in a successful type lookup.
17691 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
17696 2002-09-06 Ravi Pratap <ravi@ximian.com>
17698 * attribute.cs : Fix incorrect code which relied on catching
17699 a NullReferenceException to detect a null being passed in
17700 where an object was expected.
17702 2002-09-06 Miguel de Icaza <miguel@ximian.com>
17704 * statement.cs (Try): flag the catch variable as assigned
17706 * expression.cs (Cast): Simplified by using ResolveType instead of
17707 manually resolving.
17709 * statement.cs (Catch): Fix bug by using ResolveType.
17711 2002-09-06 Ravi Pratap <ravi@ximian.com>
17713 * expression.cs (BetterConversion): Special case for when we have
17714 a NullLiteral as the argument and we have to choose between string
17715 and object types - we choose string the way csc does.
17717 * attribute.cs (Attribute.Resolve): Catch the
17718 NullReferenceException and report error #182 since the Mono
17719 runtime no more has the bug and having this exception raised means
17720 we tried to select a constructor which takes an object and is
17723 2002-09-05 Ravi Pratap <ravi@ximian.com>
17725 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
17726 message (1502, 1503) when we can't locate a method after overload
17727 resolution. This is much more informative and closes the bug
17730 * interface.cs (PopulateMethod): Return if there are no argument
17731 types. Fixes a NullReferenceException bug.
17733 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
17734 expressions too. Previously we were checking only in one place for
17735 positional arguments leaving out named arguments.
17737 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
17738 type to the enum type is not allowed. Remove code corresponding to
17741 (ConvertNumericExplicit): Allow explicit conversions from
17742 the underlying type to enum type. This precisely follows the spec
17743 and closes a bug filed by Gonzalo.
17745 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17748 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
17750 2002-09-03 Miguel de Icaza <miguel@ximian.com>
17752 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
17753 it was important that we stored the right value after the
17754 reduction in `converted'.
17756 2002-09-04 Martin Baulig <martin@gnome.org>
17758 * location.cs (Location.SymbolDocument): Use full pathnames for the
17761 2002-08-30 Miguel de Icaza <miguel@ximian.com>
17763 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
17764 of the expression resolve mechanism, because that will catch the
17765 SimpleName error failures.
17767 (Conditional): If we can not resolve the
17768 expression, return, do not crash.
17770 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17773 (location): display token name instead of its number.
17775 2002-08-28 Martin Baulig <martin@gnome.org>
17777 * expression.cs (Binary.ResolveOperator): Don't silently return
17778 but return an error if an operator cannot be applied between two
17781 2002-08-28 Martin Baulig <martin@gnome.org>
17783 * class.cs (Constructor.Define): Set the permission attributes
17784 correctly instead of making all constructors public.
17786 2002-08-28 Martin Baulig <martin@gnome.org>
17788 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
17789 for private members before reporting a CS0103; if we find anything,
17792 2002-08-28 Martin Baulig <martin@gnome.org>
17794 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
17795 to check whether `closure_start_type == closure_invocation_type',
17796 we also need to check whether `m.DeclaringType == closure_invocation_type'
17797 before bypassing the permission checks. We might be accessing
17798 protected/private members from the base class.
17799 (TypeManager.RealMemberLookup): Only set private_ok if private
17800 members were requested via BindingFlags.NonPublic.
17802 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
17804 * expression.cs (MemberAccess.ResolveMemberAccess): Set
17805 MethodGroupExpr.IsExplicitImpl if appropriate.
17806 (Invocation.DoResolve): Don't report the CS0120 for explicit
17807 interface implementations.
17809 2002-08-27 Martin Baulig <martin@gnome.org>
17811 * expression.cs (Invocation.DoResolve): If this is a static
17812 method and we don't have an InstanceExpression, we must report
17815 2002-08-25 Martin Baulig <martin@gnome.org>
17817 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
17818 `==' between a valuetype and an object.
17820 2002-08-25 Miguel de Icaza <miguel@ximian.com>
17822 * ecore.cs (TypeExpr): Provide a ToString method.
17824 2002-08-24 Martin Baulig <martin@gnome.org>
17826 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
17827 now called proggie.dbg and it's a binary file.
17829 2002-08-23 Martin Baulig <martin@gnome.org>
17831 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
17833 2002-08-23 Martin Baulig <martin@gnome.org>
17835 * struct.cs (MyStructInfo.ctor): Make this work with empty
17836 structs; it's not allowed to use foreach() on null.
17838 2002-08-23 Martin Baulig <martin@gnome.org>
17840 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
17841 writer the full pathname of the generated assembly.
17843 2002-08-23 Martin Baulig <martin@gnome.org>
17845 * statements.cs (FlowBranching.UsageVector.MergeChildren):
17846 A `finally' block never returns or breaks; improved handling of
17849 2002-08-23 Martin Baulig <martin@gnome.org>
17851 * statement.cs (Throw.Resolve): Allow `throw null'.
17853 2002-08-23 Martin Baulig <martin@gnome.org>
17855 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
17856 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
17857 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
17858 MemberLookup would return a wrong event if this is an explicit
17859 interface implementation and the class has an event with the same
17862 2002-08-23 Martin Baulig <martin@gnome.org>
17864 * statement.cs (Block.AddChildVariableNames): New public method.
17865 (Block.AddChildVariableName): Likewise.
17866 (Block.IsVariableNameUsedInChildBlock): Likewise.
17867 (Block.AddVariable): Check whether a variable name has already
17868 been used in a child block.
17870 * cs-parser.jay (declare_local_variables): Mark all variable names
17871 from the current block as being used in a child block in the
17874 2002-08-23 Martin Baulig <martin@gnome.org>
17876 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
17877 find the symbol writer.
17879 * driver.cs: csc also allows the arguments to /define being
17880 separated by commas, not only by semicolons.
17882 2002-08-23 Martin Baulig <martin@gnome.org>
17884 * interface.cs (Interface.GetMembers): Added static check for events.
17886 2002-08-15 Martin Baulig <martin@gnome.org>
17888 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
17889 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
17891 * ecore.cs (Expression.MemberLookup): Added documentation and explained
17892 why the MethodData.EmitDestructor() change was necessary.
17894 2002-08-20 Martin Baulig <martin@gnome.org>
17896 * class.cs (TypeContainer.FindMembers): Added static check for events.
17898 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
17900 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
17901 use Type.GetEvents(), not Type.FindMembers().
17903 2002-08-20 Martin Baulig <martin@gnome.org>
17905 * decl.cs (MemberCache): Added a special method cache which will
17906 be used for method-only searched. This ensures that a method
17907 search will return a MethodInfo with the correct ReflectedType for
17910 2002-08-20 Martin Baulig <martin@gnome.org>
17912 * decl.cs (DeclSpace.FindMembers): Made this public.
17914 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17916 * delegate.cs: fixed build on windows.
17917 [FIXME: Filed as bug #29150: MCS must report these errors.]
17919 2002-08-19 Ravi Pratap <ravi@ximian.com>
17921 * ecore.cs (StandardConversionExists): Return a false
17922 if we are trying to convert the void type to anything else
17923 since that is not allowed.
17925 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
17926 we flag error 70 in the event an event is trying to be accessed
17927 directly from outside the declaring type.
17929 2002-08-20 Martin Baulig <martin@gnome.org>
17931 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
17932 MemberCache from typemanager.cs to decl.cs.
17934 2002-08-19 Martin Baulig <martin@gnome.org>
17936 * class.cs (TypeContainer): Implement IMemberContainer.
17937 (TypeContainer.DefineMembers): Create the MemberCache.
17938 (TypeContainer.FindMembers): Do better BindingFlags checking; only
17939 return public members if BindingFlags.Public was given, check
17940 whether members are static.
17942 2002-08-16 Martin Baulig <martin@gnome.org>
17944 * decl.cs (DeclSpace.Define): Splitted this in Define and
17945 DefineMembers. DefineMembers is called first and initializes the
17948 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
17949 DefineMembers() on all our DeclSpaces.
17951 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
17952 but call DefineMembers() on all nested interfaces. We call their
17953 Define() in our new Define() function.
17955 * interface.cs (Interface): Implement IMemberContainer.
17956 (Interface.Define): Moved all code except the attribute stuf to
17958 (Interface.DefineMembers): Initialize the member cache.
17960 * typemanager.cs (IMemberFinder): Removed this interface, we don't
17961 need this anymore since we can use MemberCache.FindMembers directly.
17963 2002-08-19 Martin Baulig <martin@gnome.org>
17965 * typemanager.cs (MemberCache): When creating the cache for an
17966 interface type, add all inherited members.
17967 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
17968 to `out bool used_cache' and documented it.
17969 (TypeManager.MemberLookup): If we already used the cache in the first
17970 iteration, we don't need to do the interfaces check.
17972 2002-08-19 Martin Baulig <martin@gnome.org>
17974 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
17975 here from IMemberFinder and don't implement this interface anymore.
17976 (DeclSpace.MemberCache): Moved here from IMemberFinder.
17978 * typemanager.cs (IMemberFinder): This interface is now only used by
17979 classes which actually support the member cache.
17980 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
17981 since we only put DeclSpaces into this Hashtable.
17982 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
17983 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
17985 2002-08-16 Martin Baulig <martin@gnome.org>
17987 * typemanager.cs (ICachingMemberFinder): Removed.
17988 (IMemberFinder.MemberCache): New property.
17989 (TypeManager.FindMembers): Merged this with RealFindMembers().
17990 This function will never be called from TypeManager.MemberLookup()
17991 so we can't use the cache here, just the IMemberFinder.
17992 (TypeManager.MemberLookup_FindMembers): Check whether the
17993 IMemberFinder has a MemberCache and call the cache's FindMembers
17995 (MemberCache): Rewrote larger parts of this yet another time and
17996 cleaned it up a bit.
17998 2002-08-15 Miguel de Icaza <miguel@ximian.com>
18000 * driver.cs (LoadArgs): Support quoting.
18002 (Usage): Show the CSC-like command line arguments.
18004 Improved a few error messages.
18006 2002-08-15 Martin Baulig <martin@gnome.org>
18008 * typemanager.cs (IMemberContainer.Type): New property.
18009 (IMemberContainer.IsInterface): New property.
18011 The following changes are conditional to BROKEN_RUNTIME, which is
18012 defined at the top of the file.
18014 * typemanager.cs (MemberCache.MemberCache): Don't add the base
18015 class'es members, but add all members from TypeHandle.ObjectType
18016 if we're an interface.
18017 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
18018 is the current type.
18019 (MemberCache.CacheEntry.Container): Removed this field.
18020 (TypeHandle.GetMembers): Include inherited members.
18022 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18024 * typemanager.cs: fixed compilation and added a comment on a field that
18027 2002-08-15 Martin Baulig <martin@gnome.org>
18029 * class.cs (ConstructorInitializer.Resolve): In the
18030 Expression.MemberLookup call, use the queried_type as
18033 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
18034 declared' attribute, it's always true.
18035 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
18036 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
18037 temporary wrapper for FindMembers which tells MemberLookup whether
18038 members from the base classes are included in the return value.
18039 This will go away soon.
18040 (TypeManager.MemberLookup): Use this temporary hack here; once the
18041 new MemberCache is completed, we don't need to do the DeclaredOnly
18042 looping here anymore since the MemberCache will take care of this.
18043 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
18044 (MemberCache): When creating the MemberCache for a class, get
18045 members from the current class and all its base classes.
18046 (MemberCache.CacheEntry.Container): New field. This is a
18047 temporary hack until the Mono runtime is fixed to distinguish
18048 between ReflectedType and DeclaringType. It allows us to use MCS
18049 with both the MS runtime and the unfixed Mono runtime without
18050 problems and without accecting performance.
18051 (MemberCache.SearchMembers): The DeclaredOnly looping from
18052 TypeManager.MemberLookup is now done here.
18054 2002-08-14 Martin Baulig <martin@gnome.org>
18056 * statement.cs (MyStructInfo.MyStructInfo): Don't call
18057 Type.GetFields on dynamic types but get the fields from the
18058 corresponding TypeContainer.
18059 (MyStructInfo.GetStructInfo): Added check for enum types.
18061 * typemanager.cs (MemberList.IsSynchronized): Implemented.
18062 (MemberList.SyncRoot): Implemented.
18063 (TypeManager.FilterWithClosure): No need to check permissions if
18064 closure_start_type == closure_invocation_type, don't crash if
18065 closure_invocation_type is null.
18067 2002-08-13 Martin Baulig <martin@gnome.org>
18069 Rewrote TypeContainer.FindMembers to use a member cache. This
18070 gives us a speed increase of about 35% for the self-hosting MCS
18071 build and of about 15-20% for the class libs (both on GNU/Linux).
18073 * report.cs (Timer): New class to get enhanced profiling. This
18074 whole class is "TIMER" conditional since it remarkably slows down
18077 * class.cs (MemberList): New class. This is an IList wrapper
18078 which we're now using instead of passing MemberInfo[]'s around to
18079 avoid copying this array unnecessarily.
18080 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
18081 (ICachingMemberFinder, IMemberContainer): New interface.
18082 (TypeManager.FilterWithClosure): If `criteria' is null, the name
18083 has already been checked, otherwise use it for the name comparision.
18084 (TypeManager.FindMembers): Renamed to RealMemberFinder and
18085 provided wrapper which tries to use ICachingMemberFinder.FindMembers
18086 if possible. Returns a MemberList, not a MemberInfo [].
18087 (TypeHandle): New class, implements IMemberContainer. We create
18088 one instance of this class per type, it contains a MemberCache
18089 which is used to do the member lookups.
18090 (MemberCache): New class. Each instance of this class contains
18091 all members of a type and a name-based hash table.
18092 (MemberCache.FindMembers): This is our new member lookup
18093 function. First, it looks up all members of the requested name in
18094 the hash table. Then, it walks this list and sorts out all
18095 applicable members and returns them.
18097 2002-08-13 Martin Baulig <martin@gnome.org>
18099 In addition to a nice code cleanup, this gives us a performance
18100 increase of about 1.4% on GNU/Linux - not much, but it's already
18101 half a second for the self-hosting MCS compilation.
18103 * typemanager.cs (IMemberFinder): New interface. It is used by
18104 TypeManager.FindMembers to call FindMembers on a TypeContainer,
18105 Enum, Delegate or Interface.
18106 (TypeManager.finder_to_member_finder): New PtrHashtable.
18107 (TypeManager.finder_to_container): Removed.
18108 (TypeManager.finder_to_delegate): Removed.
18109 (TypeManager.finder_to_interface): Removed.
18110 (TypeManager.finder_to_enum): Removed.
18112 * interface.cs (Interface): Implement IMemberFinder.
18114 * delegate.cs (Delegate): Implement IMemberFinder.
18116 * enum.cs (Enum): Implement IMemberFinder.
18118 * class.cs (TypeContainer): Implement IMemberFinder.
18120 2002-08-12 Martin Baulig <martin@gnome.org>
18122 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
18124 2002-08-12 Martin Baulig <martin@gnome.org>
18126 * ecore.cs (ITypeExpression): New interface for expressions which
18128 (TypeExpression): Renamed to TypeLookupExpression.
18129 (Expression.DoResolve): If we're doing a types-only lookup, the
18130 expression must implement the ITypeExpression interface and we
18131 call DoResolveType() on it.
18132 (SimpleName): Implement the new ITypeExpression interface.
18133 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
18134 hack, the situation that we're only looking up types can't happen
18135 anymore when this method is called. Moved the type lookup code to
18136 DoResolveType() and call it.
18137 (SimpleName.DoResolveType): This ITypeExpression interface method
18138 is now doing the types-only lookup.
18139 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
18140 (ResolveFlags): Added MaskExprClass.
18142 * expression.cs (MemberAccess): Implement the ITypeExpression
18144 (MemberAccess.DoResolve): Added support for a types-only lookup
18145 when we're called via ITypeExpression.DoResolveType().
18146 (ComposedCast): Implement the ITypeExpression interface.
18148 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
18149 Expression.Resolve() with ResolveFlags.Type instead.
18151 2002-08-12 Martin Baulig <martin@gnome.org>
18153 * interface.cs (Interface.Define): Apply attributes.
18155 * attribute.cs (Attribute.ApplyAttributes): Added support for
18156 interface attributes.
18158 2002-08-11 Martin Baulig <martin@gnome.org>
18160 * statement.cs (Block.Emit): Only check the "this" variable if we
18161 do not always throw an exception.
18163 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
18164 whether the property has a set accessor.
18166 2002-08-11 Martin Baulig <martin@gnome.org>
18168 Added control flow analysis support for structs.
18170 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
18171 with control flow analysis turned off.
18172 (IVariable): New interface.
18173 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
18174 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
18175 (FieldExpr.DoResolve): Resolve the instance expression with flow
18176 analysis turned off and do the definite assignment check after the
18177 resolving when we know what the expression will resolve to.
18179 * expression.cs (LocalVariableReference, ParameterReference):
18180 Implement the new IVariable interface, only call the flow analysis
18181 code if ec.DoFlowAnalysis is true.
18182 (This): Added constructor which takes a Block argument. Implement
18183 the new IVariable interface.
18184 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
18185 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
18186 This does the definite assignment checks for struct members.
18188 * class.cs (Constructor.Emit): If this is a non-static `struct'
18189 constructor which doesn't have any initializer, call
18190 Block.AddThisVariable() to tell the flow analysis code that all
18191 struct elements must be initialized before control returns from
18194 * statement.cs (MyStructInfo): New public class.
18195 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
18196 argument to this indexer. If non-zero, check an individual struct
18197 member, not the whole struct.
18198 (FlowBranching.CheckOutParameters): Check struct members.
18199 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
18200 overloaded versions of these methods which take an additional
18201 `int field_idx' argument to check struct members.
18202 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
18203 overloaded versions of these methods which take an additional
18204 `string field_name' argument to check struct member.s
18205 (VariableInfo): Implement the IVariable interface.
18206 (VariableInfo.StructInfo): New public property. Returns the
18207 MyStructInfo instance of the variable if it's a struct or null.
18208 (Block.AddThisVariable): New public method. This is called from
18209 Constructor.Emit() for non-static `struct' constructor which do
18210 not have any initializer. It creates a special variable for the
18211 "this" instance variable which will be checked by the flow
18212 analysis code to ensure that all of the struct's fields are
18213 initialized before control returns from the constructor.
18214 (UsageVector): Added support for struct members. If a
18215 variable/parameter is a struct with N members, we reserve a slot
18216 in the usage vector for each member. A struct is considered fully
18217 initialized if either the struct itself (slot 0) or all its
18218 members are initialized.
18220 2002-08-08 Martin Baulig <martin@gnome.org>
18222 * driver.cs (Driver.MainDriver): Only report an error CS5001
18223 if there were no compilation errors.
18225 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
18226 `UnsafeContext' property to determine whether the parent is in
18227 unsafe context rather than checking the parent's ModFlags:
18228 classes nested in an unsafe class are unsafe as well.
18230 2002-08-08 Martin Baulig <martin@gnome.org>
18232 * statement.cs (UsageVector.MergeChildren): Distinguish between
18233 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
18234 we return. Added test17() and test18() to test-154.cs.
18236 2002-08-08 Martin Baulig <martin@gnome.org>
18238 * typemanager.cs (TypeManager.FilterWithClosure): If we have
18239 Family access, make sure the invoking type isn't a subclass of the
18240 queried type (that'd be a CS1540).
18242 * ecore.cs (Expression.MemberLookup): Added overloaded version of
18243 this method which takes an additional `Type invocation_type'.
18245 * expression.cs (BaseAccess.DoResolve): Use the base type as
18246 invocation and query type.
18247 (MemberAccess.DoResolve): If the lookup failed and we're about to
18248 report a CS0122, try a lookup with the ec.ContainerType - if this
18249 succeeds, we must report a CS1540.
18251 2002-08-08 Martin Baulig <martin@gnome.org>
18253 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
18254 (MethodGroupExpr): Implement the IMemberExpr interface.
18256 * expression (MemberAccess.ResolveMemberAccess): No need to have
18257 any special code for MethodGroupExprs anymore, they're now
18260 2002-08-08 Martin Baulig <martin@gnome.org>
18262 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
18263 Family, FamANDAssem and FamORAssem permissions.
18264 (TypeManager.IsSubclassOrNestedChildOf): New public method.
18266 2002-08-08 Martin Baulig <martin@gnome.org>
18268 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
18269 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
18272 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
18274 * driver.cs: implemented /resource option to embed managed resources.
18276 2002-08-07 Martin Baulig <martin@gnome.org>
18278 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
18279 (FieldBase.HasFieldInitializer): New public property.
18280 (FieldBase.GetInitializerExpression): New public method. Resolves and
18281 returns the field initializer and makes sure it is only resolved once.
18282 (TypeContainer.EmitFieldInitializers): Call
18283 FieldBase.GetInitializerExpression to get the initializer, this ensures
18284 that it isn't resolved multiple times.
18286 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
18287 the resolving process (SimpleName/MemberLookup) that we're currently
18288 emitting a field initializer (which must not access any instance members,
18289 this is an error CS0236).
18291 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
18292 argument, if the `IsFieldInitializer' flag is set, we must report and
18293 error CS0236 and not an error CS0120.
18295 2002-08-07 Martin Baulig <martin@gnome.org>
18297 * ecore.cs (IMemberExpr): New public interface.
18298 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
18299 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
18300 if the expression is an IMemberExpr.
18302 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
18303 to be null, implicitly default to `this' if we're non-static in
18304 this case. Simplified the code a lot by using the new IMemberExpr
18305 interface. Also fixed bug #28176 here.
18307 2002-08-06 Martin Baulig <martin@gnome.org>
18309 * cs-parser.jay (SimpleLookup): Removed. We need to create
18310 ParameterReferences during semantic analysis so that we can do a
18311 type-only search when resolving Cast, TypeOf and SizeOf.
18312 (block): Pass the `current_local_parameters' to the Block's
18315 * class.cs (ConstructorInitializer): Added `Parameters parameters'
18316 argument to the constructor.
18317 (ConstructorInitializer.Resolve): Create a temporary implicit
18318 block with the parameters.
18320 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
18321 references here if we aren't doing a type-only search.
18323 * statement.cs (Block): Added constructor which takes a
18324 `Parameters parameters' argument.
18325 (Block.Parameters): New public property.
18327 * support.cs (InternalParameters.Parameters): Renamed `parameters'
18328 to `Parameters' and made it public readonly.
18330 2002-08-06 Martin Baulig <martin@gnome.org>
18332 * ecore.cs (Expression.Warning): Made this public as well.
18334 * report.cs (Report.Debug): Print the contents of collections.
18336 2002-08-06 Martin Baulig <martin@gnome.org>
18338 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
18339 used to tell Resolve() which kinds of expressions it may return.
18340 (Expression.Resolve): Added overloaded version of this method which
18341 takes a `ResolveFlags flags' argument. This can be used to tell
18342 Resolve() which kinds of expressions it may return. Reports a
18344 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
18345 ResolveFlags.SimpleName.
18346 (Expression.Error118): Added overloaded version of this method which
18347 takes a `ResolveFlags flags' argument. It uses the flags to determine
18348 which kinds of expressions are allowed.
18350 * expression.cs (Argument.ResolveMethodGroup): New public method.
18351 Resolves an argument, but allows a MethodGroup to be returned.
18352 This is used when invoking a delegate.
18354 * TODO: Updated a bit.
18356 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18358 Fixed compilation with csc.
18360 * ecore.cs: Expression.Error made public. Is this correct? Should
18361 Warning be made public too?
18363 * expression.cs: use ea.Location instead of ea.loc.
18364 [FIXME: Filed as bug #28607: MCS must report these errors.]
18366 2002-08-06 Martin Baulig <martin@gnome.org>
18368 * ecore.cs (Expression.loc): Moved the location here instead of
18369 duplicating it in all derived classes.
18370 (Expression.Location): New public property.
18371 (Expression.Error, Expression.Warning): Made them non-static and
18372 removed the location argument.
18373 (Expression.Warning): Added overloaded version which takes an
18374 `int level' argument.
18375 (Expression.Error118): Make this non-static and removed the
18376 expression and location arguments.
18377 (TypeExpr): Added location argument to the constructor.
18379 * expression.cs (StaticCallExpr): Added location argument to
18381 (Indirection, PointerArithmetic): Likewise.
18382 (CheckedExpr, UnCheckedExpr): Likewise.
18383 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
18384 (StringPtr): Likewise.
18387 2002-08-05 Martin Baulig <martin@gnome.org>
18389 * expression.cs (BaseAccess.DoResolve): Actually report errors.
18391 * assign.cs (Assign.DoResolve): Check whether the source
18392 expression is a value or variable.
18394 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
18395 while resolving the corresponding blocks.
18397 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
18398 an error, don't silently return null.
18400 * statement.cs (Block.AddVariable): Do the error reporting here
18401 and distinguish between CS0128 and CS0136.
18402 (Block.DoResolve): Report all unused labels (warning CS0164).
18403 (LabeledStatement): Pass the location to the constructor.
18404 (LabeledStatement.HasBeenReferenced): New property.
18405 (LabeledStatement.Resolve): Set it to true here.
18407 * statement.cs (Return.Emit): Return success even after reporting
18408 a type mismatch error (CS0126 or CS0127), this is what csc does and
18409 it avoids confusing the users with any consecutive errors.
18411 2002-08-05 Martin Baulig <martin@gnome.org>
18413 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
18415 * const.cs (Const.LookupConstantValue): Catch circular definitions.
18417 * expression.cs (MemberAccess.DoResolve): Silently return if an
18418 error has already been reported.
18420 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
18421 error has already been reported.
18423 2002-08-05 Martin Baulig <martin@gnome.org>
18425 * statement.cs (UsageVector): Only initialize the `parameters'
18426 vector if we actually have any "out" parameters.
18428 2002-08-05 Martin Baulig <martin@gnome.org>
18430 * expression.cs (Binary.ResolveOperator): When combining delegates,
18431 they must have the same type.
18433 2002-08-05 Martin Baulig <martin@gnome.org>
18435 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
18436 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
18437 work with the ms runtime and we also don't need it: if we're a
18438 PropertyBuilder and not in the `indexer_arguments' hash, then we
18439 are a property and not an indexer.
18441 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
18442 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
18443 since the latter one doesn't work with the ms runtime.
18445 2002-08-03 Martin Baulig <martin@gnome.org>
18447 Fixed bugs #27998 and #22735.
18449 * class.cs (Method.IsOperator): New public field.
18450 (Method.CheckBase): Report CS0111 if there's already a method
18451 with the same parameters in the current class. Report CS0508 when
18452 attempting to change the return type of an inherited method.
18453 (MethodData.Emit): Report CS0179 if a method doesn't have a body
18454 and it's not marked abstract or extern.
18455 (PropertyBase): New abstract base class for Property and Indexer.
18456 (PropertyBase.CheckBase): Moved here from Property and made it work
18458 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
18459 the same so we can reuse it there.
18460 (Property, Indexer): Derive from PropertyBase.
18461 (MethodSignature.inheritable_property_signature_filter): New delegate
18462 to find properties and indexers.
18464 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
18465 argument and improved error reporting.
18467 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
18468 EmptyReadOnlyParameters and made it a property.
18470 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
18471 version of this method which takes a `PropertyInfo indexer'.
18472 (TypeManager.RegisterIndexer): New method.
18474 * class.cs: Added myself as author of this file :-)
18476 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18478 * class.cs: fixed compilation on windoze.
18480 2002-08-03 Martin Baulig <martin@gnome.org>
18482 * interface.cs (Interface.GetInterfaceBases): Check whether all
18483 base interfaces are at least as accessible than the current one.
18485 * class.cs (TypeContainer.GetClassBases): Check whether base types
18486 are at least as accessible than the current type.
18487 (TypeContainer.AsAccessible): Implemented and made non-static.
18488 (MemberBase.CheckParameters): Report errors if the accessibility
18491 * delegate.cs (Delegate.Delegate): The default visibility is
18492 internal for top-level types and private for nested types.
18493 (Delegate.Define): Report errors if the accessibility checks fail.
18495 * enum.cs (Enum.Enum): The default visibility is internal for
18496 top-level types and private for nested types.
18497 (Enum.DefineType): Compute the correct visibility.
18499 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
18500 function which takes a `bool is_toplevel' instead of a TypeContainer.
18502 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
18505 2002-08-02 Martin Baulig <martin@gnome.org>
18507 * expression.cs (LocalVariableReferenc): Added constructor which
18508 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
18509 (LocalVariableReference.IsReadOnly): New property.
18510 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
18511 variable is readonly, use our own readonly flag to do this; you can
18512 use the new constructor to get a writable reference to a read-only
18515 * cs-parser.jay (foreach_statement, using_statement): Get a writable
18516 reference to the local variable.
18518 2002-08-01 Miguel de Icaza <miguel@ximian.com>
18520 * rootcontext.cs (ResolveCore): Also include System.Exception
18522 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
18523 we reach an EmptyStatement.
18525 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
18528 * expression.cs (Binary.ResolveOperator): Check error result in
18531 use brtrue/brfalse directly and avoid compares to null.
18533 2002-08-02 Martin Baulig <martin@gnome.org>
18535 * class.cs (TypeContainer.Define): Define all nested interfaces here.
18536 Fixes bug #28407, added test-155.cs.
18538 2002-08-01 Martin Baulig <martin@gnome.org>
18540 * class.cs (Event.EmitDefaultMethod): Make this work with static
18541 events. Fixes #28311, added verify-3.cs.
18543 2002-08-01 Martin Baulig <martin@gnome.org>
18545 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
18546 `is_disposable' fields.
18547 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
18548 `hm.is_disposable' if we're using the collection pattern.
18549 (Foreach.EmitCollectionForeach): Use the correct type for the
18550 enumerator's local variable, only emit the try/finally block if
18551 necessary (fixes #27713).
18553 2002-08-01 Martin Baulig <martin@gnome.org>
18555 * ecore.cs (Expression.report118): Renamed to Error118 and made
18558 * statement.cs (Throw.Resolve): Check whether the expression is of
18559 the correct type (CS0118) and whether the type derives from
18560 System.Exception (CS0155).
18561 (Catch.Resolve): New method. Do the type lookup here and check
18562 whether it derives from System.Exception (CS0155).
18563 (Catch.CatchType, Catch.IsGeneral): New public properties.
18565 * typemanager.cs (TypeManager.exception_type): Added.
18567 2002-07-31 Miguel de Icaza <miguel@ximian.com>
18569 * driver.cs: Updated About function.
18571 2002-07-31 Martin Baulig <martin@gnome.org>
18573 Implemented Control Flow Analysis.
18575 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
18576 (EmitContext.CurrentBranching): Added.
18577 (EmitContext.StartFlowBranching): Added.
18578 (EmitContext.EndFlowBranching): Added.
18579 (EmitContext.KillFlowBranching): Added.
18580 (EmitContext.IsVariableAssigned): Added.
18581 (EmitContext.SetVariableAssigned): Added.
18582 (EmitContext.IsParameterAssigned): Added.
18583 (EmitContext.SetParameterAssigned): Added.
18584 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
18585 Added control flow analysis stuff here.
18587 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
18588 resolve the expression as lvalue.
18589 (LocalVariableReference.DoResolve): Check whether the variable has
18590 already been assigned.
18591 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
18592 the parameter as assigned here.
18593 (ParameterReference.DoResolve): Check whether the parameter has already
18595 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
18596 expression as lvalue.
18598 * statement.cs (FlowBranching): New class for the flow analysis code.
18599 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
18600 (LabeledStatement.IsDefined): New public property.
18601 (LabeledStatement.AddUsageVector): New public method to tell flow
18602 analyis that the label may be reached via a forward jump.
18603 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
18605 (VariableInfo.Number): New public field. This is used by flow analysis
18606 to number all locals of a block.
18607 (Block.CountVariables): New public property. This is the number of
18608 local variables in this block (including the locals from all parent
18610 (Block.EmitMeta): Number all the variables.
18612 * statement.cs: Added flow analysis support to all classes.
18614 2002-07-31 Martin Baulig <martin@gnome.org>
18616 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
18617 To get debugging messages, compile mcs with /define:MCS_DEBUG and
18618 then use this argument.
18620 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
18622 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
18623 use this to specify /define options.
18625 2002-07-29 Martin Baulig <martin@gnome.org>
18627 * statement.cs (Fixed): Moved all code that does variable lookups
18628 and resolvings from Emit to Resolve.
18630 * statement.cs (For): Moved all code that does variable lookups
18631 and resolvings from Emit to Resolve.
18633 * statement.cs (Using): Moved all code that does variable lookups
18634 and resolvings from Emit to Resolve.
18636 2002-07-29 Martin Baulig <martin@gnome.org>
18638 * attribute.cs (Attribute.Resolve): Explicitly catch a
18639 System.NullReferenceException when creating the
18640 CustromAttributeBuilder and report a different warning message.
18642 2002-07-29 Martin Baulig <martin@gnome.org>
18644 * support.cs (ParameterData.ParameterName): Added method to
18645 get the name of a parameter.
18647 * typemanager.cs (TypeManager.IsValueType): New public method.
18649 2002-07-29 Martin Baulig <martin@gnome.org>
18651 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
18652 is a flag which specifies that it's either ref or out.
18653 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
18654 the out parameter to `out Parameter.Modifier mod', also set the
18655 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
18657 * support.cs (InternalParameters.ParameterModifier): Distinguish
18658 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
18659 Parameter.Modifier.ISBYREF flag if it's either ref or out.
18661 * expression.cs (Argument.GetParameterModifier): Distinguish
18662 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
18663 Parameter.Modifier.ISBYREF flag if it's either ref or out.
18665 2002-07-29 Martin Baulig <martin@gnome.org>
18667 * expression.cs (ParameterReference.ParameterReference): Added
18668 `Location loc' argument to the constructor.
18670 * cs-parser.jay: Pass location to ParameterReference.
18672 2002-07-28 Miguel de Icaza <miguel@ximian.com>
18674 * statement.cs (Try): Initialize the location.
18676 * cs-parser.jay: pass location to Try.
18678 * expression.cs (Unary.Reduce): Change the prototype to return
18679 whether a constant fold could be performed or not. The result is
18680 returned in an out parameters. In the case of Indirection and
18681 AddressOf, we want to perform the full tests.
18683 2002-07-26 Miguel de Icaza <miguel@ximian.com>
18685 * statement.cs (Statement.Emit): Flag dead code.
18687 2002-07-27 Andrew Birkett <andy@nobugs.org>
18689 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
18691 2002-07-27 Martin Baulig <martin@gnome.org>
18693 * class.cs (MethodData.Define): Put back call to
18694 TypeManager.AddMethod(), accidentally commented this out.
18696 * report.cs (Debug): New public method to print debugging information,
18697 this is `[Conditional ("DEBUG")]'.
18699 2002-07-26 Martin Baulig <martin@gnome.org>
18701 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
18702 (switch_statement): Push the current_block to the switch_stack and
18703 pop it again when we're done with the switch.
18704 (switch_section): The new block is a child of the current_block.
18705 Fixes bug #24007, added test-152.cs.
18707 2002-07-27 Martin Baulig <martin@gnome.org>
18709 * expression.cs (Invocation.EmitArguments): When calling a varargs
18710 function with only its fixed arguments, we need to pass an empty
18713 2002-07-27 Martin Baulig <martin@gnome.org>
18715 Mono 0.13 has been released.
18717 2002-07-25 Miguel de Icaza <miguel@ximian.com>
18719 * driver.cs: Rename --resource to --linkres, because that is what
18720 we do currently, we dont support --resource yet.
18722 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
18724 2002-07-25 Martin Baulig <martin@gnome.org>
18726 * class.cs (MethodData): New public class. This is a `method builder'
18727 class for a method or one accessor of a Property/Indexer/Event.
18728 (MethodData.GetMethodFlags): Moved here from MemberBase.
18729 (MethodData.ApplyAttributes): Likewise.
18730 (MethodData.ApplyObsoleteAttribute): Likewise.
18731 (MethodData.ApplyConditionalAttribute): Likewise.
18732 (MethodData.ApplyDllImportAttribute): Likewise.
18733 (MethodData.CheckAbstractAndExternal): Likewise.
18734 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
18735 (MethodData.Emit): Formerly known as Method.Emit().
18736 (MemberBase): Moved everything which was specific to a single
18737 accessor/method to MethodData.
18738 (Method): Create a new MethodData and call Define() and Emit() on it.
18739 (Property, Indexer, Event): Create a new MethodData objects for each
18740 accessor and call Define() and Emit() on them.
18742 2002-07-25 Martin Baulig <martin@gnome.org>
18744 Made MethodCore derive from MemberBase to reuse the code from there.
18745 MemberBase now also checks for attributes.
18747 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
18748 (MemberBase.GetMethodFlags): Moved here from class Method and marked
18750 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
18751 `CallingConventions cc' and `Attributes opt_attrs' arguments.
18752 (MemberBase.ApplyAttributes): New virtual method; applies the
18753 attributes to a method or accessor.
18754 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
18755 (MemberBase.ApplyConditionalAttribute): Likewise.
18756 (MemberBase.ApplyDllImportAttribute): Likewise.
18757 (MemberBase.CheckAbstractAndExternal): Likewise.
18758 (MethodCore.ParameterTypes): This is now a property instead of a
18759 method, it's initialized from DoDefineParameters().
18760 (MethodCore.ParameterInfo): Removed the set accessor.
18761 (MethodCore.DoDefineParameters): New protected virtual method to
18762 initialize ParameterTypes and ParameterInfo.
18763 (Method.GetReturnType): We can now simply return the MemberType.
18764 (Method.GetMethodFlags): Override the MemberBase version and add
18765 the conditional flags.
18766 (Method.CheckBase): Moved some code from Define() here, call
18767 DoDefineParameters() here.
18768 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
18769 here to avoid some larger code duplication.
18770 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
18771 ensure that abstract and external accessors don't declare a body.
18773 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
18774 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
18775 lookup in the attribute's parent classes, so we need to abort as soon
18776 as we found the first match.
18777 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
18778 the attribute has no arguments.
18780 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
18783 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18785 * cs-parser.jay: reverted previous patch.
18787 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18789 * cs-parser.jay: fixed bug #22119.
18791 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18793 * attribute.cs: fixed compilation. The error was:
18794 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
18795 be assigned to before control leaves the current method."
18796 [FIXME: Filed as bug #28186: MCS must report this error.]
18798 2002-07-25 Martin Baulig <martin@gnome.org>
18800 * attribute.cs (Attribute.Conditional_GetConditionName): New static
18801 method to pull the condition name ouf of a Conditional attribute.
18802 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
18803 the obsolete message and error flag out of an Obsolete attribute.
18805 * class.cs (Method.GetMethodFlags): New public method to get the
18806 TypeManager.MethodFlags for this method.
18807 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
18809 (Method.Define): Get and apply the Obsolete and Conditional attributes;
18810 if we're overriding a virtual function, set the new private variable
18811 `parent_method'; call the new TypeManager.AddMethod().
18813 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
18814 the MethodBuilder and the Method in a PtrHashtable.
18815 (TypeManager.builder_to_method): Added for this purpose.
18816 (TypeManager.MethodFlags): Added IsObsoleteError.
18817 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
18818 Obsolete and Conditional arguments in MethodBuilders. If we discover
18819 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
18820 the message from the attribute.
18822 2002-07-24 Martin Baulig <martin@gnome.org>
18824 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
18825 preprocessor directives, ensure that the argument to #define/#undef is
18826 exactly one identifier and that it's actually an identifier.
18828 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
18831 2002-07-24 Martin Baulig <martin@gnome.org>
18833 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
18834 initialize it to TypeManager.object_type in the constructor.
18835 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
18836 of the `hm.get_current' method if we're using the collection pattern.
18837 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
18838 for the explicit conversion to make it work when we're using the collection
18839 pattern and the `Current' property has a different return type than `object'.
18842 2002-07-24 Martin Baulig <martin@gnome.org>
18844 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
18845 does not match, but don't report any errors. This method is called in
18846 order for all methods in a MethodGroupExpr until a matching method is
18847 found, so we don't want to bail out if the first method doesn't match.
18848 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
18849 matches, report the 123. Fixes #28070.
18851 2002-07-24 Martin Baulig <martin@gnome.org>
18853 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
18854 TypeManager.TypeToCoreType() to the top of the method so the
18855 following equality checks will work. Fixes #28107.
18857 2002-07-24 Martin Baulig <martin@gnome.org>
18859 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
18860 operand is of type uint, and the other operand is of type sbyte,
18861 short or int, the operands are converted to type long." -
18862 Actually do what this comment already told us. Fixes bug #28106,
18865 2002-07-24 Martin Baulig <martin@gnome.org>
18867 * class.cs (MethodBase): New abstract class. This is now a base
18868 class for Property, Indexer and Event to avoid some code duplication
18869 in their Define() and DefineMethods() methods.
18870 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
18871 generic methods for Define() and DefineMethods().
18872 (FieldBase): Derive from MemberBase, not MemberCore.
18873 (Property): Derive from MemberBase, not MemberCore.
18874 (Property.DefineMethod): Moved all the code from this method to the
18875 new MethodBase.DefineAccessor(), just call it with appropriate
18877 (Property.Define): Call the new Property.DoDefine(), this does some
18878 sanity checks and we don't need to duplicate the code everywhere.
18879 (Event): Derive from MemberBase, not MemberCore.
18880 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
18881 accessors, this will also make them work with interface events.
18882 (Indexer): Derive from MemberBase, not MemberCore.
18883 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
18884 (Indexer.Define): Use the new MethodBase functions.
18886 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
18887 argument to the constructor.
18888 (Interface.FindMembers): Added support for interface events.
18889 (Interface.PopluateEvent): Implemented.
18891 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
18893 2002-07-22 Miguel de Icaza <miguel@ximian.com>
18895 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
18896 but this is required to check for a method name being the same as
18897 the containing class.
18901 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18903 * interface.cs: initialize variable.
18905 2002-07-23 Martin Baulig <martin@gnome.org>
18907 Implemented the IndexerName attribute in interfaces.
18909 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
18910 name if this is an explicit interface implementation.
18911 (Indexer.InterfaceIndexerName): New public variable. If we're
18912 implementing an interface indexer, this is the IndexerName in that
18913 interface. Otherwise, it's the IndexerName.
18914 (Indexer.DefineMethod): If we're implementing interface indexer,
18915 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
18916 and Pending.ImplementIndexer methods.
18917 (Indexer.Define): Also define the PropertyBuilder if we're
18918 implementing an interface indexer and this is neither an explicit
18919 interface implementation nor do the IndexerName match the one in
18922 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
18923 If a method is defined here, then we always need to create a proxy
18924 for it. This is used when implementing interface indexers.
18925 (Pending.IsInterfaceIndexer): New public method.
18926 (Pending.ImplementIndexer): New public method.
18927 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
18928 This is used when implementing interface indexers to define a proxy
18930 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
18931 define a proxy if necessary.
18933 * interface.cs (Interface.IndexerName): New public variable.
18934 (Interface.PopulateIndexer): Set the IndexerName.
18935 (Interface.DefineIndexers): New private method. Populate all the
18936 indexers and make sure their IndexerNames match.
18938 * typemanager.cs (IndexerPropertyName): Added support for interface
18941 2002-07-22 Martin Baulig <martin@gnome.org>
18943 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
18944 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
18945 ret if HasReturnLabel.
18946 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
18949 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
18950 and set the ec.LoopBeginTryCatchLevel.
18951 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
18952 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
18953 the current ec.TryCatchLevel, the branch goes out of an exception
18954 block. In this case, we need to use Leave and not Br.
18956 2002-07-22 Martin Baulig <martin@gnome.org>
18958 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
18959 block unless the block does not always return or it is contained in
18960 another try { ... } catch { ... } block. Fixes bug #26506.
18961 Added verify-1.cs to the test suite.
18963 2002-07-22 Martin Baulig <martin@gnome.org>
18965 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
18966 then we do not always return. Fixes bug #24985.
18968 2002-07-22 Martin Baulig <martin@gnome.org>
18970 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
18971 lookup on a per-class level; ie. walk up the class hierarchy until we
18972 found at least one applicable method, then choose the best among them.
18973 Fixes bug #24463 and test-29.cs.
18975 2002-07-22 Martin Baulig <martin@gnome.org>
18977 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
18978 return types of the methods. The return type is not part of the
18979 signature and we must not check it to make the `new' modifier work.
18980 Fixes bug #27999, also added test-147.cs.
18981 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
18983 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
18984 on the method's return type.
18986 2002-07-21 Martin Baulig <martin@gnome.org>
18988 * assign.cs: Make this work if the rightmost source is a constant and
18989 we need to do an implicit type conversion. Also adding a few more tests
18990 to test-38.cs which should have caught this.
18992 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
18993 target in the makefile for this. The makefile.gnu is primarily intended
18994 for end-users who don't want to debug the compiler.
18996 2002-07-21 Martin Baulig <martin@gnome.org>
18998 * assign.cs: Improved the Assign class so it can now handle embedded
18999 assignments (X = Y = Z = something). As a side-effect this'll now also
19000 consume less local variables. test-38.cs now passes with MCS, added
19001 a few new test cases to that test.
19003 2002-07-20 Martin Baulig <martin@gnome.org>
19005 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
19006 instructions. Fixes bug #27977, also added test-146.cs.
19008 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19010 * cs-tokenizer.cs: fixed getHex ().
19012 2002-07-19 Martin Baulig <martin@gnome.org>
19014 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
19015 not Type.GetType() to lookup the array type. This is needed when
19016 we're constructing an array of a user-defined type.
19017 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
19018 single-dimensional arrays, but also for single-dimensial arrays of
19021 2002-07-19 Martin Baulig <martin@gnome.org>
19023 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
19024 this function is called, it's not allowed to share LocalBuilders
19025 among ILGenerators.
19027 2002-07-19 Martin Baulig <martin@gnome.org>
19029 * expression.cs (Argument.Resolve): Report an error 118 when trying
19030 to pass a type as argument.
19032 2002-07-18 Martin Baulig <martin@gnome.org>
19034 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
19035 Conv_R_Un for the signed `long' type.
19037 2002-07-15 Miguel de Icaza <miguel@ximian.com>
19039 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
19040 `expr' for the temporary result, as that will fail if we do
19041 multiple resolves on the same expression.
19043 2002-07-05 Miguel de Icaza <miguel@ximian.com>
19045 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
19046 ec.TypeContainer for looking up aliases.
19048 * class.cs (TypeContainer): Remove LookupAlias from here.
19050 * decl.cs (DeclSpace); Move here.
19052 2002-07-01 Miguel de Icaza <miguel@ximian.com>
19054 * class.cs (FindMembers): Only call filter if the constructor
19055 bulider is not null.
19057 Also handle delegates in `NestedTypes' now. Now we will perform
19058 type lookups using the standard resolution process. This also
19061 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
19062 This uses Expressions (the limited kind that can be parsed by the
19063 tree) instead of strings.
19065 * expression.cs (ComposedCast.ToString): Implement, used to flag
19066 errors since now we have to render expressions.
19068 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
19071 * ecore.cs (SimpleName.ToString): ditto.
19073 * cs-parser.jay: Instead of using strings to assemble types, use
19074 Expressions to assemble the type (using SimpleName, ComposedCast,
19075 MemberAccess). This should fix the type lookups in declarations,
19076 because we were using a different code path for this.
19078 * statement.cs (Block.Resolve): Continue processing statements
19079 even when there is an error.
19081 2002-07-17 Miguel de Icaza <miguel@ximian.com>
19083 * class.cs (Event.Define): Also remove the `remove' method from
19084 the list of pending items.
19086 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
19087 generate more compact code.
19089 2002-07-17 Martin Baulig <martin@gnome.org>
19091 * const.cs (Const.LookupConstantValue): Add support for constant
19092 `unchecked' and `checked' expressions.
19093 Also adding test case test-140.cs for this.
19095 2002-07-17 Martin Baulig <martin@gnome.org>
19097 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
19098 check whether mi.ReturnType implements the IEnumerator interface; the
19099 `==' and the IsAssignableFrom() will fail in this situation.
19101 2002-07-16 Ravi Pratap <ravi@ximian.com>
19103 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
19106 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19108 * expression.cs: fixed bug #27811.
19110 2002-07-14 Miguel de Icaza <miguel@ximian.com>
19112 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
19113 Molaro: when we are a ref, the value already contains a pointer
19114 value, do not take the address of it.
19116 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
19117 * removed mb-parser.jay and mb-tokenizer.cs
19119 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
19121 * expression.cs: check against the building corlib void type.
19123 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
19125 * ecore.cs: fix for valuetype static readonly fields: when
19126 initializing them, we need their address, not the address of a copy.
19128 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
19130 * typemanager.cs: register also enum_type in corlib.
19132 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
19134 * class.cs: allow calling this (but not base) initializers in structs.
19136 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
19138 * ecore.cs: make sure we compare against the building base types
19141 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
19143 * typemanager.cs: fix TypeToCoreType() to handle void and object
19144 (corlib gets no more typerefs after this change).
19146 2002-07-12 Miguel de Icaza <miguel@ximian.com>
19148 * expression.cs (ArrayCreation.EmitArrayArguments): use
19149 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
19151 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
19152 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
19153 array indexes, the runtime actually forbids them.
19155 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
19156 for array arguments here.
19158 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
19159 instead of the default for ValueTypes.
19161 (New.DoEmit): Use IsValueType instead of
19162 IsSubclassOf (value_type)
19163 (New.DoResolve): ditto.
19164 (Invocation.EmitCall): ditto.
19166 * assign.cs (Assign): ditto.
19168 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
19169 Statements *are* currently doing part of their resolution during
19172 Expressions do always resolve during resolve, but statements are
19173 only required to propagate resolution to their children.
19175 2002-07-11 Miguel de Icaza <miguel@ximian.com>
19177 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
19179 (LoadAssembly): Do not add the dll if it is already specified
19181 (MainDriver): Add the System directory to the link path at the end,
19182 after all the other -L arguments.
19184 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
19185 wrong opcode for loading bytes and bools (ldelem.i1 instead of
19186 ldelem.u1) and using the opposite for sbytes.
19188 This fixes Digger, and we can finally run it.
19190 * driver.cs (UnixParseOption): Move the option parsing here.
19191 (CSCParseOption): Implement CSC-like parsing of options.
19193 We now support both modes of operation, the old Unix way, and the
19194 new CSC-like way. This should help those who wanted to make cross
19195 platform makefiles.
19197 The only thing broken is that /r:, /reference: and /lib: are not
19198 implemented, because I want to make those have the same semantics
19199 as the CSC compiler has, and kill once and for all the confussion
19200 around this. Will be doing this tomorrow.
19202 * statement.cs (Unsafe.Resolve): The state is checked during
19203 resolve, not emit, so we have to set the flags for IsUnsfe here.
19205 2002-07-10 Miguel de Icaza <miguel@ximian.com>
19207 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
19208 not catch the Error_ObjectRefRequired in SimpleName (as it is
19209 possible to have a class/instance variable name that later gets
19210 deambiguated), we have to check this here.
19212 2002-07-10 Ravi Pratap <ravi@ximian.com>
19214 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
19215 make static and put into Expression.
19217 (Event.Define): Register the private field of the event with the
19218 TypeManager so that GetFieldFromEvent can get at it.
19220 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
19221 keep track of the private field associated with an event which
19224 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
19227 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
19229 2002-07-10 Miguel de Icaza <miguel@ximian.com>
19231 * expression.cs (Binary.EmitBranchable): this routine emits the
19232 Binary expression in a branchable context. This basically means:
19233 we need to branch somewhere, not just get the value on the stack.
19235 This works together with Statement.EmitBoolExpression.
19237 * statement.cs (Statement.EmitBoolExpression): Use
19240 2002-07-09 Miguel de Icaza <miguel@ximian.com>
19242 * statement.cs (For): Reduce the number of jumps in loops.
19244 (For): Implement loop inversion for the For statement.
19246 (Break): We can be breaking out of a Try/Catch controlled section
19247 (foreach might have an implicit try/catch clause), so we need to
19248 use Leave instead of Br.
19250 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
19251 now). If the instace expression supports IMemoryLocation, we use
19252 the AddressOf method from the IMemoryLocation to extract the
19253 address instead of emitting the instance.
19255 This showed up with `This', as we were emitting the instance
19256 always (Emit) instead of the Address of This. Particularly
19257 interesting when This is a value type, as we dont want the Emit
19258 effect (which was to load the object).
19260 2002-07-08 Miguel de Icaza <miguel@ximian.com>
19262 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
19264 * statement.cs (Checked): Set the CheckedState during the resolve
19265 process too, as the ConvCast operations track the checked state on
19266 the resolve process, and not emit.
19268 * cs-parser.jay (namespace_member_declaration): Flag that we have
19269 found a declaration when we do. This is used to flag error 1529
19271 * driver.cs: Report ok when we display the help only.
19273 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
19275 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
19277 2002-07-04 Miguel de Icaza <miguel@ximian.com>
19279 * cs-tokenizer.cs (define): We also have to track locally the
19280 defines. AllDefines is just used for the Conditional Attribute,
19281 but we also need the local defines for the current source code.
19283 2002-07-03 Miguel de Icaza <miguel@ximian.com>
19285 * statement.cs (While, For, Do): These loops can exit through a
19286 Break statement, use this information to tell whether the
19287 statement is the last piece of code.
19289 (Break): Flag that we break.
19291 * codegen.cs (EmitContexts): New `Breaks' state variable.
19293 2002-07-03 Martin Baulig <martin@gnome.org>
19295 * class.cs (TypeContainer.MethodModifiersValid): Allow override
19296 modifiers in method declarations in structs. Otherwise, you won't
19297 be able to override things like Object.Equals().
19299 2002-07-02 Miguel de Icaza <miguel@ximian.com>
19301 * class.cs (Method, Property, Indexer): Do not allow the public
19302 modifier to be used in explicit interface implementations.
19304 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
19305 override modifiers in method declarations in structs
19307 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
19309 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
19310 integer or real overflow, report an error
19312 2002-07-02 Martin Baulig <martin@gnome.org>
19314 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
19315 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
19316 to tell the runtime about our newly created System.Object and
19317 System.ValueType types.
19319 2002-07-02 Miguel de Icaza <miguel@ximian.com>
19321 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
19322 struct instead of Ldarg/Starg.
19324 2002-07-02 Martin Baulig <martin@gnome.org>
19326 * expression.cs (Indirection.Indirection): Call
19327 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
19329 2002-07-02 Martin Baulig <martin@gnome.org>
19331 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
19332 ValueType, call TypeManager.TypeToCoreType() on it.
19333 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
19334 the OpCodes.Newarr argument.
19336 2002-07-02 Martin Baulig <martin@gnome.org>
19338 * expression.cs (Invocation.EmitCall): When compiling corlib,
19339 replace all calls to the system's System.Array type to calls to
19340 the newly created one.
19342 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
19343 System.Array methods.
19344 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
19345 from the system's System.Array type which must be replaced.
19347 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
19349 * typemanager.cs: load unverifiable_code_ctor so we can build
19350 corlib using the correct type. Avoid using GetTypeCode() with
19352 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
19353 TypeManager.object_type to allow building corlib.
19355 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
19357 * ecore.cs: handle System.Enum separately in LoadFromPtr().
19359 2002-07-01 Martin Baulig <martin@gnome.org>
19361 * class.cs: Make the last change actually work, we need to check
19362 whether `ifaces != null' to avoid a crash.
19364 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
19366 * class.cs: when we build structs without fields that implement
19367 interfaces, we need to add the interfaces separately, since there is
19368 no API to both set the size and add the interfaces at type creation
19371 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
19373 * expression.cs: the dimension arguments to the array constructors
19374 need to be converted if they are a long.
19376 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
19378 * class.cs: don't emit ldarg.0 if there is no parent constructor
19379 (fixes showstopper for corlib).
19381 2002-06-29 Martin Baulig <martin@gnome.org>
19383 MCS now compiles corlib on GNU/Linux :-)
19385 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
19386 ie. check for MethodImplOptions.InternalCall.
19388 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
19389 and TypeManager.attribute_type are null, so we must explicitly check
19390 whether parent is not null to find out whether it's an attribute type.
19391 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
19392 and SetBuilder, not only if the property is neither abstract nor external.
19393 This is necessary to set the MethodImplOptions on the accessor methods.
19394 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
19395 SetBuilder, see Property.Emit().
19397 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
19398 populate "System.Object", "System.ValueType" and "System.Attribute" since
19399 they've already been populated from BootCorlib_PopulateCoreTypes().
19401 2002-06-29 Martin Baulig <martin@gnome.org>
19403 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
19404 is the NullLiteral, we also need to make sure that target_type is not
19407 2002-06-29 Martin Baulig <martin@gnome.org>
19409 * rootcontext.cs (RootContext.ResolveCore): We must initialize
19410 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
19411 before calling BootstrapCorlib_ResolveDelegate ().
19413 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19415 * statement.cs: fixed build-breaker. All tests passed ok.
19417 2002-06-27 Martin Baulig <martin@gnome.org>
19419 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
19420 for System.Decimal when compiling corlib.
19422 2002-06-27 Martin Baulig <martin@gnome.org>
19424 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
19425 switch blocks which contain nothing but a default clause.
19427 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
19429 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
19431 2002-06-27 Martin Baulig <martin@gnome.org>
19433 * ecore.cs (PropertyExpr.PropertyExpr): Call
19434 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
19436 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
19437 is already a TypeBuilder.
19439 2002-06-27 Martin Baulig <martin@gnome.org>
19441 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
19442 `target_type == TypeManager.array_type', not IsAssignableFrom() in
19443 the "from an array-type to System.Array" case. This makes it work
19444 when compiling corlib.
19446 2002-06-27 Martin Baulig <martin@gnome.org>
19448 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
19449 non-static PropertyExpr, set its InstanceExpression. This makes
19450 the `ICollection.Count' property work in System/Array.cs.
19452 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
19454 * driver.cs: Made error handling more consistent. Errors now
19455 tracked by Report class, so many methods which used to return int
19456 now return void. Main() now prints success/failure and
19457 errors/warnings message.
19459 Renamed '--probe' compiler argument to '--expect-error'. Removed
19460 the magic number return values (123 and 124). Now, if the
19461 expected error occurs, the compiler exits with success (exit value
19462 0). If the compilation completes without seeing that particular
19463 error, the compiler exits with failure (exit value 1). The
19464 makefile in mcs/errors has been changed to handle the new behaviour.
19466 * report.cs: Made 'expected error' number a property and renamed
19467 it from 'Probe' to 'ExpectedError'.
19469 * genericparser.cs: Removed error handling support, since it is
19470 now all done by Report class.
19472 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
19473 class, so parse() no longer returns an int.
19475 * namespace.cs: Use Report.Error instead of GenericParser.error
19477 2002-06-22 Miguel de Icaza <miguel@ximian.com>
19479 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
19480 TypeContainer.AddOperator): At the front of the list put the
19481 explicit implementations, so they get resolved/defined first.
19483 2002-06-21 Miguel de Icaza <miguel@ximian.com>
19485 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
19486 interface type is implemented by this TypeContainer. Used during
19487 explicit interface implementation.
19489 (Property.Define, Indexer.Define, Method.Define): Validate that
19490 the given interface in the explicit implementation is one of the
19491 base classes for the containing type.
19493 Also if we are explicitly implementing an interface, but there is
19494 no match in the pending implementation table, report an error.
19496 (Property.Define): Only define the property if we are
19497 not explicitly implementing a property from an interface. Use the
19498 correct name also for those properties (the same CSC uses,
19499 although that is really not needed).
19501 (Property.Emit): Do not emit attributes for explicitly implemented
19502 properties, as there is no TypeBuilder.
19504 (Indexer.Emit): ditto.
19506 Hiding then means that we do not really *implement* a pending
19507 implementation, which makes code fail.
19509 2002-06-22 Martin Baulig <martin@gnome.org>
19511 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
19512 the return value of Object.GetType(). [FIXME: we need to do this whenever
19513 we get a type back from the reflection library].
19515 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
19517 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
19519 2002-06-20 Miguel de Icaza <miguel@ximian.com>
19521 * attribute.cs: Return null if we can not look up the type.
19523 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
19524 the interface types found.
19526 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
19527 interface types found.
19529 * typemanager.cs (GetInterfaces): Make this routine returns alll
19530 the interfaces and work around the lame differences between
19531 System.Type and System.Reflection.Emit.TypeBuilder in the results
19532 result for GetInterfaces.
19534 (ExpandInterfaces): Given an array of interface types, expand and
19535 eliminate repeated ocurrences of an interface. This expands in
19536 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
19539 2002-06-21 Martin Baulig <martin@gnome.org>
19541 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
19544 2002-06-21 Martin Baulig <martin@gnome.org>
19546 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
19547 and called with one of the core types, return the corresponding typebuilder for
19550 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
19553 2002-06-21 Martin Baulig <martin@gnome.org>
19555 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
19556 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
19557 (Expression.ConvertReferenceExplicit): Likewise.
19559 * expression.cs (ElementAccess.DoResolve): Likewise.
19560 (ElementAccess.DoResolveLValue): Likewise.
19562 2002-06-10 Martin Baulig <martin@gnome.org>
19564 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
19565 add the "value" parameter to the parameter list.
19567 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
19570 2002-06-19 Miguel de Icaza <miguel@ximian.com>
19572 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
19573 the argument to an int, uint, long or ulong, per the spec. Also
19574 catch negative constants in array creation.
19576 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
19578 * class.cs: do not allow the same interface to appear twice in
19579 the definition list.
19581 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
19583 * ecore.cs: don't use ldlen with System.Array.
19585 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
19587 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
19589 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
19591 * modifiers.cs: produce correct field attributes for protected
19592 internal. Easy fix so miguel can work on ther harder stuff:-)
19594 2002-06-18 Miguel de Icaza <miguel@ximian.com>
19596 * pending.cs: New file. Move the code from class.cs here.
19597 Support clearning the pending flag for all methods (when not doing
19598 explicit interface implementation).
19600 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
19602 * rootcontext.cs: added a couple more types needed to bootstrap.
19604 2002-06-17 Miguel de Icaza <miguel@ximian.com>
19606 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
19607 constructor in the type, instead of any constructor in the type
19608 hierarchy. Thanks to Paolo for finding this bug (it showed up as
19609 a bug in the Mono runtime when applying the params attribute).
19611 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
19612 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
19614 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
19616 * expression.cs (Unary.ResolveOperator): Use TypeManager
19617 to resolve the type.
19619 2002-06-13 Ravi Pratap <ravi@ximian.com>
19621 * cs-parser.jay (enum_member_declaration): Pass in the attributes
19624 * enum.cs (AddEnumMember): Add support to store the attributes associated
19625 with each member too.
19627 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
19628 field builders too - this takes care of the enum member case.
19630 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
19632 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
19633 address-of operator on both value types and pointers.
19635 2002-06-10 Martin Baulig <martin@gnome.org>
19637 * interface.cs (Interface.PopulateIndexer): Add the indexer's
19638 PropertyBuilder to the `property_builders' list.
19640 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
19641 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
19642 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
19643 find any indexers which are inherited from an interface.
19645 2002-06-09 Martin Baulig <martin@gnome.org>
19647 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
19648 the same type as the constant if necessary. There's also a test-130.cs
19651 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
19653 * typemanager.cs (TypeManager.ChangeType): Previously known as
19654 Enum.ChangeEnumType().
19656 2002-06-09 Martin Baulig <martin@gnome.org>
19658 * expression.cs (Cast.TryReduce): Added support for consts.
19660 2002-06-08 Ravi Pratap <ravi@ximian.com>
19662 * class.cs (Accessor): Hold attributes information so we can pass
19665 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
19666 Modify to pass in attributes attached to the methods.
19668 (add_accessor_declaration, remove_accessor_declaration): Ditto.
19670 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
19671 to handle the Accessor kind :-)
19673 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
19675 2002-06-08 Martin Baulig <martin@gnome.org>
19677 * expression.cs (Unary.TryReduceNegative): Added support for
19680 2002-06-08 Martin Baulig <martin@gnome.org>
19682 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
19683 name can't be found in the `defined_names' - the caller will do a
19684 MemberLookup in this case and thus find methods in System.Enum
19685 such as Enum.IsDefined().
19687 2002-06-08 Martin Baulig <martin@gnome.org>
19689 * enum.cs (Enum.ChangeEnumType): This is a custom version of
19690 Convert.ChangeType() which works with TypeBuilder created types.
19691 (Enum.LookupEnumValue, Enum.Define): Use it here.
19693 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
19694 `TypeBuilder.BaseType != null' check.
19695 (TypeContainer.FindMembers): Only lookup parent members if we
19696 actually have a parent.
19697 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
19698 (ConstructorInitializer.Resolve): Likewise.
19700 * interface.cs (Interface.FindMembers): Added
19701 `TypeBuilder.BaseType != null' check.
19703 * rootcontext.cs (RootContext.ResolveCore): Added
19704 "System.Runtime.CompilerServices.IndexerNameAttribute" to
19705 classes_second_stage.
19707 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
19708 debug_type and trace_type when compiling with --nostdlib.
19710 2002-06-07 Martin Baulig <martin@gnome.org>
19712 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
19713 (AddField): Set it to true when adding a non-static field.
19714 (DefineType): Use `have_nonstatic_fields' to find out whether we
19715 have non-static fields, not `Fields != null'.
19717 2002-06-02 Miguel de Icaza <miguel@ximian.com>
19719 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
19720 dereferencing a null on the static-field code path)
19722 2002-05-30 Martin Baulig <martin@gnome.org>
19724 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
19725 to take command line arguments. Use reflection to call the new
19726 custom `Initialize' function on the symbol writer and pass it the
19727 command line arguments.
19729 * driver.cs (--debug-args): New command line argument to pass command
19730 line arguments to the symbol writer.
19732 2002-05-28 Miguel de Icaza <miguel@ximian.com>
19734 * assign.cs (DoResolve): Forgot to do the implicit conversion to
19735 the target type for indexers and properties. Thanks to Joe for
19738 2002-05-27 Miguel de Icaza <miguel@ximian.com>
19740 * typemanager.cs (MethodFlags): returns the method flags
19741 (Obsolete/ShouldIgnore) that control warning emission and whether
19742 the invocation should be made, or ignored.
19744 * expression.cs (Invocation.Emit): Remove previous hack, we should
19745 not do this on matching a base type, we should do this based on an attribute
19747 Only emit calls to System.Diagnostics.Debug and
19748 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
19749 on the command line.
19751 * rootcontext.cs: Global settings for tracing and debugging.
19753 * cs-tokenizer.cs (define): New utility function to track
19754 defines. Set the global settings for TRACE and DEBUG if found.
19756 2002-05-25 Ravi Pratap <ravi@ximian.com>
19758 * interface.cs (Populate*): Pass in the TypeContainer as well as
19759 the DeclSpace as parameters so that we can create EmitContexts and
19760 then use that to apply attributes etc.
19762 (PopulateMethod, PopulateEvent, PopulateProperty)
19763 (PopulateIndexer): Apply attributes everywhere.
19765 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
19768 (ApplyAttributes): Update accordingly.
19770 We now apply interface attributes for all members too.
19772 2002-05-26 Miguel de Icaza <miguel@ximian.com>
19774 * class.cs (Indexer.Define); Correctly check if we are explicit
19775 implementation (instead of checking the Name for a ".", we
19776 directly look up if the InterfaceType was specified).
19778 Delay the creation of the PropertyBuilder.
19780 Only create the PropertyBuilder if we are not an explicit
19781 interface implementation. This means that explicit interface
19782 implementation members do not participate in regular function
19783 lookups, and hence fixes another major ambiguity problem in
19784 overload resolution (that was the visible effect).
19786 (DefineMethod): Return whether we are doing an interface
19789 * typemanager.cs: Temporary hack until we get attributes in
19790 interfaces (Ravi is working on that) and we get IndexerName
19791 support in interfaces.
19793 * interface.cs: Register the indexers as properties.
19795 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
19796 warning, I have verified that this is a bug in the .NET runtime
19797 (JavaScript suffers of the same problem).
19799 * typemanager.cs (MemberLookup): When looking up members for
19800 interfaces, the parent of an interface is the implicit
19801 System.Object (so we succeed in searches of Object methods in an
19802 interface method invocation. Example: IEnumerable x; x.ToString
19805 2002-05-25 Miguel de Icaza <miguel@ximian.com>
19807 * class.cs (Event): Events should also register if they do
19808 implement the methods that an interface requires.
19810 * typemanager.cs (MemberLookup); use the new GetInterfaces
19813 (GetInterfaces): The code used to lookup interfaces for a type is
19814 used in more than one place, factor it here.
19816 * driver.cs: Track the errors at the bottom of the file, we kept
19819 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
19820 instance if the method we are calling is static!
19822 2002-05-24 Miguel de Icaza <miguel@ximian.com>
19824 * attribute.cs (ApplyAttributes): Make this function filter out
19825 the IndexerName attribute (as that attribute in reality is never
19826 applied) and return the string constant for the IndexerName
19829 * class.cs (TypeContainer.Emit): Validate that all the indexers
19830 have the same IndexerName attribute, and if so, set the
19831 DefaultName attribute on the class.
19833 * typemanager.cs: The return value might contain other stuff (not
19834 only methods). For instance, consider a method with an "Item"
19835 property and an Item method.
19837 * class.cs: If there is a problem with the parameter types,
19840 2002-05-24 Ravi Pratap <ravi@ximian.com>
19842 * ecore.cs (ImplicitConversionExists): Wrapper function which also
19843 looks at user defined conversion after making a call to
19844 StandardConversionExists - we need this for overload resolution.
19846 * expression.cs : Update accordingly the various method calls.
19848 This fixes 2 bugs filed against implicit user defined conversions
19850 2002-05-22 Miguel de Icaza <miguel@ximian.com>
19852 * statement.cs: Track the result of the assignment.
19854 2002-05-21 Miguel de Icaza <miguel@ximian.com>
19856 * expression.cs (MemberAccess): Improved error reporting for
19857 inaccessible members.
19859 2002-05-22 Martin Baulig <martin@gnome.org>
19861 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
19862 itself with debugging support.
19864 2002-05-22 Martin Baulig <martin@gnome.org>
19866 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
19867 Removed, this isn't needed anymore.
19869 2002-05-20 Martin Baulig <martin@gnome.org>
19871 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
19872 be underlying type for an enum.
19874 2002-05-20 Miguel de Icaza <miguel@ximian.com>
19876 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
19877 that splits out the loading of just the core types.
19879 * rootcontext.cs (ResolveCore): Split the struct resolution in
19880 two, so we can load the enumeration underlying types before any
19883 * expression.cs (Is): Bandaid until we fix properly Switch (see
19884 bug #24985 for details).
19886 * typemanager.cs (ImplementsInterface): The hashtable will contain
19887 a null if there are no interfaces implemented.
19889 2002-05-18 Miguel de Icaza <miguel@ximian.com>
19891 * cs-parser.jay (indexer_declarator): It is fine to have array
19894 2002-05-17 Miguel de Icaza <miguel@ximian.com>
19896 * typemanager.cs: (RegisterBuilder): New function used to register
19897 TypeBuilders that implement interfaces. Since
19898 TypeBuilder.GetInterfaces (as usual) does not work with lame
19900 (AddUserType): register interfaces.
19902 (ImplementsInterface): Use the builder_to_ifaces hash if we are
19903 dealing with TypeBuilder. Also, arrays are showing up as
19904 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
19905 methods can not be invoked on them!
19907 * ecore.cs (ExplicitReferenceConversionExists): Made public.
19908 (ImplicitReferenceConversionExists): Split out from
19909 StandardConversionExists.
19911 * expression.cs (As): We were only implementing one of the three
19912 cases for the as operator. We now implement them all.
19913 (Is): Implement the various other cases for Is as well.
19915 * typemanager.cs (CACHE): New define used to control if we want or
19916 not the FindMembers cache. Seems to have a negative impact on
19917 performance currently
19919 (MemberLookup): Nested types have full acess to
19920 enclosing type members
19922 Remove code that coped with instance/static returns for events, we
19923 now catch this in RealFindMembers.
19925 (RealFindMembers): only perform static lookup if the instance
19926 lookup did not return a type or an event.
19928 2002-05-17 Miguel de Icaza <miguel@ximian.com>
19930 * assign.cs (CompoundAssign): We pass more semantic information
19931 now to Compound Assignments than we did before: now we have all
19932 the information at hand, and now we resolve the target *before* we
19933 do the expression expansion, which allows the "CacheValue" method
19934 to have the effect we intended (before, a [x] += 1 would generate
19935 two differen ArrayAccess expressions from the ElementAccess,
19936 during the resolution process).
19938 (CompoundAssign.DoResolve): Resolve target and original_source here.
19940 2002-05-16 Miguel de Icaza <miguel@ximian.com>
19942 * expression.cs (ArrayAccess): dropped debugging information.
19944 * typemanager.cs: Small bug fix: I was always returning i_members,
19945 instead of one of i_members or s_members (depending on which had
19948 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
19949 method is invoked before any code generation takes place, and it
19950 is a mechanism to inform that the expression will be invoked more
19951 than once, and that the method should use temporary values to
19952 avoid having side effects
19954 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
19956 * ecore.cs (Expression.CacheTemporaries): Provide empty default
19959 * expression.cs (Indirection, ArrayAccess): Add support for
19960 CacheTemporaries in these two bad boys.
19962 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
19963 ldobj or ldind_ref.
19964 (StoreFromPtr): Handle stobj as well.
19966 * expression.cs (UnaryMutator): Share more code.
19968 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
19969 down: I was not tracking the Filter function as well, which
19970 was affecting the results of the cache.
19972 2002-05-15 Miguel de Icaza <miguel@ximian.com>
19974 * attribute.cs: Remove the hack to handle the CharSet property on
19977 2002-05-14 Miguel de Icaza <miguel@ximian.com>
19979 * attribute.cs (DoResolve): More uglyness, we now only try to
19980 resolve the attribute partially, to extract the CharSet
19981 information (only if we are a StructLayout attribute). Otherwise
19983 (GetExtraTypeInfo): Add some code to conditionally kill in the
19984 future this. I am more and more convinced that the .NET
19985 framework has special code to handle the attribute setting on
19988 * expression.cs (IsParamsMethodApplicable): Revert my previous
19989 foreach change here, it was wrong.
19991 2002-05-13 Miguel de Icaza <miguel@ximian.com>
19993 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
19994 (pp_expr): do not abort on unknown input, just return.
19995 (eval): abort if there are pending chars.
19997 * attribute.cs (Attribute.Resolve): Positional parameters are
19998 optional. Deal with that case.
20000 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
20001 the Ansi/Unicode/Auto information for the type.
20003 (TypeContainer.DefineType): instantiate the EmitContext here, as
20004 we will be using it during the type definition (to resolve
20005 attributes) and during the emit phase.
20007 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
20008 to pull type information out of the attributes
20010 (Attribute.Resolve): track the constructor builder, and allow for
20011 multiple invocations (structs and classes will use this).
20013 * ecore.cs (MemberLookupFinal): new version with all the
20014 parameters customizable.
20016 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
20017 constructors. Return if the result value is null (as the error
20018 would have been flagged already by MemberLookupFinal)
20020 Do not allow instances of abstract classes or interfaces to be
20023 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
20024 We have to compare the assembly property here when dealing with
20025 FamANDAssem and Assembly access modifiers, because we might be
20026 creating an assembly from *modules* (that means that we are not
20027 getting TypeBuilders for types defined in other modules that are
20028 part of this assembly).
20030 (Method.Emit): If the method is marked abstract and has a body,
20033 (TypeContainer.DefineMembers): If both the defined member and the
20034 parent name match are methods, then do not emit any warnings: let
20035 the Method.Define routine take care of flagging warnings. But if
20036 there is a mismatch (method overrides something else, or method is
20037 overriwritten by something, then emit warning).
20039 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
20040 set to null, this means `do not check for the return type on the
20043 (Method.Define): set the return type for the method signature to
20044 null, so that we get methods with the same name and parameters and
20045 different return types. This is used to flag warning 114 (you are
20046 hiding a method, and you probably want to use the new/override
20049 * typemanager.cs (MemberLookup): Implemented proper access
20050 control, closing a long standing set of bug reports. The problem
20051 was that the Framework only has two bits: Public and NonPublic,
20052 and NonPublic includes private and protected methods, but we need
20053 to enforce the FamANDAssem, FamOrAssem and Family.
20055 2002-05-11 Miguel de Icaza <miguel@ximian.com>
20057 * statement.cs (GotoCase): Return true: Ammounts to giving up
20058 knowledge on whether we return or not, and letting the other case
20059 be responsible for it.
20061 2002-05-10 Miguel de Icaza <miguel@ximian.com>
20063 * driver.cs: Do not load directories for each file processed, only
20064 do it if there is a pattern.
20066 * ecore.cs: Report readonly assigns here as well, as we might have
20067 been resolved only by MemberAccess.
20069 (SimpleName.SimpleNameResolve): Also be useful for LValue
20070 resolution. We need this to propagate assign to local readonly variables
20072 * typemanager.cs: Use a ptrhashtable for the criteria, because we
20073 do not want to reuse potential criteria memory.
20075 * class.cs (MyEventBuilder): Set reflected_type;
20077 * ecore.cs (Constantify): Added support for constifying bools.
20079 (RootContext.LookupType): Added a cache for values looked up in
20080 the declaration space.
20082 * typemanager.cs (FindMembers): Now is a front-end to
20083 RealFindMembers, and provides a two-level hashtable-based cache to
20086 15% performance improvement: from 22.5 to 19.2 seconds.
20088 * expression.cs (IsParamsMethodApplicable): use foreach.
20089 (Invocation.DoResolve): ditto.
20090 (New.DoResolve): ditto.
20091 (ArrayCreation.DoResolve): ditto.
20093 * ecore.cs (FindMostEncompassingType): use foreach.
20095 * delegate.cs (NewDelegate.DoResolve): Use foreach
20097 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
20098 (RemoveMethods): use foreach.
20100 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
20101 nested foreach statements instead of for, and also break out of
20102 the inner loop once a match is found.
20104 (Invocation.OverloadResolve): Use foreach, simplify the code.
20106 2002-05-08 Miguel de Icaza <miguel@ximian.com>
20108 * cfold.cs (BinaryFold): During an enumeration evaluation context,
20109 we actually unwrap the expression to allow for extra information
20112 * expression.cs: Use Shr_Un on unsigned operations.
20114 2002-05-08 Ravi Pratap <ravi@ximian.com>
20116 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
20117 applicable operators was not being considered correctly. This closes
20118 the bug Miguel reported.
20120 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
20122 * attribute.cs: check that the type derives from System.Attribute
20123 and report the correct error in that case (moved the duplicate code to
20124 its own method, too).
20126 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
20128 * attribute.cs: lookup attribute type name as the spec says: first the
20129 bare attribute name and then name + "Attribute" (nant compiles with
20130 mcs after this fix).
20132 2002-05-07 Miguel de Icaza <miguel@ximian.com>
20134 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
20135 Because of the way we parse things, we should try to see if a
20136 UIntConstant can fit in an integer.
20138 2002-05-07 Ravi Pratap <ravi@ximian.com>
20140 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
20141 when we are in an explicit context.
20143 (ConvertReferenceExplicit): When converting from Iface type S to Class
20144 T make sure the rules are implemented as an OR.
20146 * parameter.cs (ParameterType): Make it a property for now although the
20147 purpose really isn't anything immediate.
20149 * expression.cs (Is*Applicable): Do better checking on the parameter type
20150 of a ref/out parameter. The ones from the system assemblies are already
20151 marked with the correct type so we don't need to do any correction.
20153 * ecore.cs (StandardConversionExists): Conversion from Interface types to
20154 the object type is standard too so include that.
20156 2002-05-06 Miguel de Icaza <miguel@ximian.com>
20158 * ecore.cs (StandardConversionExists): Augment with missing code:
20159 deal with IntConstant, LongConstants and Enumerations.
20161 * assign.cs: Report the error, instead of failing silently
20163 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
20164 typecontainer that they are declared, because the
20165 typecontainer/namespace will have the list of using clauses that
20166 need to be applied.
20168 Assembly Attributes were escaping the normal registration
20171 (EmitCode): Apply attributes within an EmitContext that represents
20172 the container they were declared on.
20174 * cs-parser.jay: Track bases for structs. How did I get this wrong?
20176 2002-05-06 Ravi Pratap <ravi@ximian.com>
20178 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
20179 Revamp completely - make much cleaner as we now operate only
20182 (FindMostSpecificSource, FindMostSpecificTarget): New methods
20183 to implement the logic detailed in the spec more correctly.
20185 (UserDefinedConversion): Update accordingly.
20187 2002-05-06 Miguel de Icaza <miguel@ximian.com>
20189 * statement.cs: Return flow analysis information up.
20191 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
20194 (token): Do not consume an extra character before calling
20197 2002-05-06 Piers Haken <piersh@friskit.com>
20199 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
20201 2002-05-06 Miguel de Icaza <miguel@ximian.com>
20203 * class.cs (Constructor.Emit): Set the IsStatic flag in the
20204 EmitContext during the instance constructor initializer
20205 resolution, to stop access to instance variables.
20207 This is mandated by the spec, last paragraph of the `constructor
20208 initializers' section.
20210 2002-05-05 Miguel de Icaza <miguel@ximian.com>
20212 * cs-parser.jay, class.cs (Accessor): new class used to represent
20213 an accessor (get or set). In the past we used `null' to represent
20214 a missing accessor. But this is ambiguous because there was no
20215 way to tell in abstract indexers/properties if one of them was
20218 Now there is a way of addressing that.
20220 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
20221 instead of FindMembers.
20223 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
20224 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
20226 * attribute.cs: Treat indexers and properties as the same in terms
20227 of applying attributes
20229 * ecore.cs (FindMostEncompassedType): Use statically initialized
20230 EmptyExpressions()s like we do elsewhere to avoid creating useless
20231 objects (and we take this out of the tight loop).
20233 (GetConversionOperators): Move the code to extract the actual
20234 operators to a separate routine to clean things up.
20236 2002-05-04 Miguel de Icaza <miguel@ximian.com>
20238 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
20239 events are always registered FieldBuilders.
20241 * class.cs (FieldBase): New class shared by Fields
20243 * delegate.cs: If we are a toplevel delegate, use our full name.
20244 If we are a nested delegate, then only use our tail name.
20246 2002-05-02 Ravi Pratap <ravi@ximian.com>
20248 * expression.cs (IsApplicable): Ensure that we add the "&" to
20249 ref/out types before comparing it with the type of the argument.
20251 (IsParamsMethodApplicable): Ditto.
20253 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
20256 * delegate.cs : Handle the case when we have more than one applicable
20257 method. Flag an error only when we finish checking all.
20259 2002-05-02 Miguel de Icaza <miguel@ximian.com>
20261 * expression.cs: Add support for boolean static initializers.
20263 2002-05-01 Miguel de Icaza <miguel@ximian.com>
20265 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
20267 * parameter.cs (ComputeParameterTypes,
20268 ComputeAndDefineParameterTypes): Better error handling: now we
20269 clear the `types' cache if we fail during any of the type lookups.
20270 We also return the status code correctly to our caller
20272 * delegate.cs: If we fail to define a delegate, abort the extra
20275 * expression.cs (Binary.ResolveOperator): for
20276 operator==(object,object) and operator !=(object, object) we also
20277 have to verify that there is an implicit conversion from one to
20280 (ArrayAccess.DoResolve): Array Access can operate on
20283 2002-04-30 Miguel de Icaza <miguel@ximian.com>
20285 * assign.cs (CompoundAssign): A new class used as a "flag" that
20286 the assignment actually is happening as part of a compound
20287 assignment operator.
20289 During compound assignment, a few new rules exist to enable things
20296 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
20297 to the type of x) if y is implicitly convertible to the type of x,
20298 and the operator is a builtin operator and the return type of the
20299 operator is explicitly convertible to the type of x.
20301 * rootcontext.cs: Reset warning level to 2. 4 catches various
20302 "interesting" features in mcs, we must clean this up at some
20303 point, but currently am trying to kill other bugs ;-)
20305 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
20306 in container classes as well.
20308 * expression.cs (Binary.ResolveOperator): Handle string case
20309 before anything else (as operator overloading does emit an error
20310 before doing anything else).
20312 This code could go away when we move to a table driven model, but
20313 i could not come up with a good plan last night.
20315 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
20317 * typemanager.cs (CSharpName): reimplementation using regex.
20318 * class.cs: added null check for fields in Emit
20319 * rootcontext.cs: set warninglevel to 4
20321 2002-04-29 Miguel de Icaza <miguel@ximian.com>
20323 * typemanager.cs (CSharpName): reimplemented with Lupus
20326 2002-04-28 Miguel de Icaza <miguel@ximian.com>
20328 * statement.cs (If): correclty implement Resolve, because we were
20329 not catching sem errors in there. The same process is needed
20331 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
20334 (Statement.Warning_DeadCodeFound): Factorize code.
20335 (While): Report dead code here too.
20337 (Statement): Added Resolve virtual method to allow
20338 for resolution split from the emit code.
20340 2002-04-26 Miguel de Icaza <miguel@ximian.com>
20342 * statement.cs (EmitBoolExpression): No longer try to resolve the
20344 (MakeBoolean): New utility function that resolve, implicitly
20345 converts to boolean and tags the expression.
20348 (If, Do): Implement dead code elimination.
20349 (While): Implement loop inversion
20351 (Do, While, For, If): Resolve the expression prior to calling our
20354 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
20357 - added method Report28 (warning: program has more than one entry point)
20358 - added method IsEntryPoint, implements paragraph 10.1 of the spec
20359 - modified method Method.Define, the part at the end of the method
20361 * rootcontext.cs: added static public Location EntryPointLocation;
20363 * ../errors/cs0028.cs : Add test case for the above warning.
20366 - modified method CSharpName to allow arrays of primitive type to
20367 be printed nicely (e.g. instead of System.Int32[][] it now prints
20369 - added method CSharpSignature: returns the signature of a method
20370 in string format to be used in reporting errors, warnings, etc.
20372 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
20375 2002-04-26 Ravi Pratap <ravi@ximian.com>
20377 * delegate.cs (Define): Fix extremely silly bug where I was
20378 setting the type of the 'object' parameter of the BeginInvoke
20379 method to System.IAsyncResult instead of System.Object ;-)
20381 2002-04-26 Miguel de Icaza <miguel@ximian.com>
20383 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
20386 (Constructor.Emit): return if we fail to initialize the
20387 constructor. Another door closed!
20389 * expression.cs (New.DoResolve): Improve error message (from -6 to
20390 1501). Use DeclaredOnly lookup to find the exact constructor.
20392 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
20393 loop. This is useful.
20395 * cs-parser.jay: Adjust the default parameters so that destructors
20396 have the proper signature.
20398 2002-04-26 Martin Baulig <martin@gnome.org>
20400 * driver.cs (LoadAssembly): If `assembly' contains any characters
20401 which are only valid in path names and not in assembly names
20402 (currently slash, backslash and point), use Assembly.LoadFrom ()
20403 instead of Assembly.Load () on the `assembly' (before iteration
20404 over the link_paths).
20406 2002-04-26 Martin Baulig <martin@gnome.org>
20408 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
20410 2002-04-25 Miguel de Icaza <miguel@ximian.com>
20412 * class.cs (Property): use the new typemanager.MemberLookup
20414 (TypeContainer.MemberLookup): Implement using the
20415 TypeManager.MemberLookup now.
20417 * typemanager.cs: Make MemberLookup a function of the TypeManager,
20418 and return MemberInfos, so that these can be used without an
20419 EmitContext (what we had before).
20421 2002-04-24 Miguel de Icaza <miguel@ximian.com>
20423 * expression.cs: Fix the case where the argument to params if the
20424 type of the params. I omitted handling this before. Fixed
20426 2002-04-22 Miguel de Icaza <miguel@ximian.com>
20428 * driver.cs: Call BootCorlib_PopulateCoreType
20430 * class.cs (Property.CheckBase): Check for properties only, not
20433 * interface.cs: Temporary hack: try/catch around the
20434 CustomAttributeBuilder, because I am getting an exception that I
20437 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
20438 types whose definitions are required to be there (attributes are
20439 defined before standard types).
20441 Compute definitions as we boot the various types, as they are used
20442 immediately (value_type class will need object_type, but if we do
20443 not initialize object_type, we will pass a null, which will let
20444 the runtime pick the System.Object from the existing corlib, which
20445 is not what we want).
20447 2002-04-22 Patrik Torstensson <totte@labs2.com>
20449 * cs-tokenizer.cs: fixed a number of trim() issues.
20451 2002-04-22 Ravi Pratap <ravi@ximian.com>
20453 * expression.cs (Argument.Type): Ensure that we return the correct
20454 type when we have out or ref parameters [in which case we
20457 2002-04-22 Miguel de Icaza <miguel@ximian.com>
20459 * class.cs (Property, Indexer): Allow extern modifier in there.
20461 * typemanager.cs (InitBaseTypes): Initializes object_type and
20462 value_type, since those will be used early on during the bootstrap
20463 process to compile corlib.
20465 (InitCoreTypes): Move code from here to InitBaseTypes.
20467 2002-04-21 Miguel de Icaza <miguel@ximian.com>
20469 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
20470 single-dimension arrays as using the ldlen opcode.
20472 Daniel Lewis discovered this optimization.
20474 * typemanager.cs: Add signature for System.Array::get_Length
20476 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20478 * statement.cs: report the error when the foreach does not apply to an
20479 array nor a collection.
20481 2002-04-19 Miguel de Icaza <miguel@ximian.com>
20483 * expression.cs: Add implicit conversions to the operator ~.
20485 * constant.cs (DecimalConstant.Emit): Emit decimal value.
20487 * typemanager.cs: Locate the decimal constructor.
20489 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20491 * attribute.cs: use the new property of TypeOf.
20492 * expression.cs: added 'get' property around typearg.
20494 These changes fix a build breaker reported by NickD. Is this the
20495 correct way to fix? If not, please, revert my changes and make it
20498 2002-04-17 Miguel de Icaza <miguel@ximian.com>
20500 * attribute.cs: Add support for typeof in attribute invocations.
20501 I am not sure that this is right though.
20503 2002-04-14 Duncan Mak <duncan@ximian.com>
20505 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
20506 Binary.Operator.Division case.
20508 2002-04-13 Ravi Pratap <ravi@ximian.com>
20510 * class.cs (DefineType): Ensure that we do a proper check on
20511 attribute types and also register it with the TypeManager.
20513 (TypeContainer.Targets): The default for attribute types is
20514 AttributeTargets.All.
20516 * attribute.cs (ApplyAttributes): Registering the attribute type
20517 is done elsewhere, not when we discover we have a Usage attribute.
20519 2002-04-12 Ravi Pratap <ravi@ximian.com>
20521 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
20522 and get rid of is_delegate parameter.
20524 * everywhere : update.
20526 2002-04-12 Ravi Pratap <ravi@ximian.com>
20528 * cs-parser.jay (compilation_unit): Revamp completely to use
20529 some new ideas that I got from Rhys' grammar to solve the problems
20530 with assembly level attributes.
20532 (outer_declaration): New grammar production.
20534 (attribute_sections): Add.
20536 (opt_attributes): Base on attribute_sections
20538 (namespace_declaration): Allow opt_attributes to tackle the case
20539 when we have assembly level attributes - we are clever in this
20542 * attribute.cs (ApplyAttributes): Do not worry about assembly
20543 attributes in the non-global context.
20545 * rootcontext.cs (AddGlobalAttributes): Go back to using this
20546 instead of SetGlobalAttributes.
20548 * class.cs, rootcontext.cs : Ensure we define and generate
20549 attribute types before anything else.
20551 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
20552 and flag the new error -20 for the case when the attribute type
20553 does not have valid targets specified. csc does not catch this.
20555 * ../errors/errors.txt : update for error # -20
20557 2002-04-11 Ravi Pratap <ravi@ximian.com>
20559 * support.cs (InternalParameters.ParameterModifier): Do some null
20560 checking and return sane values.
20562 * class.cs (Method.Define): If we are a PInvoke method, ensure
20563 that we are static and extern. Report error # 601
20565 * ../errors/cs0601.cs : Add test case for the above error.
20567 2002-04-07 Ravi Pratap <ravi@ximian.com>
20569 * rootcontext.cs (attribute_types): We need to keep type of
20570 all attribute types separately and emit code for them first.
20572 (RegisterAttribute) : Implement.
20574 * class.cs (DefineType): Check if the current Type is a custom
20575 attribute type and register it accordingly.
20577 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
20578 adding the first attribute twice and rename to
20580 (SetGlobalAttributes): this.
20582 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
20585 * attribute.cs (ApplyAttributes): Take an additional argument telling us
20586 if we are processing global arguments. Hmm, I am unsure of this.
20588 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20590 * expression.cs: added static array of strings to avoid calling
20591 Enum.ToString () for Operator in Binary. Significant recover of
20594 2002-04-10 Miguel de Icaza <miguel@ximian.com>
20596 * class.cs (FindMembers): Allow the Builders of the various
20597 members to be null. If they are skip them. This only happens
20598 during the PInvoke declaration.
20600 2002-04-09 Miguel de Icaza <miguel@ximian.com>
20602 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
20603 failure, so we do not keep going afterwards.
20605 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
20606 wanted to pass `false' as the `is_delegate' argument. If this is
20607 the case, why not use delegate_type == null to mean `is_delegate =
20608 false' and anything else as is_delegate = true.
20610 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
20612 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
20613 code for the section, not the beginning of the tests.
20615 2002-04-08 Miguel de Icaza <miguel@ximian.com>
20617 * cfold.cs: Handle operator + (Enum x, Underlying x)
20619 * expression.cs (Binary): same. Warn about errors where we have
20620 Enum/Enum in operator + as well.
20622 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
20625 - added support for switch(bool)
20626 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
20627 - add TableSwitchEmit() to handle table-based switch statements
20629 2002-04-05 Ravi Pratap <ravi@ximian.com>
20631 * expression.cs (Invocation.OverloadResolve): Factor out code which
20632 does parameter compatibility checking with arguments so that we can
20633 re-use the code even from Delegate.VerifyApplicability
20635 (VerifyArgumentsCompat): Move above code here.
20637 * delegate.cs (VerifyApplicability): Get rid of duplicate code
20638 and instead make a call to the above method.
20640 2002-03-31 Ravi Pratap <ravi@ximian.com>
20642 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
20643 We use it to keep track of classes which are attribute types.
20645 2002-04-02 Miguel de Icaza <miguel@ximian.com>
20647 * delegate.cs (Delegate.Define): Correctly define the types in the
20648 presence of fixed and array parameters.
20650 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
20653 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
20654 include NonPublic after the first iteration.
20656 * class.cs (Indexer.CheckBase): Only check if both parents are
20659 * cs-parser.jay (accessor_body): If empty, set to null.
20661 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
20662 same code path here to resolve constants names that we did have in
20663 MemberAccess.DoResolve. There is too much code duplicated here.
20665 2002-04-01 Miguel de Icaza <miguel@ximian.com>
20667 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
20669 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
20672 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
20673 tokens, numbers and strings.
20675 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
20678 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
20679 asyncronous parameters and the regular parameters.
20681 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
20682 specify the target directory.
20684 * expression.cs: (This.DoResolve): Simplify
20685 (As.Emit): Optimize, do not generate IsInst if the expression is
20686 always of the given type.
20688 (Is.DoResolve): Bug fix, we were reporting both always/never for
20691 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
20692 creating too many unnecessary arrays.
20694 2002-03-31 Miguel de Icaza <miguel@ximian.com>
20696 * class.cs (EmitFieldInitializer): Use Assign expression to assign
20697 fields instead of rolling our own initializer. Takes care of all
20698 implicit conversions, and drops unnecessary static checks/argument.
20700 2002-03-31 Dick Porter <dick@ximian.com>
20702 * driver.cs: use the GetDirectories() return values properly, and
20703 use "/" as path separator.
20705 2002-03-30 Miguel de Icaza <miguel@ximian.com>
20707 * expression.cs (Unary): Optimize - - expr into expr.
20708 (Binary): Optimize a + (-b) into a -b.
20710 * codegen.cs (CodeGen): Made all methods static.
20712 2002-03-29 Miguel de Icaza <miguel@ximian.com>
20716 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
20717 TypeBuilder property.
20719 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
20722 * tree.cs: Removed the various RecordXXXX, and replaced with a
20723 single RecordDecl. Removed all the accessor methods, and just
20724 left a single access point Type
20726 * enum.cs: Rename DefineEnum to DefineType.
20728 * decl.cs: New abstract method `DefineType' used to unify the
20729 Defines for Enumerations, Interfaces, TypeContainers and
20732 (FindType): Moved LookupInterfaceOrClass here. Moved the
20733 LookupBaseClasses method that used to live in class.cs and
20734 interface.cs here, and renamed to FindType.
20736 * delegate.cs: Implement DefineType. Take advantage of the
20737 refactored pattern for locating the parent builder without taking
20738 the parent_builder argument (which we know does not work if we are
20739 nested, and triggering a toplevel definition).
20741 2002-03-28 Miguel de Icaza <miguel@ximian.com>
20743 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
20744 accessibility of a member has changed during override and report
20747 * class.cs (Method.Define, Property.Define): Only complain on
20748 overrides if the method is private, any other accessibility is
20749 fine (and since we just checked the permission is the same, we are
20752 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
20753 and elif are processed always. The other pre-processing
20754 directives are only processed if we are "taking" the path
20756 2002-03-29 Martin Baulig <martin@gnome.org>
20758 * class.cs (Method.Emit): Only emit symbolic debugging info if the
20759 current location is not Null.
20761 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
20762 a separate method so we can profile it.
20764 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
20765 `span.Seconds' are just seconds, but no minutes or hours.
20766 (MainDriver): Profile the CodeGen.SaveSymbols calls.
20768 2002-03-28 Miguel de Icaza <miguel@ximian.com>
20770 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
20771 Remove the gratuitous set of Final:
20773 // If an interface implementation, then we can set Final.
20774 if (((flags & MethodAttributes.Abstract) == 0) &&
20775 implementing.DeclaringType.IsInterface)
20776 flags |= MethodAttributes.Final;
20778 I do not know what I was smoking when I used that.
20781 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
20782 step into fixing the name resolution issues for delegates and
20783 unifying the toplevel name resolution.
20785 2002-03-28 Martin Baulig <martin@gnome.org>
20787 * class.cs (Method.Emit): If we have a symbol writer, call its
20788 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
20789 tell it about the current method.
20791 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
20792 writer that we're going to emit the first byte of IL code for a new
20793 statement (a new source line).
20794 (EmitContext.EmitTopBlock): If we have a symbol writer, call
20795 EmitContext.Mark() before emitting any code.
20797 * location.cs (SymbolDocument): Return null when we're Null.
20799 * statement.cs (Statement): Moved the `Location loc' variable here.
20800 (Statement.EmitBoolExpression): If we have a symbol writer, call
20801 ec.Mark() before emitting any code to tell it that we're at the
20802 beginning of a new statement.
20803 (StatementExpression): Added `Location' argument to the constructor.
20804 (Block): Added public readonly variable `StartLocation' and public
20805 variable `EndLocation'. The latter is to be set using SetEndLocation().
20806 (Block): Added constructor which takes a start and end location.
20807 (Block.SetEndLocation): New method. This sets the end location.
20808 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
20809 local variables we create.
20810 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
20811 each statement and do also mark the begin and end of the block.
20813 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
20814 tell it the current lexer.Location, use Location.Null for the end of the
20816 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
20817 current block, set its end location using SetEndLocation().
20818 (statement_expression): StatementExpression constructor now takes the
20819 lexer.Location as additional argument.
20820 (for_statement, declare_local_variables): Likewise.
20821 (declare_local_variables): When creating a new implicit block, use the
20822 new Block constructor and pass it the lexer.Location.
20824 2002-03-28 Miguel de Icaza <miguel@ximian.com>
20826 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
20827 members also on the parent interfaces recursively.
20829 2002-03-27 Miguel de Icaza <miguel@ximian.com>
20831 * report.cs: Use new formats, since Gonzalo finished the missing
20834 * expression.cs (Binary.ResolveOperator): added missing operator|
20835 operator& and operator^ for bool/bool.
20837 * cs-parser.jay: CheckDef now takes a Location argument that is
20838 used to report errors more precisly (instead of reporting the end
20839 of a definition, we try to track something which is a lot closer
20840 to the source of the problem).
20842 * cs-tokenizer.cs: Track global token use, so we can properly flag
20843 the use of #define/#undef after the first token has been seen.
20845 Also, rename the reportXXXX to Error_DescriptiveName
20847 * decl.cs (DeclSpace.IsTopLevel): Move property here from
20848 TypeContainer, so that Enum and Interface can use this too.
20850 * class.cs (TypeContainer.LookupInterfaceOrClass,
20851 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
20852 `builder' argument. Typically this was used to pass the parent
20853 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
20856 The problem is that a nested class could trigger the definition of
20857 a toplevel class, and the builder would be obviously wrong in that
20860 So we drop this argument, and we compute dynamically the
20861 TypeBuilder/ModuleBuilder (the correct information was available
20862 to us anyways from DeclSpace.Parent)
20864 * interface.cs (Interface.DefineInterface): Drop builder
20865 parameter cleanup like class.cs
20867 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
20870 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
20873 (Try.Emit): Propagate the returns value from the statement.
20875 (Return.Emit): Even if we are leavning
20877 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
20879 * modifiers.cs: Fix the computation of MethodAttributes flags.
20881 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
20883 * driver.cs: allow compilation of files that start with '/'.
20884 Add a default case when checking the argument of --target.
20886 2002-03-25 Miguel de Icaza <miguel@ximian.com>
20888 * interface.cs: Implement the same search algorithm for types in
20889 the interface code.
20891 * delegate.cs: Do not allow multiple definition.
20893 * Recovered ChangeLog that got accidentally amputated
20895 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
20897 * rootcontext.cs: Load manually enum to allow core classes to
20898 contain enumerations.
20900 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
20901 Update to new static methods in TypeManager.
20903 * typemanager.cs (GetMethod, GetConstructor): Use our
20904 implementation of FindMembers to find the members, since during
20905 corlib compilation, the types are TypeBuilders and GetMethod and
20906 GetConstructor do not work.
20908 Make all methods in TypeManager static.
20910 (InitCodeHelpers): Split the functionality from
20911 the InitCodeTypes function.
20913 * driver.cs: Call InitCodeHelpers after we have populated the
20916 * cs-parser.jay (delegate_declaration): we did not used to compute
20917 the delegate name correctly for void delegates.
20919 2002-03-24 Miguel de Icaza <miguel@ximian.com>
20921 * rootcontext.cs (RootContext): Init the interface_resolve_order
20922 and type_container_resolve_order always.
20924 (ResolveCore, BootstrapCorlib_ResolveClass,
20925 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
20926 compiler when compiling with --nostdlib
20928 * class.cs (TypeContainer.DefineType): Check that our parent is
20929 not null. This test is most important when we are bootstraping
20932 * codegen.cs: Split out the symbol writing code.
20934 2002-03-25 Martin Baulig <martin@gnome.org>
20936 * driver.cs (-g): Made -g an alias for --debug.
20938 2002-03-24 Martin Baulig <martin@gnome.org>
20940 * codegen.cs (SymbolWriter): New public variable. Returns the
20941 current symbol writer.
20942 (CodeGen): Added `bool want_debugging_support' argument to the
20943 constructor. If true, tell the ModuleBuild that we want debugging
20944 support and ask it for the ISymbolWriter.
20945 (Save): If we have a symbol writer, call it's Close() method after
20946 saving the assembly.
20948 * driver.c (--debug): New command line argument to create a
20949 debugger information file.
20951 * location.cs (SymbolDocument): New public property. Returns an
20952 ISymbolDocumentWriter object for the current source file or null
20953 if we don't have a symbol writer.
20955 2002-03-21 Miguel de Icaza <miguel@ximian.com>
20957 * driver.cs (LoadAssembly): Correctly return when all the paths
20958 have been tried and not before.
20960 * statement.cs (Switch.Emit): return the actual coverage for this
20961 statement (returns/not-returns)
20963 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
20964 switch of the statement if we are the last switch section. That
20965 kills two problems: try/catch problems (we used to emit an empty
20966 nop at the end) and switch statements where all branches would
20969 2002-03-19 Miguel de Icaza <miguel@ximian.com>
20971 * driver.cs: Add default assemblies (the equivalent to the
20972 Microsoft CSC.RSP file)
20974 * cs-tokenizer.cs: When updating `cols and setting it to zero,
20975 also update tokens_seen and set it to false.
20977 * driver.cs: Implement --recurse for Mike.
20979 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
20980 correctly splitting out the paths.
20982 2002-03-18 Miguel de Icaza <miguel@ximian.com>
20984 * interface.cs (Interface.PopulateProperty): Instead of using
20985 `parent' as the declaration space for the set parameters, use
20988 * support.cs (InternalParameters): InternalParameters constructor
20989 takes a DeclSpace instead of a TypeContainer.
20991 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
20992 types are being initialized, load the address of it before calling
20995 (New): Provide a mechanism to disable the generation of local
20996 value type temporaries when the caller will be providing us with
20997 an address to store it.
20999 (ArrayCreation.EmitDynamicInitializers): Use it.
21001 2002-03-17 Miguel de Icaza <miguel@ximian.com>
21003 * expression.cs (Invocation.EmitArguments): Only probe for array
21004 property if there is more than one argument. Sorry about that.
21006 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
21007 empty param arrays.
21009 * class.cs (Method.LabelParameters): Fix incorrect code path that
21010 prevented the `ParamArrayAttribute' from being applied to the
21013 2002-03-16 Miguel de Icaza <miguel@ximian.com>
21015 * support.cs (ReflectionParameters): Correctly compute whether the
21016 last argument is a params array. Fixes the problem with
21019 * typemanager.cs: Make the assemblies array always be non-null
21020 (empty, but non-null)
21022 * tree.cs (RecordDecl): New function that abstracts the recording
21023 of names. This reports error 101, and provides a pointer to the
21024 previous declaration. Fixes a crash in the compiler.
21026 * cs-parser.jay (constructor_declaration): Update to new grammar,
21027 and provide a constructor_body that can be empty.
21029 2002-03-15 Miguel de Icaza <miguel@ximian.com>
21031 * driver.cs: Add support for --resources.
21033 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
21034 Make all types for the various array helper methods be integer.
21036 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
21037 CheckState to ConvCast.
21039 (ConvCast): Now it takes a `checked' state argument, to avoid
21040 depending on the emit context for the conversion, and just using
21041 the resolve time setting.
21043 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
21044 instead of Invocation.EmitArguments. We do not emit the original
21045 arguments, instead we emit those which have been converted to
21046 unsigned int expressions.
21048 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
21050 * codegen.cs: ditto.
21052 * expression.cs (LocalVariableReference): Drop the use of the
21053 Store function that depended on the variable index.
21055 * statement.cs (VariableInfo): Drop the `Idx' property from this
21056 class, as this is not taking into account the indexes for
21057 temporaries tat we generate during the execution, getting the
21060 * class.cs: First emit class initializers, then call the parent
21063 * expression.cs (Binary): Fix opcode emision.
21064 (UnaryMutator.EmitCode): Support checked code generation
21066 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
21067 matches for events for both the Static and Instance scans,
21068 pointing to the same element. Fix that.
21070 2002-03-14 Miguel de Icaza <miguel@ximian.com>
21072 * rootcontext.cs (ResolveTree): Always set the
21073 interface_resolve_order, because nested interfaces will be calling
21076 * class.cs (GetInterfaceOrClass): Track the same resolution
21077 process used by TypeManager.LookupType. This fixes the nested
21078 type lookups in class declarations (separate path from
21081 (TypeContainer.DefineType): Also define nested interfaces.
21082 (TypeContainer.RegisterOrder): New public function used to
21083 register the order in which child interfaces need to be closed.
21085 Nested interfaces need to be closed after their parents have been
21088 * interface.cs (InterfaceAttr): Put all the logic for computing
21089 the interface attribute here.
21091 (DefineInterface): Register our interface order with the
21092 RootContext or with the TypeContainer depending on the case.
21094 2002-03-12 Miguel de Icaza <miguel@ximian.com>
21096 * cs-parser.jay: rework foreach statement to work with the new
21097 changes to the policy on SimpleNames.
21099 * report.cs: support Stacktrace on warnings as well.
21101 * makefile: drop --unsafe and /unsafe from the compile.
21103 2002-03-13 Ravi Pratap <ravi@ximian.com>
21105 * ecore.cs (StandardConversionExists): Modify to take an Expression
21106 as the first parameter. Ensure we do null -> reference type conversion
21109 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
21110 temporary Expression objects.
21112 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
21114 * interface.cs: workaround bug in method overloading resolution
21115 (there is already a bugzilla bug for it).
21117 2002-03-12 Miguel de Icaza <miguel@ximian.com>
21119 We could also solve this problem by having a separate path for
21120 performing type lookups, instead of DoResolve, we could have a
21121 ResolveType entry point, and only participating pieces of the
21122 production (simplename, deref, array) would implement this.
21124 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
21125 signal SimpleName to only resolve type names and not attempt to
21126 resolve anything else.
21128 * expression.cs (Cast): Set the flag.
21130 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
21132 * class.cs: Only report 108 if there is no `new' modifier.
21134 * cs-parser.jay: rework foreach statement to work with the new
21135 changes to the policy on SimpleNames.
21137 * report.cs: support Stacktrace on warnings as well.
21139 * makefile: drop --unsafe and /unsafe from the compile.
21141 2002-03-11 Miguel de Icaza <miguel@ximian.com>
21143 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
21144 lookups here, instead of doing that at parse time. This means
21145 that our grammar will not introduce `LocalVariableReferences' as
21146 expressions at this point. That solves the problem of code like
21150 static void Main ()
21154 This is only half the fix. The full fix requires parameters to
21155 also be handled in this way.
21157 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
21158 makes the use more obvious of the DeclSpace. The
21159 ec.TypeContainer.TypeBuilder is now only used to pull the
21160 TypeBuilder for it.
21162 My theory is that I can get rid of the TypeBuilder completely from
21163 the EmitContext, and have typecasts where it is used (from
21164 DeclSpace to where it matters).
21166 The only pending problem is that the code that implements Aliases
21167 is on TypeContainer, and probably should go in DeclSpace.
21169 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
21170 lookups here, instead of doing that at parse time. This means
21171 that our grammar will not introduce `LocalVariableReferences' as
21172 expressions at this point. That solves the problem of code like
21176 static void Main ()
21180 This is only half the fix. The full fix requires parameters to
21181 also be handled in this way.
21183 * class.cs (Property.DefineMethod): When implementing an interface
21184 method, set newslot, when implementing an abstract method, do not
21185 set the flag (before we tried never setting it, or always setting
21186 it, which is the difference).
21187 (Indexer.DefineMethod): same.
21188 (Method.DefineMethod): same.
21190 * ecore.cs: Only set the status used flag if we get back a Field.
21192 * attribute.cs: Temporary hack, so Paolo can keep working.
21194 2002-03-08 Ravi Pratap <ravi@ximian.com>
21196 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
21197 the unmanaged type in the case we have a MarshalAs attribute.
21199 (Resolve): Handle the case when we are parsing the special MarshalAs
21200 attribute [we need to store the unmanaged type to use later]
21202 * typemanager.cs (marshal_as_attr_type): Built in type for the
21203 MarshalAs Attribute.
21205 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
21206 on parameters and accordingly set the marshalling info.
21208 2002-03-09 Miguel de Icaza <miguel@ximian.com>
21210 * class.cs: Optimizing slightly by removing redundant code after
21211 we switched to the `NoTypes' return value.
21212 (Property.DefineMethod): use NoTypes here too.
21214 This fixes the bug I introduced in my last batch of changes.
21216 2002-03-05 Ravi Pratap <ravi@ximian.com>
21218 * tree.cs (RecordEnum): Add. We now keep track of enums too.
21220 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
21221 Enums since those are types too.
21223 * cs-parser.jay (enum_declaration): Record enums as we parse them.
21225 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
21226 thanks to a call during the lookup process.
21228 2002-03-07 Miguel de Icaza <miguel@ximian.com>
21230 * statement.cs (Foreach): Lots of work to accomodate a particular
21231 kind of foreach statement that I had not kept in mind. It is
21232 possible to have foreachs on classes that provide a GetEnumerator
21233 method that return objects that implement the "pattern" for using
21234 a foreach, there is no need to support GetEnumerator
21237 This is needed to compile nant.
21239 * decl.cs: Only report 114 if the member is not `Finalize' and if
21240 the warning level is at least 2.
21242 * class.cs: Moved the compare function from Method to
21245 (MethodSignature.InheritableMemberSignatureCompare): Add new
21246 filter function that is used to extract inheritable methods from a
21249 (Method.Define): Use the new `inheritable_method_signature_filter'
21252 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
21255 2002-03-06 Miguel de Icaza <miguel@ximian.com>
21257 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
21259 * cs-parser.jay: Add opt_semicolon to the interface declaration.
21261 * expression.cs: Pass location information to
21262 ConvertImplicitStandard.
21264 * class.cs: Added debugging code to track return values from
21267 2002-03-05 Miguel de Icaza <miguel@ximian.com>
21269 * expression.cs (Is.DoResolve): If either side of the `is' is an
21270 interface, do not flag the warning.
21272 * ecore.cs (ImplicitReferenceConversion): We need a separate test
21275 * report.cs: Allow for --fatal to be used with --probe.
21277 * typemanager.cs (NoTypes): Move the definition for the empty Type
21280 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
21282 (TypeContainer.DefineProxy): New function used to proxy to parent
21283 implementations when implementing interfaces.
21284 (TypeContainer.ParentImplements): used to lookup if our parent
21285 implements a public function that is required by an interface.
21286 (TypeContainer.VerifyPendingMethods): Hook this up.
21288 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
21289 `modules' and `assemblies' arraylists into arrays. We only grow
21290 these are the very early start up of the program, so this improves
21291 the speedof LookupType (nicely measured).
21293 * expression.cs (MakeByteBlob): Replaced unsafe code with
21294 BitConverter, as suggested by Paolo.
21296 * cfold.cs (ConstantFold.Binary): Special case: perform constant
21297 folding of string concatenation, but if either side is a string,
21298 and the other is not, then return null, and let the runtime use
21299 the concatenation on the string plus the object (using
21300 `Object.ToString').
21302 2002-03-04 Miguel de Icaza <miguel@ximian.com>
21304 Constant Folding has been implemented now.
21306 * expression.cs (Unary.Reduce): Do not throw an exception, catch
21307 the error instead on types that are not supported in one's
21310 * constant.cs (Constant and all children): New set of functions to
21311 perform implict and explicit conversions.
21313 * ecore.cs (EnumConstant): Implement the new functions to perform
21314 conversion by proxying to the child expression.
21316 * codegen.cs: (ConstantCheckState): Constant evaluation has its
21317 own separate setting that can not be turned off from the command
21318 line using --unchecked or --checked and is only controlled using
21319 the checked/unchecked statements and expressions. This setting is
21320 used by the constant folder to flag errors.
21322 * expression.cs (CheckedExpr, UncheckedExpr): Set the
21323 ConstantCheckState as well.
21325 During Resolve, they also have to flag the state, because the
21326 constant folder runs completely in the Resolve phase.
21328 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
21331 2002-03-01 Miguel de Icaza <miguel@ximian.com>
21333 * cfold.cs: New file, this file contains the constant folder.
21335 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
21336 argument to track whether we are using the resulting address to
21337 load or store a value and provide better error messages.
21339 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
21340 new AddressOf arguments.
21342 * statement.cs (Foreach.EmitCollectionForeach): Update
21344 * expression.cs (Argument.Emit): Call AddressOf with proper
21345 arguments to track usage.
21347 (New.DoEmit): Call AddressOf with new arguments.
21349 (Unary.Emit): Adjust AddressOf call.
21351 2002-03-01 Ravi Pratap <ravi@ximian.com>
21353 * cs-parser.jay (member_access): Change the case for pre-defined types
21354 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
21357 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
21360 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
21361 essentially like methods and apply attributes like MethodImplOptions to them too.
21363 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
21366 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
21367 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
21370 * Update code everywhere accordingly.
21372 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
21374 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
21376 2002-02-28 Ravi Pratap <ravi@ximian.com>
21378 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
21379 try performing lookups against those instead of jumping straight into using
21380 the 'using' clauses.
21382 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
21384 (LookupType): Perform lookups in implicit parents too.
21386 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
21387 sequence as RootContext.LookupType.
21389 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
21390 the various cases of namespace lookups into this method.
21392 2002-03-01 Miguel de Icaza <miguel@ximian.com>
21394 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
21395 in positional arguments)
21397 * class.cs (Operator): Update the AllowedModifiers to contain
21400 * cs-parser.jay: Update operator declaration to allow for the
21401 operator body to be empty.
21403 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
21406 2002-02-27 Miguel de Icaza <miguel@ximian.com>
21408 * class.cs (Method.Emit): Label parameters.
21410 * driver.cs: Return 1 or 0 as the program exit code.
21412 2002-02-26 Miguel de Icaza <miguel@ximian.com>
21414 * expression.cs: Special case the `null' object when trying to
21415 auto-compute the type, as anything can be explicitly converted to
21418 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
21419 spotting this Paolo.
21421 (Expression.ImplicitNumericConversion): Perform comparissions of
21422 the type using the underlying type in the case of an enumeration
21423 rather than using the enumeration type for the compare.
21425 Cope with the underlying == type case, which is not possible to
21428 (Expression.ConvertNumericExplicit): Perform comparissions of
21429 the type using the underlying type in the case of an enumeration
21430 rather than using the enumeration type for the compare.
21432 * driver.cs: If the user does not supply an extension, assume .exe
21434 * cs-parser.jay (if_statement): Rewrote so that we can track the
21435 location for the if statement.
21437 * expression.cs (Binary.ConstantFold): Only concat strings when
21438 the operation is "+", not everything ;-)
21440 * statement.cs (Statement.EmitBoolExpression): Take a location
21442 (If, While, Do): Track location.
21444 * expression.cs (Binary.ResolveOperator): In the object + string
21445 case, I was missing a call to ConvertImplicit
21447 2002-02-25 Ravi Pratap <ravi@ximian.com>
21449 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
21450 Location arguments. Ensure we use RootContext.LookupType to do our work
21451 and not try to do a direct Type.GetType and ModuleBuilder.GetType
21453 * interface.cs (PopulateMethod): Handle the type of the parameter being
21456 * expression.cs (Invocation.BetterFunction): Handle the case when we
21457 have a params method with no fixed arguments and a call is made with no
21460 2002-02-25 Miguel de Icaza <miguel@ximian.com>
21462 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
21463 the verbatim-string-literal
21465 * support.cs (InternalParameters.ParameterModifier): handle null
21467 (InternalParameters.ParameterType): ditto.
21469 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
21470 duplicating the name of the variable parameter.
21471 (GetParameterByName): Fix bug where we were not looking up array
21472 paramters if they were the only present (thanks Paolo!).
21473 (GetParameterInfo): We only have an empty set of types if both
21474 fixed and array are set to null.
21475 (GetParameterInfo-idx): Handle FixedParameter == null
21477 * cs-parser.jay: Handle the case where there is no catch
21478 statements (missing null test).
21480 2002-02-22 Miguel de Icaza <miguel@ximian.com>
21482 * driver.cs (MainDriver): Be conservative on our command line
21485 Catch DirectoryNotFoundException when calling GetFiles.
21487 (SplitPathAndPattern): Used to split the input specification into
21488 a path and a pattern that we can feed to Directory.GetFiles.
21490 2002-02-21 Miguel de Icaza <miguel@ximian.com>
21492 * statement.cs (Fixed): Implement the last case of the Fixed
21493 statement (string handling).
21495 * expression.cs (StringPtr): New class used to return a char * to
21496 a string; Used by the Fixed statement.
21498 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
21500 * expression.cs (Binary.ResolveOperator): Remove redundant
21501 MemberLookup pn parent type.
21502 Optimize union call, we do not need a union if the types are the same.
21503 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
21506 Specialize the use of MemberLookup everywhere, instead of using
21507 the default settings.
21509 (StackAlloc): Implement stackalloc keyword.
21511 * cs-parser.jay: Add rule to parse stackalloc.
21513 * driver.cs: Handle /h, /help, /?
21515 * expression.cs (MakeByteBlob): Removed the hacks we had in place
21516 before we supported unsafe code.
21518 * makefile: add --unsafe to the self compilation of mcs.
21520 2002-02-20 Miguel de Icaza <miguel@ximian.com>
21522 * expression.cs (PointerArithmetic): New class that is used to
21523 perform pointer arithmetic.
21524 (Binary.Resolve): Handle pointer arithmetic
21525 Handle pointer comparission.
21526 (ArrayPtr): Utility expression class that is used to take the
21527 address of an array.
21529 (ElementAccess): Implement array access for pointers
21531 * statement.cs (Fixed): Implement fixed statement for arrays, we
21532 are missing one more case before we are done.
21534 * expression.cs (Indirection): Implement EmitAssign and set the
21535 ExprClass to Variable. This allows pointer dereferences to be
21536 treated as variables, and to have values assigned to them.
21538 * ecore.cs (Expression.StoreFromPtr): New utility function to
21539 store values dereferencing.
21541 2002-02-20 Ravi Pratap <ravi@ximian.com>
21543 * expression.cs (Binary.ResolveOperator): Ensure that we are
21544 not trying to operate on a void type - this fixes the reported
21547 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
21548 the parent implementation is sealed.
21550 * ../errors/cs0239.cs : Add.
21552 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
21554 * typemanager.cs (unverifiable_code_type): Corresponds to
21555 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
21556 which have unsafe code in them.
21558 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
21561 2002-02-19 Miguel de Icaza <miguel@ximian.com>
21563 * cs-tokenizer.cs: Add support for @"litreal strings"
21565 Make tokenizer accept pre-processor directives
21566 on any column (remove the old C-like limitation).
21568 * rootcontext.cs (EmitCode): Emit any global attributes.
21569 (AddGlobalAttributes): Used to keep track of assembly attributes.
21571 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
21573 * cs-parser.jay: Add support for global attributes.
21575 2002-02-17 Miguel de Icaza <miguel@ximian.com>
21577 * expression.cs (Indirection): New helper class. Unary will
21578 create Indirection classes to be able to implement the
21579 IMemoryLocation interface on it.
21581 2002-02-16 Miguel de Icaza <miguel@ximian.com>
21583 * cs-parser.jay (fixed_statement): reference the right statement.
21585 * statement.cs (Fixed.Emit): Finish implementing the fixed
21586 statement for the &x case.
21588 2002-02-14 Miguel de Icaza <miguel@ximian.com>
21590 * class.cs (Property.Define, Method.Define): Remove newslot when
21593 * modifiers.cs: My use of NewSlot when `Abstract' was set was
21594 wrong. NewSlot should only be used if the `new' keyword is present.
21596 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
21597 locating our system dir. Sorry about this.
21599 2002-02-13 Miguel de Icaza <miguel@ximian.com>
21601 * driver.cs (GetSystemDir): Compute correctly the location of our
21602 system assemblies. I was using the compiler directory instead of
21603 the library directory.
21605 2002-02-13 Ravi Pratap <ravi@ximian.com>
21607 * expression.cs (BetterFunction): Put back in what Miguel commented out
21608 since it is the correct fix. The problem is elsewhere ;-)
21610 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
21611 parameters of the parms method are themselves compatible or not !
21613 (StandardConversionExists): Fix very dangerous bug where we were forgetting
21614 to check that a class implements an interface before saying that an implicit
21615 conversion was allowed. Use ImplementsInterface to do the checking.
21617 2002-02-13 Miguel de Icaza <miguel@ximian.com>
21619 * class.cs (Method.Define): Track whether we are an explicit
21620 implementation or not. And only call DefineMethodOverride if we
21621 are an explicit implementation.
21623 (Property.DefineMethod): Ditto.
21625 2002-02-11 Ravi Pratap <ravi@ximian.com>
21627 * expression.cs (BetterFunction): Catch hideous bug which was
21628 preventing us from detecting ambiguous calls due to implicit casts i.e
21631 2002-01-29 Miguel de Icaza <miguel@ximian.com>
21633 * support.cs (Pair): Remove un-needed method. I figured why I was
21634 getting the error in cs-parser.jay, the variable in a foreach loop
21635 is readonly, and the compiler does not really treat this as a variable.
21637 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
21638 instead of EQUALS in grammar.
21640 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
21642 * expression.cs (Unary.DoResolve): Check whether the argument is
21645 2002-01-28 Miguel de Icaza <miguel@ximian.com>
21647 * support.cs: Api for Pair to set a value. Despite the fact that
21648 the variables are public the MS C# compiler refuses to compile
21649 code that accesses the field if the variable is part of a foreach
21652 * statement.cs (Fixed): Begin implementation of the fixed
21655 (Block.AddVariable): Return the VariableInfo on success and null
21656 on failure instead of true/false.
21658 * cs-parser.jay (foreach): Catch errors on variables already
21659 defined (we were ignoring this value before) and properly unwind
21660 the block hierarchy
21662 (fixed_statement): grammar for the fixed statement.
21664 2002-01-25 Miguel de Icaza <miguel@ximian.com>
21666 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
21667 pointer types to be incretemented.
21669 (SizeOf): Implement.
21671 * cs-parser.jay (pointer_member_access): Implement
21672 expr->IDENTIFIER production.
21674 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
21675 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
21678 (Unary): Implement indirection.
21680 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
21681 use in non-unsafe context).
21683 (SimpleName.DoResolve): Check for pointers in field access on safe
21686 (Expression.LoadFromPtr): Factor the load-indirect code in this
21687 function. This was duplicated in UnboxCast and ParameterReference
21689 2002-01-24 Miguel de Icaza <miguel@ximian.com>
21691 * expression.cs (ComposedCast): report an error if a pointer cast
21692 is used in a safe region.
21694 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
21695 pointer type casts in unsafe context.
21697 * codegen.cs (EmitContext): Set up IsUnsafe.
21699 * cs-parser.jay (non_expression_type): Add productions for pointer
21702 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
21703 code. We should not use force into static mode if the method is
21704 not virtual. Fixes bug in MIS
21706 * statement.cs (Do.Emit, While.Emit, For.Emit,
21707 Statement.EmitBoolExpression): Add support to Do and While to
21708 propagate infinite loop as `I do return' semantics.
21710 Improve the For case to also test for boolean constants.
21712 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
21713 to the list of attributes we can add.
21715 Remove `EmitContext' argument.
21717 * class.cs (Method.Define): Apply parameter attributes.
21718 (Constructor.Define): Apply parameter attributes.
21719 (MethodCore.LabelParameters): Move here the core of labeling
21722 * support.cs (ReflectionParameters.ParameterModifier,
21723 InternalParameters.ParameterModifier): Use IsByRef on the type and
21724 only return the OUT bit for these parameters instead of in/out/ref
21727 This is because I miss-understood things. The ParameterInfo.IsIn
21728 and IsOut represent whether the parameter has the [In] and [Out]
21731 2002-01-22 Miguel de Icaza <miguel@ximian.com>
21733 * ecore.cs (FieldExpr.Emit): Release temporaries.
21735 * assign.cs (LocalTemporary.Release): new function.
21737 * codegen.cs (EmitContext.GetTemporaryStorage,
21738 EmitContext.FreeTemporaryStorage): Rework the way we deal with
21739 temporary storage. Now we can "put back" localbuilders when we
21742 2002-01-21 Miguel de Icaza <miguel@ximian.com>
21744 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
21745 need to make a copy of the variable to generate verifiable code.
21747 2002-01-19 Miguel de Icaza <miguel@ximian.com>
21749 * driver.cs: Compute dynamically the system directory.
21751 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
21752 Slower, but more generally useful. Used by the abstract
21753 registering implementation.
21755 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
21756 the rules for the special rule on Type/instances. First check if
21757 we have the same name, and if so, try that special static path
21758 rather than the instance path.
21760 2002-01-18 Miguel de Icaza <miguel@ximian.com>
21762 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
21765 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
21766 Enum, ValueType, Delegate or Array for non-corlib compiles.
21768 * cs-tokenizer.cs: Catch long identifiers (645)
21770 * typemanager.cs (IndexerPropetyName): Ravi never tested this
21773 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
21774 fix, we were returning too early, so we were not registering
21775 pending methods from abstract classes.
21777 Do not register pending methods if the class is abstract.
21779 * expression.cs (Conditional.DoResolve): Report circular implicit
21780 conversions when we neecd to compute it for conditional
21783 (Is.DoResolve): If the expression is always of the provided type,
21784 flag warning 183. If the expression can not ever be of the
21785 provided type flag warning 184.
21787 * class.cs: Catch 169 as well.
21789 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
21792 2002-01-18 Nick Drochak <ndrochak@gol.com>
21794 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
21796 2002-01-17 Miguel de Icaza <miguel@ximian.com>
21798 * interface.cs: (PopulateMethod): Check for pointers being defined
21799 only if the unsafe context is active.
21800 (PopulateProperty): ditto.
21801 (PopulateIndexer): ditto.
21803 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
21804 specified. If pointers are present, make sure that they are
21805 present in an unsafe context.
21806 (Constructor, Constructor.Define): ditto.
21807 (Field, Field.Define): ditto.
21808 (Property, Property.Define): ditto.
21809 (Event, Event.Define): ditto.
21811 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
21812 hashtable if there are classes or structs defined.
21814 * expression.cs (LocalVariableReference.DoResolve): Simplify this
21815 code, as the constant resolution moved.
21817 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
21818 the metadata, so we can flag error 133.
21820 * decl.cs (MemberCore.UnsafeOK): New function to test that a
21821 pointer is being declared in an unsafe context.
21823 2002-01-16 Miguel de Icaza <miguel@ximian.com>
21825 * modifiers.cs (Modifiers.Check): Require a Location argument.
21826 Report error 227 for Unsafe use.
21828 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
21830 * statement.cs (For.Emit): If the test is null, then report that
21831 we do `return', as we wont reach anything afterwards.
21833 (Switch.SwitchGoverningType): Track the expression that matched
21836 * driver.cs: Allow negative numbers as an error code to flag.
21838 * cs-parser.jay: Handle 1551.
21840 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
21842 2002-01-15 Miguel de Icaza <miguel@ximian.com>
21844 * cs-parser.jay: Report 1518 (type declaration can only contain
21845 class, struct, interface, enum or delegate)
21847 (switch_label): Report 1523 (keywords `case' or `default' must
21850 (opt_switch_sections): Report 1522 (empty switch)
21852 * driver.cs: Report 1515 (response file specified multiple times)
21853 Report 1516 (Source file specified multiple times).
21855 * expression.cs (Argument.Resolve): Signal 1510
21857 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
21858 access not allowed in static code)
21860 2002-01-11 Ravi Pratap <ravi@ximian.com>
21862 * typemanager.cs (IsPointerType): Utility method which we are going
21865 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
21866 the object type, so we take care of that.
21868 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
21870 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
21871 added to non-params parameters :-)
21873 * typemanager.cs (CSharpName): Include 'void' type too.
21875 (void_ptr_type): Include in the set of core types.
21877 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
21880 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
21883 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
21884 completely forgotten about it.
21886 2002-01-10 Ravi Pratap <ravi@ximian.com>
21888 * cs-parser.jay (pointer_type): Add. This begins our implementation
21889 of parsing rules for unsafe code.
21891 (unsafe_statement): Implement.
21893 (embedded_statement): Modify to include the above.
21895 * statement.cs (Unsafe): Implement new class for unsafe blocks.
21897 * codegen.cs (EmitContext.InUnsafe): Add. This determines
21898 if the current context is an unsafe one.
21900 * cs-parser.jay (local_variable_pointer_type): Since local variable types
21901 are handled differently, we need separate rules for them.
21903 (local_variable_declaration): Update to use local_variable_pointer_type
21904 to allow variable declarations of unmanaged pointer types.
21906 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
21907 in unsafe contexts.
21909 * ../errors/cs0214.cs : Add.
21911 2002-01-16 Nick Drochak <ndrochak@gol.com>
21913 * makefile: remove 'response' file when cleaning.
21915 2002-01-15 Miguel de Icaza <miguel@ximian.com>
21917 * cs-parser.jay: Report 1524.
21919 2002-01-14 Miguel de Icaza <miguel@ximian.com>
21921 * typemanager.cs (RegisterMethod): drop checking if we have
21922 registered this from here
21924 2002-01-12 Miguel de Icaza <miguel@ximian.com>
21926 * class.cs (Method.EmitDestructor): Implement calling our base
21929 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
21930 value of InFinally.
21932 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
21933 this routine and will wrap the call in a try/catch block. Deal
21936 2002-01-11 Miguel de Icaza <miguel@ximian.com>
21938 * ecore.cs (Expression.MemberLookup): instead of taking a
21939 parameter `same_type' that was used to tell whether we could
21940 access private members we compute our containing type from the
21943 (FieldExpr): Added partial support for volatile fields. This does
21944 not work for volatile fields exposed from assemblies, as I can not
21945 figure out how to extract the modreq from it.
21947 Updated all the source files to use this.
21949 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
21950 because it is referenced by MemberLookup very often.
21952 2002-01-09 Ravi Pratap <ravi@ximian.com>
21954 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
21955 TypeBuilder.GetCustomAttributes to retrieve what we need.
21957 Get rid of redundant default_member_attr_type as this is the same as
21958 default_member_type which already exists.
21960 * interface.cs, attribute.cs : Update accordingly.
21962 2002-01-08 Miguel de Icaza <miguel@ximian.com>
21964 * typemanager.cs: Enable IndexerPropertyName again. It does not
21965 work for TYpeBuilders though. Ravi, can you please fix this?
21967 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
21969 * expression.cs (Argument.Emit): Handle the case of ref objects
21970 being passed to ref functions;
21972 (ParameterReference.EmitLoad): Loads the content of the pointer
21973 without dereferencing.
21975 2002-01-07 Miguel de Icaza <miguel@ximian.com>
21977 * cs-tokenizer.cs: Implemented the pre-processing expressions.
21979 2002-01-08 Ravi Pratap <ravi@ximian.com>
21981 * class.cs (Indexer.DefineMethod): Incorporate the interface
21982 type in the name of the method if we are doing explicit interface
21985 * expression.cs (ConversionExists): Remove as it is completely obsolete.
21987 (BetterConversion): Fix extremely trivial bug where we were referring to
21988 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
21991 * ../errors/bug16.cs : Add although we have fixed it.
21993 2002-01-07 Miguel de Icaza <miguel@ximian.com>
21995 * expression.cs (BaseIndexer): Begin implementation.
21997 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
21999 * cs-parser.jay (indexer_declarator): Use qualified_identifier
22000 production directly to remove a shift/reduce, and implement
22001 explicit interface implementation.
22003 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
22004 after a floating point suffix.
22006 * expression.cs (DoNumericPromotions): Improved the conversion for
22007 uint/uint. If we have a constant, we avoid doing a typecast to a
22010 * class.cs (Indexer): Implement explicit interface implementation
22013 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
22015 * class.cs: make the default instance constructor public and hidebysig.
22017 2001-01-03 Ravi Pratap <ravi@ximian.com>
22019 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
22020 so we can call it from elsewhere.
22022 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
22023 we emit it internally if the class has a defined indexer; otherwise the user
22024 emits it by decorating the class definition with the DefaultMemberAttribute.
22026 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
22027 attribute is not used on a type which defines an indexer.
22029 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
22030 character when we skip whitespace.
22032 * ../errors/cs0646.cs : Add.
22034 2002-01-03 Miguel de Icaza <miguel@ximian.com>
22036 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
22039 * makefile: Add practical target `mcs3.exe' which builds the third
22040 generation compiler.
22042 * expression.cs (New): Fix structures constructor calling.
22044 * class.cs (Property, Method, Indexer): Emit Final flag on the
22045 method if we are an interface implementation and we are not
22048 * ecore.cs (PropertyExpr): New public field `IsBase', tells
22049 whether this property is referencing a `base' method.
22051 * expression.cs (Invocation.EmitCall): take an extra argument:
22052 is_base, this is used to determine whether the `call' or
22053 `callvirt' opcode should be used.
22056 * delegate.cs: update EmitCall.
22058 * class.cs (Method.Define): Set NewSlot for the cases where we are
22059 not implementing an interface method.
22061 (Property.Define): ditto.
22063 2002-01-02 Miguel de Icaza <miguel@ximian.com>
22065 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
22066 'r'. Allows mcs to parse itself fully.
22068 2002-01-02 Ravi Pratap <ravi@ximian.com>
22070 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
22071 of the number of initializers that require the InitializeArray method.
22073 (CheckIndices): Store the Expression in all cases - not the plain value. Also
22074 update the above field where necessary.
22076 (MakeByteBlob): Update accordingly.
22078 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
22081 (EmitDynamicInitializers): Update in accordance with the new optimization.
22083 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
22084 same OpCode applies.
22086 * cs-parser.jay : Fix some glaring errors I introduced.
22088 2002-01-01 Ravi Pratap <ravi@ximian.com>
22090 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
22091 so that we can check for name clashes there too.
22093 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
22094 for interface indexers.
22096 * interfaces.cs (Define): Emit the default member attribute.
22098 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
22099 variable was being referred to while setting the value ;-)
22101 2002-01-01 Miguel de Icaza <miguel@ximian.com>
22103 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
22104 byte-by-byte information when we know the data is zero.
22106 Make the block always a multiple of 4, because
22107 DefineInitializedData has a bug.
22109 * assign.cs: Fix, we should assign from the temporary, not from
22112 * expression.cs (MakeByteBlob): Fix my incorrect code.
22114 2001-12-31 Miguel de Icaza <miguel@ximian.com>
22116 * typemanager.cs (EnumToUnderlying): This function is used to get
22117 the underlying type from an enumeration, because it does not
22120 * constant.cs: Use the I4_S form for values between -128 and 127.
22122 * statement.cs (Block.LookupLabel): Looks up a label.
22123 (Block): Drop support for labeled blocks.
22125 (LabeledStatement): New kind of statement that represents a label
22128 (Goto): Finally implement this bad boy.
22130 * cs-parser.jay: Update to reflect new mechanism to implement
22133 2001-12-30 Miguel de Icaza <miguel@ximian.com>
22135 * codegen.cs (EmitContext.This): a codegen property that keeps the
22136 a single instance of this instead of creating many different this
22139 * delegate.cs (Delegate.DoResolve): Update to use the property;
22141 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
22143 * expression.cs (BaseAccess.DoResolve): Ditto.
22145 2001-12-29 Ravi Pratap <ravi@ximian.com>
22147 * typemanager.cs (methodimpl_attr_type): Add to hold the type
22148 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
22150 (InitCoreTypes): Update accordingly.
22152 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
22153 so we can quickly store the state.
22155 (ApplyAttributes): Set the correct implementation flags
22156 for InternalCall methods.
22158 2001-12-29 Miguel de Icaza <miguel@ximian.com>
22160 * expression.cs (EmitCall): if a method is not virtual, then do
22161 not use callvirt on it.
22163 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
22164 user defined stuff) requires the use of stobj, which takes an
22165 address on the stack instead of an array and an index. So emit
22166 the Ldelema operation for it.
22168 (EmitStoreOpcode): Use stobj for valuetypes.
22170 (UnaryMutator.EmitCode): Use the right 1 value depending on
22171 whether we are dealing with int64/uint64, float or doubles.
22173 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
22174 constructors that I implemented last night.
22176 (Constructor.IsDefault): Fix to work properly for static
22179 * cs-parser.jay (CheckDef): report method signature errors.
22180 Update error number 103 to be 132.
22182 * decl.cs: New AdditionResult enumeration value: MethodExists.
22183 Although we do this check for methods later on in the semantic
22184 analysis, catching repeated default constructors is so easy that
22185 we catch these here.
22187 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
22190 (ParameterReference.EmitAssign, Emit): handle
22193 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
22194 (ArrayAccess.EmitStoreOpcode): ditto.
22196 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
22198 * expression.cs (MakeByteBlob): Complete all the missing types
22199 (uint, short, ushort, byte, sbyte)
22201 * class.cs: Only init instance field initializers on instance
22204 Rename `constructors' to instance_constructors.
22206 (TypeContainer.AddConstructor): Only add constructors to the list
22207 if it is not static.
22209 Make sure that we handle default_static_constructor independently
22210 everywhere where we handle instance_constructors
22212 2001-12-28 Miguel de Icaza <miguel@ximian.com>
22214 * class.cs: Do not lookup or create a base initializer for a
22215 static constructor.
22217 (ConstructorInitializer.Resolve): use the proper type to lookup
22220 * cs-parser.jay: Report error 1585 (modifiers between type and name).
22222 * enum.cs, interface.cs: Remove CloseType, this is taken care by
22225 * decl.cs: CloseType is now an virtual method, the default
22226 implementation just closes this type.
22228 2001-12-28 Ravi Pratap <ravi@ximian.com>
22230 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
22231 to PreserveSig by default. Also emit HideBySig on such methods.
22233 Basically, set the defaults to standard values.
22235 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
22236 argument, if candidate is better, it can't be worse than the best !
22238 (Invocation): Re-write bits to differentiate between methods being
22239 applicable in their expanded form and their normal form - for params
22242 Get rid of use_standard everywhere as only standard conversions are allowed
22243 in overload resolution.
22245 More spec conformance.
22247 2001-12-27 Miguel de Icaza <miguel@ximian.com>
22249 * driver.cs: Add --timestamp, to see where the compiler spends
22252 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
22253 `this' in static code.
22255 (SimpleName.DoResolve): Implement in terms of a helper function
22256 that allows static-references to be passed upstream to
22259 (Expression.ResolveWithSimpleName): Resolve specially simple
22260 names when called by MemberAccess to implement the special
22263 (Expression.ImplicitReferenceConversion): Handle conversions from
22264 Null to reference types before others, as Null's type is
22267 * expression.cs (Invocation.EmitCall): Handle the special case of
22268 calling methods declared on a reference type from a ValueType
22269 (Base classes System.Object and System.Enum)
22271 (MemberAccess.Resolve): Only perform lookups on Enumerations if
22272 the left hand side is a TypeExpr, not on every enumeration.
22274 (Binary.Resolve): If types are reference types, then do a cast to
22275 object on operators != and == of both arguments.
22277 * typemanager.cs (FindMembers): Extract instance and static
22278 members if requested.
22280 * interface.cs (PopulateProperty): Use void_type instead of null
22281 as the return type for the setter method.
22283 (PopulateIndexer): ditto.
22285 2001-12-27 Ravi Pratap <ravi@ximian.com>
22287 * support.cs (ReflectionParameters): Fix minor bug where we
22288 were examining the wrong parameter for the ParamArray attribute.
22290 Cope with requests for the type of the parameter at position
22291 greater than the params parameter's. We now return the element
22292 type of the params array as that makes more sense.
22294 * expression.cs (Invocation.IsParamsMethodApplicable): Update
22295 accordingly as we no longer have to extract the element type
22298 (Invocation.OverloadResolve): Update.
22300 2001-12-27 Miguel de Icaza <miguel@ximian.com>
22302 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
22303 against IEnumerator, test whether the return value is a descendant
22304 of the IEnumerator interface.
22306 * class.cs (Indexer.Define): Use an auxiliary method to implement
22307 the other bits of the method definition. Begin support for
22308 explicit interface implementation.
22310 (Property.DefineMethod): Use TypeManager.void_type instead of null
22311 for an empty return value.
22313 2001-12-26 Miguel de Icaza <miguel@ximian.com>
22315 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
22316 dealing with a FieldExpr which is composed of a FieldBuilder, in
22317 the code path we did extract the constant, but we should have
22318 obtained the underlying value to be able to cast it (otherwise we
22319 end up in an infinite loop, this is what Ravi was running into).
22321 (ArrayCreation.UpdateIndices): Arrays might be empty.
22323 (MemberAccess.ResolveMemberAccess): Add support for section
22324 14.5.4.1 that deals with the special case of E.I when E is a type
22325 and something else, that I can be a reference to a static member.
22327 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
22328 handle a particular array type to create byte blobs, it is just
22329 something we dont generate byteblobs for.
22331 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
22334 * location.cs (Push): remove the key from the hashtable that we
22335 are about to add. This happens for empty files.
22337 * driver.cs: Dispose files after we have parsed them.
22339 (tokenize): new function that only runs the tokenizer on its
22340 input, for speed testing.
22342 2001-12-26 Ravi Pratap <ravi@ximian.com>
22344 * class.cs (Event.Define): Define the private field only if there
22345 are no accessors defined.
22347 * expression.cs (ResolveMemberAccess): If there is no associated
22348 field with the event, that means we have an event defined with its
22349 own accessors and we should flag error cs0070 since transforming
22350 ourselves into a field is not valid in that case.
22352 * ecore.cs (SimpleName.DoResolve): Same as above.
22354 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
22355 and charset to sane values.
22357 2001-12-25 Ravi Pratap <ravi@ximian.com>
22359 * assign.cs (DoResolve): Perform check on events only if they
22360 are being accessed outside the declaring type.
22362 * cs-parser.jay (event_declarations): Update rules to correctly
22363 set the type of the implicit parameter etc.
22365 (add_accessor, remove_accessor): Set current local parameters.
22367 * expression.cs (Binary): For delegate addition and subtraction,
22368 cast the return value from the method into the appropriate delegate
22371 2001-12-24 Ravi Pratap <ravi@ximian.com>
22373 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
22374 of these as the workaround is unnecessary.
22376 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
22377 delegate data - none of that is needed at all.
22379 Re-write bits to extract the instance expression and the delegate method
22382 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
22385 * attribute.cs (ApplyAttributes): New method to take care of common tasks
22386 of attaching attributes instead of duplicating code everywhere.
22388 * everywhere : Update code to do attribute emission using the above method.
22390 2001-12-23 Miguel de Icaza <miguel@ximian.com>
22392 * expression.cs (IsParamsMethodApplicable): if there are not
22393 parameters, return immediately.
22395 * ecore.cs: The 0 literal can be implicity converted to an enum
22398 (SimpleName.DoResolve): First lookup the type, then lookup the
22401 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
22402 want to get its address. If the InstanceExpression is not
22403 addressable, store the result in a temporary variable, then get
22406 * codegen.cs: Only display 219 errors on warning level or above.
22408 * expression.cs (ArrayAccess): Make it implement the
22409 IMemoryLocation interface.
22411 (Binary.DoResolve): handle the operator == (object a, object b)
22412 and operator != (object a, object b) without incurring into a
22413 BoxedCast (because 5 != o should never be performed).
22415 Handle binary enumerator operators.
22417 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
22418 value type, otherwise use Ldelem_ref.
22420 Use precomputed names;
22422 (AddressOf): Implement address of
22424 * cs-parser.jay (labeled_statement): Fix recursive block
22425 addition by reworking the production.
22427 * expression.cs (New.DoEmit): New has a special case:
22429 If we are dealing with a ValueType, we have a few
22430 situations to deal with:
22432 * The target of New is a ValueType variable, that is
22433 easy, we just pass this as the variable reference
22435 * The target of New is being passed as an argument,
22436 to a boxing operation or a function that takes a
22439 In this case, we need to create a temporary variable
22440 that is the argument of New.
22443 2001-12-23 Ravi Pratap <ravi@ximian.com>
22445 * rootcontext.cs (LookupType): Check that current_type is not null before
22446 going about looking at nested types.
22448 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
22449 not implement the IAssignMethod interface any more.
22451 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
22452 where we tranform them into FieldExprs if they are being resolved from within
22453 the declaring type.
22455 * ecore.cs (SimpleName.DoResolve): Do the same here.
22457 * assign.cs (DoResolve, Emit): Clean up code considerably.
22459 * ../errors/bug10.cs : Add.
22461 * ../errors/cs0070.cs : Add.
22463 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
22465 * assign.cs : Get rid of EventIsLocal everywhere.
22467 2001-12-23 Miguel de Icaza <miguel@ximian.com>
22469 * ecore.cs (ConvertIntLiteral): finished the implementation.
22471 * statement.cs (SwitchLabel): Convert the value we are using as a
22472 key before looking up the table.
22474 2001-12-22 Miguel de Icaza <miguel@ximian.com>
22476 * codegen.cs (EmitTopBlock): Require a Location argument now.
22478 * cs-parser.jay (constructor_declarator): We need to setup
22479 current_local_parameters before we parse the
22480 opt_constructor_initializer, to allow the variables to be bound
22481 to the constructor arguments.
22483 * rootcontext.cs (LookupType): First lookup nested classes in our
22484 class and our parents before we go looking outside our class.
22486 * expression.cs (ConstantFold): Extract/debox the values at the
22489 * rootcontext.cs (EmitCode): Resolve the constants first before we
22490 resolve the types. This is not really needed, but it helps debugging.
22492 * statement.cs: report location.
22494 * cs-parser.jay: pass location to throw statement.
22496 * driver.cs: Small bug fix.
22498 * report.cs: Updated format to be 4-zero filled digits.
22500 2001-12-22 Ravi Pratap <ravi@ximian.com>
22502 * expression.cs (CheckIndices): Fix minor bug where the wrong
22503 variable was being referred to ;-)
22505 (DoEmit): Do not call EmitStaticInitializers when the
22506 underlying type is System.Object.
22508 2001-12-21 Ravi Pratap <ravi@ximian.com>
22510 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
22511 and do the usual workaround for SRE.
22513 * class.cs (MyEventBuilder.EventType): New member to get at the type
22514 of the event, quickly.
22516 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
22518 * assign.cs (Assign.DoResolve): Handle the case when the target
22519 is an EventExpr and perform the necessary checks.
22521 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
22524 (SimpleName.MemberStaticCheck): Include check for EventExpr.
22526 (EventExpr): Set the type in the constructor itself since we
22527 are meant to be born fully resolved.
22529 (EventExpr.Define): Revert code I wrote earlier.
22531 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
22532 instance expression is null. The instance expression is a This in that case
22533 or a null, depending on whether it is a static method or not.
22535 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
22536 refers to more than one method.
22538 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
22539 and accordingly flag errors.
22541 2001-12-21 Miguel de Icaza <miguel@ximian.com>
22543 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
22545 2001-12-22 Miguel de Icaza <miguel@ximian.com>
22547 * location.cs (ToString): Provide useful rutine.
22549 2001-12-21 Miguel de Icaza <miguel@ximian.com>
22551 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
22552 objects, return the actual integral boxed.
22554 * statement.cs (SwitchLabel): define an ILLabel for each
22557 (Switch.CheckSwitch): If the value is a Literal, extract
22558 the underlying literal.
22560 Also in the unused hashtable we had, add the SwitchLabel so we can
22561 quickly look this value up.
22563 * constant.cs: Implement a bunch of new constants. Rewrite
22564 Literal based on this. Made changes everywhere to adapt to this.
22566 * expression.cs (Expression.MakeByteBlob): Optimize routine by
22567 dereferencing array only once, and also copes with enumrations.
22569 bytes are two bytes wide, not one.
22571 (Cast): Perform constant conversions.
22573 * ecore.cs (TryImplicitIntConversion): Return literals instead of
22574 wrappers to the literals here.
22576 * expression.cs (DoNumericPromotions): long literals can converted
22577 to ulong implicity (this is taken care of elsewhere, but I was
22578 missing this spot).
22580 * ecore.cs (Expression.Literalize): Make the return type Literal,
22581 to improve type checking.
22583 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
22585 2001-12-20 Miguel de Icaza <miguel@ximian.com>
22587 * literal.cs: Revert code from ravi that checked the bounds. The
22588 bounds are sane by the definition of the type itself.
22590 * typemanager.cs: Fix implementation of ImplementsInterface. We
22591 need to actually look up in our parent hierarchy for interfaces
22594 * const.cs: Use the underlying type for enumerations
22596 * delegate.cs: Compute the basename for the delegate creation,
22597 that should fix the delegate test case, and restore the correct
22598 Type Lookup semantics in rootcontext
22600 * rootcontext.cs: Revert Ravi's last patch. The correct way of
22601 referencing a nested type with the Reflection API is using the "+"
22604 * cs-parser.jay: Do not require EOF token at the end.
22606 2001-12-20 Ravi Pratap <ravi@ximian.com>
22608 * rootcontext.cs (LookupType): Concatenate type names with
22609 a '.' instead of a '+' The test suite passes again.
22611 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
22612 field of the enumeration.
22614 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
22615 the case when the member is an EventExpr.
22617 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
22618 static has an associated instance expression.
22620 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
22622 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
22624 * class.cs (Event.Define): Register event and perform appropriate checks
22627 We define the Add and Remove methods even if the use provides none because
22628 in that case, we provide default implementations ourselves.
22630 Define a private field of the type of the event. This is done by the CSC compiler
22631 and we should be doing it too ;-)
22633 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
22634 More methods we use in code we generate.
22636 (multicast_delegate_type, delegate_type): Two separate types since the distinction
22639 (InitCoreTypes): Update accordingly for the above.
22641 * class.cs (Event.Emit): Generate code for default accessors that we provide
22643 (EmitDefaultMethod): Do the job in the above.
22645 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
22648 2001-12-20 Miguel de Icaza <miguel@ximian.com>
22650 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
22651 builders even if we were missing one.
22653 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
22654 pass the Basename as our class name instead of the Name. The
22655 basename will be correctly composed for us.
22657 * parameter.cs (Paramters): Now takes a Location argument.
22659 * decl.cs (DeclSpace.LookupType): Removed convenience function and
22660 make all the code call directly LookupType in RootContext and take
22661 this chance to pass the Location information everywhere.
22663 * Everywhere: pass Location information.
22665 2001-12-19 Miguel de Icaza <miguel@ximian.com>
22667 * class.cs (Constructor.Define): Updated way of detecting the
22668 length of the parameters.
22670 (TypeContainer.DefineType): Use basename as the type name for
22673 (TypeContainer.Define): Do not recursively define types here, as
22674 definition is taken care in order by the RootContext.
22676 * tree.cs: Keep track of namespaces in a per-file basis.
22678 * parameter.cs (Parameter.ComputeSignature): Update to use
22681 (Parameters.GetSignature): ditto.
22683 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
22684 instead of a TypeContainer.
22686 (Interface.SemanticAnalysis): Use `this' instead of our parent to
22687 resolve names. Because we need to be resolve in our context, not
22690 * driver.cs: Implement response files.
22692 * class.cs (TypeContainer.DefineType): If we are defined, do not
22693 redefine ourselves.
22695 (Event.Emit): Emit the code for add/remove handlers.
22696 (Event.Define): Save the MethodBuilders for add/remove.
22698 * typemanager.cs: Use pair here too.
22700 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
22701 DictionaryEntry requires the first argument to be non-null.
22703 (enum_declaration): Compute full name for registering the
22706 (delegate_declaration): Instead of using
22707 formal_parameter_list, use opt_formal_parameter_list as the list
22710 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
22711 (EventParsing): New property that controls whether `add' and
22712 `remove' are returned as tokens or identifiers (for events);
22714 2001-12-19 Ravi Pratap <ravi@ximian.com>
22716 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
22717 use MyEventBuilder only and let it wrap the real builder for us.
22719 (MyEventBuilder): Revamp constructor etc.
22721 Implement all operations that we perform on EventBuilder in precisely the same
22724 (FindMembers): Update to use the EventBuilder member.
22726 (Event.Emit): Update accordingly.
22728 2001-12-18 Ravi Pratap <ravi@ximian.com>
22730 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
22731 by calling the appropriate methods.
22733 (GetCustomAttributes): Make stubs as they cannot possibly do anything
22736 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
22738 2001-12-17 Ravi Pratap <ravi@ximian.com>
22740 * delegate.cs (Delegate.Populate): Check that the return type
22741 and various parameters types are indeed accessible.
22743 * class.cs (Constructor.Define): Same here.
22745 (Field.Define): Ditto.
22747 (Event.Define): Ditto.
22749 (Operator.Define): Check that the underlying Method defined itself
22750 correctly - so it's MethodBuilder should not be null.
22752 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
22753 expression happens to be null.
22755 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
22756 members but as of now we don't seem to be able to do anything really useful with it.
22758 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
22759 not the EventBuilder.
22761 2001-12-18 Miguel de Icaza <miguel@ximian.com>
22763 * cs-tokenizer.cs: Add support for defines.
22764 Add support for #if, #elif, #else, #endif
22766 (eval_var): evaluates a variable.
22767 (eval): stubbed for evaluating functions.
22769 * cs-parser.jay: Pass the defines information
22771 * driver.cs: Add --define command line option.
22773 * decl.cs: Move MemberCore here.
22775 Make it the base class for DeclSpace. This allows us to catch and
22776 report 108 and 109 for everything now.
22778 * class.cs (TypeContainer.Define): Extract all the members
22779 before populating and emit the warning 108 (new keyword required
22780 to override) instead of having each member implement this.
22782 (MemberCore.Define): New abstract method, we will be using this in
22783 the warning reporting engine in Populate.
22785 (Operator.Define): Adjust to new MemberCore protocol.
22787 * const.cs (Const): This does not derive from Expression, it is a
22788 temporary object we use to create fields, it is a MemberCore.
22790 * class.cs (Method.Define): Allow the entry point to be in a
22793 * driver.cs: Rewrite the argument handler to clean it up a bit.
22795 * rootcontext.cs: Made it just an auxiliary namespace feature by
22796 making everything static.
22798 * driver.cs: Adapt code to use RootContext type name instead of
22801 * delegate.cs: Remove RootContext argument.
22803 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
22806 * class.cs (Event.Define): The lookup can fail.
22808 * cs-tokenizer.cs: Begin implementation of pre-procesor.
22810 * expression.cs: Resolve the this instance before invoking the code.
22812 2001-12-17 Miguel de Icaza <miguel@ximian.com>
22814 * cs-parser.jay: Add a production in element_access that allows
22815 the thing to become a "type" reference. This way we can parse
22816 things like "(string [])" as a type.
22818 Note that this still does not handle the more complex rules of
22822 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
22824 * ecore.cs: (CopyNewMethods): new utility function used to
22825 assemble the list of methods from running FindMembers.
22827 (MemberLookup): Rework FindMembers so that
22829 2001-12-16 Miguel de Icaza <miguel@ximian.com>
22831 * class.cs (TypeContainer): Remove Delegates who fail to be
22834 * delegate.cs (Populate): Verify that we dont get null return
22835 values. TODO: Check for AsAccessible.
22837 * cs-parser.jay: Use basename to emit error 574 (destructor should
22838 have the same name as container class), not the full name.
22840 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
22841 possible representation.
22843 Also implements integer type suffixes U and L.
22845 2001-12-15 Miguel de Icaza <miguel@ximian.com>
22847 * expression.cs (ArrayCreation.DoResolve): We need to do the
22848 argument resolution *always*.
22850 * decl.cs: Make this hold the namespace. Hold the root context as
22852 (LookupType): Move here.
22854 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
22856 * location.cs (Row, Name): Fixed the code, it was always returning
22857 references to the first file.
22859 * interface.cs: Register properties defined through interfaces.
22861 * driver.cs: Add support for globbing on the command line
22863 * class.cs (Field): Make it derive from MemberCore as well.
22866 2001-12-15 Ravi Pratap <ravi@ximian.com>
22868 * class.cs (Event::Define): Check that the type of the event is a delegate
22869 type else flag error #66.
22871 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
22874 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
22875 values of EntryPoint, CharSet etc etc.
22877 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
22879 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
22880 be null and we should ignore this. I am not sure if this is really clean. Apparently,
22881 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
22882 which needs this to do its work.
22884 * ../errors/cs0066.cs : Add.
22886 2001-12-14 Miguel de Icaza <miguel@ximian.com>
22888 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
22891 * class.cs: (MethodSignature.MethodSignature): Removed hack that
22892 clears out the parameters field.
22893 (MemberSignatureCompare): Cleanup
22895 (MemberCore): New base class used to share code between MethodCore
22898 (RegisterRequiredImplementations) BindingFlags.Public requires
22899 either BindingFlags.Instace or Static. Use instance here.
22901 (Property): Refactored code to cope better with the full spec.
22903 * parameter.cs (GetParameterInfo): Return an empty array instead
22906 * class.cs (Property): Abstract or extern properties have no bodies.
22908 * parameter.cs (GetParameterInfo): return a zero-sized array.
22910 * class.cs (TypeContainer.MethodModifiersValid): Move all the
22911 method modifier validation to the typecontainer so we can reuse
22912 this on properties.
22914 (MethodCore.ParameterTypes): return an empty sized array of types.
22916 (Property.Define): Test property modifier validity.
22918 Add tests for sealed/override too.
22920 (Method.Emit): abstract or extern methods have no bodies.
22922 2001-12-14 Ravi Pratap <ravi@ximian.com>
22924 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
22927 (Method::Define, ::Emit): Modify accordingly.
22929 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
22931 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
22933 * makefile: Pass in /unsafe.
22935 2001-12-13 Miguel de Icaza <miguel@ximian.com>
22937 * class.cs (MakeKey): Kill routine.
22939 * class.cs (TypeContainer.Define): Correctly define explicit
22940 method implementations (they require the full interface name plus
22943 * typemanager.cs: Deply the PtrHashtable here and stop using the
22944 lame keys. Things work so much better.
22946 This of course broke everyone who depended on `RegisterMethod' to
22947 do the `test for existance' test. This has to be done elsewhere.
22949 * support.cs (PtrHashtable): A hashtable that avoid comparing with
22950 the object stupid Equals method (because, that like fails all over
22951 the place). We still do not use it.
22953 * class.cs (TypeContainer.SetRequiredInterface,
22954 TypeContainer.RequireMethods): Killed these two routines and moved
22955 all the functionality to RegisterRequiredImplementations.
22957 (TypeContainer.RegisterRequiredImplementations): This routine now
22958 registers all the implementations required in an array for the
22959 interfaces and abstract methods. We use an array of structures
22960 which can be computed ahead of time to reduce memory usage and we
22961 also assume that lookups are cheap as most classes will not
22962 implement too many interfaces.
22964 We also avoid creating too many MethodSignatures.
22966 (TypeContainer.IsInterfaceMethod): Update and optionally does not
22967 clear the "pending" bit if we find that there are problems with
22970 (TypeContainer.VerifyPendingMethods): Update to report errors of
22971 methods that look like implementations but are not.
22973 (TypeContainer.Define): Add support for explicit interface method
22976 2001-12-12 Miguel de Icaza <miguel@ximian.com>
22978 * typemanager.cs: Keep track of the parameters here instead of
22979 being a feature of the TypeContainer.
22981 * class.cs: Drop the registration of parameters here, as
22982 InterfaceMethods are also interface declarations.
22984 * delegate.cs: Register methods with the TypeManager not only with
22985 the TypeContainer. This code was buggy.
22987 * interface.cs: Full registation here.
22989 2001-12-11 Miguel de Icaza <miguel@ximian.com>
22991 * expression.cs: Remove reducer for binary expressions, it can not
22994 * const.cs: Put here the code that used to go into constant.cs
22996 * constant.cs: Put here the code for constants, this is a new base
22997 class for Literals.
22999 * literal.cs: Make Literal derive from Constant.
23001 2001-12-09 Miguel de Icaza <miguel@ximian.com>
23003 * statement.cs (Return.Emit): Report error 157 if the user
23004 attempts to return from a finally block.
23006 (Return.Emit): Instead of emitting a return, jump to the end of
23009 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
23010 LocalBuilder to store the result of the function. ReturnLabel is
23011 the target where we jump.
23014 2001-12-09 Radek Doulik <rodo@ximian.com>
23016 * cs-parser.jay: remember alias in current namespace
23018 * ecore.cs (SimpleName::DoResolve): use aliases for types or
23021 * class.cs (LookupAlias): lookup alias in my_namespace
23023 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
23025 (LookupAlias): lookup alias in this and if needed in parent
23028 2001-12-08 Miguel de Icaza <miguel@ximian.com>
23032 * rootcontext.cs: (ModuleBuilder) Made static, first step into
23033 making things static. I need this to avoid passing the
23034 TypeContainer when calling ParameterType.
23036 * support.cs (InternalParameters.ParameterType): Remove ugly hack
23037 that did string manipulation to compute the type and then call
23038 GetType. Use Parameter.ParameterType instead.
23040 * cs-tokenizer.cs: Consume the suffix for floating values.
23042 * expression.cs (ParameterReference): figure out whether this is a
23043 reference parameter or not. Kill an extra variable by computing
23044 the arg_idx during emission.
23046 * parameter.cs (Parameters.GetParameterInfo): New overloaded
23047 function that returns whether a parameter is an out/ref value or not.
23049 (Parameter.ParameterType): The type of the parameter (base,
23050 without ref/out applied).
23052 (Parameter.Resolve): Perform resolution here.
23053 (Parameter.ExternalType): The full type (with ref/out applied).
23055 * statement.cs (Using.Emit, Using.EmitExpression): Implement
23056 support for expressions on the using statement.
23058 2001-12-07 Miguel de Icaza <miguel@ximian.com>
23060 * statement.cs (Using.EmitLocalVariableDecls): Split the
23061 localvariable handling of the using statement.
23063 (Block.EmitMeta): Keep track of variable count across blocks. We
23064 were reusing slots on separate branches of blocks.
23066 (Try.Emit): Emit the general code block, we were not emitting it.
23068 Check the type of the declaration to be an IDisposable or
23069 something that can be implicity converted to it.
23071 Emit conversions if required.
23073 * ecore.cs (EmptyExpression): New utility class.
23074 (Expression.ImplicitConversionExists): New utility function.
23076 2001-12-06 Miguel de Icaza <miguel@ximian.com>
23078 * statement.cs (Using): Implement.
23080 * expression.cs (LocalVariableReference): Support read only variables.
23082 * statement.cs: Remove the explicit emit for the Leave opcode.
23083 (VariableInfo): Add a readonly field.
23085 2001-12-05 Miguel de Icaza <miguel@ximian.com>
23087 * ecore.cs (ConvCast): new class used to encapsulate the various
23088 explicit integer conversions that works in both checked and
23089 unchecked contexts.
23091 (Expression.ConvertNumericExplicit): Use new ConvCast class to
23092 properly generate the overflow opcodes.
23094 2001-12-04 Miguel de Icaza <miguel@ximian.com>
23096 * statement.cs: The correct type for the EmptyExpression is the
23097 element_type, not the variable type. Ravi pointed this out.
23099 2001-12-04 Ravi Pratap <ravi@ximian.com>
23101 * class.cs (Method::Define): Handle PInvoke methods specially
23102 by using DefinePInvokeMethod instead of the usual one.
23104 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
23105 above to do the task of extracting information and defining the method.
23107 2001-12-04 Ravi Pratap <ravi@ximian.com>
23109 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
23110 of the condition for string type.
23112 (Emit): Move that here.
23114 (ArrayCreation::CheckIndices): Keep string literals in their expression
23117 (EmitDynamicInitializers): Handle strings appropriately.
23119 2001-12-04 Miguel de Icaza <miguel@ximian.com>
23121 * codegen.cs (EmitContext): Replace multiple variables with a
23122 single pointer to the current Switch statement.
23124 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
23127 2001-12-03 Miguel de Icaza <miguel@ximian.com>
23131 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
23134 (Foreach.Emit): Foreach on arrays was not setting
23135 up the loop variables (for break/continue).
23137 (GotoCase): Semi-implented.
23139 2001-12-03 Ravi Pratap <ravi@ximian.com>
23141 * attribute.cs (CheckAttribute): Handle system attributes by using
23142 Attribute.GetAttributes to examine information we need.
23144 (GetValidPlaces): Same here.
23146 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
23148 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
23150 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
23152 (Method::Define): Set appropriate flags if we have a DllImport attribute.
23154 (Method::Emit): Handle the case when we are a PInvoke method.
23156 2001-12-03 Miguel de Icaza <miguel@ximian.com>
23158 * expression.cs: Use ResolveWithSimpleName on compound names.
23160 2001-12-02 Ravi Pratap <ravi@ximian.com>
23162 * constant.cs (EmitConstant): Make sure we resolve the associated expression
23163 before trying to reduce it.
23165 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
23167 * constant.cs (LookupConstantValue): Implement.
23169 (EmitConstant): Use the above in emitting the constant.
23171 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
23172 that are user-defined by doing a LookupConstantValue on them.
23174 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
23177 2001-11-29 Miguel de Icaza <miguel@ximian.com>
23179 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
23181 (BaseAccess.DoResolve): Implement.
23183 (MemberAccess.DoResolve): Split this routine into a
23184 ResolveMemberAccess routine that can be used independently
23186 2001-11-28 Miguel de Icaza <miguel@ximian.com>
23188 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
23189 As that share bits of the implementation. Is returns a boolean,
23190 while As returns the Type that is being probed.
23192 2001-12-01 Ravi Pratap <ravi@ximian.com>
23194 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
23195 instead of a Literal - much easier.
23197 (EnumInTransit): Remove - utterly useless :-)
23199 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
23201 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
23203 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
23204 chain when we have no associated expression.
23206 2001-11-30 Ravi Pratap <ravi@ximian.com>
23208 * constant.cs (Define): Use Location while reporting the errror.
23210 Also emit a warning when 'new' is used and there is no inherited
23213 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
23216 (LookupEnumValue): Implement to lookup an enum member's value and define it
23219 (Populate): Re-write accordingly to use the above routine.
23221 2001-11-27 Miguel de Icaza <miguel@ximian.com>
23223 * expression.cs (This): Fix prototype for DoResolveLValue to
23224 override the base class DoResolveLValue.
23226 * cs-parser.cs: Report errors cs574 and cs575 (destructor
23229 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
23230 (we need to load the address of the field here). This fixes
23233 (FieldExpr.DoResolveLValue): Call the DoResolve
23234 function to initialize the Instance expression.
23236 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
23237 correctly the GetEnumerator operation on a value type.
23239 * cs-parser.jay: Add more simple parsing error catches.
23241 * statement.cs (Switch): Add support for string switches.
23242 Handle null specially.
23244 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
23246 2001-11-28 Ravi Pratap <ravi@ximian.com>
23248 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
23250 (declare_local_constant): New helper function.
23252 * statement.cs (AddConstant): Keep a separate record of constants
23254 (IsConstant): Implement to determine if a variable is a constant.
23256 (GetConstantExpression): Implement.
23258 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
23260 * statement.cs (IsVariableDefined): Re-write.
23262 2001-11-27 Ravi Pratap <ravi@ximian.com>
23264 * class.cs (TypeContainer::FindMembers): Look for constants
23265 in the case when we are looking for MemberTypes.Field
23267 * expression.cs (MemberAccess::DoResolve): Check that in the
23268 case we are a FieldExpr and a Literal, we are not being accessed
23269 by an instance reference.
23271 * cs-parser.jay (local_constant_declaration): Implement.
23273 (declaration_statement): Implement for constant declarations.
23275 2001-11-26 Miguel de Icaza <miguel@ximian.com>
23277 * statement.cs (Switch): Catch double defaults.
23279 (Switch): More work on the switch() statement
23280 implementation. It works for integral values now, need to finish
23284 2001-11-24 Miguel de Icaza <miguel@ximian.com>
23286 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
23287 integer literals into other integer literals. To be used by
23290 2001-11-24 Ravi Pratap <ravi@ximian.com>
23292 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
23295 (EmitDynamicInitializers): Cope with the above since we extract data
23296 directly from ArrayData now.
23298 (ExpectInitializers): Keep track of whether initializers are mandatory
23301 (Bounds): Make it a hashtable to prevent the same dimension being
23302 recorded for every element in that dimension.
23304 (EmitDynamicInitializers): Fix bug which prevented the Set array method
23307 Also fix bug which was causing the indices to be emitted in the reverse
23310 2001-11-24 Miguel de Icaza <miguel@ximian.com>
23312 * expression.cs (ArrayCreation): Implement the bits that Ravi left
23313 unfinished. They do not work, because the underlying code is
23316 2001-11-22 Miguel de Icaza <miguel@ximian.com>
23318 * cs-parser.jay: Remove bogus fixme.
23320 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
23321 on Switch statement.
23323 2001-11-23 Ravi Pratap <ravi@ximian.com>
23325 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
23328 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
23329 parameter. Apparently, any expression is allowed.
23331 (ValidateInitializers): Update accordingly.
23333 (CheckIndices): Fix some tricky bugs thanks to recursion.
23335 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
23336 I was being completely brain-dead.
23338 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
23339 and re-write acordingly.
23341 (DelegateInvocation): Re-write accordingly.
23343 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
23345 (MakeByteBlob): Handle types more correctly.
23347 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
23348 initialization from expressions but it is incomplete because I am a complete
23351 2001-11-22 Miguel de Icaza <miguel@ximian.com>
23353 * statement.cs (If.Emit): Fix a bug that generated incorrect code
23354 on If. Basically, we have to return `true' (ie, we do return to
23355 our caller) only if both branches of the if return.
23357 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
23358 short-circuit operators, handle them as short circuit operators.
23360 (Cast.DoResolve): Resolve type.
23361 (Cast.Cast): Take an expression as the target type.
23363 * cs-parser.jay (cast_expression): Remove old hack that only
23364 allowed a limited set of types to be handled. Now we take a
23365 unary_expression and we resolve to a type during semantic
23368 Use the grammar productions from Rhys to handle casts (this is
23369 not complete like Rhys syntax yet, we fail to handle that corner
23370 case that C# has regarding (-x), but we will get there.
23372 2001-11-22 Ravi Pratap <ravi@ximian.com>
23374 * class.cs (EmitFieldInitializer): Take care of the case when we have a
23375 field which is an array type.
23377 * cs-parser.jay (declare_local_variables): Support array initialization too.
23379 * typemanager.cs (MakeKey): Implement.
23381 (everywhere): Use the above appropriately.
23383 * cs-parser.jay (for_statement): Update for array initialization while
23384 declaring variables.
23386 * ecore.cs : The error message was correct, it's the variable's names that
23387 were misleading ;-) Make the code more readable.
23389 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
23390 the correct type etc.
23392 (ConvertExplicit): Handle Enum types by examining the underlying type.
23394 2001-11-21 Ravi Pratap <ravi@ximian.com>
23396 * parameter.cs (GetCallingConvention): Always return
23397 CallingConventions.Standard for now.
23399 2001-11-22 Miguel de Icaza <miguel@ximian.com>
23401 * expression.cs (Binary.ResolveOperator): Update the values of `l'
23402 and `r' after calling DoNumericPromotions.
23404 * ecore.cs: Fix error message (the types were in the wrong order).
23406 * statement.cs (Foreach.ProbeCollectionType): Need to pass
23407 BindingFlags.Instance as well
23409 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
23410 implicit int literal conversion in an empty cast so that we
23411 propagate the right type upstream.
23413 (UnboxCast): new class used to unbox value types.
23414 (Expression.ConvertExplicit): Add explicit type conversions done
23417 (Expression.ImplicitNumericConversion): Oops, forgot to test for
23418 the target type before applying the implicit LongLiterals to ULong
23421 2001-11-21 Miguel de Icaza <miguel@ximian.com>
23423 * cs-parser.jay (for_statement): Reworked the way For works: now
23424 we declare manually any variables that are introduced in
23425 for_initializer to solve the problem of having out-of-band code
23426 emition (that is what got for broken).
23428 (declaration_statement): Perform the actual variable declaration
23429 that used to be done in local_variable_declaration here.
23431 (local_variable_declaration): Do not declare anything, just pass
23432 the information on a DictionaryEntry
23434 2001-11-20 Ravi Pratap <ravi@ximian.com>
23436 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
23437 re-write of the logic to now make it recursive.
23439 (UpdateIndices): Re-write accordingly.
23441 Store element data in a separate ArrayData list in the above methods.
23443 (MakeByteBlob): Implement to dump the array data into a byte array.
23445 2001-11-19 Ravi Pratap <ravi@ximian.com>
23447 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
23450 * constant.cs (Define): Implement.
23452 (EmitConstant): Re-write fully.
23454 Pass in location info.
23456 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
23459 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
23460 DictionaryEntry since we need location info too.
23462 (constant_declaration): Update accordingly.
23464 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
23465 code into another method : UpdateIndices.
23467 2001-11-18 Ravi Pratap <ravi@ximian.com>
23469 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
23470 some type checking etc.
23472 2001-11-17 Ravi Pratap <ravi@ximian.com>
23474 * expression.cs (ArrayCreation::ValidateInitializers): Implement
23475 bits to provide dimension info if the user skips doing that.
23477 Update second constructor to store the rank correctly.
23479 2001-11-16 Ravi Pratap <ravi@ximian.com>
23481 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
23482 and try to implement.
23484 * ../errors/cs0150.cs : Add.
23486 * ../errors/cs0178.cs : Add.
23488 2001-11-16 Miguel de Icaza <miguel@ximian.com>
23490 * statement.cs: Implement foreach on multi-dimensional arrays.
23492 * parameter.cs (Parameters.GetParameterByName): Also lookup the
23493 name of the params argument.
23495 * expression.cs: Use EmitStoreOpcode to get the right opcode while
23496 initializing the array.
23498 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
23499 we can use this elsewhere.
23501 * statement.cs: Finish implementation of foreach for single
23504 * cs-parser.jay: Use an out-of-band stack to pass information
23505 around, I wonder why I need this.
23507 foreach_block: Make the new foreach_block the current_block.
23509 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
23510 function used to return a static Parameters structure. Used for
23511 empty parameters, as those are created very frequently.
23513 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
23515 2001-11-15 Ravi Pratap <ravi@ximian.com>
23517 * interface.cs : Default modifier is private, not public. The
23518 make verify test passes again.
23520 2001-11-15 Ravi Pratap <ravi@ximian.com>
23522 * support.cs (ReflectionParameters): Fix logic to determine
23523 whether the last parameter is a params one. Test 9 passes again.
23525 * delegate.cs (Populate): Register the builders we define with
23526 RegisterParameterForBuilder. Test 19 passes again.
23528 * cs-parser.jay (property_declaration): Reference $6 instead
23529 of $$ to get at the location.
23531 (indexer_declaration): Similar stuff.
23533 (attribute): Ditto.
23535 * class.cs (Property): Register parameters for the Get and Set methods
23536 if they exist. Test 23 passes again.
23538 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
23539 call to EmitArguments as we are sure there aren't any params arguments.
23540 Test 32 passes again.
23542 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
23543 IndexOutOfRangeException.
23545 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
23546 Test 33 now passes again.
23548 2001-11-15 Miguel de Icaza <miguel@ximian.com>
23550 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
23551 broke a bunch of things. Will have to come up with a better way
23552 of tracking locations.
23554 * statement.cs: Implemented foreach for single dimension arrays.
23556 2001-11-09 Miguel de Icaza <miguel@ximian.com>
23558 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
23559 an error. This removes the lookup from the critical path.
23561 * cs-parser.jay: Removed use of temporary_loc, which is completely
23564 2001-11-14 Miguel de Icaza <miguel@ximian.com>
23566 * support.cs (ReflectionParameters.ParameterModifier): Report
23567 whether the argument is a PARAMS argument or not.
23569 * class.cs: Set the attribute `ParamArrayAttribute' on the
23570 parameter argument.
23572 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
23573 and cons_param_array_attribute (ConstructorInfo for
23574 ParamArrayAttribute).,
23576 * codegen.cs: Emit the return using the `Return' statement, that
23577 way we can report the error correctly for missing return values.
23579 * class.cs (Method.Emit): Clean up.
23581 * expression.cs (Argument.Resolve): Take another argument: the
23582 location where this argument is used. Notice that this is not
23583 part of the "Argument" class as to reduce the size of the
23584 structure (we know the approximate location anyways).
23586 Test if the argument is a variable-reference, if not, then
23587 complain with a 206.
23589 (Argument.Emit): Emit addresses of variables.
23591 (Argument.FullDesc): Simplify.
23593 (Invocation.DoResolve): Update for Argument.Resolve.
23595 (ElementAccess.DoResolve): ditto.
23597 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
23598 method should be virtual, as this method is always virtual.
23600 (NewDelegate.DoResolve): Update for Argument.Resolve.
23602 * class.cs (ConstructorInitializer.DoResolve): ditto.
23604 * attribute.cs (Attribute.Resolve): ditto.
23606 2001-11-13 Miguel de Icaza <miguel@ximian.com>
23608 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
23610 * expression.cs (ParameterReference): Drop IStackStorage and implement
23611 IAssignMethod instead.
23613 (LocalVariableReference): ditto.
23615 * ecore.cs (FieldExpr): Drop IStackStorage and implement
23616 IAssignMethod instead.
23618 2001-11-13 Miguel de Icaza <miguel@ximian.com>
23620 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
23621 enumerations that are used in heavily used structures derive from
23622 byte in a laughable and pathetic attempt to reduce memory usage.
23623 This is the kind of pre-optimzations that you should not do at
23624 home without adult supervision.
23626 * expression.cs (UnaryMutator): New class, used to handle ++ and
23627 -- separatedly from the other unary operators. Cleans up the
23628 code, and kills the ExpressionStatement dependency in Unary.
23630 (Unary): Removed `method' and `Arguments' from this class, making
23631 it smaller, and moving it all to SimpleCall, so I can reuse this
23632 code in other locations and avoid creating a lot of transient data
23633 strucutres when not required.
23635 * cs-parser.jay: Adjust for new changes.
23637 2001-11-11 Miguel de Icaza <miguel@ximian.com>
23639 * enum.cs (Enum.Populate): If there is a failure during
23642 * cs-parser.jay (opt_enum_base): we used to catch type errors
23643 here, but this is really incorrect. The type error should be
23644 catched during semantic analysis.
23646 2001-12-11 Ravi Pratap <ravi@ximian.com>
23648 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
23649 current_local_parameters as expected since I, in my stupidity, had forgotten
23652 * attribute.cs (GetValidPlaces): Fix stupid bug.
23654 * class.cs (Method::Emit): Perform check on applicability of attributes.
23656 (Constructor::Emit): Ditto.
23658 (Field::Emit): Ditto.
23660 (Field.Location): Store location information.
23662 (Property, Event, Indexer, Operator): Ditto.
23664 * cs-parser.jay (field_declaration): Pass in location for each field.
23666 * ../errors/cs0592.cs : Add.
23668 2001-11-12 Ravi Pratap <ravi@ximian.com>
23670 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
23672 (InitCoreTypes): Update accordingly.
23674 (RegisterAttrType, LookupAttr): Implement.
23676 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
23677 info about the same.
23679 (Resolve): Update to populate the above as necessary.
23681 (Error592): Helper.
23683 (GetValidPlaces): Helper to the above.
23685 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
23687 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
23689 2001-11-12 Ravi Pratap <ravi@ximian.com>
23691 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
23693 * ../errors/cs0617.cs : Add.
23695 2001-11-11 Ravi Pratap <ravi@ximian.com>
23697 * enum.cs (Emit): Rename to Populate to be more consistent with what
23698 we expect it to do and when exactly it is called.
23700 * class.cs, rootcontext.cs : Update accordingly.
23702 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
23703 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
23705 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
23707 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
23708 of a fieldinfo using the above, when dealing with a FieldBuilder.
23710 2001-11-10 Ravi Pratap <ravi@ximian.com>
23712 * ../errors/cs0031.cs : Add.
23714 * ../errors/cs1008.cs : Add.
23716 * ../errrors/cs0543.cs : Add.
23718 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
23721 (FindMembers): Implement.
23723 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
23724 enums and delegates too.
23726 (enum_types): Rename to builder_to_enum.
23728 (delegate_types): Rename to builder_to_delegate.
23730 * delegate.cs (FindMembers): Implement.
23732 2001-11-09 Ravi Pratap <ravi@ximian.com>
23734 * typemanager.cs (IsEnumType): Implement.
23736 * enum.cs (Emit): Re-write parts to account for the underlying type
23737 better and perform checking etc.
23739 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
23740 of the underlying type.
23742 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
23745 * enum.cs (error31): Helper to report error #31.
23747 * cs-parser.jay (enum_declaration): Store location of each member too.
23749 * enum.cs (member_to_location): New hashtable.
23751 (AddEnumMember): Update location hashtable.
23753 (Emit): Use the location of each member while reporting errors.
23755 2001-11-09 Miguel de Icaza <miguel@ximian.com>
23757 * cs-parser.jay: A for_initializer if is a
23758 local_variable_declaration really ammount to have an implicit
23759 block with the variable declaration and no initializer for for.
23761 * statement.cs (For.Emit): Cope with null initializers.
23763 This fixes the infinite loop on for initializers.
23765 2001-11-08 Miguel de Icaza <miguel@ximian.com>
23767 * enum.cs: More cleanup.
23769 * ecore.cs: Remove dead code.
23771 * class.cs (Property.Emit): More simplification.
23772 (Event.Emit): ditto.
23774 Reworked to have less levels of indentation.
23776 2001-11-08 Ravi Pratap <ravi@ximian.com>
23778 * class.cs (Property): Emit attributes.
23788 * enum.cs (Emit): Ditto.
23790 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
23793 * class.cs (Field, Event, etc.): Move attribute generation into the
23794 Emit method everywhere.
23796 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
23797 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
23798 as we had no way of defining nested enums !
23800 * rootcontext.cs : Adjust code accordingly.
23802 * typemanager.cs (AddEnumType): To keep track of enum types separately.
23804 2001-11-07 Ravi Pratap <ravi@ximian.com>
23806 * expression.cs (EvalConstantExpression): Move into ecore.cs
23808 * enum.cs (Enum): Rename some members and make them public and readonly
23809 according to our convention.
23811 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
23814 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
23816 (Enum::Emit): Write a simple version for now which doesn't try to compute
23817 expressions. I shall modify this to be more robust in just a while.
23819 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
23821 (TypeContainer::CloseType): Create the Enum types too.
23823 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
23825 * expression.cs (EvalConstantExpression): Get rid of completely.
23827 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
23828 user-defined values and other cases.
23830 (IsValidEnumLiteral): Helper function.
23832 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
23833 out there in the case we had a literal FieldExpr.
23835 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
23837 (Literalize): Revamp a bit to take two arguments.
23839 (EnumLiteral): New class which derives from Literal to wrap enum literals.
23841 2001-11-06 Ravi Pratap <ravi@ximian.com>
23843 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
23845 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
23847 (Resolve): Use the above to ensure we have proper initializers.
23849 2001-11-05 Ravi Pratap <ravi@ximian.com>
23851 * expression.cs (Expression::EvalConstantExpression): New method to
23852 evaluate constant expressions.
23854 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
23856 2001-11-07 Miguel de Icaza <miguel@ximian.com>
23858 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
23861 (Binary.ResolveOperator): Handle operator != (object a, object b)
23862 and operator == (object a, object b);
23864 (Binary.DoNumericPromotions): Indicate whether the numeric
23865 promotion was possible.
23867 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
23870 Made the ArrayAccess implement interface IAssignMethod instead of
23871 IStackStore as the order in which arguments are passed reflects
23874 * assign.cs: Instead of using expr.ExprClass to select the way of
23875 assinging, probe for the IStackStore/IAssignMethod interfaces.
23877 * typemanager.cs: Load InitializeArray definition.
23879 * rootcontext.cs (RootContext.MakeStaticData): Used to define
23880 static data that can be used to initialize arrays.
23882 2001-11-05 Miguel de Icaza <miguel@ximian.com>
23884 * expression.cs: Handle operator== and operator!= for booleans.
23886 (Conditioal.Reduce): Implement reducer for the ?: operator.
23888 (Conditional.Resolve): Implement dead code elimination.
23890 (Binary.Resolve): Catch string literals and return a new
23891 concatenated string.
23893 (Unary.Reduce): Implement reduction of unary expressions.
23895 * ecore.cs: Split out the expression core handling here.
23897 (Expression.Reduce): New method used to perform constant folding
23898 and CSE. This is needed to support constant-expressions.
23900 * statement.cs (Statement.EmitBoolExpression): Pass true and false
23901 targets, and optimize for !x.
23903 2001-11-04 Ravi Pratap <ravi@ximian.com>
23905 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
23906 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
23907 set custom atttributes.
23909 * literal.cs (Literal::GetValue): New abstract method to return the actual
23910 value of the literal, cast as an object.
23912 (*Literal): Implement GetValue method.
23914 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
23915 expressions to the arraylist but objects of type Argument.
23917 * class.cs (TypeContainer::Emit): Emit our attributes too.
23919 (Method::Emit, Constructor::Emit): Ditto.
23921 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
23922 to be ignoring earlier.
23924 2001-11-03 Ravi Pratap <ravi@ximian.com>
23926 * attribute.cs (AttributeSection::Define): Implement to do the business
23927 of constructing a CustomAttributeBuilder.
23929 (Attribute): New trivial class. Increases readability of code.
23931 * cs-parser.jay : Update accordingly.
23933 (positional_argument_list, named_argument_list, named_argument): New rules
23935 (attribute_arguments): Use the above so that we are more correct.
23937 2001-11-02 Ravi Pratap <ravi@ximian.com>
23939 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
23940 to perform all checks for a method with a params parameter.
23942 (Invocation::OverloadResolve): Update to use the above method and therefore
23943 cope correctly with params method invocations.
23945 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
23948 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
23949 constructors in our parent too because we can't afford to miss out on
23952 * attribute.cs (AttributeSection): New name for the class Attribute
23954 Other trivial changes to improve readability.
23956 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
23957 use the new class names.
23959 2001-11-01 Ravi Pratap <ravi@ximian.com>
23961 * class.cs (Method::Define): Complete definition for params types too
23963 (Indexer::Define): Ditto.
23965 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
23966 Cope everywhere with a request for info about the array parameter.
23968 2001-11-01 Ravi Pratap <ravi@ximian.com>
23970 * tree.cs (RecordNamespace): Fix up to check for the correct key.
23972 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
23973 local_variable_type to extract the string corresponding to the type.
23975 (local_variable_type): Fixup the action to use the new helper method.
23977 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
23980 * expression.cs : Clean out code which uses the above.
23982 2001-10-31 Ravi Pratap <ravi@ximian.com>
23984 * typemanager.cs (RegisterMethod): Check if we already have an existing key
23985 and bale out if necessary by returning a false.
23987 (RegisterProperty): Ditto.
23989 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
23990 and print out appropriate error messages.
23992 * interface.cs (everywhere): Ditto.
23994 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
23995 location to constructor.
23997 * class.cs (Property, Event, Indexer): Update accordingly.
23999 * ../errors/cs111.cs : Added.
24001 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
24002 of a method, as laid down by the spec.
24004 (Invocation::OverloadResolve): Use the above method.
24006 2001-10-31 Ravi Pratap <ravi@ximian.com>
24008 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
24009 now take a TypeContainer and a Parameters object.
24011 (ParameterData): Modify return type of ParameterModifier method to be
24012 Parameter.Modifier and not a string.
24014 (ReflectionParameters, InternalParameters): Update accordingly.
24016 * expression.cs (Argument::GetParameterModifier): Same here.
24018 * support.cs (InternalParameters::ParameterType): Find a better way of determining
24019 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
24020 symbol in it at all so maybe this is only for now.
24022 2001-10-30 Ravi Pratap <ravi@ximian.com>
24024 * support.cs (InternalParameters): Constructor now takes an extra argument
24025 which is the actual Parameters class.
24027 (ParameterDesc): Update to provide info on ref/out modifiers.
24029 * class.cs (everywhere): Update call to InternalParameters to pass in
24030 the second argument too.
24032 * support.cs (ParameterData): Add ParameterModifier, which is a method
24033 to return the modifier info [ref/out etc]
24035 (InternalParameters, ReflectionParameters): Implement the above.
24037 * expression.cs (Argument::ParameterModifier): Similar function to return
24038 info about the argument's modifiers.
24040 (Invocation::OverloadResolve): Update to take into account matching modifiers
24043 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
24044 a new SetFormalParameters object which we pass to InternalParameters.
24046 2001-10-30 Ravi Pratap <ravi@ximian.com>
24048 * expression.cs (NewArray): Merge into the ArrayCreation class.
24050 2001-10-29 Ravi Pratap <ravi@ximian.com>
24052 * expression.cs (NewArray): Merge classes NewBuiltinArray and
24053 NewUserdefinedArray into one as there wasn't much of a use in having
24056 * expression.cs (Argument): Change field's name to ArgType from Type.
24058 (Type): New readonly property which returns the proper type, taking into
24059 account ref/out modifiers.
24061 (everywhere): Adjust code accordingly for the above.
24063 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
24064 whether we are emitting for a ref or out parameter.
24066 * expression.cs (Argument::Emit): Use the above field to set the state.
24068 (LocalVariableReference::Emit): Update to honour the flag and emit the
24071 * parameter.cs (Attributes): Set the correct flags for ref parameters.
24073 * expression.cs (Argument::FullDesc): New function to provide a full desc.
24075 * support.cs (ParameterData): Add method ParameterDesc to the interface.
24077 (ReflectionParameters, InternalParameters): Implement the above method.
24079 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
24082 (Invocation::FullMethodDesc): Ditto.
24084 2001-10-29 Miguel de Icaza <miguel@ximian.com>
24086 * cs-parser.jay: Add extra production for the second form of array
24089 * expression.cs (ArrayCreation): Update to reflect the above
24092 * Small changes to prepare for Array initialization.
24094 2001-10-28 Miguel de Icaza <miguel@ximian.com>
24096 * typemanager.cs (ImplementsInterface): interface might be null;
24097 Deal with this problem;
24099 Also, we do store negative hits on the cache (null values), so use
24100 this instead of calling t.GetInterfaces on the type everytime.
24102 2001-10-28 Ravi Pratap <ravi@ximian.com>
24104 * typemanager.cs (IsBuiltinType): New method to help determine the same.
24106 * expression.cs (New::DoResolve): Get rid of array creation code and instead
24107 split functionality out into different classes.
24109 (New::FormArrayType): Move into NewBuiltinArray.
24111 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
24114 (NewBuiltinArray): New class to handle creation of built-in arrays.
24116 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
24117 account creation of one-dimensional arrays.
24119 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
24121 (NewUserdefinedArray::DoResolve): Implement.
24123 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
24125 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
24126 we maintain inside the TypeManager. This is necessary to perform lookups on the
24129 (LookupType): Update to perform GetType on the module builders too.
24131 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
24133 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
24135 2001-10-23 Ravi Pratap <ravi@ximian.com>
24137 * expression.cs (New::DoResolve): Implement guts of array creation.
24139 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
24141 2001-10-27 Miguel de Icaza <miguel@ximian.com>
24143 * expression.cs: Fix bug I introduced lsat night that broke
24146 (Expression.Resolve): Report a 246 error (can not resolve name)
24147 if we find a SimpleName in the stream.
24149 (Expression.ResolveLValue): Ditto.
24151 (Expression.ResolveWithSimpleName): This function is a variant of
24152 ResolveName, this one allows SimpleNames to be returned without a
24153 warning. The only consumer of SimpleNames is MemberAccess
24155 2001-10-26 Miguel de Icaza <miguel@ximian.com>
24157 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
24158 might arrive here. I have my doubts that this is correct.
24160 * statement.cs (Lock): Implement lock statement.
24162 * cs-parser.jay: Small fixes to support `lock' and `using'
24164 * cs-tokenizer.cs: Remove extra space
24166 * driver.cs: New flag --checked, allows to turn on integer math
24169 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
24170 Threading.Monitor.Exit
24172 2001-10-23 Miguel de Icaza <miguel@ximian.com>
24174 * expression.cs (IndexerAccess::DoResolveLValue): Set the
24175 Expression Class to be IndexerAccess.
24177 Notice that Indexer::DoResolve sets the eclass to Value.
24179 2001-10-22 Miguel de Icaza <miguel@ximian.com>
24181 * class.cs (TypeContainer::Emit): Emit code for indexers.
24183 * assign.cs (IAssignMethod): New interface implemented by Indexers
24184 and Properties for handling assignment.
24186 (Assign::Emit): Simplify and reuse code.
24188 * expression.cs (IndexerAccess, PropertyExpr): Implement
24189 IAssignMethod, clean up old code.
24191 2001-10-22 Ravi Pratap <ravi@ximian.com>
24193 * typemanager.cs (ImplementsInterface): New method to determine if a type
24194 implements a given interface. Provides a nice cache too.
24196 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
24199 (ConvertReferenceExplicit): Ditto.
24201 * delegate.cs (Delegate::Populate): Update to define the parameters on the
24202 various methods, with correct names etc.
24204 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
24205 Operator.UnaryNegation.
24207 * cs-parser.jay (operator_declarator): Be a little clever in the case where
24208 we have a unary plus or minus operator.
24210 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
24213 * everywhere : update accordingly.
24215 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
24218 * class.cs (Method::Define): For the case where we are implementing a method
24219 inherited from an interface, we need to set the MethodAttributes.Final flag too.
24220 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
24222 2001-10-21 Ravi Pratap <ravi@ximian.com>
24224 * interface.cs (FindMembers): Implement to work around S.R.E
24227 * typemanager.cs (IsInterfaceType): Implement.
24229 (FindMembers): Update to handle interface types too.
24231 * expression.cs (ImplicitReferenceConversion): Re-write bits which
24232 use IsAssignableFrom as that is not correct - it doesn't work.
24234 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
24235 and accordingly override EmitStatement.
24237 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
24238 using the correct logic :-)
24240 2001-10-19 Ravi Pratap <ravi@ximian.com>
24242 * ../errors/cs-11.cs : Add to demonstrate error -11
24244 2001-10-17 Miguel de Icaza <miguel@ximian.com>
24246 * assign.cs (Assign::Resolve): Resolve right hand side first, and
24247 then pass this as a hint to ResolveLValue.
24249 * expression.cs (FieldExpr): Add Location information
24251 (FieldExpr::LValueResolve): Report assignment to readonly
24254 (Expression::ExprClassFromMemberInfo): Pass location information.
24256 (Expression::ResolveLValue): Add new method that resolves an
24259 (Expression::DoResolveLValue): Default invocation calls
24262 (Indexers): New class used to keep track of indexers in a given
24265 (IStackStore): Renamed from LValue, as it did not really describe
24266 what this did. Also ResolveLValue is gone from this interface and
24267 now is part of Expression.
24269 (ElementAccess): Depending on the element access type
24271 * typemanager.cs: Add `indexer_name_type' as a Core type
24272 (System.Runtime.CompilerServices.IndexerNameAttribute)
24274 * statement.cs (Goto): Take a location.
24276 2001-10-18 Ravi Pratap <ravi@ximian.com>
24278 * delegate.cs (Delegate::VerifyDelegate): New method to verify
24279 if two delegates are compatible.
24281 (NewDelegate::DoResolve): Update to take care of the case when
24282 we instantiate a delegate from another delegate.
24284 * typemanager.cs (FindMembers): Don't even try to look up members
24285 of Delegate types for now.
24287 2001-10-18 Ravi Pratap <ravi@ximian.com>
24289 * delegate.cs (NewDelegate): New class to take care of delegate
24292 * expression.cs (New): Split the delegate related code out into
24293 the NewDelegate class.
24295 * delegate.cs (DelegateInvocation): New class to handle delegate
24298 * expression.cs (Invocation): Split out delegate related code into
24299 the DelegateInvocation class.
24301 2001-10-17 Ravi Pratap <ravi@ximian.com>
24303 * expression.cs (New::DoResolve): Implement delegate creation fully
24304 and according to the spec.
24306 (New::DoEmit): Update to handle delegates differently.
24308 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
24309 because of which we were printing out arguments in reverse order !
24311 * delegate.cs (VerifyMethod): Implement to check if the given method
24312 matches the delegate.
24314 (FullDelegateDesc): Implement.
24316 (VerifyApplicability): Implement.
24318 * expression.cs (Invocation::DoResolve): Update to accordingly handle
24319 delegate invocations too.
24321 (Invocation::Emit): Ditto.
24323 * ../errors/cs1593.cs : Added.
24325 * ../errors/cs1594.cs : Added.
24327 * delegate.cs (InstanceExpression, TargetMethod): New properties.
24329 2001-10-16 Ravi Pratap <ravi@ximian.com>
24331 * typemanager.cs (intptr_type): Core type for System.IntPtr
24333 (InitCoreTypes): Update for the same.
24335 (iasyncresult_type, asynccallback_type): Ditto.
24337 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
24340 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
24343 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
24344 the builders for the 4 members of a delegate type :-)
24346 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
24349 * expression.cs (New::DoResolve): Implement guts for delegate creation.
24351 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
24353 2001-10-15 Miguel de Icaza <miguel@ximian.com>
24355 * statement.cs (Break::Emit): Implement.
24356 (Continue::Emit): Implement.
24358 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
24359 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
24360 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
24361 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
24364 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
24365 properties that track the label for the current loop (begin of the
24366 loop and end of the loop).
24368 2001-10-15 Ravi Pratap <ravi@ximian.com>
24370 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
24371 use of emitting anything at all.
24373 * class.cs, rootcontext.cs : Get rid of calls to the same.
24375 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
24377 (Populate): Define the constructor correctly and set the implementation
24380 * typemanager.cs (delegate_types): New hashtable to hold delegates that
24383 (AddDelegateType): Implement.
24385 (IsDelegateType): Implement helper method.
24387 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
24389 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
24390 and accordingly handle it.
24392 * delegate.cs (Populate): Take TypeContainer argument.
24393 Implement bits to define the Invoke method. However, I still haven't figured out
24394 how to take care of the native int bit :-(
24396 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
24397 Qualify the name of the delegate, not its return type !
24399 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
24402 (StandardConversionExists): Checking for array types turns out to be recursive.
24404 (ConvertReferenceExplicit): Implement array conversion.
24406 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
24408 2001-10-12 Ravi Pratap <ravi@ximian.com>
24410 * cs-parser.jay (delegate_declaration): Store the fully qualified
24411 name as it is a type declaration.
24413 * delegate.cs (ReturnType, Name): Rename members to these. Make them
24416 (DefineDelegate): Renamed from Define. Does the same thing essentially,
24417 as TypeContainer::DefineType.
24419 (Populate): Method in which all the definition of the various methods (Invoke)
24422 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
24425 (CloseDelegate): Finally creates the delegate.
24427 * class.cs (TypeContainer::DefineType): Update to define delegates.
24428 (Populate, Emit and CloseType): Do the same thing here too.
24430 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
24431 delegates in all these operations.
24433 2001-10-14 Miguel de Icaza <miguel@ximian.com>
24435 * expression.cs: LocalTemporary: a new expression used to
24436 reference a temporary that has been created.
24438 * assign.cs: Handle PropertyAccess back here, so that we can
24439 provide the proper semantic access to properties.
24441 * expression.cs (Expression::ConvertReferenceExplicit): Implement
24442 a few more explicit conversions.
24444 * modifiers.cs: `NEW' modifier maps to HideBySig.
24446 * expression.cs (PropertyExpr): Make this into an
24447 ExpressionStatement, and support the EmitStatement code path.
24449 Perform get/set error checking, clean up the interface.
24451 * assign.cs: recognize PropertyExprs as targets, and if so, turn
24452 them into toplevel access objects.
24454 2001-10-12 Miguel de Icaza <miguel@ximian.com>
24456 * expression.cs: PropertyExpr::PropertyExpr: use work around the
24459 * typemanager.cs: Keep track here of our PropertyBuilders again to
24460 work around lameness in SRE.
24462 2001-10-11 Miguel de Icaza <miguel@ximian.com>
24464 * expression.cs (LValue::LValueResolve): New method in the
24465 interface, used to perform a second resolution pass for LValues.
24467 (This::DoResolve): Catch the use of this in static methods.
24469 (This::LValueResolve): Implement.
24471 (This::Store): Remove warning, assigning to `this' in structures
24474 (Invocation::Emit): Deal with invocation of
24475 methods on value types. We need to pass the address to structure
24476 methods rather than the object itself. (The equivalent code to
24477 emit "this" for structures leaves the entire structure on the
24478 stack instead of a pointer to it).
24480 (ParameterReference::DoResolve): Compute the real index for the
24481 argument based on whether the method takes or not a `this' pointer
24482 (ie, the method is static).
24484 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
24485 value types returned from functions when we need to invoke a
24486 method on the sturcture.
24489 2001-10-11 Ravi Pratap <ravi@ximian.com>
24491 * class.cs (TypeContainer::DefineType): Method to actually do the business of
24492 defining the type in the Modulebuilder or Typebuilder. This is to take
24493 care of nested types which need to be defined on the TypeBuilder using
24494 DefineNestedMethod.
24496 (TypeContainer::GetClassBases): Implement. Essentially the code from the
24497 methods in RootContext, only ported to be part of TypeContainer.
24499 (TypeContainer::GetInterfaceOrClass): Ditto.
24501 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
24503 * interface.cs (Interface::DefineInterface): New method. Does exactly
24504 what RootContext.CreateInterface did earlier, only it takes care of nested types
24507 (Interface::GetInterfaces): Move from RootContext here and port.
24509 (Interface::GetInterfaceByName): Same here.
24511 * rootcontext.cs (ResolveTree): Re-write.
24513 (PopulateTypes): Re-write.
24515 * class.cs (TypeContainer::Populate): Populate nested types too.
24516 (TypeContainer::Emit): Emit nested members too.
24518 * typemanager.cs (AddUserType): Do not make use of the FullName property,
24519 instead just use the name argument passed in as it is already fully
24522 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
24523 to TypeContainer mapping to see if a type is user-defined.
24525 * class.cs (TypeContainer::CloseType): Implement.
24527 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
24528 the default constructor.
24530 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
24533 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
24535 * interface.cs (CloseType): Create the type here.
24537 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
24540 Remove all the methods which are now in TypeContainer.
24542 2001-10-10 Ravi Pratap <ravi@ximian.com>
24544 * delegate.cs (Define): Re-write bits to define the delegate
24547 2001-10-10 Miguel de Icaza <miguel@ximian.com>
24549 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
24551 * expression.cs (ImplicitReferenceConversion): handle null as well
24552 as a source to convert to any reference type.
24554 * statement.cs (Return): Perform any implicit conversions to
24555 expected return type.
24557 Validate use of return statement.
24559 * codegen.cs (EmitContext): Pass the expected return type here.
24561 * class.cs (Method, Constructor, Property): Pass expected return
24562 type to EmitContext.
24564 2001-10-09 Miguel de Icaza <miguel@ximian.com>
24566 * expression.cs: Make DoResolve take an EmitContext instead of a
24569 Replaced `l' and `location' for `loc', for consistency.
24571 (Error, Warning): Remove unneeded Tc argument.
24573 * assign.cs, literal.cs, constant.cs: Update to new calling
24576 * codegen.cs: EmitContext now contains a flag indicating whether
24577 code is being generated in a static method or not.
24579 * cs-parser.jay: DecomposeQI, new function that replaces the old
24580 QualifiedIdentifier. Now we always decompose the assembled
24581 strings from qualified_identifier productions into a group of
24584 2001-10-08 Miguel de Icaza <miguel@ximian.com>
24586 * rootcontext.cs: Deal with field-less struct types correctly now
24587 by passing the size option to Define Type.
24589 * class.cs: Removed hack that created one static field.
24591 2001-10-07 Miguel de Icaza <miguel@ximian.com>
24593 * statement.cs: Moved most of the code generation here.
24595 2001-10-09 Ravi Pratap <ravi@ximian.com>
24597 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
24600 (ElementAccess): Remove useless bits for now - keep checks as the spec
24603 2001-10-08 Ravi Pratap <ravi@ximian.com>
24605 * expression.cs (ElementAccess::DoResolve): Remove my crap code
24606 and start performing checks according to the spec.
24608 2001-10-07 Ravi Pratap <ravi@ximian.com>
24610 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
24611 rank_specifiers instead.
24613 (rank_specifiers): Change the order in which the rank specifiers are stored
24615 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
24617 * expression.cs (ElementAccess): Implement the LValue interface too.
24619 2001-10-06 Ravi Pratap <ravi@ximian.com>
24621 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
24622 except that user defined conversions are not included.
24624 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
24625 perform the conversion of the return type, if necessary.
24627 (New::DoResolve): Check whether we are creating an array or an object
24628 and accordingly do the needful.
24630 (New::Emit): Same here.
24632 (New::DoResolve): Implement guts of array creation.
24634 (New::FormLookupType): Helper function.
24636 2001-10-07 Miguel de Icaza <miguel@ximian.com>
24638 * codegen.cs: Removed most of the code generation here, and move the
24639 corresponding code generation bits to the statement classes.
24641 Added support for try/catch/finalize and throw.
24643 * cs-parser.jay: Added support for try/catch/finalize.
24645 * class.cs: Catch static methods having the flags override,
24646 virtual or abstract.
24648 * expression.cs (UserCast): This user cast was not really doing
24649 what it was supposed to do. Which is to be born in fully resolved
24650 state. Parts of the resolution were being performed at Emit time!
24654 2001-10-05 Miguel de Icaza <miguel@ximian.com>
24656 * expression.cs: Implicity convert the result from UserCast.
24658 2001-10-05 Ravi Pratap <ravi@ximian.com>
24660 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
24661 prevented it from working correctly.
24663 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
24664 merely ConvertImplicit.
24666 2001-10-05 Miguel de Icaza <miguel@ximian.com>
24668 * typemanager.cs: Make the LookupTypeContainer function static,
24669 and not per-instance.
24671 * class.cs: Make static FindMembers (the one that takes a Type
24674 * codegen.cs: Add EmitForeach here.
24676 * cs-parser.jay: Make foreach a toplevel object instead of the
24677 inline expansion, as we need to perform semantic analysis on it.
24679 2001-10-05 Ravi Pratap <ravi@ximian.com>
24681 * expression.cs (Expression::ImplicitUserConversion): Rename to
24682 UserDefinedConversion.
24684 (Expression::UserDefinedConversion): Take an extra argument specifying
24685 whether we look for explicit user conversions too.
24687 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
24689 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
24691 (ExplicitUserConversion): Make it a call to UserDefinedConversion
24692 with the appropriate arguments.
24694 * cs-parser.jay (cast_expression): Record location too.
24696 * expression.cs (Cast): Record location info.
24698 (Expression::ConvertExplicit): Take location argument.
24700 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
24701 to determine if we are doing explicit conversions.
24703 (UserCast::Emit): Update accordingly.
24705 (Expression::ConvertExplicit): Report an error if everything fails.
24707 * ../errors/cs0030.cs : Add.
24709 2001-10-04 Miguel de Icaza <miguel@ximian.com>
24711 * modifiers.cs: If the ABSTRACT keyword is present, also set the
24712 virtual and newslot bits.
24714 * class.cs (TypeContainer::RegisterRequiredImplementations):
24715 Record methods we need.
24717 (TypeContainer::MakeKey): Helper function to make keys for
24718 MethodBases, since the Methodbase key is useless.
24720 (TypeContainer::Populate): Call RegisterRequiredImplementations
24721 before defining the methods.
24723 Create a mapping for method_builders_to_methods ahead of time
24724 instead of inside a tight loop.
24726 (::RequireMethods): Accept an object as the data to set into the
24727 hashtable so we can report interface vs abstract method mismatch.
24729 2001-10-03 Miguel de Icaza <miguel@ximian.com>
24731 * report.cs: Make all of it static.
24733 * rootcontext.cs: Drop object_type and value_type computations, as
24734 we have those in the TypeManager anyways.
24736 Drop report instance variable too, now it is a global.
24738 * driver.cs: Use try/catch on command line handling.
24740 Add --probe option to debug the error reporting system with a test
24743 * report.cs: Add support for exiting program when a probe
24744 condition is reached.
24746 2001-10-03 Ravi Pratap <ravi@ximian.com>
24748 * expression.cs (Binary::DoNumericPromotions): Fix the case when
24749 we do a forcible conversion regardless of type, to check if
24750 ForceConversion returns a null.
24752 (Binary::error19): Use location to report error.
24754 (Unary::error23): Use location here too.
24756 * ../errors/cs0019.cs : Check in.
24758 * ../errors/cs0023.cs : Check in.
24760 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
24761 case of a non-null MethodInfo object with a length of 0 !
24763 (Binary::ResolveOperator): Flag error if overload resolution fails to find
24764 an applicable member - according to the spec :-)
24765 Also fix logic to find members in base types.
24767 (Unary::ResolveOperator): Same here.
24769 (Unary::report23): Change name to error23 and make first argument a TypeContainer
24770 as I was getting thoroughly confused between this and error19 :-)
24772 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
24773 (::FindMostEncompassedType): Implement.
24774 (::FindMostEncompassingType): Implement.
24775 (::StandardConversionExists): Implement.
24777 (UserImplicitCast): Re-vamp. We now need info about most specific
24778 source and target types so that we can do the necessary conversions.
24780 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
24781 mathematical union with no duplicates.
24783 2001-10-03 Miguel de Icaza <miguel@ximian.com>
24785 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
24786 in order from base classes to child classes, so that we can in
24787 child classes look up in our parent for method names and
24788 attributes (required for handling abstract, virtual, new, override
24789 constructs: we need to instrospect our base class, and if we dont
24790 populate the classes in order, the introspection might be
24791 incorrect. For example, a method could query its parent before
24792 the parent has any methods and would determine that the parent has
24793 no abstract methods (while it could have had them)).
24795 (RootContext::CreateType): Record the order in which we define the
24798 2001-10-02 Miguel de Icaza <miguel@ximian.com>
24800 * class.cs (TypeContainer::Populate): Also method definitions can
24801 fail now, keep track of this.
24803 (TypeContainer::FindMembers): Implement support for
24804 DeclaredOnly/noDeclaredOnly flag.
24806 (Constructor::Emit) Return the ConstructorBuilder.
24808 (Method::Emit) Return the MethodBuilder.
24809 Check for abstract or virtual methods to be public.
24811 * rootcontext.cs (RootContext::CreateType): Register all the
24812 abstract methods required for the class to be complete and the
24813 interface methods that must be implemented.
24815 * cs-parser.jay: Report error 501 (method requires body if it is
24816 not marked abstract or extern).
24818 * expression.cs (TypeOf::Emit): Implement.
24820 * typemanager.cs: runtime_handle_type, new global type.
24822 * class.cs (Property::Emit): Generate code for properties.
24824 2001-10-02 Ravi Pratap <ravi@ximian.com>
24826 * expression.cs (Unary::ResolveOperator): Find operators on base type
24827 too - we now conform exactly to the spec.
24829 (Binary::ResolveOperator): Same here.
24831 * class.cs (Operator::Define): Fix minor quirk in the tests.
24833 * ../errors/cs0215.cs : Added.
24835 * ../errors/cs0556.cs : Added.
24837 * ../errors/cs0555.cs : Added.
24839 2001-10-01 Miguel de Icaza <miguel@ximian.com>
24841 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
24842 single integer which is really efficient
24844 2001-10-01 Ravi Pratap <ravi@ximian.com>
24846 * expression.cs (Expression::ImplicitUserConversion): Use location
24847 even in the case when we are examining True operators.
24849 * class.cs (Operator::Define): Perform extensive checks to conform
24850 with the rules for operator overloading in the spec.
24852 * expression.cs (Expression::ImplicitReferenceConversion): Implement
24853 some of the other conversions mentioned in the spec.
24855 * typemanager.cs (array_type): New static member for the System.Array built-in
24858 (cloneable_interface): For System.ICloneable interface.
24860 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
24861 we start resolving the tree and populating types.
24863 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
24865 2001-10-01 Miguel de Icaza <miguel@ximian.com>
24867 * expression.cs (Expression::ExprClassFromMemberInfo,
24868 Expression::Literalize): Create literal expressions from
24869 FieldInfos which are literals.
24871 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
24872 type casts, because they were wrong. The test suite in tests
24875 (ImplicitNumericConversion): ushort to ulong requires a widening
24878 Int32 constant to long requires widening cast as well.
24880 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
24881 for integers because the type on the stack is not i4.
24883 2001-09-30 Miguel de Icaza <miguel@ximian.com>
24885 * expression.cs (report118): require location argument.
24887 * parameter.cs: Do not dereference potential null value.
24889 * class.cs: Catch methods that lack the `new' keyword when
24890 overriding a name. Report warnings when `new' is used without
24891 anything being there to override.
24893 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
24895 * class.cs: Only add constructor to hashtable if it is non-null
24896 (as now constructors can fail on define).
24898 (TypeManager, Class, Struct): Take location arguments.
24900 Catch field instance initialization in structs as errors.
24902 accepting_filter: a new filter for FindMembers that is static so
24903 that we dont create an instance per invocation.
24905 (Constructor::Define): Catch errors where a struct constructor is
24908 * cs-parser.jay: Pass location information for various new
24911 * delegate.cs (Delegate): take a location argument.
24913 * driver.cs: Do not call EmitCode if there were problesm in the
24914 Definition of the types, as many Builders wont be there.
24916 * decl.cs (Decl::Decl): Require a location argument.
24918 * cs-tokenizer.cs: Handle properly hex constants that can not fit
24919 into integers, and find the most appropiate integer for it.
24921 * literal.cs: Implement ULongLiteral.
24923 * rootcontext.cs: Provide better information about the location of
24924 failure when CreateType fails.
24926 2001-09-29 Miguel de Icaza <miguel@ximian.com>
24928 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
24931 * expression.cs (Binary::CheckShiftArguments): Add missing type
24933 (Binary::ResolveOperator): Add type to the logical and and logical
24934 or, Bitwise And/Or and Exclusive Or code paths, it was missing
24937 (Binary::DoNumericPromotions): In the case where either argument
24938 is ulong (and most signed types combined with ulong cause an
24939 error) perform implicit integer constant conversions as well.
24941 2001-09-28 Miguel de Icaza <miguel@ximian.com>
24943 * expression.cs (UserImplicitCast): Method should always be
24945 (Invocation::BetterConversion): Simplified test for IntLiteral.
24947 (Expression::ImplicitNumericConversion): Split this routine out.
24948 Put the code that performs implicit constant integer conversions
24951 (Expression::Resolve): Become a wrapper around DoResolve so we can
24952 check eclass and type being set after resolve.
24954 (Invocation::Badness): Remove this dead function
24956 (Binary::ResolveOperator): Do not compute the expensive argumnets
24957 unless we have a union for it.
24959 (Probe::Emit): Is needs to do an isinst and then
24960 compare against null.
24962 (::CanConvert): Added Location argument. If the Location argument
24963 is null (Location.Null), then we do not report errors. This is
24964 used by the `probe' mechanism of the Explicit conversion. We do
24965 not want to generate an error for something that the user
24966 explicitly requested to be casted. But the pipeline for an
24967 explicit cast first tests for potential implicit casts.
24969 So for now, if the Location is null, it means `Probe only' to
24970 avoid adding another argument. Might have to revise this
24973 (ClassCast): New class used to type cast objects into arbitrary
24974 classes (used in Explicit Reference Conversions).
24976 Implement `as' as well.
24978 Reverted all the patches from Ravi below: they were broken:
24980 * The use of `level' as a mechanism to stop recursive
24981 invocations is wrong. That was there just to catch the
24982 bug with a strack trace but not as a way of addressing
24985 To fix the problem we have to *understand* what is going
24986 on and the interactions and come up with a plan, not
24987 just get things going.
24989 * The use of the type conversion cache that I proposed
24990 last night had an open topic: How does this work across
24991 protection domains. A user defined conversion might not
24992 be public in the location where we are applying the
24993 conversion, a different conversion might be selected
24994 (ie, private A->B (better) but public B->A (worse),
24995 inside A, A->B applies, but outside it, B->A will
24998 * On top of that (ie, even if the above is solved),
24999 conversions in a cache need to be abstract. Ie, `To
25000 convert from an Int to a Short use an OpcodeCast', not
25001 `To convert from an Int to a Short use the OpcodeCast on
25002 the variable 5' (which is what this patch was doing).
25004 2001-09-28 Ravi Pratap <ravi@ximian.com>
25006 * expression.cs (Invocation::ConversionExists): Re-write to use
25007 the conversion cache
25009 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
25010 cache all conversions done, not just user-defined ones.
25012 (Invocation::BetterConversion): The real culprit. Use ConversionExists
25013 to determine if a conversion exists instead of acutually trying to
25014 perform the conversion. It's faster too.
25016 (Expression::ConvertExplicit): Modify to use ConversionExists to check
25017 and only then attempt the implicit conversion.
25019 2001-09-28 Ravi Pratap <ravi@ximian.com>
25021 * expression.cs (ConvertImplicit): Use a cache for conversions
25022 already found. Check level of recursion and bail out if necessary.
25024 2001-09-28 Miguel de Icaza <miguel@ximian.com>
25026 * typemanager.cs (string_concat_string_string, string_concat_object_object):
25027 Export standard methods that we expect for string operations.
25029 * statement.cs (Block::UsageWarning): Track usage of variables and
25030 report the errors for not used variables.
25032 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
25035 2001-09-27 Miguel de Icaza <miguel@ximian.com>
25037 * codegen.cs: remove unnneded code
25039 * expression.cs: Removed BuiltinTypeAccess class
25041 Fix the order in which implicit conversions are
25044 The previous fixed dropped support for boxed conversions (adding a
25045 test to the test suite now)
25047 (UserImplicitCast::CanConvert): Remove test for source being null,
25048 that code is broken. We should not feed a null to begin with, if
25049 we do, then we should track the bug where the problem originates
25050 and not try to cover it up here.
25052 Return a resolved expression of type UserImplicitCast on success
25053 rather than true/false. Ravi: this is what I was talking about,
25054 the pattern is to use a static method as a "constructor" for
25057 Also, do not create arguments until the very last minute,
25058 otherwise we always create the arguments even for lookups that
25059 will never be performed.
25061 (UserImplicitCast::Resolve): Eliminate, objects of type
25062 UserImplicitCast are born in a fully resolved state.
25064 * typemanager.cs (InitCoreTypes): Init also value_type
25065 (System.ValueType).
25067 * expression.cs (Cast::Resolve): First resolve the child expression.
25069 (LValue): Add new method AddressOf to be used by
25072 Change the argument of Store to take an EmitContext instead of an
25073 ILGenerator, because things like FieldExpr need to be able to call
25074 their children expression to generate the instance code.
25076 (Expression::Error, Expression::Warning): Sugar functions for
25079 (Expression::MemberLookup): Accept a TypeContainer instead of a
25080 Report as the first argument.
25082 (Expression::ResolvePrimary): Killed. I still want to improve
25083 this as currently the code is just not right.
25085 (Expression::ResolveMemberAccess): Simplify, but it is still
25088 (Unary::Resolve): Catch errors in AddressOf operators.
25090 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
25091 index to a byte for the short-version, or the compiler will choose
25092 the wrong Emit call, which generates the wrong data.
25094 (ParameterReference::Emit, ::Store): same.
25096 (FieldExpr::AddressOf): Implement.
25098 * typemanager.cs: TypeManager: made public variable instead of
25101 * driver.cs: document --fatal.
25103 * report.cs (ErrorMessage, WarningMessage): new names for the old
25104 Error and Warning classes.
25106 * cs-parser.jay (member_access): Turn built-in access to types
25107 into a normal simplename
25109 2001-09-27 Ravi Pratap <ravi@ximian.com>
25111 * expression.cs (Invocation::BetterConversion): Fix to cope
25112 with q being null, since this was introducing a bug.
25114 * expression.cs (ConvertImplicit): Do built-in conversions first.
25116 2001-09-27 Ravi Pratap <ravi@ximian.com>
25118 * expression.cs (UserImplicitCast::Resolve): Fix bug.
25120 2001-09-27 Ravi Pratap <ravi@ximian.com>
25122 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
25123 I had introduced long ago (what's new ?).
25125 * expression.cs (UserImplicitCast::CanConvert): Static method to do
25126 the work of all the checking.
25127 (ConvertImplicit): Call CanConvert and only then create object if necessary.
25128 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
25130 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
25131 that is the right way.
25133 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
25134 overloading resolution. Use everywhere instead of cutting and pasting code.
25136 (Binary::ResolveOperator): Use MakeUnionSet.
25138 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
25139 we have to convert to bool types. Not complete yet.
25141 2001-09-27 Miguel de Icaza <miguel@ximian.com>
25143 * typemanager.cs (TypeManager::CSharpName): support ushort.
25145 * expression.cs (Expression::TryImplicitIntConversion): Attempts
25146 to provide an expression that performsn an implicit constant int
25147 conversion (section 6.1.6).
25148 (Expression::ConvertImplicitRequired): Reworked to include
25149 implicit constant expression conversions.
25151 (Expression::ConvertNumericExplicit): Finished.
25153 (Invocation::Emit): If InstanceExpression is null, then it means
25154 that we perform a call on this.
25156 2001-09-26 Miguel de Icaza <miguel@ximian.com>
25158 * expression.cs (Unary::Emit): Remove some dead code.
25159 (Probe): Implement Resolve and Emit for `is'.
25160 (Expression::ConvertImplicitRequired): Attempt to do constant
25161 expression conversions here. Maybe should be moved to
25162 ConvertImplicit, but I am not sure.
25163 (Expression::ImplicitLongConstantConversionPossible,
25164 Expression::ImplicitIntConstantConversionPossible): New functions
25165 that tell whether is it possible to apply an implicit constant
25166 expression conversion.
25168 (ConvertNumericExplicit): Started work on explicit numeric
25171 * cs-parser.jay: Update operator constants.
25173 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
25174 (Parameters::GetSignature): Hook up VerifyArgs here.
25175 (Parameters::VerifyArgs): Verifies that no two arguments have the
25178 * class.cs (Operator): Update the operator names to reflect the
25179 ones that the spec expects (as we are just stringizing the
25182 * expression.cs (Unary::ResolveOperator): Fix bug: Use
25183 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
25184 previous usage did only work for our methods.
25185 (Expression::ConvertImplicit): Handle decimal implicit numeric
25186 conversions as well.
25187 (Expression::InternalTypeConstructor): Used to invoke constructors
25188 on internal types for default promotions.
25190 (Unary::Emit): Implement special handling for the pre/post
25191 increment/decrement for overloaded operators, as they need to have
25192 the same semantics as the other operators.
25194 (Binary::ResolveOperator): ditto.
25195 (Invocation::ConversionExists): ditto.
25196 (UserImplicitCast::Resolve): ditto.
25198 2001-09-26 Ravi Pratap <ravi@ximian.com>
25200 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
25201 operator, return after emitting body. Regression tests pass again !
25203 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
25204 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
25205 (Invocation::OverloadResolve): Ditto.
25206 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
25208 * everywhere : update calls to the above methods accordingly.
25210 2001-09-26 Miguel de Icaza <miguel@ximian.com>
25212 * assign.cs (Assign): Make it inherit from ExpressionStatement.
25214 * expression.cs (ExpressionStatement): New base class used for
25215 expressions that can appear in statements, so that we can provide
25216 an alternate path to generate expression that do not leave a value
25219 (Expression::Emit, and all the derivatives): We no longer return
25220 whether a value is left on the stack or not. Every expression
25221 after being emitted leaves a single value on the stack.
25223 * codegen.cs (EmitContext::EmitStatementExpression): Use the
25224 facilties of ExpressionStatement if possible.
25226 * cs-parser.jay: Update statement_expression.
25228 2001-09-25 Miguel de Icaza <miguel@ximian.com>
25230 * driver.cs: Change the wording of message
25232 2001-09-25 Ravi Pratap <ravi@ximian.com>
25234 * expression.cs (Binary::ResolveOperator): Had forgottten to set
25235 the type of the expression to the return type of the method if
25236 we have an overloaded operator match ! The regression tests pass again !
25237 (Unary::ResolveOperator): Ditto.
25239 * expression.cs (Invocation::ConversionExists): Correct the member lookup
25240 to find "op_Implicit", not "implicit" ;-)
25241 (UserImplicitCast): New class to take care of user-defined implicit conversions.
25242 (ConvertImplicit, ForceConversion): Take TypeContainer argument
25244 * everywhere : Correct calls to the above accordingly.
25246 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
25247 (ConvertImplicit): Do user-defined conversion if it exists.
25249 2001-09-24 Miguel de Icaza <miguel@ximian.com>
25251 * assign.cs: track location.
25252 (Resolve): Use implicit conversions on assignment.
25254 * literal.cs: Oops. Not good, Emit of short access values should
25255 pass (Bytes) or the wrong argument will be selected.
25257 * expression.cs (Unary::Emit): Emit code for -expr.
25259 (Unary::ResolveOperator): Handle `Substract' for non-constants
25260 (substract from zero from the non-constants).
25261 Deal with Doubles as well.
25263 (Expression::ConvertImplicitRequired): New routine that reports an
25264 error if no implicit conversion exists.
25266 (Invocation::OverloadResolve): Store the converted implicit
25267 expressions if we make them
25269 2001-09-24 Ravi Pratap <ravi@ximian.com>
25271 * class.cs (ConstructorInitializer): Take a Location argument.
25272 (ConstructorBaseInitializer): Same here.
25273 (ConstructorThisInitializer): Same here.
25275 * cs-parser.jay : Update all calls accordingly.
25277 * expression.cs (Unary, Binary, New): Take location argument.
25278 Update accordingly everywhere.
25280 * cs-parser.jay : Update all calls to the above to take a location
25283 * class.cs : Ditto.
25285 2001-09-24 Ravi Pratap <ravi@ximian.com>
25287 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
25288 (Invocation::BetterConversion): Same here
25289 (Invocation::ConversionExists): Ditto.
25291 (Invocation::ConversionExists): Implement.
25293 2001-09-22 Ravi Pratap <ravi@ximian.com>
25295 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
25296 Also take an additional TypeContainer argument.
25298 * All over : Pass in TypeContainer as argument to OverloadResolve.
25300 * typemanager.cs (CSharpName): Update to check for the string type and return
25303 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
25306 2001-09-21 Ravi Pratap <ravi@ximian.com>
25308 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
25309 (Invocation::BetterFunction): Implement.
25310 (Invocation::BetterConversion): Implement.
25311 (Invocation::ConversionExists): Skeleton, no implementation yet.
25313 Okay, things work fine !
25315 2001-09-21 Miguel de Icaza <miguel@ximian.com>
25317 * typemanager.cs: declare and load enum_type, delegate_type and
25320 * expression.cs (Expression::Emit): Now emit returns a value that
25321 tells whether a value is left on the stack or not. This strategy
25322 might be reveted tomorrow with a mechanism that would address
25323 multiple assignments.
25324 (Expression::report118): Utility routine to report mismatches on
25327 (Unary::Report23): Report impossible type/operator combination
25330 (Unary::IsIncrementableNumber): Whether the type can be
25331 incremented or decremented with add.
25332 (Unary::ResolveOperator): Also allow enumerations to be bitwise
25334 (Unary::ResolveOperator): Implement ++, !, ~,
25336 (Invocation::Emit): Deal with new Emit convetion.
25338 * All Expression derivatives: Updated their Emit method to return
25339 whether they leave values on the stack or not.
25341 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
25342 stack for expressions that are statements.
25344 2001-09-20 Miguel de Icaza <miguel@ximian.com>
25346 * expression.cs (LValue): New interface. Must be implemented by
25348 (LocalVariableReference, ParameterReference, FieldExpr): Implement
25351 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
25352 interface for generating code, simplifies the code.
25354 2001-09-20 Ravi Pratap <ravi@ximian.com>
25356 * expression.cs (everywhere): Comment out return statements in ::Resolve
25357 methods to avoid the warnings.
25359 2001-09-20 Miguel de Icaza <miguel@ximian.com>
25361 * driver.cs (parse): Report error 2001 if we can not open the
25364 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
25367 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
25370 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
25371 otherwise nested blocks end up with the same index.
25373 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
25375 * expression.cs: Instead of having FIXMEs in the Resolve
25376 functions, throw exceptions so it is obvious that we are facing a
25379 * cs-parser.jay (invocation_expression): Pass Location information.
25381 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
25382 Use a basename for those routines because .NET does not like paths
25385 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
25388 2001-09-19 Miguel de Icaza <miguel@ximian.com>
25390 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
25391 are loading the correct data types (throws an exception if not).
25392 (TypeManager::InitCoreTypes): Use CoreLookupType
25394 * expression.cs (Unary::ResolveOperator): return the child
25395 expression for expressions which are just +expr.
25396 (Unary::ResolveOperator): Return negative literals for -LITERAL
25397 expressions (otherwise they are Unary {Literal}).
25398 (Invocation::Badness): Take into account `Implicit constant
25399 expression conversions'.
25401 * literal.cs (LongLiteral): Implement long literal class.
25402 (IntLiteral): export the `Value' of the intliteral.
25404 2001-09-19 Ravi Pratap <ravi@ximian.com>
25406 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
25408 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
25409 instead of 'Operator'
25411 * expression.cs (Binary::ResolveOperator): Update accordingly.
25412 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
25415 * cs-parser.jay (unary_expression): Update to use the new names.
25417 * gen-treedump.cs (GetUnary): Same here.
25419 * expression.cs (Unary::Resolve): Implement.
25420 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
25421 operators are found instead of making noise ;-)
25422 (Unary::ResolveOperator): New method to do precisely the same thing which
25423 Binary::ResolveOperator does for Binary expressions.
25424 (Unary.method, .Arguments): Add.
25425 (Unary::OperName): Implement.
25426 (Unary::ForceConversion): Copy and Paste !
25428 * class.cs (Operator::Define): Fix a small bug for the case when we have
25431 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
25432 for the inbuilt operators. Only overloading works for now ;-)
25434 2001-09-18 Miguel de Icaza <miguel@ximian.com>
25436 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
25437 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
25439 * expression.cs (This::Emit): Implement.
25440 (This::Resolve): Implement.
25441 (TypeOf:Resolve): Implement.
25442 (Expression::ResolveSimpleName): Add an implicit this to instance
25444 (MemberAccess::Resolve): Deal with Parameters and Fields.
25445 Bind instance variable to Field expressions.
25446 (FieldExpr::Instance): New field used to track the expression that
25447 represents the object instance.
25448 (FieldExpr::Resolve): Track potential errors from MemberLookup not
25450 (FieldExpr::Emit): Implement.
25452 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
25453 the last instruction contains a return opcode to avoid generating
25454 the last `ret' instruction (this generates correct code, and it is
25455 nice to pass the peverify output).
25457 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
25458 initializer for static and instance variables.
25459 (Constructor::Emit): Allow initializer to be null in the case of
25460 static constructors. Only emit initializer for instance
25463 (TypeContainer::FindMembers): Return a null array if there are no
25466 Also fix the code for the MemberTypes.Method branch, as it was not
25467 scanning that for operators (or tried to access null variables before).
25469 * assign.cs (Assign::Emit): Handle instance and static fields.
25473 * driver.cs: Stop compilation if there are parse errors.
25475 * cs-parser.jay (constructor_declaration): Provide default base
25476 initializer for non-static constructors.
25477 (constructor_declarator): Do not provide a default base
25478 initializers if none was specified.
25479 Catch the fact that constructors should not have parameters.
25481 * class.cs: Do not emit parent class initializers for static
25482 constructors, that should be flagged as an error.
25484 2001-09-18 Ravi Pratap <ravi@ximian.com>
25486 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
25487 Move back code into TypeContainer::Populate.
25489 2001-09-18 Ravi Pratap <ravi@ximian.com>
25491 * class.cs (TypeContainer::AddConstructor): Fix the check to
25492 compare against Name, not Basename.
25493 (Operator::OpType): Change Plus and Minus to Add and Subtract.
25495 * cs-parser.jay : Update accordingly.
25497 * class.cs (TypeContainer::FindMembers): For the case where we are searching
25498 for methods, don't forget to look into the operators too.
25499 (RegisterMethodBuilder): Helper method to take care of this for
25500 methods, constructors and operators.
25501 (Operator::Define): Completely revamp.
25502 (Operator.OperatorMethod, MethodName): New fields.
25503 (TypeContainer::Populate): Move the registering of builders into
25504 RegisterMethodBuilder.
25505 (Operator::Emit): Re-write.
25507 * expression.cs (Binary::Emit): Comment out code path to emit method
25508 invocation stuff for the case when we have a user defined operator. I am
25509 just not able to get it right !
25511 2001-09-17 Miguel de Icaza <miguel@ximian.com>
25513 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
25516 (Expression::MemberLookup): Provide a version that allows to
25517 specify the MemberTypes and BindingFlags.
25519 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
25520 so it was not fetching variable information from outer blocks.
25522 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
25523 Beforefieldinit as it was buggy.
25525 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
25526 that Ravi put here.
25528 * class.cs (Constructor::Emit): Only emit if block is not null.
25529 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
25530 deal with this by semantically definining it as if the user had
25533 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
25534 constructors as we now "emit" them at a higher level.
25536 (TypeContainer::DefineDefaultConstructor): Used to define the
25537 default constructors if none was provided.
25539 (ConstructorInitializer): Add methods Resolve and Emit.
25541 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
25543 2001-09-17 Ravi Pratap <ravi@ximian.com>
25545 * class.cs (TypeContainer::EmitDefaultConstructor): Register
25546 the default constructor builder with our hashtable for methodbuilders
25549 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
25550 and argument_count is 0 in which case we have a match.
25551 (Binary::ResolveOperator): More null checking and miscellaneous coding
25554 2001-09-17 Ravi Pratap <ravi@ximian.com>
25556 * rootcontext.cs (IsNameSpace): Compare against null.
25558 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
25560 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
25561 and Unary::Operator.
25563 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
25566 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
25567 we have overloaded operators.
25568 (Binary::ResolveOperator): Implement the part which does the operator overload
25571 * class.cs (Operator::Emit): Implement.
25572 (TypeContainer::Emit): Emit the operators we have too.
25574 * expression.cs (Binary::Emit): Update to emit the appropriate code for
25575 the case when we have a user-defined operator.
25577 2001-09-17 Miguel de Icaza <miguel@ximian.com>
25579 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
25581 2001-09-16 Ravi Pratap <ravi@ximian.com>
25583 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
25584 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
25585 (Constructor::Emit): Implement.
25586 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
25587 if we have no work to do.
25588 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
25591 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
25592 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
25594 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
25597 2001-09-15 Ravi Pratap <ravi@ximian.com>
25599 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
25601 (Tree::RecordNamespace): Method to do what the name says ;-)
25602 (Tree::Namespaces): Property to get at the namespaces hashtable.
25604 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
25607 * rootcontext.cs (IsNamespace): Fixed it :-)
25609 2001-09-14 Miguel de Icaza <miguel@ximian.com>
25611 * class.cs (TypeContainer::FindMembers): Add support for
25613 (MethodCore): New class that encapsulates both the shared aspects
25614 of a Constructor and a Method.
25615 (Method, Constructor): Factored pieces into MethodCore.
25617 * driver.cs: Added --fatal which makes errors throw exceptions.
25618 Load System assembly as well as part of the standard library.
25620 * report.cs: Allow throwing exceptions on errors for debugging.
25622 * modifiers.cs: Do not use `parent', instead use the real type
25623 container to evaluate permission settings.
25625 * class.cs: Put Ravi's patch back in. He is right, and we will
25626 have to cope with the
25628 2001-09-14 Ravi Pratap <ravi@ximian.com>
25630 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
25631 FamORAssem, not FamANDAssem.
25633 2001-09-14 Miguel de Icaza <miguel@ximian.com>
25635 * driver.cs: Added --parse option that only parses its input files
25638 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
25639 incorrect. IsTopLevel is not used to tell whether an object is
25640 root_types or not (that can be achieved by testing this ==
25641 root_types). But to see if this is a top-level *class* (not
25642 necessarly our "toplevel" container).
25644 2001-09-14 Ravi Pratap <ravi@ximian.com>
25646 * enum.cs (Enum::Define): Modify to call the Lookup method on the
25647 parent instead of a direct call to GetType.
25649 2001-09-14 Ravi Pratap <ravi@ximian.com>
25651 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
25652 Modifiers.TypeAttr. This should just be a call to that method.
25654 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
25655 object so that we can determine if we are top-level or not.
25657 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
25660 * enum.cs (Enum::Define): Ditto.
25662 * modifiers.cs (FieldAttr): Re-write.
25664 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
25665 (TypeContainer::HaveStaticConstructor): New property to provide access
25666 to precisely that info.
25668 * modifiers.cs (MethodAttr): Re-write.
25669 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
25671 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
25672 of top-level types as claimed.
25674 2001-09-13 Miguel de Icaza <miguel@ximian.com>
25676 * expression.cs (MemberLookup): Fruitless attempt to lookup
25677 constructors. Maybe I need to emit default constructors? That
25678 might be it (currently .NET emits this for me automatically).
25679 (Invocation::OverloadResolve): Cope with Arguments == null.
25680 (Invocation::EmitArguments): new function, shared by the new
25681 constructor and us.
25682 (Invocation::Emit): Handle static and instance methods. Emit
25683 proper call instruction for virtual or non-virtual invocations.
25684 (New::Emit): Implement.
25685 (New::Resolve): Implement.
25686 (MemberAccess:Resolve): Implement.
25687 (MethodGroupExpr::InstanceExpression): used conforming to the spec
25688 to track instances.
25689 (FieldExpr::Resolve): Set type.
25691 * support.cs: Handle empty arguments.
25693 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
25694 SimpleLookup): Auxiliary routines to help parse a qualifier
25697 Update qualifier_identifier rule.
25699 * codegen.cs: Removed debugging messages.
25701 * class.cs: Make this a global thing, this acts just as a "key" to
25702 objects that we might have around.
25704 (Populate): Only initialize method_builders_to_methods once.
25706 * expression.cs (PropertyExpr): Initialize type from the
25709 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
25710 Resolve pattern. Attempt to implicitly convert value to boolean.
25713 * expression.cs: Set the type for the int32/int32 argument case.
25714 (Binary::ResolveOperator): Set the return type to boolean for
25715 comparission operators
25717 * typemanager.cs: Remove debugging print code.
25719 (Invocation::Resolve): resolve type.
25721 * class.cs: Allocate a MemberInfo of the correct size, as the code
25722 elsewhere depends on the test to reflect the correct contents.
25724 (Method::) Keep track of parameters, due to System.Reflection holes
25726 (TypeContainer::Populate): Keep track of MethodBuilders to Method
25729 (TypeContainer::FindMembers): Use ArrayList and then copy an array
25730 of the exact size and return that.
25732 (Class::LookupMethodByBuilder): New function that maps
25733 MethodBuilders to its methods. Required to locate the information
25734 on methods because System.Reflection bit us again.
25736 * support.cs: New file, contains an interface ParameterData and
25737 two implementations: ReflectionParameters and InternalParameters
25738 used to access Parameter information. We will need to grow this
25741 * expression.cs (Invocation::GetParameterData): implement a cache
25742 and a wrapper around the ParameterData creation for methods.
25743 (Invocation::OverloadResolve): Use new code.
25745 2001-09-13 Ravi Pratap <ravi@ximian.com>
25747 * class.cs (TypeContainer::EmitField): Remove and move into
25748 (Field::Define): here and modify accordingly.
25749 (Field.FieldBuilder): New member.
25750 (TypeContainer::Populate): Update accordingly.
25751 (TypeContainer::FindMembers): Implement.
25753 2001-09-13 Miguel de Icaza <miguel@ximian.com>
25755 * statement.cs: (VariableInfo::VariableType): New field to be
25756 initialized with the full type once it is resolved.
25758 2001-09-12 Miguel de Icaza <miguel@ximian.com>
25760 * parameter.cs (GetParameterInfo): Use a type cache to compute
25761 things only once, and to reuse this information
25763 * expression.cs (LocalVariableReference::Emit): Implement.
25764 (OpcodeCast::Emit): fix.
25766 (ParameterReference::Resolve): Implement.
25767 (ParameterReference::Emit): Implement.
25769 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
25770 that are expressions need to stay as Expressions.
25772 * typemanager.cs (CSharpName): Returns the C# name of a type if
25775 * expression.cs (Expression::ConvertImplicit): New function that
25776 implements implicit type conversions.
25778 (Expression::ImplicitReferenceConversion): Implements implicit
25779 reference conversions.
25781 (EmptyCast): New type for transparent casts.
25783 (OpcodeCast): New type for casts of types that are performed with
25784 a sequence of bytecodes.
25786 (BoxedCast): New type used for casting value types into reference
25787 types. Emits a box opcode.
25789 (Binary::DoNumericPromotions): Implements numeric promotions of
25790 and computation of the Binary::Type.
25792 (Binary::EmitBranchable): Optimization.
25794 (Binary::Emit): Implement code emission for expressions.
25796 * typemanager.cs (TypeManager): Added two new core types: sbyte
25799 2001-09-12 Ravi Pratap <ravi@ximian.com>
25801 * class.cs (TypeContainer::FindMembers): Method which does exactly
25802 what Type.FindMembers does, only we don't have to use reflection. No
25803 implementation yet.
25805 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
25806 typecontainer objects as we need to get at them.
25807 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
25809 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
25810 typecontainer object.
25812 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
25813 of just a Report object.
25815 2001-09-11 Ravi Pratap <ravi@ximian.com>
25817 * class.cs (Event::Define): Go back to using the prefixes "add_" and
25819 (TypeContainer::Populate): Now define the delegates of the type too.
25820 (TypeContainer.Delegates): Property to access the list of delegates defined
25823 * delegates.cs (Delegate::Define): Implement partially.
25825 * modifiers.cs (TypeAttr): Handle more flags.
25827 2001-09-11 Ravi Pratap <ravi@ximian.com>
25829 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
25831 (Operator::Define): Re-write logic to get types by using the LookupType method
25832 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
25833 (Indexer::Define): Ditto.
25834 (Event::Define): Ditto.
25835 (Property::Define): Ditto.
25837 2001-09-10 Ravi Pratap <ravi@ximian.com>
25839 * class.cs (TypeContainer::Populate): Now define operators too.
25840 (TypeContainer.Operators): New property to access the list of operators
25842 (Operator.OperatorMethodBuilder): New member to hold the method builder
25843 for the operator we are defining.
25844 (Operator::Define): Implement.
25846 2001-09-10 Ravi Pratap <ravi@ximian.com>
25848 * class.cs (Event::Define): Make the prefixes of the accessor methods
25849 addOn_ and removeOn_
25851 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
25852 of the location being passed in too. Ideally, this should go later since all
25853 error reporting should be done through the Report object.
25855 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
25856 (Populate): Iterate thru the indexers we have and define them too.
25857 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
25858 for the get and set accessors.
25859 (Indexer::Define): Implement.
25861 2001-09-09 Miguel de Icaza <miguel@ximian.com>
25863 * expression.cs (Binary::Resolve): Beginning of it. I scratched
25864 my previous implementation, did not work.
25866 * typemanager.cs: Add a couple of missing types (the longs).
25868 * literal.cs: Use TypeManager.bool_type instead of getting it.
25870 * expression.cs (EventExpr): New kind of expressions.
25871 (Expressio::ExprClassFromMemberInfo): finish
25873 2001-09-08 Miguel de Icaza <miguel@ximian.com>
25875 * assign.cs: Emit stores to static fields differently.
25877 2001-09-08 Ravi Pratap <ravi@ximian.com>
25879 * Merge in changes and adjust code to tackle conflicts. Backed out my
25880 code in Assign::Resolve ;-)
25882 2001-09-08 Ravi Pratap <ravi@ximian.com>
25884 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
25885 instead Report.Error and also pass in the location.
25886 (CSharpParser::Lexer): New readonly property to return the reference
25887 to the Tokenizer object.
25888 (declare_local_variables): Use Report.Error with location instead of plain
25892 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
25893 (Operator.CheckBinaryOperator): Ditto.
25895 * cs-parser.jay (operator_declarator): Update accordingly.
25897 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
25898 (CheckBinaryOperator): Same here.
25900 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
25901 on the name without any prefixes of namespace names etc. This is because we
25902 already might have something already fully qualified like
25903 'System.Console.WriteLine'
25905 * assign.cs (Resolve): Begin implementation. Stuck ;-)
25907 2001-09-07 Ravi Pratap <ravi@ximian.com>
25909 * cs-tokenizer.cs (location): Return a string which also contains
25912 * expression.cs (ElementAccess): New class for expressions of the
25913 type 'element access.'
25914 (BaseAccess): New class for expressions of the type 'base access.'
25915 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
25918 * cs-parser.jay (element_access): Implement action.
25919 (base_access): Implement actions.
25920 (checked_expression, unchecked_expression): Implement.
25922 * cs-parser.jay (local_variable_type): Correct and implement.
25923 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
25925 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
25927 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
25928 name and the specifiers.
25930 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
25932 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
25933 making them all public ;-)
25935 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
25938 2001-09-07 Miguel de Icaza <miguel@ximian.com>
25940 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
25942 (FieldExpr, PropertyExprs): New resolved expressions.
25943 (SimpleName::MemberStaticCheck): Perform static checks for access
25944 to non-static fields on static methods. Maybe this should be
25945 generalized for MemberAccesses.
25946 (SimpleName::ResolveSimpleName): More work on simple name
25949 * cs-parser.jay (primary_expression/qualified_identifier): track
25950 the parameter index.
25952 * codegen.cs (CodeGen::Save): Catch save exception, report error.
25953 (EmitContext::EmitBoolExpression): Chain to expression generation
25954 instead of temporary hack.
25955 (::EmitStatementExpression): Put generic expression code generation.
25957 * assign.cs (Assign::Emit): Implement variable assignments to
25958 local variables, parameters and fields.
25960 2001-09-06 Miguel de Icaza <miguel@ximian.com>
25962 * statement.cs (Block::GetVariableInfo): New method, returns the
25963 VariableInfo for a variable name in a block.
25964 (Block::GetVariableType): Implement in terms of GetVariableInfo
25966 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
25967 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
25969 2001-09-06 Ravi Pratap <ravi@ximian.com>
25971 * cs-parser.jay (operator_declaration): Continue on my quest : update
25972 to take attributes argument.
25973 (event_declaration): Ditto.
25974 (enum_declaration): Ditto.
25975 (indexer_declaration): Ditto.
25977 * class.cs (Operator::Operator): Update constructor accordingly.
25978 (Event::Event): Ditto.
25980 * delegate.cs (Delegate::Delegate): Same here.
25982 * enum.cs (Enum::Enum): Same here.
25984 2001-09-05 Ravi Pratap <ravi@ximian.com>
25986 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
25988 * ../tests/cs0658.cs : New file to demonstrate error 0658.
25990 * attribute.cs (Attributes): New class to encapsulate all attributes which were
25991 being passed around as an arraylist.
25992 (Attributes::AddAttribute): Method to add attribute sections.
25994 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
25995 (struct_declaration): Update accordingly.
25996 (constant_declaration): Update.
25997 (field_declaration): Update.
25998 (method_header): Update.
25999 (fixed_parameter): Update.
26000 (parameter_array): Ditto.
26001 (property_declaration): Ditto.
26002 (destructor_declaration): Ditto.
26004 * class.cs (Struct::Struct): Update constructors accordingly.
26005 (Class::Class): Ditto.
26006 (Field::Field): Ditto.
26007 (Method::Method): Ditto.
26008 (Property::Property): Ditto.
26009 (TypeContainer::OptAttribute): update property's return type.
26011 * interface.cs (Interface.opt_attributes): New member.
26012 (Interface::Interface): Update to take the extra Attributes argument.
26014 * parameter.cs (Parameter::Parameter): Ditto.
26016 * constant.cs (Constant::Constant): Ditto.
26018 * interface.cs (InterfaceMemberBase): New OptAttributes field.
26019 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
26020 the attributes as a parameter.
26021 (InterfaceProperty): Update constructor call.
26022 (InterfaceEvent): Ditto.
26023 (InterfaceMethod): Ditto.
26024 (InterfaceIndexer): Ditto.
26026 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
26027 pass the attributes too.
26028 (interface_event_declaration): Ditto.
26029 (interface_property_declaration): Ditto.
26030 (interface_method_declaration): Ditto.
26031 (interface_declaration): Ditto.
26033 2001-09-05 Miguel de Icaza <miguel@ximian.com>
26035 * class.cs (Method::Define): Track the "static Main" definition to
26036 create an entry point.
26038 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
26039 EntryPoint if we find it.
26041 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
26042 (EmitContext::ig): Make this variable public.
26044 * driver.cs: Make the default output file be the first file name
26045 with the .exe extension.
26047 Detect empty compilations
26049 Handle various kinds of output targets. Handle --target and
26050 rename -t to --dumper.
26052 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
26053 methods inherited from Expression return now an Expression. This
26054 will is used during the tree rewriting as we resolve them during
26057 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
26058 the spec. Missing entirely is the information about
26059 accessability of elements of it.
26061 (Expression::ExprClassFromMemberInfo): New constructor for
26062 Expressions that creates a fully initialized Expression based on
26063 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
26066 (Invocation::Resolve): Begin implementing resolution of invocations.
26068 * literal.cs (StringLiteral): Implement Emit.
26070 2001-09-05 Ravi Pratap <ravi@ximian.com>
26072 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
26075 2001-09-04 Ravi Pratap <ravi@ximian.com>
26077 * cs-parser.jay (attribute_arguments): Implement actions.
26078 (attribute): Fix bug in production. Implement action.
26079 (attribute_list): Implement.
26080 (attribute_target): Implement.
26081 (attribute_target_specifier, opt_target_specifier): Implement
26082 (CheckAttributeTarget): New method to check if the attribute target
26084 (attribute_section): Implement.
26085 (opt_attributes): Implement.
26087 * attribute.cs : New file to handle attributes.
26088 (Attribute): Class to hold attribute info.
26090 * cs-parser.jay (opt_attribute_target_specifier): Remove production
26091 (attribute_section): Modify production to use 2 different rules to
26092 achieve the same thing. 1 s/r conflict down !
26093 Clean out commented, useless, non-reducing dimension_separator rules.
26095 * class.cs (TypeContainer.attributes): New member to hold list
26096 of attributes for a type.
26097 (Struct::Struct): Modify to take one more argument, the attribute list.
26098 (Class::Class): Ditto.
26099 (Field::Field): Ditto.
26100 (Method::Method): Ditto.
26101 (Property::Property): Ditto.
26103 * cs-parser.jay (struct_declaration): Update constructor call to
26104 pass in the attributes too.
26105 (class_declaration): Ditto.
26106 (constant_declaration): Ditto.
26107 (field_declaration): Ditto.
26108 (method_header): Ditto.
26109 (fixed_parameter): Ditto.
26110 (parameter_array): Ditto.
26111 (property_declaration): Ditto.
26113 * constant.cs (Constant::Constant): Update constructor similarly.
26114 Use System.Collections.
26116 * parameter.cs (Parameter::Parameter): Update as above.
26118 2001-09-02 Ravi Pratap <ravi@ximian.com>
26120 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
26121 (TypeContainer.delegates): New member to hold list of delegates.
26123 * cs-parser.jay (delegate_declaration): Implement the action correctly
26124 this time as I seem to be on crack ;-)
26126 2001-09-02 Miguel de Icaza <miguel@ximian.com>
26128 * rootcontext.cs (RootContext::IsNamespace): new function, used to
26129 tell whether an identifier represents a namespace.
26131 * expression.cs (NamespaceExpr): A namespace expression, used only
26132 temporarly during expression resolution.
26133 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
26134 utility functions to resolve names on expressions.
26136 2001-09-01 Miguel de Icaza <miguel@ximian.com>
26138 * codegen.cs: Add hook for StatementExpressions.
26140 * class.cs: Fix inverted test for static flag in methods.
26142 2001-09-02 Ravi Pratap <ravi@ximian.com>
26144 * class.cs (Operator::CheckUnaryOperator): Correct error number used
26145 to make it coincide with MS' number.
26146 (Operator::CheckBinaryOperator): Ditto.
26148 * ../errors/errors.txt : Remove error numbers added earlier.
26150 * ../errors/cs1019.cs : Test case for error # 1019
26152 * ../errros/cs1020.cs : Test case for error # 1020
26154 * cs-parser.jay : Clean out commented cruft.
26155 (dimension_separators, dimension_separator): Comment out. Ostensibly not
26156 used anywhere - non-reducing rule.
26157 (namespace_declarations): Non-reducing rule - comment out.
26159 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
26160 with TypeContainer::AddEnum.
26162 * delegate.cs : New file for delegate handling classes.
26163 (Delegate): Class for declaring delegates.
26165 * makefile : Update.
26167 * cs-parser.jay (delegate_declaration): Implement.
26169 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
26171 * class.cs (Event::Define): Implement.
26172 (Event.EventBuilder): New member.
26174 * class.cs (TypeContainer::Populate): Update to define all enums and events
26176 (Events): New property for the events arraylist we hold. Shouldn't we move to using
26177 readonly fields for all these cases ?
26179 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
26181 * class.cs (Property): Revamp to use the convention of making fields readonly.
26182 Accordingly modify code elsewhere.
26184 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
26185 the Define method of the Property class.
26187 * class.cs : Clean up applied patch and update references to variables etc. Fix
26189 (TypeContainer::Populate): Update to define all the properties we have. Also
26190 define all enumerations.
26192 * enum.cs (Define): Implement.
26194 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
26196 * cs-parser.jay (overloadable_operator): The semantic value is an
26197 enum of the Operator class.
26198 (operator_declarator): Implement actions.
26199 (operator_declaration): Implement.
26201 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
26202 validity of definitions.
26203 (Operator::CheckBinaryOperator): Static method to check for binary operators
26204 (TypeContainer::AddOperator): New method to add an operator to a type.
26206 * cs-parser.jay (indexer_declaration): Added line to actually call the
26207 AddIndexer method so it gets added ;-)
26209 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
26210 already taken care of by the MS compiler ?
26212 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
26214 * class.cs (Operator): New class for operator declarations.
26215 (Operator::OpType): Enum for the various operators.
26217 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
26219 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
26220 ostensibly handle this in semantic analysis.
26222 * cs-parser.jay (general_catch_clause): Comment out
26223 (specific_catch_clauses, specific_catch_clause): Ditto.
26224 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
26225 (catch_args, opt_catch_args): New productions.
26226 (catch_clause): Rewrite to use the new productions above
26227 (catch_clauses): Modify accordingly.
26228 (opt_catch_clauses): New production to use in try_statement
26229 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
26230 and re-write the code in the actions to extract the specific and
26231 general catch clauses by being a little smart ;-)
26233 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
26234 Hooray, try and catch statements parse fine !
26236 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
26238 * statement.cs (Block::GetVariableType): Fix logic to extract the type
26239 string from the hashtable of variables.
26241 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
26242 I end up making that mistake ;-)
26243 (catch_clauses): Fixed gross error which made Key and Value of the
26244 DictionaryEntry the same : $1 !!
26246 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
26248 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
26250 * cs-parser.jay (event_declaration): Correct to remove the semicolon
26251 when the add and remove accessors are specified.
26253 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
26255 * cs-parser.jay (IndexerDeclaration): New helper class to hold
26256 information about indexer_declarator.
26257 (indexer_declarator): Implement actions.
26258 (parsing_indexer): New local boolean used to keep track of whether
26259 we are parsing indexers or properties. This is necessary because
26260 implicit_parameters come into picture even for the get accessor in the
26261 case of an indexer.
26262 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
26264 * class.cs (Indexer): New class for indexer declarations.
26265 (TypeContainer::AddIndexer): New method to add an indexer to a type.
26266 (TypeContainer::indexers): New member to hold list of indexers for the
26269 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
26271 * cs-parser.jay (add_accessor_declaration): Implement action.
26272 (remove_accessor_declaration): Implement action.
26273 (event_accessors_declaration): Implement
26274 (variable_declarators): swap statements for first rule - trivial.
26276 * class.cs (Event): New class to hold information about event
26278 (TypeContainer::AddEvent): New method to add an event to a type
26279 (TypeContainer::events): New member to hold list of events.
26281 * cs-parser.jay (event_declaration): Implement actions.
26283 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
26285 * cs-parser.jay (dim_separators): Implement. Make it a string
26286 concatenating all the commas together, just as they appear.
26287 (opt_dim_separators): Modify accordingly
26288 (rank_specifiers): Update accordingly. Basically do the same
26289 thing - instead, collect the brackets here.
26290 (opt_rank_sepcifiers): Modify accordingly.
26291 (array_type): Modify to actually return the complete type string
26292 instead of ignoring the rank_specifiers.
26293 (expression_list): Implement to collect the expressions
26294 (variable_initializer): Implement. We make it a list of expressions
26295 essentially so that we can handle the array_initializer case neatly too.
26296 (variable_initializer_list): Implement.
26297 (array_initializer): Make it a list of variable_initializers
26298 (opt_array_initializer): Modify accordingly.
26300 * expression.cs (New::NType): Add enumeration to help us
26301 keep track of whether we have an object/delegate creation
26302 or an array creation.
26303 (New:NewType, New::Rank, New::Indices, New::Initializers): New
26304 members to hold data about array creation.
26305 (New:New): Modify to update NewType
26306 (New:New): New Overloaded contructor for the array creation
26309 * cs-parser.jay (array_creation_expression): Implement to call
26310 the overloaded New constructor.
26312 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
26314 * class.cs (TypeContainer::Constructors): Return member
26315 constructors instead of returning null.
26317 2001-08-26 Miguel de Icaza <miguel@ximian.com>
26319 * typemanager.cs (InitCoreTypes): Initialize the various core
26320 types after we have populated the type manager with the user
26321 defined types (this distinction will be important later while
26322 compiling corlib.dll)
26324 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
26325 on Expression Classification. Now all expressions have a method
26326 `Resolve' and a method `Emit'.
26328 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
26329 generation from working. Also add some temporary debugging
26332 2001-08-24 Miguel de Icaza <miguel@ximian.com>
26334 * codegen.cs: Lots of code generation pieces. This is only the
26335 beginning, will continue tomorrow with more touches of polish. We
26336 handle the fundamentals of if, while, do, for, return. Others are
26337 trickier and I need to start working on invocations soon.
26339 * gen-treedump.cs: Bug fix, use s.Increment here instead of
26342 * codegen.cs (EmitContext): New struct, used during code
26343 emission to keep a context. Most of the code generation will be
26346 * cs-parser.jay: Add embedded blocks to the list of statements of
26347 this block. So code generation proceeds in a top down fashion.
26349 2001-08-23 Miguel de Icaza <miguel@ximian.com>
26351 * statement.cs: Add support for multiple child blocks.
26353 2001-08-22 Miguel de Icaza <miguel@ximian.com>
26355 * codegen.cs (EmitCode): New function, will emit the code for a
26356 Block of code given a TypeContainer and its ILGenerator.
26358 * statement.cs (Block): Standard public readonly optimization.
26359 (Block::Block constructors): Link children.
26360 (Block::Child): Child Linker.
26361 (Block::EmitVariables): Emits IL variable declarations.
26363 * class.cs: Drop support for MethodGroups here, delay until
26365 (Method::): Applied the same simplification that I did before, and
26366 move from Properties to public readonly fields.
26367 (Method::ParameterTypes): Returns the parameter types for the
26368 function, and implements a cache that will be useful later when I
26369 do error checking and the semantic analysis on the methods is
26371 (Constructor::GetCallingConvention): Renamed from CallingConvetion
26372 and made a method, optional argument tells whether this is a class
26373 or a structure to apply the `has-this' bit.
26374 (Method::GetCallingConvention): Implement, returns the calling
26376 (Method::Define): Defines the type, a second pass is performed
26377 later to populate the methods.
26379 (Constructor::ParameterTypes): implement a cache similar to the
26380 one on Method::ParameterTypes, useful later when we do semantic
26383 (TypeContainer::EmitMethod): New method. Emits methods.
26385 * expression.cs: Removed MethodGroup class from here.
26387 * parameter.cs (Parameters::GetCallingConvention): new method.
26389 2001-08-21 Miguel de Icaza <miguel@ximian.com>
26391 * class.cs (TypeContainer::Populate): Drop RootContext from the
26394 (Constructor::CallingConvention): Returns the calling convention.
26395 (Constructor::ParameterTypes): Returns the constructor parameter
26398 (TypeContainer::AddConstructor): Keep track of default constructor
26399 and the default static constructor.
26401 (Constructor::) Another class that starts using `public readonly'
26402 instead of properties.
26404 (Constructor::IsDefault): Whether this is a default constructor.
26406 (Field::) use readonly public fields instead of properties also.
26408 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
26409 track of static constructors; If none is used, turn on
26410 BeforeFieldInit in the TypeAttributes.
26412 * cs-parser.jay (opt_argument_list): now the return can be null
26413 for the cases where there are no arguments.
26415 (constructor_declarator): If there is no implicit `base' or
26416 `this', then invoke the default parent constructor.
26418 * modifiers.cs (MethodAttr): New static function maps a set of
26419 modifiers flags into a MethodAttributes enum
26420 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
26421 MethodAttr, TypeAttr to represent the various mappings where the
26422 modifiers are used.
26423 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
26425 2001-08-19 Miguel de Icaza <miguel@ximian.com>
26427 * parameter.cs (GetParameterInfo): Fix bug where there would be no
26430 * interface.cs (PopulateIndexer): Implemented the code generator
26431 for interface indexers.
26433 2001-08-17 Miguel de Icaza <miguel@ximian.com>
26435 * interface.cs (InterfaceMemberBase): Now we track the new status
26438 (PopulateProperty): Implement property population. Woohoo! Got
26439 Methods and Properties going today.
26441 Removed all the properties for interfaces, and replaced them with
26442 `public readonly' fields.
26444 2001-08-16 Miguel de Icaza <miguel@ximian.com>
26446 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
26447 initialize their hashtables/arraylists only when they are needed
26448 instead of doing this always.
26450 * parameter.cs: Handle refs and out parameters.
26452 * cs-parser.jay: Use an ArrayList to construct the arguments
26453 instead of the ParameterCollection, and then cast that to a
26456 * parameter.cs: Drop the use of ParameterCollection and use
26457 instead arrays of Parameters.
26459 (GetParameterInfo): Use the Type, not the Name when resolving
26462 2001-08-13 Miguel de Icaza <miguel@ximian.com>
26464 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
26465 and instead use public readonly fields.
26467 * class.cs: Put back walking code for type containers.
26469 2001-08-11 Miguel de Icaza <miguel@ximian.com>
26471 * class.cs (MakeConstant): Code to define constants.
26473 * rootcontext.cs (LookupType): New function. Used to locate types
26476 2001-08-08 Miguel de Icaza <miguel@ximian.com>
26478 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
26479 this System.Reflection code is. Kudos to Microsoft
26481 * typemanager.cs: Implement a type cache and avoid loading all
26482 types at boot time. Wrap in LookupType the internals. This made
26483 the compiler so much faster. Wow. I rule!
26485 * driver.cs: Make sure we always load mscorlib first (for
26486 debugging purposes, nothing really important).
26488 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
26489 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
26491 * rootcontext.cs: Lookup types on their namespace; Lookup types
26492 on namespaces that have been imported using the `using' keyword.
26494 * class.cs (TypeContainer::TypeAttr): Virtualize.
26495 (Class::TypeAttr): Return attributes suitable for this bad boy.
26496 (Struct::TypeAttr): ditto.
26497 Handle nested classes.
26498 (TypeContainer::) Remove all the type visiting code, it is now
26499 replaced with the rootcontext.cs code
26501 * rootcontext.cs (GetClassBases): Added support for structs.
26503 2001-08-06 Miguel de Icaza <miguel@ximian.com>
26505 * interface.cs, statement.cs, class.cs, parameter.cs,
26506 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
26507 Drop use of TypeRefs, and use strings instead.
26509 2001-08-04 Miguel de Icaza <miguel@ximian.com>
26513 * class.cs (Struct::Struct): set the SEALED flags after
26514 checking the modifiers.
26515 (TypeContainer::TypeAttr): new property, returns the
26516 TypeAttributes for a class.
26518 * cs-parser.jay (type_list): Oops, list production was creating a
26519 new list of base types.
26521 * rootcontext.cs (StdLib): New property.
26522 (GetInterfaceTypeByName): returns an interface by type name, and
26523 encapsulates error handling here.
26524 (GetInterfaces): simplified.
26525 (ResolveTree): Encapsulated all the tree resolution here.
26526 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
26529 * driver.cs: Add support for --nostdlib, to avoid loading the
26530 default assemblies.
26531 (Main): Do not put tree resolution here.
26533 * rootcontext.cs: Beginning of the class resolution.
26535 2001-08-03 Miguel de Icaza <miguel@ximian.com>
26537 * rootcontext.cs: Provide better error reporting.
26539 * cs-parser.jay (interface_base): set our $$ to be interfaces.
26541 * rootcontext.cs (CreateInterface): Handle the case where there
26542 are no parent interfaces.
26544 (CloseTypes): Routine to flush types at the end.
26545 (CreateInterface): Track types.
26546 (GetInterfaces): Returns an array of Types from the list of
26547 defined interfaces.
26549 * typemanager.c (AddUserType): Mechanism to track user types (puts
26550 the type on the global type hash, and allows us to close it at the
26553 2001-08-02 Miguel de Icaza <miguel@ximian.com>
26555 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
26556 RecordInterface instead.
26558 * cs-parser.jay: Updated to reflect changes above.
26560 * decl.cs (Definition): Keep track of the TypeBuilder type that
26561 represents this type here. Not sure we will use it in the long
26562 run, but wont hurt for now.
26564 * driver.cs: Smaller changes to accomodate the new code.
26566 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
26569 * rootcontext.cs (CreateInterface): New method, used to create
26570 the System.TypeBuilder type for interfaces.
26571 (ResolveInterfaces): new entry point to resolve the interface
26573 (CodeGen): Property, used to keep track of the code generator.
26575 2001-07-26 Miguel de Icaza <miguel@ximian.com>
26577 * cs-parser.jay: Add a second production for delegate_declaration
26580 (enum_body): Put an opt_comma here instead of putting it on
26581 enum_body or enum_member_declarations so we can handle trailing
26582 commas on enumeration members. Gets rid of a shift/reduce.
26584 (type_list): Need a COMMA in the middle.
26586 (indexer_declaration): Tell tokenizer to recognize get/set
26588 * Remove old targets.
26590 * Re-add the parser target.
26592 2001-07-13 Simon Cozens <simon@simon-cozens.org>
26594 * cs-parser.jay: Add precendence rules for a number of operators
26595 ot reduce the number of shift/reduce conflicts in the grammar.
26597 2001-07-17 Miguel de Icaza <miguel@ximian.com>
26599 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
26602 Get rid of old crufty code.
26604 * rootcontext.cs: Use this to keep track of the parsed
26605 representation and the defined types available to the program.
26607 * gen-treedump.cs: adjust for new convention.
26609 * type.cs: Split out the type manager, and the assembly builder
26612 * typemanager.cs: the type manager will live here now.
26614 * cil-codegen.cs: And the code generator here.
26616 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
26618 * makefile: Fixed up for easy making.
26620 2001-07-13 Simon Cozens <simon@simon-cozens.org>
26622 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
26625 (unary_expression): Expand pre_increment_expression and
26626 post_decrement_expression to reduce a shift/reduce.
26628 2001-07-11 Simon Cozens
26630 * cs-tokenizer.cs: Hex numbers should begin with a 0.
26632 Improve allow_keyword_as_indent name.
26634 2001-06-19 Miguel de Icaza <miguel@ximian.com>
26636 * Adjustments for Beta2.
26638 2001-06-13 Miguel de Icaza <miguel@ximian.com>
26640 * decl.cs: Added `Define' abstract method.
26641 (InTransit): new property, used to catch recursive definitions.
26643 * interface.cs: Implement `Define'.
26645 * modifiers.cs: Map Modifiers.constants to
26646 System.Reflection.TypeAttribute flags.
26648 * class.cs: Keep track of types and user-defined types.
26649 (BuilderInit): New method for creating an assembly
26650 (ResolveType): New function to launch the resolution process, only
26651 used by interfaces for now.
26653 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
26654 that are inserted into the name space.
26656 2001-06-08 Miguel de Icaza <miguel@ximian.com>
26658 * ARGH. I have screwed up my tree so many times due to the use of
26659 rsync rather than using CVS. Going to fix this at once.
26661 * driver.cs: Objetify driver. Load assemblies, use assemblies to
26664 2001-06-07 Miguel de Icaza <miguel@ximian.com>
26666 * Experiment successful: Use System.Type rather that our own
26669 2001-05-25 Miguel de Icaza <miguel@ximian.com>
26671 * cs-parser.jay: Removed nsAliases from here.
26673 Use new namespaces, handle `using XXX;'
26675 * namespace.cs: Reimplemented namespace handling, use a recursive
26676 definition of the class. Now we can keep track of using clauses
26677 and catch invalid using clauses.
26679 2001-05-24 Miguel de Icaza <miguel@ximian.com>
26681 * gen-treedump.cs: Adapted for all the renaming.
26683 * expression.cs (Expression): this class now has a Type property
26684 which returns an expression Type.
26686 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
26687 `Type', as this has a different meaning now in the base
26689 2001-05-22 Miguel de Icaza <miguel@ximian.com>
26691 * interface.cs, class.cs: Removed from all the sources the
26692 references to signature computation, as we can not do method
26693 signature computation during the parsing time, as we are not
26694 trying to solve at that point distinguishing:
26698 void a (NS.Blah x) {}
26701 Which depending on the context might be valid or not, as we do not
26702 know if Blah is the same thing as NS.Blah at that point.
26704 * Redid everything so the code uses TypeRefs now instead of
26705 Types. TypeRefs are just temporary type placeholders, that need
26706 to be resolved. They initially have a pointer to a string and the
26707 current scope in which they are used. This is used later by the
26708 compiler to resolve the reference to an actual Type.
26710 * DeclSpace is no longer a CIR.Type, and neither are
26711 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
26712 are all DeclSpaces, but no Types.
26714 * type.cs (TypeRefManager): This implements the TypeRef manager,
26715 which keeps track of all the types that need to be resolved after
26716 the parsing has finished.
26718 2001-05-13 Miguel de Icaza <miguel@ximian.com>
26720 * ARGH. We are going to have to store `foreach' as a class rather
26721 than resolving it, as we need to verify error 1579 after name
26722 resolution. *OR* we could keep a flag that says `This request to
26723 IEnumerator comes from a foreach statement' which we can then use
26724 to generate the error.
26726 2001-05-10 Miguel de Icaza <miguel@ximian.com>
26728 * class.cs (TypeContainer.AddMethod): we now add methods to the
26729 MethodGroup instead of the method hashtable.
26731 * expression.cs: Add MethodGroup abstraction, which gets us one
26732 step closer to the specification in the way we handle method
26735 * cs-parser.jay (primary_expression): qualified_identifier now
26736 tried to match up an identifier to a local variable reference or
26737 to a parameter reference.
26739 current_local_parameters is now a parser global variable that
26740 points to the current parameters for the block, used during name
26743 (property_declaration): Now creates an implicit `value' argument to
26746 2001-05-09 Miguel de Icaza <miguel@ximian.com>
26748 * parameter.cs: Do not use `param' arguments as part of the
26749 signature, per the spec.
26751 2001-05-08 Miguel de Icaza <miguel@ximian.com>
26753 * decl.cs: Base class for classes, structs and interfaces. This
26754 is the "Declaration Space"
26756 * cs-parser.jay: Use CheckDef for checking declaration errors
26757 instead of having one on each function.
26759 * class.cs: Factor out some code for handling error handling in
26760 accordance to the "Declarations" section in the "Basic Concepts"
26761 chapter in the ECMA C# spec.
26763 * interface.cs: Make all interface member classes derive from
26764 InterfaceMemberBase.
26766 2001-05-07 Miguel de Icaza <miguel@ximian.com>
26768 * Many things: all interfaces are parsed and generated in
26769 gen-treedump. Support for member variables, constructors,
26770 destructors, properties, constants is there.
26772 Beginning of the IL backend, but very little done, just there for
26775 2001-04-29 Miguel de Icaza <miguel@ximian.com>
26777 * cs-parser.jay: Fix labeled statement.
26779 * cs-tokenizer.cs (escape): Escape " and ' always.
26780 ref_line, ref_name: keep track of the line/filename as instructed
26781 by #line by the compiler.
26784 2001-04-27 Miguel de Icaza <miguel@ximian.com>
26786 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
26787 to match the values in System.CodeDOM.
26789 Divid renamed to Divide.
26791 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
26793 (Statements.set): remove.
26795 * System.CodeDOM/CodeCatchClause.cs: always have a valid
26798 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
26799 falseStatements always have valid values.
26801 * cs-parser.jay: Use System.CodeDOM now.