1 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
3 * doc.cs : delegates must not be referenced with parameters.
6 2005-04-12 Miguel de Icaza <miguel@novell.com>
8 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
10 2005-04-11 Marek Safar <marek.safar@seznam.cz>
13 * class.cs (TypeContainer.CircularDepException) New nested
15 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
16 (TypeContainer.DefineType): Removed error, reset InTransit before
18 (Class.DefineType): Throw exception when is in Transit.
19 Catch exception and report error.
20 (Struct.DefineType): Throw exception when is in Transit.
21 Catch exception and report error.
22 (Interface.DefineType): Throw exception when is in Transit.
23 Catch exception and report error.
25 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
26 handle nested exception handlers.
28 * flowanalysis.cs (InTryWithCatch): New method, search for try with
31 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
32 InFinally and InCatch storage.
34 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
35 (Catch.Resolve): Set and Restore ec.InCatch.
36 (Try.Resolve): Set and Restore ec.InFinally.
37 (Try.HasCatch): True when try has catch.
39 2005-04-10 Miguel de Icaza <miguel@novell.com>
41 * driver.cs (MainDriver): Stop processing if the CLS stage found
44 (CompilerCallableEntryPoint.InvokeCompiler): Always
45 reset after execution; Take a TextWriter argument for the
48 * report.cs: Use the error stream instead of hardcoding stderr.
50 2005-04-09 Miguel de Icaza <miguel@novell.com>
52 * class.cs: Reduce code paths to test, too small of an
53 optimization to make it worth the extra testing. Always perform
56 2005-04-08 Raja R Harinath <rharinath@novell.com>
59 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
60 operators that had errors reported on them.
62 2005-04-08 Marek Safar <marek.safar@seznam.cz>
64 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
66 (Attribute.Resolve): Add named argument type checking.
68 * class.cs (FixedField.Define): Use IsPrimitiveType
70 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
72 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
73 unsafe parameter types.
75 * statement.cs (Using.ResolveExpression): Add better error description.
77 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
79 2005-04-08 Raja R Harinath <rharinath@novell.com>
82 * attribute.cs (Attribute.GetAttributeUsage): Resolve
83 AttributeUsageAttribute in the emitcontext of the attribute class,
84 not in the emitcontext of the attributable entity it was attached to.
85 * cs-parser.jay: Use 'current_class', not 'current_container',
86 when creating a GlobalAttribute.
88 2005-04-08 Alp Toker <alp@atoker.com>
90 * pending.cs: The fix to #58413 failed to compile methods implementing
91 interfaces with/without params modifiers and vice versa, even though
92 params modifiers aren't part of the signature. Make the modifier check
93 less strict as in csc.
95 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
96 Anoob V E <projectmonokochi@rediffmail.com>
97 Harilal P R <projectmonokochi@rediffmail.com>
100 * pending.cs (TypeAndMethods.mods): New. Store the parameter
101 modifiers of pending methods.
102 (PendingImplementation.PendingImplementation): Initialize it.
103 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
104 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
105 with ParameterData. Add check for modifiers.
106 * class.cs (MethodData.Define): Update to changes.
108 2005-04-07 Raja R Harinath <rharinath@novell.com>
110 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
112 2005-04-07 Marek Safar <marek.safar@seznam.cz>
114 * class.cs (PropertyMethod.Define): Check private accessor in abstract
117 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
120 * typemanager.cs: Registered RequiredAttributeAttribute.
122 2005-04-06 Marek Safar <marek.safar@seznam.cz>
124 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
125 Warning CS0169 is back at level 3.
126 (IMethodData.SetMemberIsUsed): New method.
128 * decl.cs (IsUsed): New value; moved from FieldBase.Status
129 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
131 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
133 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
135 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
138 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
141 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
142 to avoid the problems with nested types.
144 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
145 Anoob V.E <projectmonokochi@rediffmail.com>
146 Harilal P.R <projectmonokochi@rediffmail.com>
147 Raja R Harinath <rharinath@novell.com>
150 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
152 * typemanager (GetConstructor): Make public.
154 2005-04-05 John Luke <john.luke@gmail.com>
155 Raja R Harinath <rharinath@novell.com>
158 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
159 struct too. Return false quicker in a few cases.
160 (VerifyUnManaged): Use it.
162 2005-04-05 Raja R Harinath <rharinath@novell.com>
165 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
166 not 'unreachable_seen'.
168 2005-04-04 Marek Safar <marek.safar@seznam.cz>
170 * attribute.cs (Attribute.GetValue): Removed unused.
172 * codegen.cs (CodeGen.TrimExt): Removed unused.
174 * cs-parser.jay (output): Removed unused.
176 * cs-tokenizer.cs (hex_digits): Removed unused.
178 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
180 * expression.cs (Indirection.LoadExprValue): Removed unused.
181 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
183 * iterators.cs (Iterator.param_types): Removed unused.
185 * statement.cs (Goto.block): Removed unused.
186 (ToplevelBlock.did): Removed unused.
187 (Switch.ResolveConstantSwitch): Removed unused.
189 2005-04-01 Ben Maurer <bmaurer@ximian.com>
191 * rootcontext.cs: Allow mcs to bootstrap with the compilation
194 2005-04-01 Raja R Harinath <rharinath@novell.com>
196 Fix #74232 and cs0208-3.cs.
197 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
198 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
199 unmanaged type. Don't use FieldBuilders when 't' is a
200 TypeBuilder. Use ModFlags and MemberType fields.
201 * class.cs (MemberBase.member_type): Rename from MemberType.
202 (MemberBase.MemberType): New property. Determines member_type on
204 (MemberBase.DoDefine): Don't initialize MemberType here.
205 (FieldMember.Define): Likewise.
207 2005-04-01 Marek Safar <marek.safar@seznam.cz>
210 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
211 Attributes are emitted there.
213 2005-04-01 Raja R Harinath <rharinath@novell.com>
215 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
216 keyword in 'partial enum' too.
217 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
219 Report from Kamil Skalski <nazgul@omega.pl>.
222 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
223 have partial containers too.
225 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
226 in block' checks to Block.CheckInvariantMeaningInBlock.
227 * statement.cs (Block.GetKnownVariableInfo): Make private.
228 (Block.IsVariableUsedInChildBlock): Remove.
229 (Block.IsVariableUsedInBlock): Likewise.
230 (Block.CheckInvariantMeaningInBlock): New. Show location of
231 conflicting declaration.
232 (Block.AddVariable): Make error messages less long-winded and more
233 specific. Show location of conflicting declaration.
234 * parameter.cs (Parameters.Location): New readonly property.
236 2005-03-31 Raja R Harinath <rharinath@novell.com>
238 Clean up semantics of invoking ResolveMemberAccess.
239 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
240 can have an instance, ensure that we pass in a non-TypeExpression
241 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
242 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
243 argument. Update to changes and simplify.
244 (FieldExpr.Emitinstance): Remove CS0120 check.
245 (PropertyExpr.EmitInstance): Likewise.
246 * expression.cs (Argument.Resolve): Likewise.
247 (Invocation.DoResolve): Update to changes in semantics of
250 2005-03-31 Marek Safar <marek.safar@seznam.cz>
253 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
256 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
258 2005-03-31 Raja R Harinath <rharinath@novell.com>
260 Fix difference in behaviour with commandline invocation.
261 * driver.cs (Driver.Reset): New.
262 (CompilerCallableEntryPoint): Call it.
264 * statement.cs (If.Resolve): Avoid spurious "uninitialized
265 variable" warnings if the boolean expression failed to resolve.
267 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
269 * attribute.cs: Fix the union of several permissions when some of them
270 are unrestricted (so the result isn't an unrestricted permission set).
273 2005-03-30 Raja R Harinath <rharinath@novell.com>
275 * ecore.cs (MemberExpr): New class. Convert from interface
277 (MemberExpr.ResolveMemberAccess): Refactor and move here from
278 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
280 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
281 (MethodGroupExpr.IsExplicitImpl): Remove.
282 (Expression.GetFieldFromEvent): Remove.
283 (SimpleName.MemberStaticCheck): Remove.
284 (SimpleName.DoSimpleNameResolve): Update to changes.
285 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
286 (MemberAccess.IdenticalNameAndTypeName): Remove.
287 (MemberAccess.error176): Move to MemberExpr.
288 (MemberAccess.DoResolve): Update to changes.
289 (BaseAccess.DoResolve): Likewise.
291 2005-03-30 Marek Safar <marek.safar@seznam.cz>
293 C# 2.0 Conditional attribute class implementation
295 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
296 Analyzes class whether it has attribute which has ConditionalAttribute
297 and its condition is not defined.
299 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
300 (Class.IsExcluded): New method. Search for at least one defined
301 condition in ConditionalAttribute of attribute class.
303 2005-03-30 Raja R Harinath <rharinath@novell.com>
305 * ecore.cs (PropertyExpr): Derive from Expression, not
307 (PropertyExpr.EmitStatement): Remove.
309 2005-03-29 Raja R Harinath <rharinath@novell.com>
312 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
313 internal field "value__" of an enum be private. The examples for
314 "value__" that I found on MSDN all used FieldAttributes.Private.
316 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
317 Don't mention IL method attribute names.
319 Fix #47991. Remove a TODO.
320 * statement.cs (Block.Toplevel): Make into a field.
321 (Block.Parameters): Move into ToplevelBlock.
322 (Block.known_variables): Rename from child_variable_names.
323 (Block.Block): Remove variants that take Parameters. Initialize
324 'Toplevel' with the immediately surrounding toplevel block.
325 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
327 (Block.GetKnownVariableInfo): New.
328 (Block.IsVariableNameUsedInChildBlock): Update.
329 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
330 the block, even though it may not be in scope.
331 (Block.AddVariable): Remove Parameters parameter. Use
332 Toplevel.Parameters instead.
333 (Block.AddConstant): Remove Parameters parameter.
334 (Block.GetParameterReference): Update to use Toplevel.Parameters.
335 (Block.IsParamaterReference): Likewise.
336 (Block.IsLocalParameter): Likewise. Simplify a lot.
337 (ToplevelBlock.Parameters): New. Moved from Block.
338 (ToplevelBlock.ToplevelBlock): Update to changes. Always
339 initialize Parameters to a non-null value.
340 * cs-parser.jay: Update to changes.
341 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
342 simple names that mean different things in the same block. Use
343 Block.IsVariableNameUsedInBlock.
345 2005-03-28 Raja R Harinath <rharinath@novell.com>
347 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
348 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
349 GetTypeHandle. It is possible for a reflected type to derive from
350 a TypeBuilder (e.g., int[] derives from the TypeBuilder
351 System.Array during mscorlib compilation).
352 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
353 contain a method_hash, don't create one either. Don't create a
354 deep copy of the base cache's method_hash.
355 (MemberCache.SetupCache): Rename back from DeepCopy.
356 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
357 already initialized. If we see an override function, add its
358 underlying base virtual function to the member_hash too.
360 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
362 2005-03-26 Raja R Harinath <harinath@acm.org>
365 * assign.cs (Assign.DoResolve): When the RHS of an assignment
366 fails to resolve, ensure that the LHS is still resolved as an
369 2005-03-25 Raja R Harinath <harinath@acm.org>
371 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
373 (Enum.current_ec): Remove.
374 (Enum.LookupEnumValue): Remove EmitContext argument.
375 Just uses the one created during DefineType.
376 (Enum.FindMembers): Update.
377 * expression.cs (MemberAccess.DoResolve): Update.
379 2005-03-22 Marek Safar <marek.safar@seznam.cz>
381 * assign.cs (Assign.DoResolve): Check for CS1717 when
382 source and target are same (uses Equals).
384 * expression.cs (LocalVariableReference, ParameterReference,
385 This): Implemented Equals, GetHashCode.
387 * statement.cs (Block.GetParameterReference): Removed useless
390 2005-03-22 Raja R Harinath <rharinath@novell.com>
393 * statement.cs (Block.AddVariable): Ensure that we skip implicit
394 blocks before deciding whether the error is cs0136 or cs0128.
396 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
397 (using_alias_directive, using_namespace_directive): Pass
398 MemberName, not an expression to Namespace.UsingAlias and
400 (MakeName): Use the MemberName of the namespace.
401 * namespace.cs (Namespace.MemberName): New.
402 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
403 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
405 * decl.cs (MemberName.Name): Make readonly.
406 (MemberName.FromDotted): New "constructor".
407 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
408 (MemberCore.Name): Compute from MemberName on demand.
409 (MemberCore.SetMemberName): Provide a way to change the
411 (MemberCore.AddToContainer): Don't take a fullname parameter.
412 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
413 fully qualified name of the container to the member name.
414 (TypeContainer.AddToTypeContainer): Use a fully qualified name
415 only if the type is a member of the root container.
416 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
417 MemberName.Left rather than searching for an embedded ".".
418 (PartialContainer.CreatePart): Update to changes in RootContext.
419 (MemberBase.ShortName): Turn into a property. Use
420 MemberCore.SetMemberName.
421 (MemberBase.ExplicitInterfaceName): Remove.
422 (MemberBase.UpdateMemberName): Remove.
423 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
424 (PropertyBase.SetMemberName): New override.
425 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
427 (Tree.AllDecls): Rename from Decls.
428 * attribute.cs, enum.cs, report.cs: Update to changes.
429 * driver.cs (MainDriver): Use MemberName.FromDotted on
430 RootContext.MainClass.
432 2005-03-21 Marek Safar <marek.safar@seznam.cz>
434 * class.cs (FixedField.Define): Check for CS1664 and more sanity
437 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
439 2005-03-18 Marek Safar <marek.safar@seznam.cz>
441 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
442 property accessor modifiers.
444 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
445 fixed buffer attribute (CS1716).
446 (PropertyMethod.HasCustomAccessModifier): When property accessor
449 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
451 (PropertyExpr.DoResolveLValue): Add CS0272.
453 2005-03-17 Miguel de Icaza <miguel@novell.com>
455 * convert.cs: When converting to a pointer, use the proper Conv.U
456 or Conv.I depending on the source data type.
458 * cs-tokenizer.cs: Make the size for large decimal constants,
461 2005-03-17 Martin Baulig <martin@ximian.com>
463 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
464 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
466 2005-03-17 Martin Baulig <martin@ximian.com>
468 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
469 to bool so we can return an error condition.
470 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
473 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
475 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
478 2005-03-16 Raja R Harinath <rharinath@novell.com>
480 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
481 Refactor to avoid traversing the list of assemblies, and to avoid
482 string concatenation.
483 * typemanager.cs (guid_attr_type): Remove.
484 (negative_hits, pointers, references): Remove hashes.
486 (GetConstructedType): New. Uses type_hash to handle constructed
487 types (arrays, references, pointers).
488 (GetReferenceType, GetPointerType): Use it.
489 (GetNestedType): New. Uses type_hash to handle nested types of
491 (LookupType, LookupTypeDirect): Remove.
492 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
493 'types' hash and LookupTypeReflection directly.
494 (params_string, params_object): Use GetConstructedType.
495 * namespace.cs (Namespace.cached_types): New. Cache of reflected
497 (Namespace.Lookup): Use cached_types.
498 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
499 provided by old TypeManager.LookupType.
500 * rootcontext.cs (MakeFQN): Remove.
501 * decl.cs (DeclSpace.MakeFQN): Likewise.
502 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
503 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
504 TypeManager.GetConstructedType.
505 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
507 2005-03-15 Marek Safar <marek.safar@seznam.cz>
509 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
512 * cs-parser.jay: Reports CS1527 for any namespace element.
514 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
517 * expression.cs (ParameterReference.IsAssigned): Changed error to
519 (Error_WrongNumArguments): Moved CS0245 detection here.
521 * statement.cs (Return.Resolve): Add CS1622 report.
523 2005-03-11 Marek Safar <marek.safar@seznam.cz>
525 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
527 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
529 * attribute.cs expression.cs: Get rid of some allocations.
531 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
533 * doc.cs : just eliminate the latest change.
535 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
537 * doc.cs : commented out the latest change. It breaks xml-030.cs
539 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
541 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
542 fail. So invoke CreateType() in FindDocumentedType().
544 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
546 * cs-tokenizer.cs : added IsKeyword().
547 * doc.cs : Detect keyword incorrectly used as identifier.
548 Allow identifiers prefixed by @.
550 2005-03-10 Marek Safar <marek.safar@seznam.cz>
552 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
553 It caused exception in namespace resolving (again!).
555 * class.cs (Class.ctor): Removed exit.
556 (PropertyMethod.ctor): ditto.
558 * codegen.cs (Codegen.Reset): Reset static data.
559 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
561 * cs-tokenizer.cs (Cleanup): Removed.
563 * driver.cs (GetSystemDir): Rewrote to one line command.
564 It caused problem with unloaded dynamic modules.
565 (UnixParseOption): Removed Exit.
566 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
567 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
568 Now can be mcs used as library.
570 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
573 * location.cs (Reset): Reset static data.
575 * namespace.cs (Reset): Reset static data.
577 * report.cs (Report.Reset): Reset static data.
579 * rootcontext.cs (RootContext.Reset): Reset static data.
581 * tree.cs (RootTypes.ctor): Use Location.Null
583 * typemanager.cs (TypeManager.Reset): Reset static data.
584 (CoreLookupType): Removed Exit.
585 (TypeHandle.Reset): Reset static data.
587 2005-03-10 Raja R Harinath <rharinath@novell.com>
590 * typemanager.cs (ComputeNamespaces): Import namespaces from
591 referenced modules too.
593 2005-03-09 Raja R Harinath <rharinath@novell.com>
595 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
598 2005-03-09 Raja R Harinath <rharinath@novell.com>
600 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
601 enclosing DeclSpace. This ensures that a name-lookup populates
602 more caches and there are fewer 'TypeExpression's. Carve out
603 nested type lookup into ...
604 (LookupNestedTypeInHierarchy): ... this.
606 2005-03-09 Raja R Harinath <rharinath@novell.com>
608 Clean up a few partial-class semantics.
609 Fixes test-357.cs and cs1618-2.cs.
610 * cs-parser.jay (struct_declaration): Use 'current_class' as
611 parent of newly-created struct. Remove call to Register ().
612 Use 'pop_current_class' to complete handing the current struct.
613 (interface_declaration): Likewise.
614 (class_declaration): Likewise.
615 (enum_declaration): Use 'current_class' as parent of newly created
617 (delegate_declaration): Likewise.
618 (pop_current_class): New function. This is used to handle closing
619 up the 'current_class' and 'current_container', and pointing them
620 to the enclosing class/container.
621 (CSharpParser): Initialize 'current_class' too.
622 * decl.cs (MemberCore): Add check for invariant: a partial
623 container is not a parsed entity, and thus does not enclose any
625 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
626 (DeclSpace.BaseTypeExpr): Use it.
627 (DeclSpace.LookupType): Add check for invariant.
628 * class.cs (TypeContainer): Add check for invariant: a nested
629 class should have the same NamespaceEntry as its enclosing class.
630 (TypeContainer.EmitFieldInitializers): Make virtual.
631 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
633 (TypeContainer.Register): Remove.
634 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
635 null. Use TypeResolveEmitContext for resolving base types and
636 interfaces. Move initialization of Parts.TypeBuilder here from
638 (TypeContainer.DefineNestedTypes): ... here.
639 (PartialContainer): Take a Namespace not a NamespaceEntry.
640 (PartialContainer.Create): Don't use Register. Call the
641 appropriate Add... function directly.
642 (ClassPart): Take both the PartialContainer and the enclosing
643 class as constructor arguments.
644 (ClassPart.EmitFieldInitializers): Override.
645 (ClassPart.PartFindNestedTypes): Remove.
646 (FieldBase.GetInitializerExpression): Resolve the initializer
647 expression in the emit context of the enclosing class.
648 * tree.cs (RootTypes): Remove Register ().
650 2005-03-08 Marek Safar <marek.safar@seznam.cz>
652 * cs-parser.jay: Removed CS0134.
654 * driver.cs: Removed CS1901.
656 * expression.cs (SizeOf.DoResolve): Don't report CS0233
657 for predefined types.
659 2005-03-07 Duncan Mak <duncan@novell.com>
661 * codegen.cs (Save): Catch UnauthorizedAccessException as
662 well. Fixes bug #73454.
664 2005-03-07 Marek Safar <marek.safar@seznam.cz>
666 * cs-tokenizer.cs (xtoken): Add CS1035.
668 * class.cs (MethodData.Define): Add CS0683.
669 (FieldMember.ctor): Add CS0681.
671 2005-03-07 Raja R Harinath <rharinath@novell.com>
673 * ecore.cs (SimpleName.DoResolve): Rename from
674 SimpleName.DoResolveAllowStatic.
675 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
676 Pass 'intermediate' flag to MemberStaticCheck.
677 (SimpleName.MemberStaticCheck): Skip "static check" only in case
678 of "intermediate" lookups via MemberAccess.
679 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
680 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
682 2005-03-07 Raja R Harinath <rharinath@novell.com>
685 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
686 slipped in because of variable names that are identical to a
687 builtin type's BCL equivalent ('string String;', 'int Int32;').
688 (PropertyExpr.EmitInstance): Likewise.
690 2005-03-04 Marek Safar <marek.safar@seznam.cz>
692 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
694 * report.cs (warning_ignore_table): Made public.
696 2005-03-04 Raja R Harinath <rharinath@novell.com>
699 * class.cs (MethodData.Emit): Pass 'container' to
700 container.GetObsoleteAttribute instead of 'container.Parent'.
702 2005-03-03 Marek Safar <marek.safar@seznam.cz>
704 * cs-parser.jay: Add 1534 error test.
706 * iterators.cs (Yield.CheckContext): Add error 1629.
707 (Iterator.ctor): Save unsafe modifier.
708 (MoveNextMethod.DoEmit): Restore unsafe context.
710 * namespace.cs (UsingAlias): Better error message.
712 2005-03-03 Dan Winship <danw@novell.com>
714 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
715 the warning message [#73219]
717 2005-03-03 Raja R Harinath <rharinath@novell.com>
719 Fix compile with MCS 1.0.0.0.
720 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
721 w_restore to not depend on string constant folding.
723 2005-03-03 Raja R Harinath <rharinath@novell.com>
725 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
726 CS0246 check to users who passed 'silent = false'.
727 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
729 (SimpleName.SimpleNameResolve): Update.
730 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
731 (MemberAccess.IdenticalNameAndTypeName): Update.
732 * doc.cs (FindDocumentedTypeNonArray): Update.
734 2005-03-03 Raja R Harinath <rharinath@novell.com>
736 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
737 * parameters.cs (ComputeAndDefineParameters): Remove.
738 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
739 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
740 Use GetParameterInfo.
742 2005-03-02 Marek Safar <marek.safar@seznam.cz>
744 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
746 2005-03-02 Raja R Harinath <rharinath@novell.com>
748 Unify DeclSpace.LookupType and DeclSpace.FindType.
749 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
750 is in charge of defining nested types on demand.
751 (DeclSpace.LookupType): Use it when the current_type is a
752 TypeBuilder. Use LookupTypeDirect for reflected types.
753 (DeclSpace.FindType): Remove.
754 (DeclSpace.LookupInterfaceOrClass): Likewise.
755 (DeclSpace.DefineTypeAndParents): Likewise.
756 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
757 DeclSpace.LookupType.
758 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
759 * typemanager.cs (LookupType): Simplify.
760 (AddUserType): Remove type from negative_hits.
761 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
762 * class.cs (TypeContainer.FindMembers): Move handling of nested
764 (TypeContainer.FindMembers_NestedTypes): ... here.
765 (TypeContainer.FindNestedType): Implement override.
766 (ClassPart.FindNestedType): Delegate to PartialContainer.
767 (ClassPart.PartFindNestedType): Looks up the nested types of the
770 2005-03-02 Martin Baulig <martin@ximian.com>
772 * class.cs (TypeContainer.DoDefineMembers): We also need a default
773 static constructor in static classes.
775 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
777 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
778 sizeParamIndex is not specified.
780 2005-03-01 Marek Safar <marek.safar@seznam.cz>
783 * report.cs (WarningMessage.IsEnabled): Missing null check.
785 2005-02-28 Marek Safar <marek.safar@seznam.cz>
787 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
788 in the fields and not in the properties.
790 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
792 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
795 2005-02-28 Marek Safar <marek.safar@seznam.cz>
797 * attribute.cs: Small refactoring (improved robustness).
798 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
799 (ValidateGuid): Removed.
800 (Resolve): Removed referenced to above mentioned.
801 (GetAttributeUsage): Made private and changed to work without
803 (GetIndexerAttributeValue): Don't crash.
804 (GetConditionalAttributeValue): Ditto.
805 (GetClsCompliantAttributeValue): Ditto.
806 (ExtractSecurityPermissionSet): All attributes exceptions are
808 (GetPropertyValue): New helper.
809 (GetMethodImplOptions): New method.
810 (DefinePInvokeMethod): Reuse common code. Implemented handling of
811 some missing properties.
813 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
814 (Method.ApplyAttributeBuilder): Updated.
816 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
819 2005-02-28 Raja R Harinath <rharinath@novell.com>
822 * report.cs (Report.SymbolRelatedToPreviousError): Handle
823 non-simple types (array, pointer, reference).
825 2005-02-28 Marek Safar <marek.safar@seznam.cz>
827 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
829 * class.cs (MethodCore.IsDuplicateImplementation): Special error
831 (Method.CheckBase): Catch wrong destructor here.
832 (MethodData.Define): Add errors 550, 668.
834 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
836 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
838 * pending.cs (VerifyPendingMethods): Add error 551.
840 * typemanager.cs (CSharpName): Next error report helper.
842 2005-02-25 Marek Safar <marek.safar@seznam.cz>
844 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
845 attributes. Removed useless attribute double check.
846 It saves almost 2MBs for corlib.
848 2005-02-25 Raja R Harinath <rharinath@novell.com>
851 * statement.cs (ExpressionStatement.Resolve): Make robust to being
852 called twice in case of error.
854 2005-02-23 Chris Toshok <toshok@ximian.com>
856 Fix compiler portions of #72827.
857 * statement.cs (Block.Emit): call Begin/EndScope on the
858 EmitContext instead of the ILGenerator.
860 * codegen.cs (EmitContext.BeginScope): new method, call
861 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
863 (EmitContext.BeginScope): same, but EndScope and CloseScope
865 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
866 offset and call the superclass's OpenScope(int) with it.
867 (SymbolWriter.CloseScope): get the current il
868 offset and call superclass's CloseScope(int) with it.
870 2005-02-23 Marek Safar <marek.safar@seznam.cz>
872 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
873 CS1677 for out and ref as well.
875 * class.cs (Method.Define): Add error CS1599 detection.
877 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
879 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
881 * delegate.cs (Delegate.Define): Add error CS1599 detection.
883 * support.cs.cs (ModifierDesc): New helper method.
885 2005-02-23 Raja R Harinath <rharinath@novell.com>
886 Abin Thomas <projectmonokochi@rediffmail.com>
887 Anoob V E <projectmonokochi@rediffmail.com>
888 Harilal P R <projectmonokochi@rediffmail.com>
891 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
892 MemberLookup (used for error reporting) actually returns a result.
893 Fix error report number (122, not 112).
895 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
896 Anoob V E <projectmonokochi@rediffmail.com>
897 Harilal P R <projectmonokochi@rediffmail.com>
900 * pending.cs (PendingImplementation.GetAbstractMethods):
901 Find NonPublic members too.
903 2005-02-22 Marek Safar <marek.safar@seznam.cz>
905 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
908 * class.cs (MethodCore.CheckMethodAgainstBase):
909 Add error 239 report.
911 2005-02-21 Raja R Harinath <rharinath@novell.com>
914 * expression.cs (Invocation.IsApplicable): Make public.
915 (Invocation.IsParamsMethodApplicable): Likewise.
916 * delegate.cs (Delegate.VerifyApplicability): Don't use
917 Invocation.VerifyArgumentCompat for parameter applicability
918 testing. Use Invocation.IsApplicable and
919 Invocation.IsParamsMethodApplicable.
921 2005-02-21 Marek Safar <marek.safar@seznam.cz>
923 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
925 * class.cs (Operator.Define): Add error 217 report.
927 2005-02-21 Raja R Harinath <rharinath@novell.com>
929 * namespace.cs (UsingEntry.Resolve): Undo change below.
931 2005-02-21 Raja R Harinath <rharinath@novell.com>
934 * ecore.cs (Expression.MemberLookupFailed): Add argument to
935 disable the error message when the extended MemberLookup also
937 (Expression.MemberLookupFinal): Update.
938 (SimpleName.DoSimpleNameResolve): Update.
939 * expression.cs (MemberAccess.ResolveNamespaceOrType):
940 Don't use MemberLookupFinal.
941 (New.DoResolve): Update.
942 (BaseAccess.CommonResolve): Update.
944 2005-02-21 Raja R Harinath <rharinath@novell.com>
947 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
948 occured previously, don't resolve again.
950 2005-02-21 Marek Safar <marek.safar@seznam.cz>
953 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
954 argument. Call ResolveAttributeUsage for unresolved.
955 when types doesn't match ctor arguments.
957 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
958 for nested attribute classes.
959 (Class.attribute_usage): Removed.
960 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
963 * ecore.cs (IsAttribute): Removed.
965 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
967 * rootcontext.cs (RegisterAttribute): Removed, attributes are
969 (attribute_types): Removed.
970 (EmitCode): Global attributes are emited as the latest.
972 2005-02-18 Marek Safar <marek.safar@seznam.cz>
974 * class.cs (EmitFieldInitializers): Don't emit field initializer
975 for default values when optimilization is on.
977 * constant.cs (Constant.IsDefaultValue): New property.
979 * driver.cs: Add /optimize handling.
983 * literal.cs: Implement new IsDefaultValue property.
985 * rootcontext.cs (Optimize): New field, holds /optimize option.
987 2005-02-18 Raja R Harinath <rharinath@novell.com>
989 Fix crasher in re-opened #72347.
990 * namespace.cs (Namespace.Lookup): Return null if
991 DeclSpace.DefineType returns null.
994 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
996 2005-02-18 Raja R Harinath <rharinath@novell.com>
998 Fix remainder of #63202. Change semantics of DoResolveLValue: it
999 now returns null if it cannot resolve to an lvalue.
1000 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
1001 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
1002 returned null. Remove check for SimpleName.
1003 (EventExpr.DoResolveLValue): New.
1004 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
1005 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
1007 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
1009 (Unary.ResolveOperator): Move CS0211 check ...
1010 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
1012 (Unary.DoResolveLValue): Simplify.
1013 (AddressOf.DoResolveLValue): New.
1014 (ArrayAccess.DoResolveLValue): New.
1016 2005-02-16 Marek Safar <marek.safar@seznam.cz>
1018 * attribute.cs (Attribute.Resolve): Add arguments casting for
1019 when types doesn't match ctor arguments.
1021 2005-02-16 Raja R Harinath <rharinath@novell.com>
1023 Fix parts of #63202.
1024 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
1025 lookup of operator in base type. Ensure that all checks happen
1026 when the operator resolves to an "op_..." method.
1028 2005-02-15 Raja R Harinath <rharinath@novell.com>
1031 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
1032 'ignore_cs0104' parameter. Pass it to ...
1033 (NamespaceEntry.Lookup): ... this.
1034 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
1035 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
1036 (TypeLookupExpression.DoResolveAsTypeStep): Update.
1037 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
1038 Update. Request that cs0104 errors be ignored.
1039 (ComposedCast.ResolveAsTypeStep): Update.
1041 2005-02-14 Raja R Harinath <rharinath@novell.com>
1044 * expression.cs (Invocation.BetterFunction): Remove support for
1045 comparing virtual functions and their overrides.
1046 (Invocation.IsOverride): New.
1047 (Invocation.OverloadResolve): Don't consider 'override' functions
1048 during candidate selection. Store them in a lookaside list.
1049 If the selected method is a 'virtual' function, use the list to
1050 find any overrides that are closer to the LHS type.
1052 2005-02-14 Marek Safar <marek.safar@seznam.cz>
1054 * expression.cs (New.DoResolve): Add complex core type reduction.
1055 (New.Constantify): Converts complex core type syntax like 'new int ()'
1058 2005-02-14 Raja R Harinath <rharinath@novell.com>
1060 * decl.cs (EntryType.EntryType): New constructor to create an
1061 updated copy of a cache entry.
1062 (MemberCache.AddMethods): Use it.
1063 (MemberCache.ClearDeclaredOnly): Remove.
1064 (MemberCache.MemberCache): Update.
1066 2005-02-11 Miguel de Icaza <miguel@novell.com>
1068 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
1069 variable. This one is represents the actual low-level declaration
1070 of the method, as opposed to the semantic level `IsStatic'.
1072 An anonymous method which is hosted into a static method might be
1073 actually an instance method. IsStatic would reflect the
1074 container, while MethodIsStatic represents the actual code
1077 * expression.cs (ParameterReference): Use the new MethodIsStatic
1078 instead of IsStatic.
1080 * anonymous.cs (AnonymousMethod.Compatible): Pass the
1081 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
1082 set on the current EmitContext.
1084 * expression.cs (Cast): Overload DoResolveLValue so we can pass
1085 resolve our casted expression as an LValue. This triggers the
1086 proper LValue processing that is later required by Assign.
1090 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
1092 2005-02-11 Marek Safar <marek.safar@seznam.cz>
1094 C# 2.0 Fixed buffer implementation
1096 * anonymous.cs: Update after RegisterHelperClass renaming.
1098 * attribute.cs (AttributeTester.fixed_buffer_cache):
1099 Cache of external fixed buffers.
1100 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
1101 implementation if field is fixed buffer else null.
1104 (TypeContainer.AddField): Accept FieldMember instead of Field.
1105 (FieldBase.IsFieldClsCompliant): Extracted code from
1106 VerifyClsCompliance descendant customization.
1107 (FixedField): New class handles fixed buffer fields.
1108 (FixedFieldExternal): Keeps information about imported fixed
1110 (IFixedField): Make access to internal or external fixed buffer
1113 * cs-parser.jay: Add fixed buffer parsing.
1115 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
1118 * expression.cs (Indirection): Extended implementation to accept
1120 (PointerArithmetic.Emit): Get element from fixed buffer as well.
1121 (ElementAccess.MakePointerAccess): Get type as parameter.
1122 (DoResolve): Add fixed buffer field expression conversion.
1123 (DoResolveLValue): Ditto.
1124 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
1125 (ArrayPtr): Derives from FixedBufferPtr.
1126 (ArrayPtr.Emit): Add extra emit for array elements.
1128 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
1130 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
1131 for compiler generated types.
1132 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
1134 * statement.cs (Fixed): Refactored to be easier add fixed buffer
1135 and consume less memory.
1136 (Fixed.Resolve): Add fixed buffer case.
1138 * typemanager.cs (compiler_generated_attr_ctor,
1139 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
1140 (HasElementType): Add our own implementation to work on every
1143 2005-02-11 Miguel de Icaza <miguel@novell.com>
1145 * anonymous.cs (CaptureContext): Track whether `this' has been
1148 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
1149 only captured `this' if it was implicitly done (instance
1150 methods/variables were used).
1152 * codegen.cs (EmitContext.CaptureThis): New method to flag that
1153 `this' must be captured.
1155 2005-01-30 Miguel de Icaza <miguel@novell.com>
1157 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
1158 is null it means that there has been no need to capture anything,
1159 so we just create a sibling.
1161 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
1163 Just a partial fix. The other half is fairly elusive.
1165 2005-02-10 Raja R Harinath <rharinath@novell.com>
1167 Fix #52586, cs0121-4.cs.
1168 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
1169 and return a hashtable.
1170 (MemberCache.ClearDeclaredOnly): New.
1171 (MemberCache.MemberCache): Update to change. Make a deep copy of
1172 the method_hash of a base type too.
1173 (MemberCache.AddMethods): Adapt to having a deep copy of the base
1174 type methods. Overwrite entries with the same MethodHandle so
1175 that the ReflectedType is correct. The process leaves in base
1176 virtual functions and their overrides as distinct entries.
1177 (CacheEntry): Now a class instead of a struct. It shouldn't alter
1178 matters since it was boxed in a ArrayList before.
1179 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
1181 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
1182 case of a virtual function and its override (choose the overload
1184 (Invocation.OverloadResolve): Avoid 'override' members during
1185 'applicable_type' calculation.
1187 2005-02-09 Raja R Harinath <rharinath@novell.com>
1189 Combine two near-redundant caches.
1190 * typemanager.cs (method_params): Rename from method_internal_params.
1191 (TypeManager.GetParameterData): New. Replace
1192 Invocation.GetParameterData.
1193 (TypeManager.LookupParametersByBuilder): Remove.
1194 * expression.cs (Invocation.method_parameter_cache): Remove.
1195 (Invocation.GetParameterData): Remove.
1197 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
1200 2005-02-08 Raja R Harinath <rharinath@novell.com>
1203 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
1204 TypeManager.multicast_delegate_type is null, resolve it by looking
1205 up "System.MulticastDelegate".
1206 * rootcontext.cs (RootContext.ResolveCore): Simplify.
1208 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
1209 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
1210 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
1213 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
1214 (LabeledStatement.AddReference): New. Set 'referenced'.
1215 (Goto.Resolve): Use it.
1217 2005-02-05 John Luke <john.luke@gmail.com>
1219 * driver.cs: remove duplicate -doc line in Usage ()
1221 2005-02-04 Raja R Harinath <rharinath@novell.com>
1223 * location.cs (Location.AddFile): Fix CS2002 error report.
1225 2005-02-02 Martin Baulig <martin@ximian.com>
1227 * delegate.cs (Delegate.DefineType): Report an internal error if
1228 TypeManager.multicast_delegate_type is null. See bug #72015 for
1231 2005-02-02 Raja R Harinath <rharinath@novell.com>
1233 Fix a crasher in a variant of #31984.
1234 * const.cs (Constant.CheckBase): New override that defers the
1235 new-or-override check in case the base type hasn't been populated
1237 (Constant.Define): Ensure the new-or-override check is performed.
1239 2005-02-01 Duncan Mak <duncan@ximian.com>
1241 * const.cs (LookupConstantValue): Check that `ce' is not null
1242 before calling GetValue ().
1244 2005-02-01 Raja R Harinath <rharinath@novell.com>
1246 Fix test-334.cs (#69519).
1247 * cs-parser.jay (using_alias_directive): Pass in an expression to
1248 NamespaceEntry.UsingAlias.
1249 (using_namespace_directive): Pass in an expression to
1250 NamespaceEntry.Using.
1251 (namespace_name): Don't flatten to a string.
1252 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
1253 (NamespaceEntry.AliasEntry.Resolve): Lookup using
1255 (NamespaceEntry.UsingEntry): Likewise.
1256 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
1258 (NamespaceEntry.LookupForUsing): Remove.
1259 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
1261 (NamespaceEntry.Lookup): Remove support for dotted names.
1263 2005-02-01 Raja R Harinath <rharinath@novell.com>
1265 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
1267 (NamespaceEntry.ImplicitParent): Compute on demand.
1268 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
1269 parallels the current.
1270 (NamespaceEntry.LookupForUsing): Use it.
1271 (NamespaceEntry.Lookup): If the current namespace-entry is
1272 implicit, don't search aliases and using tables.
1274 2005-02-01 Raja R Harinath <rharinath@novell.com>
1277 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
1279 (TypeContainer.BaseCache): Compute on demand.
1280 (TypeContainer.FindMembers): Define constants and types if they're
1281 not already created.
1282 (FieldMember.Define): Move resetting of ec.InUnsafe before error
1284 * const.cs (Constant.Define): Make idempotent.
1286 2005-01-29 Miguel de Icaza <miguel@novell.com>
1288 * pending.cs: Produce better code (no nops produced by using Ldarg
1291 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
1292 i - 1' it should be arg + 1.
1296 2005-01-28 Raja R Harinath <rharinath@novell.com>
1298 * attribute.cs (Attribute.CheckAttributeType): Make private
1300 (Attribute.ResolveType): Make virtual.
1301 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
1302 handling of RootContext.Tree.Types.
1304 2005-01-27 Raja R Harinath <rharinath@novell.com>
1306 Update attribute-handling to use the SimpleName/MemberAccess
1308 * cs-parser.jay (attribute): Pass in an expression to the
1309 constructors of Attribute and GlobalAttribute.
1310 * attribute.cs (Attribute): Take an expression for the name.
1311 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
1312 passed in attribute name expression.
1313 (Attribute.CheckAttributeType): Use it.
1314 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
1315 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
1316 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
1317 argument to prevent error messages if the lookup fails.
1319 2005-01-27 Marek Safar <marek.safar@seznam.cz>
1321 * expression.cs (Indirection): Implemented IVariable interface
1322 to support indirection in AddressOf operator.
1323 (PointerArithmetic.Emit): Add optimalization for case where
1324 result can be precomputed.
1326 2005-01-26 Martin Baulig <martin@ximian.com>
1328 * class.cs (TypeContainer.AttributeTargets): Return the correct
1329 AttributeTargets depending on our `Kind' instead of throwing an
1330 exception; fixes #71632.
1332 2005-01-26 Marek Safar <marek.safar@seznam.cz>
1335 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
1338 2005-01-25 Raja R Harinath <rharinath@novell.com>
1341 * expression.cs (MemberAccess.DoResolve): Don't complain with
1342 cs0572 when the LHS of a member access has identical name and type
1345 2005-01-25 Marek Safar <marek.safar@seznam.cz>
1348 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
1350 Create custom PermissionSet only for PermissionSetAttribute.
1352 2005-01-24 Marek Safar <marek.safar@seznam.cz>
1355 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
1356 delegates in static class.
1358 2005-01-24 Martin Baulig <martin@ximian.com>
1360 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
1361 merging an implicit block, just use its reachability.
1363 * statement.cs (Block.Resolve): Make the unreachable code check
1364 work wrt. implicit blocks; see test-337 from #63842.
1366 2005-01-21 Alp Toker <alp@atoker.com>
1368 * cs-parser.jay: destructor_declaration's container is PartialContainer
1369 not Class when partial types are used, so use Kind prop instead of
1372 2005-01-22 Miguel de Icaza <miguel@ximian.com>
1374 * cs-parser.jay: Improve error reporting when an interface
1377 2005-01-20 Dick Porter <dick@ximian.com>
1379 * support.cs: SeekableStreamReader fix from Sandor Dobos
1380 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
1381 chars are read. Fixes bug 70369.
1383 2005-01-20 Raja R Harinath <rharinath@novell.com>
1385 * cs-parser.jay (catch_clause): Simplify current_block handling
1388 2005-01-17 Miguel de Icaza <miguel@ximian.com>
1390 * convert.cs (ImplicitStandardConversionExists): Synchronize the
1391 code with ImplicitStandardConversion to handle the implicit
1392 conversion of method groups into valid delegate invocations.
1394 The problem is that in parameter handling we were using this code
1395 path. Fixes bug #64698
1397 2005-01-19 Raja R Harinath <rharinath@novell.com>
1399 * cs-parser.jay: Fix several infelicities.
1400 - Avoid assigning to the parser value stack. Code like
1401 '$3 = null' is unclean. Synthesize a value for the code block
1403 - Avoid using oob_stack for storing location information. Use ...
1404 (_mark_): ... this. New (empty) rule. Saves the current location
1406 (foreach_statement): Avoid using oob_stack for current_block
1407 handling. Use technique used in for_statement and
1408 using_statement. Synthesize a value for the code block to store
1409 additional intermediate information.
1411 2005-01-13 Miguel de Icaza <miguel@ximian.com>
1413 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
1414 of a different type is only allowed to private fields of a
1415 containing type, not on fields of a base class.
1417 See test-174.cs and error cs0122-9.cs
1419 2005-01-13 Raja R Harinath <rharinath@novell.com>
1421 Fix test-335.cs (bug #58126).
1422 * cs-parser.jay (argument): Split out non-expression parts of the
1423 rule into 'non_simple_argument'.
1424 (invocation_expression): Support parenthesized invocations with
1425 multiple arguments, and with single non-simple arguments.
1427 2005-01-13 Raja R Harinath <rharinath@novell.com>
1429 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
1432 2005-01-12 Raja R Harinath <rharinath@novell.com>
1434 Fix cs0038-1.cs, cs1640-6.cs.
1435 * ecore.cs (Expression.Resolve): Remove special-case for
1436 SimpleName in error-handling.
1437 (Expression.almostMatchedMembers): Relax access permission to
1439 (Expression.MemberLookupFailed): Handle duplicates in
1440 almostMatchedMembers list.
1441 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
1442 * expression.cs (New.DoResolve): Report CS1540 for more cases.
1443 * typemanager.cs (GetFullNameSignature): Use the MethodBase
1444 overload if the passed in MemberInfo is a MethodBase.
1446 2005-01-12 Marek Safar <marek.safar@seznam.cz>
1449 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
1450 for non-CAS & merge permission sets properly.
1452 2005-01-11 Raja R Harinath <rharinath@novell.com>
1454 Improve standard-compliance of simple name and member access
1455 resolution. Fixes bugs #52697, #57200, #67520, #69519.
1456 * ecore.cs (FullNamedExpression): New abstract base class
1457 for Namespaces and TypeExpressions.
1458 (ResolveFlags.SimpleName): Remove.
1459 (SimpleName): Remove support for dotted names.
1460 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
1461 DeclSpace.FindType and DeclSpace.LookupType.
1462 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
1463 (Expression.ExprClassName): Make member function.
1464 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
1465 a namespace. Remove creation of dotted "SimpleName"s.
1466 (MemberAccess.DoResolve): Likewise.
1467 * decl.cs (DeclSpace.Cache): Make private.
1468 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
1469 (DeclSpace.FindType): Update.
1470 (DeclSpace.LookupType): Move here from RootContext. Return a
1471 FullNamedExpression.
1472 * namespace.cs (Namespace): Derive from FullNamedExpression
1473 so that it can be part of expression resolution.
1474 (Namespace.Lookup): Return an FullNamedExpression.
1475 (NamespaceEntry.LookupAlias): Lookup aliases only in current
1477 * rootcontext.cs (NamespaceLookup): Remove.
1478 (LookupType): Move to DeclSpace.
1479 * attribute.cs (CheckAttributeType): Update.
1480 * doc.cs (FindDocumentedType): Remove allowAlias argument.
1481 (FindDocumentedTypeNonArray): Likewise.
1483 2005-01-11 Raja R Harinath <rharinath@novell.com>
1485 Fix cs0509.cs, cs1632.cs.
1486 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
1487 is the same as IsInterface.
1488 (TypeContainer.GetClassBases): Likewise.
1489 * statement.cs (LabeledStatement.ig): New field.
1490 (LabeledStatement.LabelTarget): Save ILGenerator which created the
1492 (LabeledStatement.DoEmit): Check that the label was created with
1493 the same ILGenerator.
1495 2005-01-10 Marek Safar <marek.safar@seznam.cz>
1498 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
1499 accessors to its properties.
1501 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
1502 from accessors to property.
1504 2005-01-10 Marek Safar <marek.safar@seznam.cz>
1507 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
1510 2005-01-08 Miguel de Icaza <miguel@ximian.com>
1512 * attribute.cs: Check for null and empty strings.
1514 I have lost another battle to Paolo.
1516 2005-01-07 Marek Safar <marek.safar@seznam.cz>
1519 * class.cs (PropertyMethod): Set Parent field in ctors.
1520 (SetMethod.InternalParameters): Add unsafe switch hack.
1521 Override MarkForDuplicationCheck where it is appropriate.
1523 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
1524 It says whether container allows members with the same name.
1526 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
1527 Removed is_method parameter.
1529 2005-01-06 Duncan Mak <duncan@ximian.com>
1531 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
1532 because the previous change led to incorrect reporting of CS1032
1533 ("Cannot define/undefine preprocessor symbols after first token in
1534 file"). Instead of using `tokens_seen' as the only flag that
1535 triggers CS1040, introduce `comments_seen'. This new flag is used
1536 to signify having seen comments on the current line, so it is
1537 unset after a newline.
1539 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
1541 * doc.cs : When searching for a type, find nested type too.
1542 This fixes bug #71040.
1544 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
1547 - Warn missing member comment on those classes which also does not
1548 have doc comments. Fixed bug #71041.
1549 - Don't warn missing doc comment on default constructor.
1552 2005-01-06 Duncan Mak <duncan@ximian.com>
1554 * cs-tokenizer.cs (xtoken): After handling traditional C-style
1555 comments, set `tokens_seen' to true. This allows us to detect
1556 misplaced preprocessor directives (i.e. not at the beginning of
1557 the a line, nor after whitespaces). In that case, report error
1558 CS1040. This fixes bug #56460.
1560 * cs-parser.jay (interface_member_declaration): Add checks for
1561 IsExplicitImpl, and report CS0541 error if an interface member is
1562 defined as an explicit interface declaration.
1564 2005-01-06 Marek Safar <marek.safar@seznam.cz>
1567 * class.cs (PropertyMethod): Set Parent field in ctors.
1568 (SetMethod.InternalParameters): Add unsafe switch hack.
1570 * decl.cs (MemberCore.Parent): Cannot be readonly.
1572 2005-01-06 Raja R Harinath <rharinath@novell.com>
1574 * decl.cs (DeclSpace.ResolveType): Remove.
1575 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
1576 Merge in code from ...
1577 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
1578 * class.cs, enum.cs: Update to changes.
1580 2005-01-06 Miguel de Icaza <miguel@ximian.com>
1582 * anonymous.cs: Ensure that we init the scope of our parent if it
1583 has not been initialized yet.
1585 2004-12-30 Duncan Mak <duncan@ximian.com>
1587 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
1588 if field.FieldBuilder is null. Fixes #70758.
1590 * convert.cs: Fixed some typos and updated some of the comments.
1591 (ImplicitStandardConversionExists):
1592 (TryImplicitIntConversion): If `target_type' is an interface and
1593 the type of `ic' implements this interface, return true or a new
1594 BoxedCast instead of null. This fixes #70468.
1596 2004-12-29 Duncan Mak <duncan@ximian.com>
1598 * expression.cs (Argument.Emit): Check that Expr is
1599 IMemoryLocation before casting to it, and report CS1510 otherwise.
1603 2004-12-21 Ben Maurer <bmaurer@ximian.com>
1605 * statement.cs (Block.ThisVariable): remove the recursion here, to
1606 make the --profile more sane.
1608 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
1610 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
1611 assembly, by JB Evain.
1613 2004-12-17 Raja R Harinath <rharinath@novell.com>
1615 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
1616 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
1617 "parent" refers to enclosing type/class. "base" refers to superclass.
1619 2004-12-17 Raja R Harinath <rharinath@novell.com>
1621 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
1622 Ensure that we only have GlobalAttributes.
1623 * attribute.cs (Attribute.Emit): Make non-virtual.
1624 (GlobalAttribute.Emit): Remove.
1625 (Attribute.Resolve): Make virtual.
1626 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
1627 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
1628 the argument. Don't create one.
1629 (Attribute.GetObsoleteAttribute): Likewise.
1630 (Attribute.GetClsCompliantAttributeValue): Likewise.
1631 * class.cs, decl.cs: Update to changes.
1633 2004-12-17 Marek Safar <marek.safar@seznam.cz>
1635 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
1637 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
1639 * statement.cs (Foreach.Resolve): Add error 186 report.
1641 2004-12-16 Marek Safar <marek.safar@seznam.cz>
1643 * expression.cs (Conditional.DoResolve): Add warning 429.
1645 * statement.cs (If.Resolve): Add warning 665.
1647 2004-12-16 Raja R Harinath <rharinath@novell.com>
1649 New invariant: RootContext.Tree.Types.NamespaceEntry == null
1650 except when in the parser, and in GlobalAttribute.
1651 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
1652 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
1653 RootContext.Tree.Types.NamespaceEntry once work is done.
1654 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
1655 and resets RootContext.Tree.Types.NamespaceEntry.
1657 2004-12-15 Marek Safar <marek.safar@seznam.cz>
1659 * cs-parser.jay: Don't create a block for every variable.
1661 2004-12-14 Miguel de Icaza <miguel@ximian.com>
1663 * location.cs: Provide extra information.
1665 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
1666 variables from the captured environment, it is the ldarg_0.
1668 2004-12-14 Marek Safar <marek.safar@seznam.cz>
1670 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
1673 * class.cs: Changed warning level for 169 to avoid developer
1674 displeasure from warning flooding. It will be changed back when they
1675 fix most of current BCL warnings.
1677 * RootContext.cs: Pushed default WarningLevel to 3.
1679 * statement.cs: Removed unused variable.
1681 2004-12-14 Marek Safar <marek.safar@seznam.cz>
1683 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
1684 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
1685 Add error 502 report.
1686 (StaticClass.DefineType): Add error 441 report.
1687 (Class.AllowedModifiersProp): New virtual property as temporary
1688 extension to AllowedModifiers.
1689 (Class.DefineType): Add error 418 report. Moved ModFlags check here
1690 to share implementation with StaticClass and don't call virtual
1693 * driver.cs (MainDriver): Add error 1558 test.
1695 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
1696 report. Moved error 36 test here.
1698 * statement.cs (Throw.Resolve): Add error 724 report.
1700 * typemanager.cs: Add out_attribute_type core type.
1702 2004-12-13 Marek Safar <marek.safar@seznam.cz>
1704 * class.cs (TypeContainer.VerifyClsCompliance): Add error
1706 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
1708 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
1711 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
1713 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
1714 Add error 3023 report.
1715 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
1717 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
1720 2004-12-12 John Luke <john.luke@gmail.com>
1722 * driver.cs (AddArgs): take -- into account when
1723 adding arguments, fixes bug 65710
1725 2004-12-12 Martin Baulig <martin@ximian.com>
1727 * expression.cs (Unary.TryReduceNegative): Added support for
1728 SByteConstant and ByteConstant.
1729 (Unary.Reduce): Check error values from TryReduceNegative().
1731 2004-12-10 Marek Safar <marek.safar@seznam.cz>
1733 * attributes.cs (Attribute.Resolve): Avoid multiple error report
1734 and report exception as error 182.
1736 2004-12-10 Raja R Harinath <rharinath@novell.com>
1738 * driver.cs (Main): Fix message when there are warnings.
1740 2004-12-09 Miguel de Icaza <miguel@ximian.com>
1742 * delegate.cs: Fixed my fix from yesterday, sorry about that.
1744 2004-12-09 Marek Safar <marek.safar@seznam.cz>
1746 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
1747 Reduced number of warnings.
1749 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
1751 2004-12-08 Miguel de Icaza <miguel@ximian.com>
1753 * driver.cs: Removed message.
1755 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
1757 2004-12-08 <vargaz@freemail.hu>
1759 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
1761 2004-12-08 Martin Baulig <martin@ximian.com>
1763 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
1764 instead of a CS3002 for properties and indexer.
1766 2004-12-08 Martin Baulig <martin@ximian.com>
1768 * decl.cs (MemberName.ToString): Make this work again.
1770 2004-12-08 Marek Safar <marek.safar@seznam.cz>
1772 * attribute.cs (Resolve): Add error 591 detection.
1774 * class.cs (FieldMember.Define): Add error 1547 detection.
1775 (Indexer.Define): Add error 620 detection.
1776 (Operator.Define): Add error 590 detection.
1778 * ecore.cs: Missing argument for error 79.
1780 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
1783 2004-12-07 Marek Safar <marek.safar@seznam.cz>
1786 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
1789 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
1791 * cs-parser.jay : handle doc comments on implicit/explicit operators.
1792 Some operator comments were suppressed.
1793 * doc.cs : Implicit/explicit operator name in doc comments are like
1794 "op_Explicit(type)~returnType", so added suffix handling.
1796 2004-12-07 Martin Baulig <martin@ximian.com>
1799 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
1800 (MemberCore.GetClsCompliantAttributeValue): Likewise.
1801 (DeclSpace.ec): New protected field; store the EmitContext here.
1802 (DeclSpace.EmitContext): New public property; moved here from
1804 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
1807 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
1808 (Enum.Emit): Don't create a new EmitContext.
1810 * delegate.cs (Delegate.DefineType): Always create the
1813 * iterators.cs (Iterators.DefineIterator): Create a new
1814 EmitContext and store it in `ec'.
1816 2004-08-24 Martin Baulig <martin@ximian.com>
1819 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
1820 this for accessibility checks.
1821 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
1822 IsNestedFamilyAccessible.
1823 (TypeManager.IsSubclassOf): New method, do what the name actually
1826 2004-12-06 Raja R Harinath <rharinath@novell.com>
1828 Fix crash on cs0657-17.cs.
1829 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
1830 Use RootContext.Tree.Types, not 'new RootTypes ()'.
1831 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
1832 the case where the NamespaceEntry gets overwritten.
1834 2004-12-06 Marek Safar <marek.safar@seznam.cz>
1836 Fixed #69195, #56821
1837 * ecore.cs (ResolveBoolean): Tiny refactoring.
1839 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
1840 of right expression resolving when left is false constant and
1841 operator is LogicalAnd OR true constant and operator is LogicalOr.
1843 * statement.cs (ResolveUnreachable): Always reports warning.
1845 2004-12-05 Miguel de Icaza <miguel@ximian.com>
1847 * class.cs: Distinguish between 1721 and 1722 (just a little help
1848 for the programmer).
1850 2004-12-03 Miguel de Icaza <miguel@ximian.com>
1852 * delegate.cs: Only allow this on new versions of the language.
1854 2004-12-02 Duncan Mak <duncan@ximian.com>
1856 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
1858 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
1859 here as a static method. Take an additional bool out parameter
1860 `must_do_cs1540_check' for signaling to InstanceResolve.
1861 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
1862 member field from PropertyExpr class and made it an argument of
1864 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
1865 check for MarshalByRefObject, and report CS0122 instead of CS1540.
1866 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
1867 and `remove_accessor' as well as InstanceResolve: report CS0122
1872 2004-12-03 Raja R Harinath <rharinath@novell.com>
1874 Fix test-327.cs, test-328.cs, and put in early infrastructure
1875 for eventually fixing #52697.
1876 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
1877 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
1879 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
1880 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
1881 (VerifyUsing, error246): Update.
1882 * rootcontext.cs (RootContext.NamespaceLookup): Just use
1883 'NamespaceEntry.LookupNamespaceOrType'.
1885 2004-12-03 Martin Baulig <martin@ximian.com>
1887 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
1888 method as our child, call AnonymousMethod.Compatible() on it.
1890 2004-12-03 Raja R Harinath <rharinath@novell.com>
1892 Disable XML documentation support in 'basic' profile.
1893 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
1894 Redirect XmlElement to System.Object.
1895 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
1896 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
1897 * mcs.exe.sources: Add doc-bootstrap.cs.
1898 * doc-bootstrap.cs: New file. Contains empty stub implementation
1901 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
1903 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
1904 comments are allowed.
1906 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1908 * delegate.cs: Add checks for subtypes in paramaters and return values
1909 in VerifyMethod () to add support for Covariance/Contravariance
1912 2004-12-02 Miguel de Icaza <miguel@ximian.com>
1914 * report.cs: Remove extra closing parenthesis.
1916 * convert.cs (Error_CannotImplicitConversion): If the name of the
1917 types are the same, provide some extra information.
1919 * class.cs (FieldBase): Use an unused bit field from the field to
1920 encode the `has_offset' property from the FieldMember. This saves
1921 a couple of Ks on bootstrap compilation.
1923 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
1924 method as our child, return the AnonymousMethod resolved
1927 * expression.cs (New.DoResolve): Allow return values from
1928 NewDelegate to also include AnonymousMethods.
1932 2004-12-02 Marek Safar <marek.safar@seznam.cz>
1935 * attribute.cs (Resolve): Improved implementation of params
1936 attribute arguments.
1938 * support.cs (ParameterData): Add HasParams to be faster.
1940 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
1942 all things are for /doc support:
1944 * doc.cs: new file that supports XML documentation generation.
1945 * mcs.exe.sources: added doc.cs.
1947 Handle /doc command line option.
1948 Report error 2006 instead of 5 for missing file name for /doc.
1949 Generate XML documentation when required, after type resolution.
1951 Added support for picking up documentation (/// and /** ... */),
1952 including a new XmlCommentState enumeration.
1954 Added lines to fill Documentation element for field, constant,
1955 property, indexer, method, constructor, destructor, operator, event
1956 and class, struct, interface, delegate, enum.
1957 Added lines to warn incorrect comment.
1959 Added Documentation field (passed only when /doc was specified).
1961 Added DocComment, DocCommentHeader, GenerateDocComment() and
1962 OnGenerateDocComment() and some supporting private members for
1963 /doc feature to MemberCore.
1965 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
1967 Added overriden DocCommentHeader.
1969 Added overriden DocCommentHeader and GenerateDocComment().
1971 2004-12-01 Miguel de Icaza <miguel@ximian.com>
1973 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
1974 unwrapping the enumeration values, chain to
1975 DoConstantNumericPromotions again, so we can promote things to the
1976 fundamental types (takes care of enums that are bytes, sbytes).
1980 2004-12-01 Raja R Harinath <rharinath@novell.com>
1982 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
1983 Fix long-standing bug in type-lookup. Use FindType instead of
1984 LookupType when ec.ResolvingTypeTree.
1985 (Attribute.ResolveType, Attribute.Resolve)
1986 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
1988 (Attributes.Search): Remove internal version. Update.
1989 (Attributes.SearchMulti): Update.
1990 (Attributes.GetClsCompliantAttribute): Remove.
1991 (Attributes.GetIndexerNameAttribute): Remove.
1992 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
1993 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
1994 * class.cs (Indexer.Define): Likewise.
1996 2004-12-01 Marek Safar <marek.safar@seznam.cz>
1999 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
2000 MarshallByReference members access.
2002 * expression.cs: Use CheckMarshallByRefAccess;
2003 Better error CS0197 message.
2005 * report.cs: Print whole related error message.
2007 2004-11-30 Raja R Harinath <rharinath@novell.com>
2009 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
2010 the current directory to help debugging.
2012 2004-11-29 Marek Safar <marek.safar@seznam.cz>
2014 * class (GetClassBases): Better error 60 report.
2015 (EventProperty): Disabled warning 67 detection.
2017 2004-11-29 Marek Safar <marek.safar@seznam.cz>
2020 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
2022 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
2025 2004-11-29 Marek Safar <marek.safar@seznam.cz>
2028 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
2030 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
2032 2004-11-26 Miguel de Icaza <miguel@ximian.com>
2034 * attribute.cs (Attribute.Resolve): Refine error reporting and
2035 report a cs0117 if the identifier does not exist, to distinguish
2036 from 0617 which is a miss-use of the actual identifier.
2038 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
2039 between cs0070 and cs0079.
2041 * class.cs (MemberBase.DoDefine): When reporting a wrong
2042 accessibility level, we use MethodCore to compare instead of
2043 Method (this was a regression in some refactoring effort).
2045 So now we correctly report cs0056 again.
2047 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
2048 testing the target_type (which was known to be object_type) and
2049 not the source type (which is anonymous_method).
2051 Fixed reporting of error cs1660.
2053 * expression.cs (UserCast.Source): Expose the underlying cast.
2055 * statement.cs (Switch.SwitchGoverningType): Sort the list of
2056 allowed types to find a match to int32 first (most common).
2058 In addition, it ignores any ImplicitUserConversions that did an
2059 internal implicit conversion (as the switch statement allows only
2060 one integral conversion to exist).
2062 * class.cs (PartialContainer.Create): rename `name' to
2063 `member_name' for clarity. Then replace the string calls with a
2064 call to MemberName.GetPartialName, as now using
2065 MemberName.ToString is an error (this is due to the side effects
2066 it had, that were fixed in the past).
2068 This will restore the error reporting on a number of partial class
2069 errors that were missusing this (and getting an exception as a
2070 results, which is now just a plain textual warning, because
2071 yyparse debug output would crash otherwise).
2073 2004-11-26 Raja R Harinath <rharinath@novell.com>
2075 * Makefile (PROGRAM_INSTALL_DIR): Remove.
2077 2004-11-25 Ben Maurer <bmaurer@ximian.com>
2079 * rootcontext.cs (LookupType): Make sure to cache lookups that
2080 don't give us a negative result. This saves about 5% of corlib
2083 2004-11-25 Miguel de Icaza <miguel@ximian.com>
2085 * report.cs (AbstractMessage.Print): messages are sent to stderr
2087 * class.cs (TypeContainer.GetClassBases): It is an error to have a
2088 non-interface in the list of interfaces (at this point, either
2089 parent was properly set, or a base class is being listed in the
2090 interfaces section).
2092 This flags error 1722, and resolves the crash from bug 69259.
2094 2004-11-25 Ben Maurer <bmaurer@ximian.com>
2096 * statement.cs (Using.EmitExpressionFinally): make this work right
2097 for valuetypes. Fixes 69926.
2099 2004-11-25 Miguel de Icaza <miguel@ximian.com>
2101 * const.cs (Const.ChangeType): Cope with the "0 literal can be
2102 converted to an enum" here, before we try to change the underlying
2103 type. This code exists, but it is a different code path than the
2104 one used while encoding constants.
2106 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
2107 old bug: when converting from the null literal to a pointer,
2108 return an EmptyCast, not the NullLiteral.
2110 This fixes #69921, the recent null_type changes probably made this
2113 (ImplicitReferenceConversionExists): In addition, resynchronized
2114 the code here, so it matches the same code in
2115 ImplicitReferenceConversionExists for the `from any class-type S
2116 to any interface-type T'.
2119 2004-11-25 Marek Safar <marek.safar@seznam.cz>
2121 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
2123 2004-11-24 Miguel de Icaza <miguel@ximian.com>
2125 * cs-parser.jay: Use verbosity accordingly.
2127 2004-11-24 Marek Safar <marek.safar@seznam.cz>
2129 * expression.cs (Unary.ResolveOperator): Do not report warning;
2130 AddressOf reads from variable.
2132 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
2134 2004-11-24 Marek Safar <marek.safar@seznam.cz>
2138 * attribute.cs (Attributable): Removed CheckTargets.
2139 (Attributes.Emit): Explicit attribute targets are tested here.
2141 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
2142 not enabled for interfaces.
2144 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
2145 (GetAssemblyName): Ouch next bug there.
2147 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2149 * expression.cs: Error 275 added.
2151 2004-11-23 Marek Safar <marek.safar@seznam.cz>
2153 Fix bug #69177 (Implemented decimal constant support)
2155 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
2156 (BinaryFold): Add DecimalConstant.
2158 * const.cs (Define): Decimal constant
2160 (ChangeType): Add decimal type handling.
2161 (LookupConstantValue): Don't set value for decimal type but
2162 emit DecimalConstantAttribute. Needed for constant optimization.
2164 * constant.cs (ToDecimal): New method.
2165 (ConvertToDecimal): New method.
2166 (IntConstant): Implemented ConvertToDecimal.
2167 (DecimalConstant.Emit): Emit optimized version for decimals in
2170 * expression.cs (ResolveOperator): Changed order of constant
2171 reduction to work correctly with native types which have
2172 overloaded operators.
2173 (ResolveMemberAccess): Extract constant value from attribute
2176 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
2178 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
2179 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
2180 (ChangeType): Decimal is special.
2181 (TypeToCoreType): Add decimal type.
2183 2004-11-22 Marek Safar <marek.safar@seznam.cz>
2185 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
2188 2004-11-22 Marek Safar <marek.safar@seznam.cz>
2190 * class.cs (EventField.ApplyAttributeBuilder): Fix error
2193 2004-11-19 Marek Safar <marek.safar@seznam.cz>
2195 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
2197 * pending.cs (PendingImplementation): Grab only interfaces.
2199 2004-11-19 Marek Safar <marek.safar@seznam.cz>
2201 * statement.cs (ForeachHelperMethods): Add location member and
2202 error 202 detection.
2204 2004-11-19 Raja R Harinath <rharinath@novell.com>
2206 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
2207 automatically handled by executable.make.
2208 (PROGRAM): Make profile-specific.
2210 2004-11-18 Marek Safar <marek.safar@seznam.cz>
2212 * expression.cs (DoResolveBase): Fixed wrong warning for out
2215 2004-11-18 Martin Baulig <martin@ximian.com>
2217 Merged latest changes into gmcs. Please keep this comment in
2218 here, it makes it easier for me to see what changed in MCS since
2219 the last time I merged.
2221 2004-11-17 Raja R Harinath <rharinath@novell.com>
2223 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
2224 (TypeHandle.GetMemberCache): New.
2225 (TypeHandle.TypeHandle): Update.
2226 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
2227 (TypeManager.LookupParentInterfacesCache):
2228 Rename from LookupInterfaceCache. Optimize slightly.
2229 (TypeManager.MemberLookup_FindMembers): Update.
2230 * decl.cs (MemberCache.MemberCache): Set Container to null in the
2232 (AddCacheContents): Rename from AddHashtable.
2233 * class.cs (TypeContainer.parent_container): Remove.
2234 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
2235 (TypeContainer.DoDefineMembers): Don't initialize it.
2236 Update to name changes.
2238 2004-11-17 Miguel de Icaza <miguel@ximian.com>
2240 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
2241 that factors the code to check access modifiers on override.
2243 (PropertyBase): Use the code here.
2245 Patch from Lluis S'anchez, fixes bug #69361.
2247 2004-11-15 Miguel de Icaza <miguel@ximian.com>
2249 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
2250 routine that is used to report the use of a captured variable
2251 whose address has been taken.
2253 There are two checks: one when variables are being captured and
2254 the other check is when the address of a variable is taken.
2256 (because an anonymous methods might be resolved before *or* after
2257 the address has been taken) and
2259 * expression.cs (Conditional.DoResolve): Remove the special
2260 casing that Martin added to trueExpr and falseExpr being both
2261 NullLiteral. We get the right behavior now just by introducing
2262 the null_type into the compiler.
2264 * convert.cs (ExplicitConversion): Change the code to use
2265 null_type instead of testing `expr is NullLiteral'.
2266 (ImplicitConversionStandard): use null_type too.
2267 (ImplicitReferenceConversionExists): use null_type too.
2268 (ImplicitReferenceConversion): use null_type too.
2270 * literal.cs: The type of `NullLiteral' is now null_type instead
2272 (Resolve): Set the type here.
2274 * typemanager.cs: Introduce null_type.
2276 2004-11-17 Martin Baulig <martin@ximian.com>
2278 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
2279 direction, like FindMembers() does. Fixes #69546, testcase is in
2282 2004-11-16 Martin Baulig <martin@ximian.com>
2284 This is based on a patch from Marek Safar, see bug #69082.
2285 Fixes bugs #63705 and #67130.
2287 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
2288 method; create a MemberCache for an interface type and cache the
2291 * decl.cs (IMemberContainer.ParentContainer): Removed.
2292 (IMemberContainer.ParentCache): New property.
2293 (MemberCache.SetupCacheForInterface): Removed.
2294 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
2295 to create a cache for an interface's "parent".
2297 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
2300 2004-11-16 Martin Baulig <martin@ximian.com>
2302 Merged back from gmcs; these changes already went into gmcs a
2303 couple of weeks ago.
2306 (TypeManager.AddUserType): Removed the `ifaces' argument.
2307 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
2309 (TypeManager.AddUserInterface): Removed.
2310 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
2312 (TypeManager.GetInterfaces): Likewise.
2313 (TypeManager.GetExplicitInterfaces): Likewise.
2315 * ecore.cs (TypeExpr.GetInterfaces): Removed.
2317 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
2318 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
2320 2004-11-14 Ben Maurer <bmaurer@ximian.com>
2322 * statement.cs: Avoid adding bools to a hashtable.
2324 2004-11-07 Miguel de Icaza <miguel@ximian.com>
2326 * expression.cs (Invocation.OverloadResolve): Flag error if we are
2327 calling an unsafe method from a safe location.
2329 2004-11-06 Marek Safar <marek.safar@seznam.cz>
2332 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
2334 2004-11-06 Miguel de Icaza <miguel@ximian.com>
2336 * namespace.cs (VerifyUsing): use GetPartialName instead of
2339 2004-11-05 Miguel de Icaza <miguel@ximian.com>
2341 * statement.cs (Return.Resolve): Fix regression in typo: if
2342 `in_exc', we have to request a NeedReturnLabel, this was a typo
2343 introduced in the anonymous method check-in. Fixes #69131.
2345 * Indexers were using the ShortName when defining themselves,
2346 causing a regression in the compiler bootstrap when applying the
2347 patch from 2004-11-02 (first part), now they use their full name
2348 and the bug is gone.
2350 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
2352 * driver.cs: Strip the path from the names of embedded resources. Fixes
2355 2004-11-04 Raja R Harinath <rharinath@novell.com>
2357 Fix error message regression: cs0104-2.cs.
2358 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
2359 (AliasEntry.Resolve): Update.
2360 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
2362 (RootContext.LookupType): Update.
2364 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
2366 * cs-parser.jay: Add support for handling accessor modifiers
2367 * class: Add support port accessor modifiers and error checking,
2368 define PropertyMethod.Define as virtual (not abstract anymore)
2369 * ecore.cs: Add checking for proeprties access with access modifiers
2370 * iterators.cs: Modify Accessor constructor call based in the modified
2372 2004-11-02 Ben Maurer <bmaurer@ximian.com>
2374 * expression.cs (StringConcat): Handle being called twice,
2375 as when we have a concat in a field init with more than two
2378 2004-11-02 Miguel de Icaza <miguel@ximian.com>
2380 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
2381 special case explicit implementations, we should always produce
2382 the .property or .event declaration.
2384 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
2385 since it will not return correct data if people use this
2386 unresolved in the presence of using statements (see test-313).
2388 * class.cs (MethodData.Define): If we are an explicit interface
2389 implementation, set the method name to the full name of the
2390 interface plus the name of the method.
2392 Notice that using the method.MethodName.GetFullName() does not
2393 work, as it will only contain the name as declared on the source
2394 file (it can be a shorthand in the presence of using statements)
2395 and not the fully qualifed type name, for example:
2399 class D : ICloneable {
2400 object ICloneable.Clone () {
2404 Would produce a method called `ICloneable.Clone' instead of
2405 `System.ICloneable.Clone'.
2407 * namespace.cs (Alias.Resolve): Use GetPartialName.
2409 2004-11-01 Marek Safar <marek.safar@seznam.cz>
2411 * cs-parser.jay: Add error 1055 report.
2413 2004-11-01 Miguel de Icaza <miguel@ximian.com>
2415 * assign.cs (Assign.DoResolve): Only do the transform of
2416 assignment into a New if the types are compatible, if not, fall
2417 through and let the implicit code deal with the errors and with
2418 the necessary conversions.
2420 2004-11-01 Marek Safar <marek.safar@seznam.cz>
2422 * cs-parser.jay: Add error 1031 report.
2424 * cs-tokenizer.cs: Add location for error 1038.
2426 2004-10-31 Marek Safar <marek.safar@seznam.cz>
2428 * cs-parser.jay: Add error 1016 report.
2430 2004-10-31 Marek Safar <marek.safar@seznam.cz>
2432 * cs-parser.jay: Add errors 1575,1611 report.
2434 2004-10-31 Marek Safar <marek.safar@seznam.cz>
2436 * cs-parser.jay: Add error 1001 report.
2438 2004-10-31 Marek Safar <marek.safar@seznam.cz>
2441 * attribute.cs (GetMarshal): Add method argument for
2442 caller identification.
2444 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
2445 agument for GetMarshal and RuntimeMissingSupport.
2447 2004-10-31 Marek Safar <marek.safar@seznam.cz>
2449 * attribute.cs (ExtractSecurityPermissionSet): Removed
2450 TypeManager.code_access_permission_type.
2452 * typemanager.cs: Removed TypeManager.code_access_permission_type.
2454 2004-10-27 Miguel de Icaza <miguel@ximian.com>
2456 * expression.cs (LocalVariableReference.DoResolveLValue): Check
2457 for obsolete use of a variable here. Fixes regression on errors
2458 cs0619-25 and cs0619-26.
2460 2004-10-27 Marek Safar <marek.safar@seznam.cz>
2462 Fix #62358, implemented security attribute encoding.
2464 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
2465 Tests permitted SecurityAction for assembly or other types.
2466 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
2467 data from SecurityPermissionAttribute to PermisionSet class.
2469 * class.cs (ApplyAttributeBuilder): Added special handling
2470 for System.Security.Permissions.SecurityAttribute based types.
2472 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
2473 special handling for System.Security.Permissions.SecurityAttribute
2476 * enum.cs (ApplyAttributeBuilder): Added special handling
2477 for System.Security.Permissions.SecurityAttribute based types.
2479 * parameter.cs (ApplyAttributeBuilder): Added special handling
2480 for System.Security.Permissions.SecurityAttribute based types.
2482 * rootcontext.cs: Next 2 core types.
2484 * typemanager.cs (TypeManager.security_permission_attr_type):
2485 Built in type for the SecurityPermission Attribute.
2486 (code_access_permission_type): Build in type.
2488 2004-10-17 Miguel de Icaza <miguel@ximian.com>
2490 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
2491 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
2492 all of this information into
2493 EmitContext.EmitCapturedVariableInstance.
2495 * codegen.cs (EmitCapturedVariableInstance): move here the
2496 funcionality of emitting an ldarg.0 in the presence of a
2497 remapping. This centralizes the instance emit code.
2499 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
2500 then emit a load of this: it means that we have reached the
2501 topmost ScopeInfo: the one that contains the pointer to the
2502 instance of the class hosting the anonymous method.
2504 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
2505 captures to the topmost CaptureContext.
2507 2004-10-12 Miguel de Icaza <miguel@ximian.com>
2509 * expression.cs (LocalVariableReference): Move the knowledge about
2510 the iterators into codegen's EmitCapturedVariableInstance.
2512 2004-10-11 Miguel de Icaza <miguel@ximian.com>
2514 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
2515 all code paths return a value from an anonymous method (it is the
2516 same as the 161 error, but for anonymous methods).
2518 2004-10-08 Miguel de Icaza <miguel@ximian.com>
2520 The introduction of anonymous methods in the compiler changed
2521 various ways of doing things in the compiler. The most
2522 significant one is the hard split between the resolution phase
2523 and the emission phases of the compiler.
2525 For instance, routines that referenced local variables no
2526 longer can safely create temporary variables during the
2527 resolution phase: they must do so from the emission phase,
2528 since the variable might have been "captured", hence access to
2529 it can not be done with the local-variable operations from the runtime.
2533 (Block.Flags): New flag `IsTopLevel' to indicate that this block
2534 is a toplevel block.
2536 (ToplevelBlock): A new kind of Block, these are the blocks that
2537 are created by the parser for all toplevel method bodies. These
2538 include methods, accessors and anonymous methods.
2540 These contain some extra information not found in regular blocks:
2541 A pointer to an optional CaptureContext (for tracking captured
2542 local variables and parameters). A pointer to the parent
2545 (Return.Resolve): Catch missmatches when returning a value from an
2546 anonymous method (error 1662).
2547 Invoke NeedReturnLabel from the Resolve phase instead of the emit
2550 (Break.Resolve): ditto.
2552 (SwitchLabel): instead of defining the labels during the
2553 resolution phase, we now turned the public ILLabel and ILLabelCode
2554 labels into methods called GetILLabelCode() and GetILLabel() that
2555 only define the label during the Emit phase.
2557 (GotoCase): Track the SwitchLabel instead of the computed label
2558 (its contained therein). Emit the code by using
2559 SwitchLabel.GetILLabelCode ().
2561 (LocalInfo.Flags.Captured): A new flag has been introduce to track
2562 whether the Local has been captured or not.
2564 (LocalInfo.IsCaptured): New property, used to tell whether the
2565 local has been captured.
2567 * anonymous.cs: Vastly updated to contain the anonymous method
2570 The main classes here are: CaptureContext which tracks any
2571 captured information for a toplevel block and ScopeInfo used to
2572 track the activation frames for various local variables.
2574 Each toplevel block has an optional capture context associated
2575 with it. When a method contains an anonymous method both the
2576 toplevel method and the anonymous method will create a capture
2577 context. When variables or parameters are captured, they are
2578 recorded on the CaptureContext that owns them, for example:
2582 MyDelegate d = delegate {
2587 Here `a' will be recorded as captured on the toplevel
2588 CapturedContext, the inner captured context will not have anything
2589 (it will only have data if local variables or parameters from it
2590 are captured in a nested anonymous method.
2592 The ScopeInfo is used to track the activation frames for local
2593 variables, for example:
2595 for (int i = 0; i < 10; i++)
2596 for (int j = 0; j < 10; j++){
2597 MyDelegate d = delegate {
2602 At runtime this captures a single captured variable `i', but it
2603 captures 10 different versions of the variable `j'. The variable
2604 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
2605 recorded on a child.
2607 The toplevel ScopeInfo will also track information like the `this'
2608 pointer if instance variables were referenced (this is necessary
2609 as the anonymous method lives inside a nested class in the host
2610 type of the method).
2612 (AnonymousMethod): Expanded to track the Toplevel, implement
2613 `AnonymousMethod.Compatible' to tell whether an anonymous method
2614 can be converted to a target delegate type.
2616 The routine now also produces the anonymous method content
2618 (AnonymousDelegate): A helper class that derives from
2619 DelegateCreation, this is used to generate the code necessary to
2620 produce the delegate for the anonymous method that was created.
2622 * assign.cs: API adjustments for new changes in
2623 Convert.ImplicitStandardConversionExists.
2625 * class.cs: Adjustments to cope with the fact that now toplevel
2626 blocks are of type `ToplevelBlock'.
2628 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
2629 insteda of standard blocks.
2631 Flag errors if params arguments are passed to anonymous methods.
2633 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
2634 `CurrentAnonymousMethod' which points to the current Anonymous
2635 Method. The variable points to the AnonymousMethod class that
2636 holds the code being compiled. It is set in the new EmitContext
2637 created for the anonymous method.
2639 (EmitContext.Phase): Introduce a variable and an enumeration to
2640 assist in enforcing some rules about when and where we are allowed
2641 to invoke certain methods (EmitContext.NeedsReturnLabel is the
2642 only one that enfonces this right now).
2644 (EmitContext.HaveCaptureInfo): new helper method that returns
2645 whether we have a CapturedContext initialized.
2647 (EmitContext.CaptureVariable): New method used to register that a
2648 LocalInfo must be flagged for capturing.
2650 (EmitContext.CapturedParameter): New method used to register that a
2651 parameters must be flagged for capturing.
2653 (EmitContext.CapturedField): New method used to register that a
2654 field must be flagged for capturing.
2656 (EmitContext.HaveCapturedVariables,
2657 EmitContext.HaveCapturedFields): Return whether there are captured
2658 variables or fields.
2660 (EmitContext.EmitMethodHostInstance): This is used to emit the
2661 instance for the anonymous method. The instance might be null
2662 (static methods), this (for anonymous methods that capture nothing
2663 and happen to live side-by-side with the current method body) or a
2664 more complicated expression if the method has a CaptureContext.
2666 (EmitContext.EmitTopBlock): Routine that drives the emission of
2667 code: it will first resolve the top block, then emit any metadata
2668 and then emit the code. The split is done so that we can extract
2669 any anonymous methods and flag any captured variables/parameters.
2671 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
2672 during this phase, the ILGenerator should not be used as labels
2673 and local variables declared here might not be accessible to any
2674 code that is part of an anonymous method.
2676 Exceptions to this include the temporary variables that are
2677 created by some statements internally for holding temporary
2680 (EmitContext.EmitMeta): New routine, in charge of emitting all the
2683 (EmitContext.TemporaryReturn): This method is typically called
2684 from the Emit phase, and its the only place where we allow the
2685 ReturnLabel to be defined other than the EmitMeta. The reason is
2686 that otherwise we would have to duplicate a lot of logic in the
2687 Resolve phases of various methods that today is on the Emit
2690 (EmitContext.NeedReturnLabel): This no longer creates the label,
2691 as the ILGenerator is not valid during the resolve phase.
2693 (EmitContext.EmitThis): Extended the knowledge in this class to
2694 work in anonymous methods in addition to iterators.
2696 (EmitContext.EmitCapturedVariableInstance): This emits whatever
2697 code is necessary on the stack to access the instance to a local
2698 variable (the variable will be accessed as a field).
2700 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
2701 EmitContext.EmitAddressOfParameter): Routines to support
2702 parameters (not completed at this point).
2704 Removals: Removed RemapLocal and RemapLocalLValue. We probably
2705 will also remove the parameters.
2707 * convert.cs (Convert): Define a `ConstantEC' which points to a
2708 null. This is just to prefity some code that uses
2709 ImplicitStandardConversion code and do not have an EmitContext
2712 The idea is to flag explicitly that at that point in time, it is
2713 known that the conversion will not trigger the delegate checking
2714 code in implicit conversions (which requires a valid
2717 Everywhere: pass new EmitContext parameter since
2718 ImplicitStandardConversionExists now requires it to check for
2719 anonymous method conversions.
2721 (Convert.ImplicitStandardConversionExists): If the type of an
2722 expression is the anonymous_method_type, and the type is a
2723 delegate, we invoke the AnonymousMethod.Compatible method to check
2724 whether an implicit conversion is possible.
2726 (Convert.ImplicitConversionStandard): Only do implicit method
2727 group conversions if the language level is not ISO_1.
2729 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
2730 MethodInfo for the Invoke method. used by Delegate and
2733 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
2734 method conversions if the target type is a delegate.
2736 Removed extra debugging nops.
2738 (LocalVariableReference): Turn the `local_info' into a public
2741 Add `prepared' field, the same hack used for FieldExprs to cope
2742 with composed assignments, as Local variables do not necessarily
2743 operate purely on the stack as they used to: they can be captured
2746 Add `temp' for a temporary result, like fields.
2748 Refactor DoResolve and DoResolveLValue into DoResolveBase.
2750 It now copes with Local variables that are captured and emits the
2751 proper instance variable to load it from a field in the captured
2754 (ParameterReference.DoResolveBase): During the resolve phase,
2755 capture parameters if we are in an anonymous method.
2757 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
2758 anonymous method, use the EmitContext helper routines to emit the
2759 parameter reference.
2761 * iterators.cs: Set RemapToProxy to true/false during the
2764 * parameters.cs (GetParameterByName): New helper method.
2766 * typemanager.cs (anonymous_method_type) a new type that
2767 represents an anonyous method. This is always an internal type,
2768 used as a fencepost to test against the anonymous-methodness of an
2771 2004-10-20 Marek Safar <marek.safar@seznam.cz>
2773 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
2775 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
2777 2004-10-18 Martin Baulig <martin@ximian.com>
2779 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
2780 `Type' directly, but call ResolveType() on it.
2781 (Catch.Resolve): Likewise.
2782 (Foreach.Resolve): Likewise.
2784 2004-10-18 Martin Baulig <martin@ximian.com>
2786 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
2787 `Type' directly, but call ResolveType() on it.
2788 (Probe.DoResolve): Likewise.
2789 (ArrayCreation.LookupType): Likewise.
2790 (TypeOf.DoResolve): Likewise.
2791 (SizeOf.DoResolve): Likewise.
2793 2004-10-18 Martin Baulig <martin@ximian.com>
2795 * expression.cs (Invocation.BetterFunction): Put back
2796 TypeManager.TypeToCoreType().
2798 2004-10-18 Raja R Harinath <rharinath@novell.com>
2800 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
2803 2004-10-18 Martin Baulig <martin@ximian.com>
2805 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
2806 `Type' directly, but call ResolveType() on it.
2808 2004-10-18 Martin Baulig <martin@ximian.com>
2810 * class.cs (FieldMember.Define): Don't access the TypeExpr's
2811 `Type' directly, but call ResolveType() on it.
2812 (MemberBase.DoDefine): Likewise.
2814 * expression.cs (New.DoResolve): Don't access the TypeExpr's
2815 `Type' directly, but call ResolveType() on it.
2816 (ComposedCast.DoResolveAsTypeStep): Likewise.
2818 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
2819 `Type' directly, but call ResolveType() on it.
2821 2004-10-17 John Luke <john.luke@gmail.com>
2823 * class.cs (Operator.GetSignatureForError): use CSharpName
2825 * parameter.cs (Parameter.GetSignatureForError): Returns
2826 correct name even if was not defined.
2828 2004-10-13 Raja R Harinath <rharinath@novell.com>
2831 * class.cs (TypeContainer.EmitContext): New property.
2832 (DefineNestedTypes): Create an emitcontext for each part.
2833 (MethodCore.DoDefineParameters): Use container's emitcontext.
2834 Pass type array to InternalParameters.
2835 (MemberBase.DoDefine): Use container's emitcontext.
2836 (FieldMember.Define): Likewise.
2837 (Event.Define): Likewise.
2838 (SetMethod.GetParameterInfo): Change argument to EmitContext.
2839 Pass type array to InternalParameters.
2840 (SetIndexerMethod.GetParameterInfo): Likewise.
2841 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
2842 * delegate.cs (Define): Pass emitcontext to
2843 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
2844 array to InternalParameters.
2845 * expression.cs (ParameterReference.DoResolveBase): Pass
2846 emitcontext to GetParameterInfo.
2847 (ComposedCast.DoResolveAsTypeStep): Remove check on
2848 ec.ResolvingTypeTree.
2849 * parameter.cs (Parameter.Resolve): Change argument to
2850 EmitContext. Use ResolveAsTypeTerminal.
2851 (Parameter.GetSignature): Change argument to EmitContext.
2852 (Parameters.ComputeSignature): Likewise.
2853 (Parameters.ComputeParameterTypes): Likewise.
2854 (Parameters.GetParameterInfo): Likewise.
2855 (Parameters.ComputeAndDefineParameterTypes): Likewise.
2856 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
2857 * support.cs (InternalParameters..ctor): Remove variant that takes
2859 * typemanager.cs (system_intptr_expr): New.
2860 (InitExpressionTypes): Initialize it.
2862 2004-10-12 Chris Toshok <toshok@ximian.com>
2864 * cs-parser.jay: fix location for try_statement and catch_clause.
2866 2004-10-11 Martin Baulig <martin@ximian.com>
2868 * report.cs: Don't make --fatal abort on warnings, we have
2869 -warnaserror for that.
2871 2004-10-07 Raja R Harinath <rharinath@novell.com>
2873 More DeclSpace.ResolveType avoidance.
2874 * decl.cs (MemberCore.InUnsafe): New property.
2875 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
2876 with newly created EmitContext.
2877 (FieldMember.Define): Likewise.
2878 * delegate.cs (Delegate.Define): Likewise.
2879 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
2880 only if normal name-lookup fails.
2881 (TypeExpr.DoResolve): Enable error-checking.
2882 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
2883 (SizeOf.DoResolve): Likewise.
2884 (ComposedCast.DoResolveAsTypeStep): Likewise.
2885 (StackAlloc.DoResolve): Likewise.
2886 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
2887 (Block.Unsafe): New property.
2888 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
2889 (Unsafe): Set 'unsafe' flag of contained block.
2890 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
2891 (Fixed.Resolve): Likewise.
2892 (Catch.Resolve): Likewise.
2893 (Using.ResolveLocalVariableDecls): Likewise.
2894 (Foreach.Resolve): Likewise.
2896 2004-10-05 John Luke <john.luke@gmail.com>
2898 * cs-parser.jay: add location to error CS0175
2900 2004-10-04 Miguel de Icaza <miguel@ximian.com>
2902 * ecore.cs (Expression.Constantity): Add support for turning null
2905 * const.cs (Const.Define): Allow constants to be reference types
2906 as long as the value is Null.
2908 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
2910 * namespace.cs (NamespaceEntry.Using): No matter which warning
2911 level is set, check if this namespace name has already been added.
2913 2004-10-03 Ben Maurer <bmaurer@ximian.com>
2915 * expression.cs: reftype [!=]= null should always use br[true,false].
2918 2004-10-03 Marek Safar <marek.safar@seznam.cz>
2921 * attribute.cs: Enum conversion moved to
2922 GetAttributeArgumentExpression to be applied to the all
2925 2004-10-01 Raja R Harinath <rharinath@novell.com>
2927 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
2928 * class.c (TypeContainer.DefineType): Flag error if
2929 base types aren't accessible due to access permissions.
2930 * decl.cs (DeclSpace.ResolveType): Move logic to
2931 Expression.ResolveAsTypeTerminal.
2932 (DeclSpace.ResolveTypeExpr): Thin layer over
2933 Expression.ResolveAsTypeTerminal.
2934 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
2935 Refactor code into NestedAccess. Use it.
2936 (DeclSpace.NestedAccess): New.
2937 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
2938 argument to silence errors. Check access permissions.
2939 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
2940 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
2941 (Cast.DoResolve): Likewise.
2942 (New.DoResolve): Likewise.
2943 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
2944 (TypeOf.DoResolve): Likewise.
2946 * expression.cs (Invocation.BetterConversion): Return the Type of
2947 the better conversion. Implement section 14.4.2.3 more faithfully.
2948 (Invocation.BetterFunction): Make boolean. Make correspondence to
2949 section 14.4.2.2 explicit.
2950 (Invocation.OverloadResolve): Update.
2951 (Invocation): Remove is_base field.
2952 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
2953 (Invocation.Emit): Likewise.
2955 2004-09-27 Raja R Harinath <rharinath@novell.com>
2957 * README: Update to changes.
2959 2004-09-24 Marek Safar <marek.safar@seznam.cz>
2961 * cs-parser.jay: Reverted 642 warning fix.
2963 2004-09-23 Marek Safar <marek.safar@seznam.cz>
2966 * decl.cs (FindMemberWithSameName): Indexer can have more than
2969 2004-09-23 Marek Safar <marek.safar@seznam.cz>
2971 * expression.cs (LocalVariableReference.DoResolveLValue):
2972 Do not report warning 219 for out values.
2973 (EmptyExpression.Null): New member to avoid extra allocations.
2975 2004-09-23 Marek Safar <marek.safar@seznam.cz>
2977 * cs-parser.jay: Fix wrong warning 642 report.
2979 * cs-tokenizer.cs (CheckNextToken): New helper;
2980 Inspect next character if is same as expected.
2982 2004-09-23 Martin Baulig <martin@ximian.com>
2984 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
2985 (Convert.ImplicitReferenceConversionExists): Likewise.
2987 2004-09-23 Marek Safar <marek.safar@seznam.cz>
2989 * class.cs (Operator.Define): Add error 448 and 559 report.
2991 2004-09-22 Marek Safar <marek.safar@seznam.cz>
2993 * class.cs (MemberBase.IsTypePermitted): New protected
2994 method for checking error CS0610.
2996 2004-09-22 Marek Safar <marek.safar@seznam.cz>
2998 * class.cs (TypeContainer.HasExplicitLayout): New property
2999 Returns whether container has StructLayout attribute set Explicit.
3000 (FieldMember): New abstract class for consts and fields.
3001 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
3002 (Field): Reuse FieldMember.
3004 * const.cs (Const): Reuse FieldMember.
3006 * rootcontext.cs: EmitConstants call moved to class.
3008 2004-09-22 Martin Baulig <martin@ximian.com>
3010 Thanks to Peter Sestoft for this bug report.
3012 * expression.cs (Conditional): If both the `trueExpr' and the
3013 `falseExpr' is a NullLiteral, return a NullLiteral.
3015 2004-09-22 Martin Baulig <martin@ximian.com>
3017 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
3018 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
3019 for the "get_Current" call.
3021 2004-09-22 Martin Baulig <martin@ximian.com>
3023 Marek and me just fixed one of our oldest bugs: #28562 :-)
3025 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
3027 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
3028 we're an EnumConstant, just return that.
3029 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
3030 an EnumConstant. In this case, we need to use GetValueAsEnumType()
3031 to get the value which'll actually be written into the attribute.
3032 However, we have to use GetValue() to access the attribute's value
3035 2004-09-22 Marek Safar <marek.safar@seznam.cz>
3037 * constant.cs (Constant.IsNegative): New abstract property
3040 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
3041 (StackAlloc.DoResolve): Reused IsNegative.
3043 2004-09-21 Martin Baulig <martin@ximian.com>
3045 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
3046 if we're used in an iterator, we may be called from different
3049 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
3050 we actually have an exception block.
3052 2004-09-20 John Luke <jluke@cfl.rr.com>
3054 * class.cs, cs-parser.jay: Improve the error report for 1520:
3055 report the actual line where the error happens, not where the
3058 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
3059 Pass location information that was available elsewhere.
3061 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
3063 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
3064 runtime to delay sign assemblies.
3066 2004-09-19 Miguel de Icaza <miguel@ximian.com>
3068 * cs-parser.jay: Do not report the stack trace, this is barely
3071 2004-08-22 John Luke <john.luke@gmail.com>
3073 * driver.cs : check that a resource id is not already used
3074 before adding it, report CS1508 if it is, bug #63637
3076 2004-09-19 Miguel de Icaza <miguel@ximian.com>
3078 * ecore.cs: Removed dead code.
3080 2004-09-18 Marek Safar <marek.safar@seznam.cz>
3082 * class.cs: Do not report warning CS0067 on the interfaces.
3084 2004-09-16 Marek Safar <marek.safar@seznam.cz>
3086 * cs-parser.jay: Add error 504 report.
3088 2004-09-16 Marek Safar <marek.safar@seznam.cz>
3090 * rootcontext.cs: WarningLevel is 4 by default now.
3092 * statement.cs (Fixed.Resolve): Do not null
3095 2004-09-16 Marek Safar <marek.safar@seznam.cz>
3098 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
3099 deep search when property is not virtual.
3100 (PropertyExpr.ResolveAccessors): Make one call for both
3103 2004-09-15 Marek Safar <marek.safar@seznam.cz>
3106 * statement.cs: Error 152 report constains also location.
3108 2004-09-15 Marek Safar <marek.safar@seznam.cz>
3111 * const.cs: Explicitly set constant as static.
3113 2004-09-15 Marek Safar <marek.safar@seznam.cz>
3116 * cs-parser.jay: Add error 1017 report.
3118 2004-09-15 Marek Safar <marek.safar@seznam.cz>
3120 Fixed bug #59980, #64224
3121 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
3123 * typemanager.cs (IsSpecialMethod): Simplified
3125 2004-09-14 Marek Safar <marek.safar@seznam.cz>
3127 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
3128 condition with better params.
3130 2004-09-14 Marek Safar <marek.safar@seznam.cz>
3133 * attribute.cs (Resolve): Property has to have both
3136 2004-09-14 Martin Baulig <martin@ximian.com>
3138 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
3140 2004-09-14 Marek Safar <marek.safar@seznam.cz>
3143 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
3144 called and is obsolete then this member suppress message
3145 when call is inside next [Obsolete] method or type.
3147 * expression.cs: Use TestObsoleteMethodUsage member.
3149 2004-09-14 Martin Baulig <martin@ximian.com>
3151 * cs-parser.jay: Sync a bit with the GMCS version.
3153 2004-09-14 Martin Baulig <martin@ximian.com>
3155 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
3156 (CSharpParser.yacc_verbose_flag): New public field.
3158 * genericparser.cs: Removed.
3160 2004-09-14 Raja R Harinath <rharinath@novell.com>
3162 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
3164 2004-09-13 Marek Safar <marek.safar@seznam.cz>
3166 * class.cs (MethodCore.CheckBase): Fix bug #65757.
3168 2004-09-10 Martin Baulig <martin@ximian.com>
3170 Backported my MemberName changes from GMCS into MCS.
3172 - we are now using a special `MemberName' class instead of using
3173 strings; in GMCS, the `MemberName' also contains the type
3176 - changed the grammar rules a bit:
3177 * the old `member_name' is now a `namespace_or_type_name':
3178 The rule is that we use `namespace_or_type_name' everywhere
3179 where we expect either a "member name" (GetEnumerator) or a
3180 "member name" with an explicit interface name
3181 (IEnumerable.GetEnumerator).
3182 In GMCS, the explicit interface name may include type arguments
3183 (IEnumerable<T>.GetEnumerator).
3184 * we use `member_name' instead of just `IDENTIFIER' for
3186 The rule is that we use `member_name' wherever a member may
3187 have type parameters in GMCS.
3189 * decl.cs (MemberName): New public class.
3190 (MemberCore.MemberName): New public readonly field.
3191 (MemberCore.ctor): Take a `MemberName' argument, not a string.
3192 (DeclSpace): Likewise.
3194 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
3195 * enum.cs (Enum.ctor): Likewise.
3197 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
3199 (AliasEntry.ctor): Take a MemberName, not an Expression.
3200 (AliasEntry.UsingAlias): Likewise.
3202 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
3203 (IMethodData.MemberName): Changed type from string to MemberName.
3204 (MemberBase.ExplicitInterfaceName): Likewise.
3205 (AbstractPropertyEventMethod.SetupName): Make this private.
3206 (AbstractPropertyEventMethod.ctor): Added `string prefix'
3207 argument; compute the member name here.
3208 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
3209 on the `member.MemberName' and the `prefix'.
3211 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
3213 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
3214 thus, we get a `MemberName' instead of a `string'. These
3215 declarations may have type parameters in GMCS.
3216 (interface_method_declaration, delegate_declaration): Likewise.
3217 (class_declaration, interface_declaration): Likewise.
3218 (method_header): Use `namespace_or_type_name' instead of
3219 `member_name'. We may be an explicit interface implementation.
3220 (property_declaration, event_declaration): Likewise.
3221 (member_name): This is now just an `IDENTIFIER', not a
3222 `namespace_or_type_name'.
3223 (type_name, interface_type): Removed.
3224 (namespace_or_type_name): Return a MemberName, not an Expression.
3225 (primary_expression): Use `member_name' instead of `IDENTIFIER';
3226 call GetTypeExpression() on the MemberName to get an expression.
3227 (IndexerDeclaration.interface_type): Changed type from string to
3229 (MakeName): Operate on MemberName's instead of string's.
3231 2004-09-13 Raja R Harinath <rharinath@novell.com>
3234 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
3235 (NamespaceEntry.Lookup): Add new argument to flag if we want the
3236 lookup to avoid symbols introduced by 'using'.
3237 * rootcontext.cs (NamespaceLookup): Update.
3239 2004-09-12 Marek Safar <marek.safar@seznam.cz>
3241 * class.cs (TypeContainer.DoDefineMembers): Do not call
3242 DefineDefaultConstructor for static classes.
3244 2004-09-12 Marek Safar <marek.safar@seznam.cz>
3246 * attribute.cs (Attribute.Resolve): Add error 653 report.
3248 * class.cs (Class.ApplyAttributeBuilder): Add error 641
3250 (Method.ApplyAttributeBuilder): Add error 685 report.
3251 (Operator.Define): Add error 564 report.
3253 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
3255 * expression.cs (Invocation.DoResolve): Add error
3258 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
3261 2004-09-11 Marek Safar <marek.safar@seznam.cz>
3263 * class.cs (ConstructorInitializer.Resolve):
3264 Wrong error number (515->516).
3266 2004-09-11 Marek Safar <marek.safar@seznam.cz>
3268 * class.cs (Indexer.Define): Add error 631 report.
3270 2004-09-11 Marek Safar <marek.safar@seznam.cz>
3272 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
3274 2004-09-11 Marek Safar <marek.safar@seznam.cz>
3276 * expression.cs (Probe.DoResolve): Add error CS0241 report.
3278 2004-09-10 Marek Safar <marek.safar@seznam.cz>
3280 * cs-parser.jay: Added error CS0241 report.
3282 2004-09-10 Raja R Harinath <rharinath@novell.com>
3284 * cs-parser.jay (fixed_statement): Introduce a scope for the
3285 declaration in the 'fixed' statement.
3287 2004-09-09 Marek Safar <marek.safar@seznam.cz>
3289 * cs-parser.jay: Added CS0230 error report.
3291 2004-09-09 Marek Safar <marek.safar@seznam.cz>
3293 * cs-parser.jay: Added errors CS0231 and CS0257 report.
3295 2004-09-09 Marek Safar <marek.safar@seznam.cz>
3297 * expression.cs (Argument.Resolve): Added error CS0192 and
3300 2004-09-09 Marek Safar <marek.safar@seznam.cz>
3302 C# 2.0 #pragma warning feature
3304 * cs-tokenizer.cs (PreProcessPragma): New method;
3305 Handles #pragma directive.
3307 * report.cs (WarningRegions): New class; Support
3308 class for #pragma warning directive. It tests whether
3309 warning is enabled for a given line.
3311 2004-09-08 Miguel de Icaza <miguel@ximian.com>
3313 * const.cs: Add more descriptive error report, tahnks to
3316 2004-09-08 Marek Safar <marek.safar@seznam.cz>
3318 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
3320 2004-09-07 Miguel de Icaza <miguel@ximian.com>
3322 * expression.cs: Apply patch from Ben: Remove dead code from
3323 ArrayCreation, and remove the TurnintoConstant call in const.cs,
3324 as that code just threw an exception anwyays.
3326 * const.cs: Remove the call to the turnintoconstant, for details
3329 * literal.cs: The type of the null-literal is the null type; So
3330 we use a placeholder type (literal.cs:System.Null, defined here)
3333 * expression.cs (Conditional.DoResolve): Remove some old code that
3334 is no longer needed, conversions have been fixed.
3336 (ArrayCreationExpression.DoResolve): Return false if we fail to
3337 resolve the inner expression.
3339 2004-09-07 Raja R Harinath <rharinath@novell.com>
3342 * cs-parser.jay (delegate_declaration): Record a delegate
3343 declaration as a type declaration.
3344 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
3346 2004-09-06 Miguel de Icaza <miguel@ximian.com>
3348 * parameter.cs: Do not crash if the type can not be resolved.
3350 * expression.cs: Report errors with unsafe pointers, fixes #64896
3352 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
3354 * expression.cs: Pointer arith always needs to do a conv.i
3355 if the operand is a long. fix 65320
3357 2004-09-04 Marek Safar <marek.safar@seznam.cz>
3359 Fixed cs0619-37.cs, cs0619-38.cs
3361 * enum.cs (GetObsoleteAttribute): Removed.
3363 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
3364 on Enum member is double staged. The first is tested member
3367 2004-09-04 Marek Safar <marek.safar@seznam.cz>
3369 Fixed #56986, #63631, #65231
3371 * class.cs: (TypeContainer.AddToMemberContainer): New method,
3372 adds member to name container.
3373 (TypeContainer.AddToTypeContainer): New method, adds type to
3375 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
3376 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
3377 AddOperator): Simplified by reusing AddToMemberContainer.
3378 (TypeContainer.UserDefinedStaticConstructor): Changed to property
3380 (Method.CheckForDuplications): Fixed implementation to test all
3382 (MemberBase): Detection whether member is explicit interface
3383 implementation is now in constructor.
3384 (MemberBase.UpdateMemberName): Handles IndexerName.
3385 (Accessor): Changed to keep also location information.
3386 (AbstractPropertyEventMethod): Is derived from MemberCore.
3387 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
3388 will be emited or not.
3389 (PropertyBase.AreAccessorsDuplicateImplementation):
3390 Tests whether accessors are not in collision with some method.
3391 (Operator): Is derived from MethodCore to simplify common
3394 * decl.cs (Flags.TestMethodDuplication): Test for duplication
3396 (DeclSpace.AddToContainer): Adds the member to defined_names
3397 table. It tests for duplications and enclosing name conflicts.
3399 * enum.cs (EnumMember): Clean up to reuse the base structures
3401 2004-09-03 Martin Baulig <martin@ximian.com>
3403 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
3404 into TypeContainer, to make partial classes work again.
3406 2004-09-03 Martin Baulig <martin@ximian.com>
3408 * rootcontext.cs (RootContext.V2): Removed.
3410 2004-03-23 Martin Baulig <martin@ximian.com>
3412 * expression.cs (Invocation.OverloadResolve): Added `bool
3413 may_fail' argument and use it instead of the Location.IsNull() hack.
3415 2004-09-03 Martin Baulig <martin@ximian.com>
3417 Merged latest changes into gmcs. Please keep this comment in
3418 here, it makes it easier for me to see what changed in MCS since
3419 the last time I merged.
3421 2004-09-03 Raja R Harinath <rharinath@novell.com>
3424 * expression.cs (BetterConversion): Don't allow either conversion
3425 to be null. Remove redundant implicit conversion test when 'q ==
3426 null' -- when this function is invoked, we already know that the
3427 implicit conversion exists.
3428 (BetterFunction): Assume that 'best' is non-null. Remove
3429 redundant reimplementation of IsApplicable when 'best' is null.
3430 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
3431 number of arguments.
3432 (IsAncestralType): Extract from OverloadResolve.
3433 (OverloadResolve): Make robust to the MethodGroupExpr being
3434 unsorted. Implement all the logic of Section 14.5.5.1, and
3435 support overloading of methods from multiple applicable types.
3436 Clean up logic somewhat. Don't pass null methods to BetterFunction.
3438 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
3439 (RealError, Warning): Append type of report to related symbol.
3441 2004-09-03 Marek Safar <marek.safar@seznam.cz>
3443 * enum.cs: Fixed CLS-Compliance checks for enum members.
3444 Error tests cs3008-8.cs, cs3014-8.cs
3446 2004-09-02 Marek Safar <marek.safar@seznam.cz>
3448 Fixed bug #62342, #63102
3449 * class.cs: ImplementIndexer uses member.IsExplicitImpl
3450 like ImplementMethod.
3452 2004-09-02 Marek Safar <marek.safar@seznam.cz>
3454 * attribute.cs (Attribute.GetAttributeArgumentExpression):
3457 2004-09-02 Martin Baulig <martin@ximian.com>
3459 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
3460 TypeManager.GetArgumentTypes() rather than calling GetParameters()
3463 2004-09-01 Marek Safar <marek.safar@seznam.cz>
3465 C# 2.0 Static classes implemented
3467 * class.cs (TypeContainer): instance_constructors,
3468 initialized_fields, initialized_static_fields,
3469 default_constructor, base_inteface_types are protected to be
3470 accessible from StaticClass.
3471 (TypeContainer.DefineDefaultConstructor): New virtual method
3472 for custom default constructor generating
3473 (StaticClass): New class to handle "Static classes" feature.
3475 * cs-parser.jay: Handle static keyword on class like instance
3478 * driver.cs: Added "/langversion" command line switch with two
3479 options (iso-1, default).
3481 2004-08-31 Marek Safar <marek.safar@seznam.cz>
3483 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
3485 2004-08-31 Miguel de Icaza <miguel@ximian.com>
3487 * delegate.cs: Style.
3489 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
3491 * delegate.cs: Add seperate instance expr field for miguel.
3493 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
3495 * PointerArithmetic (Resolve): make sure we are not doing
3496 pointer arith on void*. Also, make sure we are resolved
3497 by not setting eclass until resolve.
3499 All callers: Make sure that PointerArithmetic gets resolved.
3501 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
3503 * ArrayCreation (LookupType): If the type does not resolve
3504 to an array, give an error.
3506 2004-08-27 Marek Safar <marek.safar@seznam.cz>
3508 * statement.cs (Try.Resolve): Fixed bug #64222
3510 2004-08-27 Martin Baulig <martin@ximian.com>
3513 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
3516 2004-08-26 Marek Safar <marek.safar@seznam.cz>
3518 * ecore.cs (Constantify): Get underlying type via
3519 System.Enum.GetUnderlyingType to avoid StackOverflow on the
3520 Windows in special cases.
3522 2004-08-26 Marek Safar <marek.safar@seznam.cz>
3524 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
3525 for obtaining also private methods.
3526 (GetRemoveMethod): Used GetRemoveMethod (true)
3527 for obtaining also private methods.
3529 2004-08-24 Martin Baulig <martin@ximian.com>
3531 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
3532 MethodAttributes.HideBySig for operators.
3534 2004-08-23 Martin Baulig <martin@ximian.com>
3536 Back to the old error reporting system :-)
3538 * report.cs (Message): Removed.
3539 (Report.MessageData, ErrorData, WarningData): Removed.
3540 (Report.Error, Warning): Back to the old system.
3542 2004-08-23 Martin Baulig <martin@ximian.com>
3544 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
3546 * class.cs (TypeContainer.ParentContainer): New public virtual
3547 method; replaces the explicit interface implementation.
3548 (ClassPart.ParentContainer): Override.
3550 2004-08-23 Martin Baulig <martin@ximian.com>
3552 * statement.cs (Switch): Added support for constant switches; see
3553 #59428 or test-285.cs.
3555 2004-08-22 Marek Safar <marek.safar@seznam.cz>
3558 * statement.cs (GetEnumeratorFilter): Removed useless
3559 logic because C# specs is strict. GetEnumerator must be
3562 2004-08-22 Martin Baulig <martin@ximian.com>
3564 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3565 a switch and may break, reset the barrier. Fixes #59867.
3567 2004-08-22 Marek Safar <marek.safar@seznam.cz>
3569 CLS-Compliance speed up (~5% for corlib)
3571 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
3572 New method. Tests container for CLS-Compliant names
3574 * class.cs (TypeContainer.VerifyClsName): New method.
3575 Checks whether container name is CLS Compliant.
3576 (Constructor): Implements IMethodData.
3578 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
3579 low-case table for CLS Compliance test.
3580 (MemberCache.VerifyClsParameterConflict): New method.
3581 Checks method parameters for CS3006 error.
3583 * enum.cs (EnumMember): Is derived from MemberCore.
3584 (Enum.VerifyClsName): Optimized for better performance.
3586 2004-08-06 Marek Safar <marek.safar@seznam.cz>
3588 * report.cs: Renamed Error_T to Error and changed all
3591 2004-08-06 Marek Safar <marek.safar@seznam.cz>
3593 * class.cs (TypeContainer.IndexerArrayList): New inner class
3594 container for indexers.
3595 (TypeContainer.DefaultIndexerName): New constant for default
3596 indexer name. Replaced all "Item" with this constant.
3597 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
3599 * typemanager.cs (TypeManager.default_member_ctor): Cache here
3600 DefaultMemberAttribute constructor.
3602 2004-08-05 Martin Baulig <martin@ximian.com>
3604 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
3607 2004-08-05 Marek Safar <marek.safar@seznam.cz>
3609 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
3610 multi platforms problem.
3612 * compiler.csproj: Included shared files.
3614 2004-08-04 Marek Safar <marek.safar@seznam.cz>
3616 Fix bug 60333, 55971 in the more general way
3617 * attribute.cs (Attribute.GetAttributeArgumentExpression):
3618 Added arg_type argument for constant conversion.
3619 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
3621 2004-08-04 Marek Safar <marek.safar@seznam.cz>
3624 * class.cs (TypeContainer ): New inner classes MethodArrayList,
3625 OperatorArrayList, MethodCoreArrayList for typecontainer
3626 containers. Changed class member types to these new types.
3627 (MethodArrayList.DefineMembers): Added test for CS0659.
3629 2004-08-04 Miguel de Icaza <miguel@ximian.com>
3631 * cfold.cs: Synchronize the folding with the code in expression.cs
3632 Binary.DoNumericPromotions for uint operands.
3634 * attribute.cs: Revert patch from Raja, it introduced a regression
3635 while building Blam-1.2.1 (hard to isolate a test case).
3637 2004-08-04 Marek Safar <marek.safar@seznam.cz>
3641 (TypeContainer.Define): Renamed to DefineContainerMembers because of
3643 (MethodCore.parent_method): New member. The method we're overriding
3644 if this is an override method.
3645 (MethodCore.CheckBase): Moved from Method class and made common.
3646 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
3648 (MethodCore.CheckForDuplications): New abstract method. For custom
3649 member duplication search in a container
3650 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
3651 method and its return type.
3652 (Event.conflict_symbol): New member. Symbol with same name in the
3656 (MemberCache.FindMemberWithSameName): New method. The method
3657 is looking for conflict with inherited symbols.
3659 2004-08-04 Martin Baulig <martin@ximian.com>
3661 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
3663 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
3665 2004-08-03 Marek Safar <marek.safar@seznam.cz>
3667 * report.cs (Message): New enum for better error, warning reference in
3669 (MessageData): New inner abstract class. It generally handles printing of
3670 error and warning messages.
3671 Removed unused Error, Warning, Message methods.
3673 2004-08-03 Marek Safar <marek.safar@seznam.cz>
3675 Fix for cs0592-8.cs test
3677 (Attributable.ValidAttributeTargets): Made public.
3678 (Attribute.ExplicitTarget): New member for explicit target value.
3679 (Attribute.CheckTargets): Now we translate explicit attribute
3680 target to Target here.
3682 2004-08-03 Ben Maurer <bmaurer@ximian.com>
3684 * ecore.cs (MethodGroupExpr): new IsBase property.
3686 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
3688 * delegate.cs (DelegateCreation): store a MethodGroupExpr
3689 rather than an instance expr.
3691 (DelegateCreation.Emit): Use the method group rather than
3692 the instance expression. Also, if you have base.Foo as the
3693 method for a delegate, make sure to emit ldftn, not ldftnvirt.
3695 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
3697 (NewDelegate.DoResolve): Only check for the existance of Invoke
3698 if the method is going to be needed. Use MethodGroupExpr.
3700 (NewDelegate.Emit): Remove, DelegateCreation implements this.
3702 * expression.cs: For pointer arith., make sure to use
3703 the size of the type, not the size of the pointer to
3706 2004-08-03 Marek Safar <marek.safar@seznam.cz>
3709 * class.cs (Class): Added error CS0502 test.
3711 2004-08-03 John Luke <jluke@cfl.rr.com>
3712 Raja R Harinath <rharinath@novell.com>
3715 * attribute.cs (Attribute.complained_before): New flag.
3716 (Attribute.ResolveType, Attribute.Resolve),
3717 (Attribute.DefinePInvokeMethod): Set it.
3718 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
3720 2004-08-03 Martin Baulig <martin@ximian.com>
3722 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
3723 use a user-defined operator; we still need to do numeric
3724 promotions in case one argument is a builtin type and the other
3725 one has an implicit conversion to that type. Fixes #62322.
3727 2004-08-02 Martin Baulig <martin@ximian.com>
3729 * statement.cs (LocalInfo.Flags): Added `IsThis'.
3730 (LocalInfo.IsThis): New public property.
3731 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
3733 2004-08-01 Martin Baulig <martin@ximian.com>
3735 * class.cs (TypeContainer.GetClassBases): Don't set the default
3736 here since we may get called from GetPartialBases().
3737 (TypeContainer.DefineType): If GetClassBases() didn't return a
3738 parent, use the default one.
3740 2004-07-30 Duncan Mak <duncan@ximian.com>
3742 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
3744 2004-07-30 Martin Baulig <martin@ximian.com>
3746 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
3748 * class.cs (SourceMethod): New public class, derive from the
3749 symbol writer's ISourceMethod.
3750 (Method): Use the new symbol writer API.
3752 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
3753 as argument and use the new symbol writer.
3756 (SourceFile): Implement the symbol writer's ISourceFile.
3757 (Location.SymbolDocument): Removed.
3758 (Location.SourceFile): New public property.
3760 * symbolwriter.cs: Use the new symbol writer API.
3762 2004-07-30 Raja R Harinath <rharinath@novell.com>
3764 * Makefile (install-local): Remove. Functionality moved to
3767 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
3769 * Makefile: Install mcs.exe.config file together with mcs.exe.
3770 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
3771 correct runtime version.
3773 2004-07-25 Martin Baulig <martin@ximian.com>
3776 (TypeContainer.RegisterOrder): Removed, this was unused.
3777 (TypeContainer, interface_order): Removed.
3778 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
3779 TypeContainer as argument since we can also be called with a
3780 `PartialContainer' for a partial class/struct/interface.
3781 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
3782 of checking whether we're an `Interface' - we could be a
3784 (PartialContainer.Register): Override; call
3785 AddClass()/AddStruct()/AddInterface() on our parent.
3787 * cs-parser.jay (interface_member_declaration): Add things to the
3788 `current_container', not the `current_class'.
3790 * rootcontext.cs (RegisterOrder): The overloaded version which
3791 takes an `Interface' was unused, removed.
3793 * typemanager.cs (TypeManager.LookupInterface): Return a
3794 `TypeContainer', not an `Interface'.
3795 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
3796 contain a `PartialContainer' for an interface, so check it's
3797 `Kind' to figure out what it is.
3799 2004-07-25 Martin Baulig <martin@ximian.com>
3801 * class.cs (Class.DefaultTypeAttributes): New public constant.
3802 (Struct.DefaultTypeAttributes): Likewise.
3803 (Interface.DefaultTypeAttributes): Likewise.
3804 (PartialContainer.TypeAttr): Override this and add the
3805 DefaultTypeAttributes.
3807 2004-07-25 Martin Baulig <martin@ximian.com>
3809 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
3810 we can just use the `Parent' field instead.
3812 2004-07-25 Martin Baulig <martin@ximian.com>
3814 * class.cs (TypeContainer.Emit): Renamed to EmitType().
3816 2004-07-25 Martin Baulig <martin@ximian.com>
3818 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
3819 our parts before defining any methods.
3820 (TypeContainer.VerifyImplements): Make this virtual.
3821 (ClassPart.VerifyImplements): Override and call VerifyImplements()
3822 on our PartialContainer.
3824 2004-07-25 Martin Baulig <martin@ximian.com>
3826 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
3828 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
3829 argument, we can just use the `Parent' field instead.
3832 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
3833 (MemberBase.DoDefine): Likewise.
3835 2004-07-24 Martin Baulig <martin@ximian.com>
3837 * decl.cs (MemberCore.Parent): New public field.
3838 (DeclSpace.Parent): Moved to MemberCore.
3840 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
3841 (MemberBase.ctor): Added TypeContainer argument, pass it to our
3843 (FieldBase, Field, Operator): Likewise.
3844 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
3845 (EventField, Event): Likewise.
3847 2004-07-23 Martin Baulig <martin@ximian.com>
3849 * class.cs (PartialContainer): New public class.
3850 (ClassPart): New public class.
3851 (TypeContainer): Added support for partial classes.
3852 (TypeContainer.GetClassBases): Splitted some of the functionality
3853 out into GetNormalBases() and GetPartialBases().
3855 * cs-tokenizer.cs (Token.PARTIAL): New token.
3856 (Tokenizer.consume_identifier): Added some hacks to recognize
3857 `partial', but only if it's immediately followed by `class',
3858 `struct' or `interface'.
3860 * cs-parser.jay: Added support for partial clases.
3862 2004-07-23 Martin Baulig <martin@ximian.com>
3864 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
3865 a `DeclSpace' and also made it readonly.
3866 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
3867 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
3868 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
3870 * cs-parser.jay: Pass the `current_class', not the
3871 `current_container' (at the moment, this is still the same thing)
3872 to a new Method, Property, Event, Indexer or Constructor.
3874 2004-07-23 Martin Baulig <martin@ximian.com>
3876 * cs-parser.jay (CSharpParser): Added a new `current_class' field
3877 and removed the `current_interface' one.
3878 (struct_declaration, class_declaration, interface_declaration):
3879 Set `current_class' to the newly created class/struct/interface;
3880 set their `Bases' and call Register() before parsing their body.
3882 2004-07-23 Martin Baulig <martin@ximian.com>
3884 * class.cs (Kind): New public enum.
3885 (TypeContainer): Made this class abstract.
3886 (TypeContainer.Kind): New public readonly field.
3887 (TypeContainer.CheckDef): New public method; moved here from
3889 (TypeContainer.Register): New public abstract method.
3890 (TypeContainer.GetPendingImplementations): New public abstract
3892 (TypeContainer.GetClassBases): Removed the `is_class' and
3893 `is_iface' parameters.
3894 (TypeContainer.DefineNestedTypes): Formerly known as
3896 (ClassOrStruct): Made this class abstract.
3898 * tree.cs (RootTypes): New public type.
3900 2004-07-20 Martin Baulig <martin@ximian.com>
3902 * tree.cs (Tree.RecordNamespace): Removed.
3903 (Tree.Namespaces): Removed.
3905 * rootcontext.cs (RootContext.IsNamespace): Removed.
3907 * cs-parser.jay (namespace_declaration): Just create a new
3908 NamespaceEntry here.
3910 2004-07-20 Martin Baulig <martin@ximian.com>
3912 * statement.cs (ExceptionStatement): New abstract class. This is
3913 now used as a base class for everyone who's using `finally'.
3914 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
3915 our local variables before using them.
3917 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
3918 virtual method. This is used by Yield.Resolve() to "steal" an
3919 outer block's `finally' clauses.
3920 (FlowBranchingException): The .ctor now takes an ExceptionStatement
3923 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
3924 version which takes an ExceptionStatement. This version must be
3925 used to create exception branchings.
3928 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
3929 (Iterator.EmitMoveNext): Added exception support; protect the
3930 block with a `fault' clause, properly handle 'finally' clauses.
3931 (Iterator.EmitDispose): Run all the `finally' clauses here.
3933 2004-07-20 Martin Baulig <martin@ximian.com>
3935 * iterator.cs: This is the first of a set of changes in the
3936 iterator code. Match the spec more closely: if we're an
3937 IEnumerable, then GetEnumerator() must be called. The first time
3938 GetEnumerator() is called, it returns the current instance; all
3939 subsequent invocations (if any) must create a copy.
3941 2004-07-19 Miguel de Icaza <miguel@ximian.com>
3943 * expression.cs: Resolve the constant expression before returning
3946 2004-07-19 Martin Baulig <martin@ximian.com>
3948 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
3949 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
3950 the return type of the new EmitContext.
3952 2004-07-18 Martin Baulig <martin@ximian.com>
3954 * class.cs (Property.Define): Fix iterators.
3956 * iterators.cs (Iterator.Define): Moved the
3957 `container.AddInterator (this)' call here from the .ctor; only do
3958 it if we resolved successfully.
3960 2004-07-17 Miguel de Icaza <miguel@ximian.com>
3962 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
3963 `true' for preprocessing directives that we parse. The return
3964 value indicates whether we should return to regular tokenizing or
3965 not, not whether it was parsed successfully.
3967 In the past if we were in: #if false ... #line #endif, we would
3968 resume parsing after `#line'. See bug 61604.
3970 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
3971 building: IsEnumType should return true only for enums, not for
3972 enums or System.Enum itself. This fixes #61593.
3974 Likely what happened is that corlib was wrong: mcs depended on
3975 this bug in some places. The bug got fixed, we had to add the
3976 hack, which caused bug 61593.
3978 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
3979 that was a workaround for the older conditions.
3981 2004-07-16 Ben Maurer <bmaurer@ximian.com>
3983 * assign.cs: IAssignMethod has a new interface, as documented
3984 inline. All assignment code now uses this new api.
3986 * ecore.cs, expression.cs: All classes which implement
3987 IAssignMethod now use the new interface.
3989 * expression.cs (Invocation): add a hack to EmitCall so that
3990 IndexerAccess can be the target of a compound assignment without
3991 evaluating its arguments twice.
3993 * statement.cs: Handle changes in Invocation api.
3995 2004-07-16 Martin Baulig <martin@ximian.com>
3997 * iterators.cs: Rewrote this. We're now using one single Proxy
3998 class for both the IEnumerable and the IEnumerator interface and
3999 `Iterator' derives from Class so we can use the high-level API.
4001 * class.cs (TypeContainer.AddIterator): New method.
4002 (TypeContainer.DoDefineType): New protected virtual method, which
4003 is called from DefineType().
4004 (TypeContainer.DoDefineMembers): Call DefineType() and
4005 DefineMembers() on all our iterators.
4006 (TypeContainer.Emit): Call Emit() on all our iterators.
4007 (TypeContainer.CloseType): Call CloseType() on all our iterators.
4009 * codegen.cs (EmitContext.CurrentIterator): New public field.
4011 2004-07-15 Martin Baulig <martin@ximian.com>
4014 (TypeManager.not_supported_exception_type): New type.
4016 2004-07-14 Martin Baulig <martin@ximian.com>
4018 * iterators.cs: Use real error numbers.
4020 2004-07-14 Martin Baulig <martin@ximian.com>
4022 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
4023 requires this to be a System.Collection.IEnumerable and not a
4024 class implementing that interface.
4025 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
4027 2004-07-13 Marek Safar <marek.safar@seznam.cz>
4029 * class.cs: Fixed previous fix, it broke some error tests.
4031 2004-07-12 Martin Baulig <martin@ximian.com>
4033 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
4036 2004-07-09 Miguel de Icaza <miguel@ximian.com>
4038 * assign.cs (LocalTemporary): Add new argument: is_address,If
4039 `is_address' is true, then the value that we store is the address
4040 to the real value, and not the value itself.
4042 * ecore.cs (PropertyExpr): use the new local temporary
4043 stuff to allow us to handle X.Y += z (where X is a struct)
4045 2004-07-08 Martin Baulig <martin@ximian.com>
4047 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
4048 not always return, just like we're doing in Using.Resolve().
4050 2004-07-07 Miguel de Icaza <miguel@ximian.com>
4052 * cs-parser.jay (fixed_statement): flag this as Pinned.
4054 2004-07-06 Miguel de Icaza <miguel@ximian.com>
4056 * typemanager.cs (TypeManager): Removed MakePinned method, this
4057 mechanism is replaced with the .NET 2.x compatible mechanism of
4058 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
4060 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
4061 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
4062 `IsFixed' property which has a different meaning.
4064 2004-07-02 Raja R Harinath <rharinath@novell.com>
4066 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
4067 visible from inside a nested class, not just the names of the
4068 immediately enclosing class.
4071 2004-06-24 Raja R Harinath <rharinath@novell.com>
4073 * expression.cs (BetterConversion): Remove buggy special-case
4074 handling of "implicit constant expression conversions". At this
4075 point, we already know that the conversion is possible -- we're
4076 only checking to see which is better.
4078 2004-06-24 Marek Safar <marek.safar@seznam.cz>
4080 * cs-parser.jay: Added error CS0210 test.
4082 2004-06-24 Marek Safar <marek.safar@seznam.cz>
4084 * cs-parser.jay: Added error CS0134 test.
4086 2004-06-24 Marek Safar <marek.safar@seznam.cz>
4089 * cs-parser.jay: Added error CS0145 test.
4091 2004-06-24 Marek Safar <marek.safar@seznam.cz>
4093 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
4095 2004-06-23 Ben Maurer <bmaurer@ximian.com>
4097 * expression.cs (StackAlloc.Resolve): The argument may not
4098 be a constant; deal with this case.
4100 2004-06-23 Marek Safar <marek.safar@seznam.cz>
4102 * attribute.cs (IndexerName_GetIndexerName): Renamed to
4103 GetIndexerAttributeValue.
4104 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
4106 * class.cs (Indexer.Define): Added error tests for CS0415,
4109 2004-06-23 Miguel de Icaza <miguel@ximian.com>
4111 * attribute.cs (Attribute.Resolve): Keep field code in sync with
4114 2004-06-23 Martin Baulig <martin@ximian.com>
4116 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
4117 neither return nor throw, reset the barrier as well. Fixes #60457.
4119 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
4121 * class.cs : EventAttributes is now set to None by default.
4122 This fixes bug #60459.
4124 2004-06-18 Marek Safar <marek.safar@seznam.cz>
4127 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
4128 Don't throw exception but return null (it's sufficient now).
4130 2004-06-18 Marek Safar <marek.safar@seznam.cz>
4132 * typemanager.cs (GetArgumentTypes): Faster implementation.
4134 2004-06-18 Martin Baulig <martin@ximian.com>
4136 * attribute.cs (Attribute.Resolve): Check whether we're an
4137 EmptyCast which a Constant child. Fixes #60333.
4139 2004-06-17 Ben Maurer <bmaurer@ximian.com>
4141 * statement.cs (EmitCollectionForeach): Account for the fact that
4142 not all valuetypes are in areas which we can take the address of.
4143 For these variables, we store to a temporary variable. Also, make
4144 sure that we dont emit a `callvirt' on a valuetype method.
4146 2004-06-15 Marek Safar <marek.safar@seznam.cz>
4148 * expression.cs (StackAlloc.DoReSolve): Added test for
4149 negative parameter (CS0247).
4151 2004-06-15 Marek Safar <marek.safar@seznam.cz>
4154 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
4156 2004-06-15 Marek Safar <marek.safar@seznam.cz>
4159 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
4162 2004-06-14 Marek Safar <marek.safar@seznam.cz>
4164 Fix bug #58254 & cs1555.cs, cs1556.cs
4165 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
4167 2004-06-14 Marek Safar <marek.safar@seznam.cz>
4169 * cs-parser.jay: Added error CS1669 test for indexers.
4171 2004-06-11 Martin Baulig <martin@ximian.com>
4173 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
4174 call this twice: for params and varargs methods.
4176 2004-06-11 Marek Safar <marek.safar@seznam.cz>
4179 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
4181 2004-06-11 Marek Safar <marek.safar@seznam.cz>
4183 * attribute.cs (Attribute.GetValidTargets): Made public.
4186 (AbstractPropertyEventMethod): New class for better code sharing.
4187 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
4189 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
4191 2004-06-11 Raja R Harinath <rharinath@novell.com>
4194 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
4195 that the call to Resolve is part of a MemberAccess.
4196 (Expression.Resolve): Use it for SimpleName resolution.
4197 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
4198 Add 'intermediate' boolean argument.
4199 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
4200 error message when the SimpleName can be resolved ambiguously
4201 between an expression and a type.
4202 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
4204 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
4205 call on the left-side.
4207 2004-06-11 Marek Safar <marek.safar@seznam.cz>
4210 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
4212 2004-06-11 Marek Safar <marek.safar@seznam.cz>
4214 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
4216 2004-06-11 Martin Baulig <martin@ximian.com>
4218 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
4219 varargs methods if applicable.
4221 2004-06-11 Martin Baulig <martin@ximian.com>
4223 * expression.cs (Invocation.EmitCall): Don't use
4224 `method.CallingConvention == CallingConventions.VarArgs' since the
4225 method could also have `CallingConventions.HasThis'.
4227 2004-06-11 Marek Safar <marek.safar@seznam.cz>
4229 * class.cs (Event.GetSignatureForError): Implemented.
4230 Fixed crash in error test cs3010.cs
4232 2004-06-10 Miguel de Icaza <miguel@ximian.com>
4234 * cs-tokenizer.cs: Change the way we track __arglist to be
4235 consistent with the other keywords.
4237 2004-06-09 Miguel de Icaza <miguel@ximian.com>
4239 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
4242 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
4244 * codegen.cs: Check that all referenced assemblies have a strongname
4245 before strongnaming the compiled assembly. If not report error CS1577.
4246 Fix bug #56563. Patch by Jackson Harper.
4247 * typemanager.cs: Added a method to return all referenced assemblies.
4248 Fix bug #56563. Patch by Jackson Harper.
4250 2004-06-08 Marek Safar <marek.safar@seznam.cz>
4253 (Method.ApplyAttributeBuilder): Moved and added conditional
4254 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
4257 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
4259 2004-06-08 Marek Safar <marek.safar@seznam.cz>
4262 * class.cs: (EventField.attribute_targets): Changed default target.
4264 2004-06-08 Martin Baulig <martin@ximian.com>
4266 * expression.cs (Invocation.EmitCall): Enable varargs methods.
4268 2004-06-08 Martin Baulig <martin@ximian.com>
4270 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
4272 2004-06-07 Martin Baulig <martin@ximian.com>
4274 Added support for varargs methods.
4276 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
4279 * cs-parser.jay: Added support for `__arglist'.
4281 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
4283 * expression.cs (Argument.AType): Added `ArgList'.
4284 (Invocation): Added support for varargs methods.
4285 (ArglistAccess): New public class.
4286 (Arglist): New public class.
4288 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
4290 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
4291 a method's top-level block if the method has varargs.
4293 * support.cs (ReflectionParameters, InternalParameters): Added
4294 support for varargs methods.
4296 2004-06-07 Miguel de Icaza <miguel@ximian.com>
4298 * class.cs: Provide location in indexer error report.
4300 * driver.cs: Use standard names.
4302 * namespace.cs: Catch the use of using after a namespace has been
4303 declared also on using aliases.
4305 2004-06-03 Raja R Harinath <rharinath@novell.com>
4308 * typemanager.cs (closure_private_ok, closure_invocation_type)
4309 (closure_qualifier_type, closure_invocation_assembly)
4310 (FilterWithClosure): Move to ...
4311 (Closure): New internal nested class.
4312 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
4313 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
4314 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
4315 (MemberLookup, MemberLookupFailed): Use it.
4316 * expression.cs (New.DoResolve): Treat the lookup for the
4317 constructor as being qualified by the 'new'ed type.
4318 (Indexers.GetIndexersForTypeOrInterface): Update.
4320 2004-06-03 Marek Safar <marek.safar@seznam.cz>
4323 (GetConditionalAttributeValue): New method. Returns
4324 condition of ConditionalAttribute.
4325 (SearchMulti): New method. Returns all attributes of type 't'.
4326 Use it when attribute is AllowMultiple = true.
4327 (IsConditionalMethodExcluded): New method.
4330 (Method.IsExcluded): Implemented. Returns true if method has conditional
4331 attribute and the conditions is not defined (method is excluded).
4332 (IMethodData): Extended interface for ConditionalAttribute support.
4333 (PropertyMethod.IsExcluded): Implemented.
4336 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
4339 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
4342 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
4344 * expression.cs (ArrayCreationExpression): Make this just an
4345 `expression'. It can't be a statement, so the code here was
4348 2004-06-02 Marek Safar <marek.safar@seznam.cz>
4351 * typemanager.cs (GetFullNameSignature): New method for
4354 2004-06-02 Marek Safar <marek.safar@seznam.cz>
4357 * class.cs (MemberBase.GetSignatureForError): New virtual method.
4358 Use this method when MethodBuilder is null.
4359 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
4360 Added test for error CS0626 (MONO reports error for this situation).
4361 (IMethodData.GetSignatureForError): Extended interface.
4363 2004-06-01 Marek Safar <marek.safar@seznam.cz>
4366 (AttributeTester.GetObsoleteAttribute): Returns instance of
4367 ObsoleteAttribute when type is obsolete.
4370 (TypeContainer.VerifyObsoleteAttribute): Override.
4371 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
4372 (MethodCode.VerifyObsoleteAttribute): Override.
4373 (MemberBase.VerifyObsoleteAttribute): Override.
4376 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
4377 and report proper error.
4380 Delegate.VerifyObsoleteAttribute): Override.
4383 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
4384 and report proper error.
4385 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
4388 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
4392 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
4393 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
4394 Added test for ObsoleteAttribute.
4397 (Catch): Derived from Statement.
4399 2004-06-01 Marek Safar <marek.safar@seznam.cz>
4401 Fixed bug #59071 & cs0160.cs
4403 * statement.cs (Try.Resolve): Check here whether order of catch
4404 clauses matches their dependencies.
4406 2004-05-31 Miguel de Icaza <miguel@ximian.com>
4408 * Reverted patch to namespace.cs (Use lookuptypedirect). This
4409 caused a regression: #59343. Referencing nested classes from an
4410 assembly stopped working.
4412 2004-05-31 Martin Baulig <martin@ximian.com>
4414 MCS is now frozen for beta 2.
4416 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
4418 * convert.cs: add a trivial cache for overload operator resolution.
4420 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
4422 * decl.cs: If possible, use lookuptypedirect here. We can only do
4423 this if there is no `.' after the namespace. Avoids using
4424 LookupType, which does lots of slow processing.
4425 (FindNestedType) New method, does what it says :-).
4426 * namespace.cs: use LookupTypeDirect.
4427 * rootcontext.cs: use membercache, if possible.
4428 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
4430 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
4433 According to the spec,
4435 In a member access of the form E.I, if E is a single identifier,
4436 and if the meaning of E as a simple-name (§7.5.2) is a constant,
4437 field, property, localvariable, or parameter with the same type as
4438 the meaning of E as a type-name (§3.8), then both possible
4439 meanings of E are permitted.
4441 We did not check that E as a simple-name had the same type as E as
4444 This trivial check gives us 5-7% on bootstrap time.
4446 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
4448 * expression.cs (Invocation.OverloadResolve): Avoid the
4449 use of hashtables and boxing here by allocating on demand.
4451 2004-05-30 Martin Baulig <martin@ximian.com>
4453 * rootcontext.cs (RootContext.LookupType): Don't cache things if
4454 we're doing a silent lookup. Don't try to lookup nested types in
4455 TypeManager.object_type (thanks to Ben Maurer).
4457 2004-05-30 Martin Baulig <martin@ximian.com>
4459 Committing a patch from Ben Maurer.
4461 * rootcontext.cs (RootContext.LookupType): Cache negative results.
4463 2004-05-29 Martin Baulig <martin@ximian.com>
4465 * class.cs (IMethodData.ShouldIgnore): New method.
4467 * typemanager.cs (TypeManager.MethodFlags): Don't take a
4468 `Location' argument, we don't need it anywhere. Use
4469 `IMethodData.ShouldIgnore ()' instead of
4470 `MethodData.GetMethodFlags ()'.
4471 (TypeManager.AddMethod): Removed.
4472 (TypeManager.AddMethod2): Renamed to AddMethod.
4474 2004-05-29 Martin Baulig <martin@ximian.com>
4476 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
4478 * convert.cs (Convert.ImplicitReferenceConversion): If we're
4479 converting from a class type S to an interface type and we already
4480 have an object on the stack, don't box it again. Fixes #52578.
4482 2004-05-29 Martin Baulig <martin@ximian.com>
4484 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
4485 Added support for `params' parameters. Fixes #59267.
4487 2004-05-29 Martin Baulig <martin@ximian.com>
4489 * literal.cs (NullPointer): Provide a private .ctor which sets
4490 `type' to TypeManager.object_type. Fixes #59048.
4492 2004-05-29 Martin Baulig <martin@ximian.com>
4494 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
4495 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
4497 * ecore.cs (EventExpr.instance_expr): Make the field private.
4499 2004-05-26 Marek Safar <marek.safar@seznam.cz>
4501 Fixed bug #50080 & cs0214-2.cs
4502 * expression.cs (Cast.DoResolve): Check unsafe context here.
4504 * statement.cs (Resolve.DoResolve): Likewise.
4506 2004-05-26 Martin Baulig <martin@ximian.com>
4508 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
4510 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
4511 (RootContext.LookupType): Pass down the `silent' flag.
4513 2004-05-25 Martin Baulig <martin@ximian.com>
4516 (MethodGroupExpr.IdenticalTypeName): New public property.
4517 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
4518 expression actually refers to a type.
4520 2004-05-25 Martin Baulig <martin@ximian.com>
4522 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
4523 for #56176 and made it actually work.
4525 2004-05-25 Martin Baulig <martin@ximian.com>
4527 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
4528 (FieldExpr, PropertyExpr): Override and implement
4529 CacheTemporaries. Fixes #52279.
4531 2004-05-25 Miguel de Icaza <miguel@ximian.com>
4533 * location.cs: In the new compiler listing a file twice is a
4534 warning, not an error.
4536 2004-05-24 Martin Baulig <martin@ximian.com>
4538 * enum.cs (Enum.DefineType): For the `BaseType' to be a
4539 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
4541 2004-05-24 Martin Baulig <martin@ximian.com>
4543 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
4544 walking the `using' list. Fixes #53921.
4546 2004-05-24 Martin Baulig <martin@ximian.com>
4548 * const.cs (Const.LookupConstantValue): Added support for
4549 EmptyCast's; fixes #55251.
4551 2004-05-24 Martin Baulig <martin@ximian.com>
4553 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
4554 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
4555 which does the CS0135 check. The reason is that we first need to
4556 check whether the variable actually exists.
4558 2004-05-24 Martin Baulig <martin@ximian.com>
4560 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
4561 than RootContext.LookupType() to find the explicit interface
4564 2004-05-24 Raja R Harinath <rharinath@novell.com>
4566 * Makefile: Simplify. Use executable.make.
4567 * mcs.exe.sources: New file. List of sources of mcs.exe.
4569 2004-05-24 Anders Carlsson <andersca@gnome.org>
4573 Use the invariant culture when doing String.Compare for CLS case
4576 2004-05-23 Martin Baulig <martin@ximian.com>
4578 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
4579 don't have any dots. Fixes #52622, added cs0246-8.cs.
4581 * namespace.cs (NamespaceEntry.Lookup): Likewise.
4583 2004-05-23 Marek Safar <marek.safar@seznam.cz>
4585 * class.cs (MemberBase.Define): Reuse MemberType member for
4586 resolved type. Other methods can use it too.
4588 2004-05-23 Martin Baulig <martin@ximian.com>
4590 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
4591 the variable also exists in the current block (otherwise, we need
4592 to report a CS0103). Fixes #58670.
4594 2004-05-23 Martin Baulig <martin@ximian.com>
4596 * flowanalysis.cs (Reachability.Reachable): Compute this
4597 on-the-fly rather than storing it as a field.
4599 2004-05-23 Martin Baulig <martin@ximian.com>
4601 * flowanalysis.cs (Reachability.And): Manually compute the
4602 resulting `barrier' from the reachability.
4604 2004-05-23 Marek Safar <marek.safar@seznam.cz>
4607 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
4608 instance of ObsoleteAttribute when symbol is obsolete.
4611 (IMethodData): Extended interface for ObsoleteAttribute support.
4613 2004-05-22 Marek Safar <marek.safar@seznam.cz>
4615 * attribute.cs: Fix bug #55970
4617 2004-05-22 Marek Safar <marek.safar@seznam.cz>
4621 (GetObsoleteAttribute): New method. Creates the instance of
4623 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
4624 ObsoleteAttribute when member is obsolete.
4625 (AttributeTester.Report_ObsoleteMessage): Common method for
4626 Obsolete error/warning reporting.
4629 (TypeContainer.base_classs_type): New member for storing parent type.
4632 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
4633 for this MemberCore.
4635 2004-05-21 Marek Safar <marek.safar@seznam.cz>
4637 * attribute.cs, const.cs: Fix bug #58590
4639 2004-05-21 Martin Baulig <martin@ximian.com>
4641 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
4642 out parameters if the end of the method is unreachable. Fixes
4645 2004-05-21 Marek Safar <marek.safar@seznam.cz>
4647 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
4648 Hari was right, why extra method.
4650 2004-05-21 Marek Safar <marek.safar@seznam.cz>
4652 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
4654 2004-05-20 Martin Baulig <martin@ximian.com>
4656 Merged this back from gmcs to keep the differences to a minumum.
4658 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
4659 instead of a Declspace.
4660 (Attribute.ResolveType): Likewise.
4661 (Attributes.Search): Likewise.
4662 (Attributes.Contains): Likewise.
4663 (Attributes.GetClsCompliantAttribute): Likewise.
4665 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
4667 (MethodData.ApplyAttributes): Take an EmitContext instead of a
4670 2004-05-19 Marek Safar <marek.safar@seznam.cz>
4672 Fix bug #58688 (MCS does not report error when the same attribute
4675 * attribute.cs (Attribute.Emit): Distinction between null and default.
4677 2004-05-19 Raja R Harinath <rharinath@novell.com>
4679 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
4680 of a top-level attribute without an attribute target.
4681 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
4683 (Attribute.Conditional_GetConditionName),
4684 (Attribute.Obsolete_GetObsoleteMessage): Update.
4685 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
4686 part of ScanForIndexerName.
4687 (Attribute.CanIgnoreInvalidAttribute): New function.
4688 (Attribute.ScanForIndexerName): Move to ...
4689 (Attributes.ScanForIndexerName): ... here.
4690 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
4691 (Attributes.Search): New internal variant that can choose not to
4692 complain if types aren't resolved. The original signature now
4694 (Attributes.GetClsCompliantAttribute): Use internal variant, with
4695 complaints suppressed.
4696 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
4697 only if it not useful.
4698 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
4699 top-level for attributes that are shared between the assembly
4700 and a top-level class.
4701 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
4702 * class.cs: Update to reflect changes.
4703 (DefineIndexers): Fuse loops.
4704 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
4705 a couple more variants of attribute names.
4707 2004-05-18 Marek Safar <marek.safar@seznam.cz>
4709 Fix bug #52585 (Implemented explicit attribute declaration)
4712 (Attributable.ValidAttributeTargets): New abstract method. It gets
4713 list of valid attribute targets for explicit target declaration.
4714 (Attribute.Target): It holds target itself.
4715 (AttributeSection): Removed.
4716 (Attribute.CheckTargets): New method. It checks whether attribute
4717 target is valid for the current element.
4720 (EventProperty): New class. For events that are declared like
4721 property (with add and remove accessors).
4722 (EventField): New class. For events that are declared like field.
4725 * cs-parser.jay: Implemented explicit attribute target declaration.
4727 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
4728 Override ValidAttributeTargets.
4731 (ReturnParameter): Class for applying custom attributes on
4733 (ParameterAtribute): New class. Class for applying custom
4734 attributes on the parameter type.
4736 2004-05-17 Miguel de Icaza <miguel@ximian.com>
4738 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
4741 (Method): Allow UNSAFE here.
4743 * modifiers.cs: Support unsafe reporting.
4745 2004-05-17 Marek Safar <marek.safar@seznam.cz>
4747 * decl.cs: Fix bug #58478.
4749 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
4751 * statement.cs: When checking for unreachable code on an EmptyStatement,
4752 set the location. Fixes bug #58488.
4754 2004-05-13 Miguel de Icaza <miguel@ximian.com>
4756 * driver.cs: Add -pkg handling.
4758 From Gonzalo: UseShelLExecute=false
4760 2004-05-12 Marek Safar <marek.safar@seznam.cz>
4763 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
4765 (Attribute.IsClsCompliaceRequired): Moved to base for better
4767 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
4768 when attribute is AttributeUsageAttribute.
4769 (Attribute.GetValidTargets): Simplified.
4770 (Attribute.GetAttributeUsage): New method returns AttributeUsage
4771 attribute for this type.
4772 (Attribute.ApplyAttributes): Method renamed to Emit and make
4774 (GlobalAttributeSection): New class for special handling of global
4775 attributes (assembly, module).
4776 (AttributeSection.Emit): New method.
4778 * class.cs: Implemented Attributable abstract methods.
4779 (MethodCore.LabelParameters): Moved to Parameter class.
4780 (Accessor): Is back simple class.
4781 (PropertyMethod): Implemented Attributable abstract class.
4782 (DelegateMethod): Implemented Attributable abstract class.
4783 (Event): New constructor for disctintion between normal Event
4784 and Event with accessors.
4786 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
4788 * codegen.cs, const.cs, decl.cs, delegate.cs:
4789 (CommonAssemblyModulClass): Implemented Attributable abstract class
4792 * enum.cs: Implement IAttributeSupport interface.
4793 (EnumMember): New class for emum members. Implemented Attributable
4797 (ParameterBase): Is abstract.
4798 (ReturnParameter): New class for easier [return:] attribute handling.
4800 * typemanager.cs: Removed builder_to_attr.
4802 2004-05-11 Raja R Harinath <rharinath@novell.com>
4805 * attribute.cs (Attribute.GetPositionalValue): New function.
4806 * class.cs (TypeContainer.VerifyMembers): New function.
4807 (TypeContainer.Emit): Use it.
4808 (ClassOrStruct): New base class for Class and Struct.
4809 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
4810 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
4812 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
4813 then each non-static field should have a FieldOffset attribute.
4814 Otherwise, none of the fields should have a FieldOffset attribute.
4815 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
4816 and FieldOffset attributes.
4817 * typemanager.cs (TypeManager.struct_layout_attribute_type)
4818 (TypeManager.field_offset_attribute_type): New core types.
4819 (TypeManager.InitCoreTypes): Initialize them.
4821 2004-05-11 Michal Moskal <malekith@pld-linux.org>
4823 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
4824 Return correct type.
4827 2004-05-09 Miguel de Icaza <miguel@ximian.com>
4829 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
4830 be implicitly converted to ulong.
4832 * expression.cs: The logic for allowing operator &, | and ^ worked
4833 was wrong, it worked before because we did not report an error in
4834 an else branch. Fixes 57895.
4836 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
4837 allow volatile fields to be reference types.
4839 2004-05-07 Miguel de Icaza <miguel@ximian.com>
4841 * driver.cs: Add support for /debug-
4843 2004-05-07 Raja R Harinath <rharinath@novell.com>
4845 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
4846 Add a 'complain' parameter to silence errors.
4847 (Attribute.Resolve): Update to changes. Put in sanity check to catch
4848 silently overlooked type-resolutions.
4849 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
4851 (Attributes.Search): New function.
4852 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
4853 (Attributes.GetAttributeFullName): Remove hack.
4854 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
4855 Update to reflect changes.
4856 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
4857 Use Attributes.Search instead of nested loops.
4859 2004-05-07 Marek Safar <marek.safar@seznam.cz>
4862 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
4863 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
4864 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
4866 * report.cs: (Report.Warning): Renamed to Warning_T because of
4867 parameter collision.
4869 2004-05-05 Raja R Harinath <rharinath@novell.com>
4871 * expression.cs (MemberAccess.ResolveMemberAccess):
4872 Exit with non-zero status after Report.Error.
4873 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
4875 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
4877 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
4879 * support.cs: Don't hang when the file is empty.
4881 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
4883 * support.cs: In SeekableStreamReader, compute the preamble size of the
4884 underlying stream. Position changes should take into account that initial
4887 2004-05-03 Todd Berman <tberman@sevenl.net>
4889 * driver.cs: remove unused GetSysVersion function.
4891 2004-05-03 Todd Berman <tberman@sevenl.net>
4893 * driver.cs: Remove the hack from saturday, as well as the hack
4894 from jackson (LoadAssemblyFromGac), also adds the CWD to the
4895 link_paths to get that bit proper.
4897 2004-05-01 Todd Berman <tberman@sevenl.net>
4899 * driver.cs: Try a LoadFrom before a Load, this checks the current
4900 path. This is currently a bug in mono that is be fixed, however, this
4901 provides a workaround for now. This will be removed when the bug
4904 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
4906 * CryptoConvert.cs: Updated to latest version. Fix issue with
4907 incomplete key pairs (#57941).
4909 2004-05-01 Todd Berman <tberman@sevenl.net>
4911 * driver.cs: Remove '.' from path_chars, now System.* loads properly
4914 2004-04-30 Jackson Harper <jackson@ximian.com>
4916 * codegen.cs: Open keys readonly.
4918 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
4920 * typemanager.cs: don't report cyclic struct layout when a struct
4921 contains 2 or more fields of the same type. Failed for Pango.AttrShape
4922 which has 2 Pango.Rectangle fields.
4924 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
4926 * expression.cs: Handle IntPtr comparisons with IL code
4927 rather than a method call.
4929 2004-04-29 Martin Baulig <martin@ximian.com>
4931 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
4932 the list of PropertyInfo's in class hierarchy and find the
4933 accessor. Fixes #56013.
4935 2004-04-29 Martin Baulig <martin@ximian.com>
4937 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
4939 2004-04-29 Martin Baulig <martin@ximian.com>
4941 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
4943 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
4945 2004-04-29 Martin Baulig <martin@ximian.com>
4947 * class.cs (ConstructorInitializer.Resolve): Check whether the
4948 parent .ctor is accessible. Fixes #52146.
4950 2004-04-29 Martin Baulig <martin@ximian.com>
4952 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
4954 * statement.cs (Using.EmitLocalVariableDecls): Use
4955 TypeManager.idisposable_type, not typeof (IDisposable).
4956 (Foreach.EmitCollectionForeach): Added support for valuetypes.
4958 2004-04-29 Martin Baulig <martin@ximian.com>
4960 * class.cs (Event.Define): Don't emit the field and don't set
4961 RTSpecialName and SpecialName for events on interfaces. Fixes
4964 2004-04-29 Raja R Harinath <rharinath@novell.com>
4966 Refactor Attribute.ApplyAttributes.
4967 * attribute.cs (Attributable): New base class for objects that can
4968 have Attributes applied on them.
4969 (Attribute): Make AttributeUsage fields public.
4970 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
4971 (Attribute.IsInternalCall): New property.
4972 (Attribute.UsageAttr): Convert to a public read-only property.
4973 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
4974 (Attribute.ResolveType, Attribute.Resolve)
4975 (Attribute.ScanForIndexerName): Update to reflect changes.
4976 (Attribute.CheckAttributeTarget): Re-format.
4977 (Attribute.ApplyAttributes): Refactor, to various
4978 Attributable.ApplyAttributeBuilder methods.
4979 * decl.cs (MemberCore): Make Attributable.
4980 * class.cs (Accessor): Make Attributable.
4981 (MethodData.ApplyAttributes): Use proper attribute types, not
4983 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
4984 (TypeContainer.ApplyAttributeBuilder)
4985 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
4986 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
4987 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
4988 (Operator.ApplyAttributeBuilder): New factored-out methods.
4989 * const.cs (Const.ApplyAttributeBuilder): Likewise.
4990 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
4991 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
4992 * parameter.cs (ParameterBase): New Attributable base class
4993 that can also represent Return types.
4994 (Parameter): Update to the changes.
4996 2004-04-29 Jackson Harper <jackson@ximian.com>
4998 * driver.cs: Prefer the corlib system version when looking for
4999 assemblies in the GAC. This is still a hack, but its a better hack
5002 2004-04-29 Marek Safar <marek.safar@seznam.cz>
5004 * decl.cs, enum.cs: Improved error 3005 reporting.
5006 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
5007 (related_symbols): New private member for list of symbols
5008 related to reported error/warning.
5010 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
5012 2004-04-29 Martin Baulig <martin@ximian.com>
5014 * ecore.cs (Expression.Constantify): If we're an enum and
5015 TypeManager.TypeToCoreType() doesn't give us another type, use
5016 t.UnderlyingSystemType. Fixes #56178.
5018 2004-04-29 Martin Baulig <martin@ximian.com>
5020 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
5021 interfaces and for each interface, only add members directly
5022 declared in that interface. Fixes #53255.
5024 2004-04-28 Martin Baulig <martin@ximian.com>
5026 * expression.cs (ConditionalLogicalOperator): Use a temporary
5027 variable for `left' to avoid that we evaluate it more than once;
5030 2004-04-28 Martin Baulig <martin@ximian.com>
5032 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
5035 2004-04-28 Martin Baulig <martin@ximian.com>
5037 * statement.cs (LocalInfo.Resolve): Check whether the type is not
5040 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
5041 whether the type is not void (CS1547).
5043 2004-04-28 Martin Baulig <martin@ximian.com>
5045 * expression.cs (Unary.DoResolveLValue): Override this and report
5046 CS0131 for anything but Operator.Indirection.
5048 2004-04-28 Martin Baulig <martin@ximian.com>
5050 Committing a patch from Ben Maurer; see bug #50820.
5052 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
5055 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
5058 2004-04-28 Martin Baulig <martin@ximian.com>
5060 Committing a patch from Ben Maurer; see bug #50820.
5062 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
5065 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
5068 2004-04-28 Martin Baulig <martin@ximian.com>
5070 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
5071 (Block.AddLabel): Call DoLookupLabel() to only search in the
5074 2004-04-28 Martin Baulig <martin@ximian.com>
5076 * cfold.cs (ConstantFold.BinaryFold): Added special support for
5077 comparing StringConstants and NullLiterals in Equality and Inequality.
5079 2004-04-28 Jackson Harper <jackson@ximian.com>
5081 * driver.cs: Attempt to load referenced assemblies from the
5082 GAC. This is the quick and dirty version of this method that
5083 doesnt take into account versions and just takes the first
5084 canidate found. Will be good enough for now as we will not have more
5085 then one version installed into the GAC until I update this method.
5087 2004-04-28 Martin Baulig <martin@ximian.com>
5089 * typemanager.cs (TypeManager.CheckStructCycles): New public
5090 static method to check for cycles in the struct layout.
5092 * rootcontext.cs (RootContext.PopulateTypes): Call
5093 TypeManager.CheckStructCycles() for each TypeContainer.
5094 [Note: We only need to visit each type once.]
5096 2004-04-28 Martin Baulig <martin@ximian.com>
5098 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
5100 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
5101 success and added `out object value'. Use a `bool resolved' field
5102 to check whether we've already been called rather than
5103 `ConstantValue != null' since this breaks for NullLiterals.
5105 2004-04-28 Raja R Harinath <rharinath@novell.com>
5107 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
5108 setting of this flag, since the 'set' method may be non-public.
5110 2004-04-28 Raja R Harinath <rharinath@novell.com>
5112 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
5113 check on current_vector.Block.
5115 2004-04-27 Martin Baulig <martin@ximian.com>
5117 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
5118 a field initializer. Fixes #56459.
5120 2004-04-27 Martin Baulig <martin@ximian.com>
5122 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
5123 we're not attempting to use an indexer. Fixes #52154.
5125 2004-04-27 Martin Baulig <martin@ximian.com>
5127 * statement.cs (Return): Don't create a return label if we don't
5128 need it; reverts my change from January 20th. Thanks to Ben
5131 2004-04-27 Martin Baulig <martin@ximian.com>
5133 According to the spec, `goto' can only leave a nested scope, but
5136 * statement.cs (Block.LookupLabel): Only lookup in the current
5137 block, don't recurse into parent or child blocks.
5138 (Block.AddLabel): Check in parent and child blocks, report
5139 CS0140/CS0158 if we find a duplicate.
5140 (Block): Removed this indexer for label lookups.
5141 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
5142 this already does the error reporting for us.
5145 (FlowBranching.UsageVector.Block): New public variable; may be null.
5146 (FlowBranching.CreateSibling): Added `Block' argument.
5147 (FlowBranching.LookupLabel): New public virtual method. Lookup a
5148 label for the target of a `goto' and check whether we're not
5149 leaving a `finally'.
5151 2004-04-27 Martin Baulig <martin@ximian.com>
5153 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5154 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
5157 2004-04-27 Martin Baulig <martin@ximian.com>
5159 * statement.cs (Block.AddLabel): Also check for implicit blocks
5160 and added a CS0158 check.
5162 2004-04-27 Martin Baulig <martin@ximian.com>
5164 * flowanalysis.cs (FlowBranchingLoop): New class.
5165 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
5166 UsageVector's instead of an ArrayList.
5167 (FlowBranching.Label): Likewise.
5168 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
5169 (FlowBranching.AddBreakVector): New method.
5171 2004-04-27 Miguel de Icaza <miguel@ximian.com>
5173 * attribute.cs: Small regression fix: only convert the type if we
5174 the type is different, fixes System.Drawing build.
5176 2004-04-27 Martin Baulig <martin@ximian.com>
5178 * attribute.cs (Attribute.Resolve): If we have a constant value
5179 for a named field or property, implicity convert it to the correct
5182 2004-04-27 Raja R Harinath <rharinath@novell.com>
5184 * statement.cs (Block.Block): Implicit blocks share
5185 'child_variable_names' fields with parent blocks.
5186 (Block.AddChildVariableNames): Remove.
5187 (Block.AddVariable): Mark variable as "used by a child block" in
5188 every surrounding block.
5189 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
5190 been used in a child block, complain about violation of "Invariant
5191 meaning in blocks" rule.
5192 * cs-parser.jay (declare_local_variables): Don't use
5193 AddChildVariableNames.
5194 (foreach_statement): Don't create an implicit block: 'foreach'
5197 2004-04-23 Miguel de Icaza <miguel@ximian.com>
5199 * convert.cs (ImplicitNumericConversion): 0 is also positive when
5200 converting from 0L to ulong. Fixes 57522.
5202 2004-04-22 Marek Safar <marek.safar@seznam.cz>
5204 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
5205 derived class hides via 'new' keyword field from base class (test-242.cs).
5206 TODO: Handle this in the more general way.
5208 * class.cs (CheckBase): Ditto.
5210 2004-04-22 Marek Safar <marek.safar@seznam.cz>
5212 * decl.cs (caching_flags): New member for storing cached values
5214 (MemberCore.Flags): New enum where bit flags for caching_flags
5216 (MemberCore.cls_compliance): Moved to caching_flags.
5217 (DeclSpace.Created): Moved to caching_flags.
5219 * class.cs: Use caching_flags instead of DeclSpace.Created
5221 2004-04-21 Miguel de Icaza <miguel@ximian.com>
5223 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
5224 if we are only a derived class, not a nested class.
5226 * typemanager.cs: Same as above, but do this at the MemberLookup
5227 level (used by field and methods, properties are handled in
5228 PropertyExpr). Allow for the qualified access if we are a nested
5231 2004-04-21 Marek Safar <marek.safar@seznam.cz>
5233 * class.cs: Refactoring.
5234 (IMethodData): New inteface; Holds links to parent members
5235 to avoid member duplication (reduced memory allocation).
5236 (Method): Implemented IMethodData interface.
5237 (PropertyBase): New inner classes for get/set methods.
5238 (PropertyBase.PropertyMethod): Implemented IMethodData interface
5239 (Event): New inner classes for add/remove methods.
5240 (Event.DelegateMethod): Implemented IMethodData interface.
5242 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
5243 EmitContext (related to class.cs refactoring).
5245 2004-04-21 Raja R Harinath <rharinath@novell.com>
5247 * delegate.cs (Delegate.VerifyApplicability): If the number of
5248 arguments are the same as the number of parameters, first try to
5249 verify applicability ignoring any 'params' modifier on the last
5253 2004-04-16 Raja R Harinath <rharinath@novell.com>
5255 * class.cs (TypeContainer.AddIndexer): Use
5256 'ExplicitInterfaceName' to determine if interface name was
5257 explicitly specified. 'InterfaceType' is not initialized at this time.
5258 (TypeContainer.DefineIndexers): Remove use of temporary list. The
5259 Indexers array is already in the required order. Initialize
5260 'IndexerName' only if there are normal indexers.
5261 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
5262 (TypeContainer.Emit): Emit DefaultMember attribute only if
5263 IndexerName is initialized.
5266 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
5268 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
5271 2004-04-15 Raja R Harinath <rharinath@novell.com>
5273 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
5277 * attribute.cs (Attribute.Resolve): Check for duplicate named
5281 2004-04-15 Miguel de Icaza <miguel@ximian.com>
5283 * iterators.cs (MarkYield): track whether we are in an exception,
5284 and generate code accordingly. Use a temporary value to store the
5285 result for our state.
5287 I had ignored a bit the interaction of try/catch with iterators
5288 since their behavior was not entirely obvious, but now it is
5289 possible to verify that our behavior is the same as MS .NET 2.0
5293 2004-04-14 Miguel de Icaza <miguel@ximian.com>
5295 * iterators.cs: Avoid creating temporaries if there is no work to
5298 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
5299 Enumerations, use TypeManager.EnumToUnderlying and call
5302 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
5305 (This.Emit): Use EmitContext.EmitThis to emit our
5308 (This.EmitAssign): Ditto.
5310 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
5311 codepaths, we will move all the functionality into
5314 (FieldExpr.EmitAssign): Ditto.
5316 This fixes several hidden bugs that I uncovered while doing a code
5317 review of this today.
5319 * codegen.cs (EmitThis): reworked so the semantics are more clear
5320 and also support value types "this" instances.
5322 * iterators.cs: Changed so that for iterators in value types, we
5323 do not pass the value type as a parameter.
5325 Initialization of the enumerator helpers is now done in the caller
5326 instead of passing the parameters to the constructors and having
5327 the constructor set the fields.
5329 The fields have now `assembly' visibility instead of private.
5331 2004-04-11 Miguel de Icaza <miguel@ximian.com>
5333 * expression.cs (Argument.Resolve): Check if fields passed as ref
5334 or out are contained in a MarshalByRefObject.
5336 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
5337 another compiler type.
5339 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
5341 * class.cs (Indexer.Define): use the new name checking method.
5342 Also, return false on an error.
5343 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
5344 (is_identifier_[start/part]_character): make static.
5346 2004-04-10 Miguel de Icaza <miguel@ximian.com>
5348 * expression.cs (Binary.ResolveOperator): Do no append strings
5349 twice: since we can be invoked more than once (array evaluation)
5350 on the same concatenation, take care of this here. Based on a fix
5351 from Ben (bug #56454)
5353 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
5355 * codegen.cs: Fix another case where CS1548 must be reported (when
5356 delay-sign isn't specified and no private is available #56564). Fix
5357 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
5358 error when MCS is used on the MS runtime and we need to delay-sign
5359 (which seems unsupported by AssemblyBuilder - see #56621).
5361 2004-04-08 Marek Safar <marek.safar@seznam.cz>
5363 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
5364 (TypeManager.ComputeNamespaces): Faster implementation for
5367 * compiler.csproj: Updated AssemblyName to mcs.
5369 2004-04-07 Miguel de Icaza <miguel@ximian.com>
5371 * rootcontext.cs: Add new types to the boot resolution.
5373 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
5374 MulticastDelegate is not allowed.
5376 * typemanager.cs: Add new types to lookup: System.TypedReference
5379 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
5380 check for TypedReference or ArgIterator, they are not allowed.
5382 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
5383 makes us properly catch 1510 in some conditions (see bug 56016 for
5386 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
5388 * CryptoConvert.cs: update from corlib version
5391 2004-04-05 Miguel de Icaza <miguel@ximian.com>
5393 * class.cs (Indexer.Define): Check indexername declaration
5395 2004-04-05 Marek Safar <marek.safar@seznam.cz>
5397 * attribute.cs (IsClsCompliant): Fixed problem with handling
5398 all three states (compliant, not-compliant, undetected).
5400 2004-03-30 Marek Safar <marek.safar@seznam.cz>
5402 * attribute.cs (Attribute): Location is now public.
5403 (Resolve): Store resolved arguments (pos_values) in attribute class.
5404 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
5405 (GetClsCompliantAttributeValue): New method that gets
5406 CLSCompliantAttribute value.
5407 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
5408 if exists else null.
5409 (AttributeTester): New class for CLS-Compliant verification routines.
5411 * class.cs (Emit): Add CLS-Compliant verification.
5412 (Method.GetSignatureForError): Implemented.
5413 (Constructor.GetSignatureForError): Implemented
5414 (Constructor.HasCompliantArgs): Returns if constructor has
5415 CLS-Compliant arguments.
5416 (Constructor.Emit): Override.
5417 (Construcor.IsIdentifierClsCompliant): New method; For constructors
5418 is needed to test only parameters.
5419 (FieldBase.GetSignatureForError): Implemented.
5420 (TypeContainer): New member for storing base interfaces.
5421 (TypeContainer.FindMembers): Search in base interfaces too.
5423 * codegen.cs (GetClsComplianceAttribute): New method that gets
5424 assembly or module CLSCompliantAttribute value.
5425 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
5427 (ModuleClass.Emit): Add error 3012 test.
5429 * const.cs (Emit): Override and call base for CLS-Compliant tests.
5431 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
5432 state for all decl types.
5433 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
5434 if CLS-Compliant tests are required.
5435 (IsClsCompliaceRequired): New method. Analyze whether code
5436 must be CLS-Compliant.
5437 (IsExposedFromAssembly): New method. Returns true when MemberCore
5438 is exposed from assembly.
5439 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
5440 value or gets cached value.
5441 (HasClsCompliantAttribute): New method. Returns true if MemberCore
5442 is explicitly marked with CLSCompliantAttribute.
5443 (IsIdentifierClsCompliant): New abstract method. This method is
5444 used to testing error 3005.
5445 (IsIdentifierAndParamClsCompliant): New method. Common helper method
5446 for identifier and parameters CLS-Compliant testing.
5447 (VerifyClsCompliance): New method. The main virtual method for
5448 CLS-Compliant verifications.
5449 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
5450 null. I don't know why is null (too many public members !).
5451 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
5452 and get value of first CLSCompliantAttribute that found.
5454 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
5455 (VerifyClsCompliance): Override and add extra tests.
5457 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
5458 clscheck- disable CLS-Compliant verification event if assembly is has
5459 CLSCompliantAttribute(true).
5461 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
5462 ApllyAttribute is now called in emit section as in the other cases.
5463 Possible future Emit integration.
5464 (IsIdentifierClsCompliant): New override.
5465 (VerifyClsCompliance): New override.
5466 (GetEnumeratorName): Returns full enum name.
5468 * parameter.cs (GetSignatureForError): Implemented.
5470 * report.cs (WarningData): New struct for Warning message information.
5471 (LocationOfPreviousError): New method.
5472 (Warning): New method. Reports warning based on the warning table.
5473 (Error_T): New method. Reports error based on the error table.
5475 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
5476 verifications are done here.
5478 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
5480 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
5481 CLSCompliantAttribute.
5482 (all_imported_types): New member holds all imported types from other
5484 (LoadAllImportedTypes): New method fills static table with exported types
5485 from all referenced assemblies.
5486 (Modules): New property returns all assembly modules.
5488 2004-03-30 Miguel de Icaza <miguel@ximian.com>
5490 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
5491 throwing a parser error.
5493 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
5494 which removes the hardcoded get_/set_ prefixes for properties, as
5495 IL allows for the properties to be named something else.
5499 * expression.cs: Do not override operand before we know if it is
5502 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
5504 * typemanager.cs: support for pinned variables.
5506 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
5508 * decl.cs, typemanager.cs: Avoid using an arraylist
5509 as a buffer if there is only one result set.
5511 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
5513 * expression.cs: Make sure you cant call a static method
5514 with an instance expression, bug #56174.
5516 2004-03-29 Miguel de Icaza <miguel@ximian.com>
5518 * class.cs (IsDuplicateImplementation): Improve error reporting to
5519 flag 663 (method only differs in parameter modifier).
5521 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
5522 in preprocessor directives.
5524 * location.cs (LookupFile): Allow for the empty path.
5526 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
5527 better approach for some of that patch, but its failing with the
5528 CharSet enumeration. For now try/catch will do.
5530 * typemanager.cs: Do not crash if a struct does not have fields.
5533 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
5535 * expression.cs: cs0213, cant fix a fixed expression.
5538 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
5540 * cs-parser.jay: detect invalid embeded statements gracefully.
5543 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
5545 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
5548 the invocation type may not be a subclass of the tye of the item/
5549 The type of the item must be a subclass of the invocation item.
5554 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
5556 * attribute.cs: Added methods to get a string and a bool from an
5557 attribute. Required to information from AssemblyKeyFileAttribute,
5558 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
5559 * codegen.cs: Modified AssemblyName creation to include support for
5560 strongnames. Catch additional exceptions to report them as CS1548.
5561 * compiler.csproj: Updated include CryptoConvert.cs.
5562 * compiler.csproj.user: Removed file - user specific configuration.
5563 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
5564 Mono.Security assembly. The original class is maintained and tested in
5565 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
5566 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
5567 like CSC 8.0 (C# v2) supports.
5568 * Makefile: Added CryptoConvert.cs to mcs sources.
5569 * rootcontext.cs: Added new options for strongnames.
5571 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
5573 * driver.cs: For --expect-error, report error code `2'
5574 if the program compiled with no errors, error code `1' if
5575 it compiled with an error other than the one expected.
5577 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
5579 * compiler.csproj: Updated for Visual Studio .NET 2003.
5580 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
5581 * compiler.sln: Updated for Visual Studio .NET 2003.
5583 2004-03-24 Ravi Pratap M <ravi@ximian.com>
5585 * expression.cs: Fix bug #47234. We basically need to apply the
5586 rule that we prefer the conversion of null to a reference type
5587 when faced with a conversion to 'object' (csc behaviour).
5589 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
5591 * statement.cs: Shorter form for foreach, eliminates
5592 a local variable. r=Martin.
5594 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
5596 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
5597 checks if we can use brtrue/brfalse to test for 0.
5598 * expression.cs: use the above in the test for using brtrue/brfalse.
5601 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
5603 * expression.cs: Rewrite string concat stuff. Benefits:
5605 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
5606 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
5607 rather than a concat chain.
5609 * typemanager.cs: Add lookups for more concat overloads.
5611 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
5613 * expression.cs: Emit shorter il code for array init.
5630 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
5632 * statement.cs: Before, two switch blocks would be merged if the
5633 total size of the blocks (end_item - begin_item + 1) was less than
5634 two times the combined sizes of the blocks.
5636 Now, it will only merge if after the merge at least half of the
5641 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
5643 * class.cs : csc build fix for GetMethods(). See bug #52503.
5645 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
5647 * expression.cs: Make sure fp comparisons work with NaN.
5648 This fixes bug #54303. Mig approved this patch a long
5649 time ago, but we were not able to test b/c the runtime
5652 2004-03-19 Miguel de Icaza <miguel@ximian.com>
5654 * ecore.cs (TypExpr.GetHashCode): implement this overload.
5656 2004-03-19 Martin Baulig <martin@ximian.com>
5658 * class.cs (MemberCore.IsDuplicateImplementation): Report the
5659 error here and not in our caller.
5661 2004-03-19 Martin Baulig <martin@ximian.com>
5663 * interface.cs: Completely killed this file.
5664 (Interface): We're now a TypeContainer and live in class.cs.
5666 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
5667 argument; we're now also called for interfaces.
5668 (TypeContainer.DefineMembers): Allow this method being called
5670 (TypeContainer.GetMethods): New public method; formerly known as
5671 Interface.GetMethod(). This is used by PendingImplementation.
5672 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
5673 it's now private and non-static.
5674 (Interface): Moved this here; it's now implemented similar to
5676 (Method, Property, Event, Indexer): Added `bool is_interface'
5677 argument to their .ctor's.
5678 (MemberBase.IsInterface): New public field.
5680 * cs-parser.jay: Create normal Method, Property, Event, Indexer
5681 instances instead of InterfaceMethod, InterfaceProperty, etc.
5682 (opt_interface_base): Removed; we now use `opt_class_base' instead.
5683 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
5685 2004-03-19 Martin Baulig <martin@ximian.com>
5687 * class.cs (MethodCore.IsDuplicateImplementation): New private
5688 method which does the CS0111 checking.
5689 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
5690 Use IsDuplicateImplementation().
5692 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
5694 * decl.cs (FindMemberToOverride): New method to find the correct
5695 method or property to override in the base class.
5697 - Make Method/Property use the above method to find the
5698 version in the base class.
5699 - Remove the InheritableMemberSignatureCompare as it is now
5702 This patch makes large code bases much faster to compile, as it is
5703 O(n) rather than O(n^2) to do this validation.
5705 Also, it fixes bug 52458 which is that nested classes are not
5706 taken into account when finding the base class member.
5708 Reviewed/Approved by Martin.
5710 2004-03-17 Marek Safar <marek.safar@seznam.cz>
5712 * interface.cs: In all interface classes removed redundant
5713 member initialization.
5715 2004-03-16 Martin Baulig <martin@ximian.com>
5717 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
5719 2004-03-15 Miguel de Icaza <miguel@ximian.com>
5721 * decl.cs (DefineTypeAndParents): New helper method to define a
5722 type's containers before the type itself is defined; This is a
5723 bug exposed by the recent changes to Windows.Forms when an
5724 implemented interface was defined inside a class that had not been
5727 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
5729 (Check): Loop correctly to report errors modifiers
5730 (UNSAFE was not in the loop, since it was the same as TOP).
5732 * interface.cs: Every interface member now takes a ModFlags,
5733 instead of a "is_new" bool, which we set on the base MemberCore.
5735 Every place where we called "UnsafeOk" in the interface, now we
5736 call the proper member (InterfaceMethod.UnsafeOK) instead to get
5737 the unsafe settings from the member declaration instead of the
5738 container interface.
5740 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
5742 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
5743 `set_indexer_name' to the pending bits (one per type).
5745 We fixed a bug today that was picking the wrong method to
5746 override, since for properties the existing InterfaceMethod code
5747 basically ignored the method name. Now we make sure that the
5748 method name is one of the valid indexer names.
5750 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
5752 * support.cs (SeekableStreamReader): Keep track of stream byte
5753 positions and don't mix them with character offsets to the buffer.
5755 Patch from Gustavo Giráldez
5757 2004-03-15 Marek Safar <marek.safar@seznam.cz>
5759 * interface.cs (InterfaceSetGetBase): Removed double member
5760 initialization, base class does it as well.
5762 2004-03-13 Martin Baulig <martin@ximian.com>
5764 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
5765 when compiling corlib.
5767 2004-03-13 Miguel de Icaza <miguel@ximian.com>
5769 * convert.cs (ExplicitConversion): We were reporting an error on
5770 certain conversions (object_type source to a value type, when the
5771 expression was `null') before we had a chance to pass it through
5772 the user defined conversions.
5774 * driver.cs: Replace / and \ in resource specifications to dots.
5777 * class.cs: Add check for duplicate operators. Fixes 52477
5779 2004-03-11 Miguel de Icaza <miguel@ximian.com>
5781 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
5782 that are in the middle of the statements, not only at the end.
5785 * class.cs (TypeContainer.AddField): No longer set the
5786 `HaveStaticConstructor' flag, now we call it
5787 `UserDefineStaticConstructor' to diferentiate the slightly
5788 semantic difference.
5790 The situation is that we were not adding BeforeFieldInit (from
5791 Modifiers.TypeAttr) to classes that could have it.
5792 BeforeFieldInit should be set to classes that have no static
5797 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
5799 And most importantly Zoltan's comment:
5801 http://bugzilla.ximian.com/show_bug.cgi?id=44229
5803 "I think beforefieldinit means 'it's ok to initialize the type sometime
5804 before its static fields are used', i.e. initialization does not need
5805 to be triggered by the first access to the type. Setting this flag
5806 helps the JIT to compile better code, since it can run the static
5807 constructor at JIT time, and does not need to generate code to call it
5808 (possibly lots of times) at runtime. Unfortunately, mcs does not set
5809 this flag for lots of classes like String.
5811 csc sets this flag if the type does not have an explicit static
5812 constructor. The reasoning seems to be that if there are only static
5813 initalizers for a type, and no static constructor, then the programmer
5814 does not care when this initialization happens, so beforefieldinit
5817 This bug prevents the AOT compiler from being usable, since it
5818 generates so many calls to mono_runtime_class_init that the AOT code
5819 is much slower than the JITted code. The JITted code is faster,
5820 because it does not generate these calls if the vtable is type is
5821 already initialized, which is true in the majority of cases. But the
5822 AOT compiler can't do this."
5824 2004-03-10 Miguel de Icaza <miguel@ximian.com>
5826 * class.cs (MethodData.Emit): Refactor the code so symbolic
5827 information is generated for destructors; For some reasons we
5828 were taking a code path that did not generate symbolic information
5831 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
5833 * class.cs: Create a Constructor.CheckBase method that
5834 takes care of all validation type code. The method
5835 contains some code that was moved from Define.
5837 It also includes new code that checks for duplicate ctors.
5838 This fixes bug #55148.
5840 2004-03-09 Joshua Tauberer <tauberer@for.net>
5842 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
5843 a { ... }-style array creation invokes EmitStaticInitializers
5844 which is not good for reference-type arrays. String, decimal
5845 and now null constants (NullCast) are not counted toward
5846 static initializers.
5848 2004-03-05 Martin Baulig <martin@ximian.com>
5850 * location.cs (SourceFile.HasLineDirective): New public field;
5851 specifies whether the file contains or is referenced by a "#line"
5853 (Location.DefineSymbolDocuments): Ignore source files which
5854 either contain or are referenced by a "#line" directive.
5856 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
5858 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
5859 direct access to our parent, so check the method inline there.
5861 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
5863 * expression.cs (Invocation.EmitCall): Miguel's last commit
5864 caused a regression. If you had:
5869 In Foo the implict this would be null.
5871 2004-02-27 Miguel de Icaza <miguel@ximian.com>
5873 * expression.cs (Invocation.EmitCall): If the method is not
5874 virtual, do not emit a CallVirt to it, use Call.
5876 * typemanager.cs (GetFullNameSignature): Improve the method to
5877 cope with ".ctor" and replace it with the type name.
5879 * class.cs (ConstructorInitializer.Resolve): Now the method takes
5880 as an argument the ConstructorBuilder where it is being defined,
5881 to catch the recursive constructor invocations.
5883 2004-02-26 Miguel de Icaza <miguel@ximian.com>
5885 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
5886 routines to check if a type is an enumerable/enumerator allow
5887 classes that implement the IEnumerable or IEnumerator interfaces.
5889 * class.cs (Property, Operator): Implement IIteratorContainer, and
5890 implement SetYields.
5892 (Property.Define): Do the block swapping for get_methods in the
5893 context of iterators. We need to check if Properties also
5894 include indexers or not.
5896 (Operator): Assign the Block before invoking the
5897 OperatorMethod.Define, so we can trigger the Iterator code
5900 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
5901 Property and Operator classes are not created when we parse the
5902 declarator but until we have the block completed, so we use a
5903 singleton SimpleIteratorContainer.Simple to flag whether the
5904 SetYields has been invoked.
5906 We propagate this setting then to the Property or the Operator to
5907 allow the `yield' to function.
5909 2004-02-25 Marek Safar <marek.safar@seznam.cz>
5911 * codegen.cs: Implemented attribute support for modules.
5912 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
5913 Assembly/Module functionality.
5915 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
5916 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
5917 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
5919 2004-02-16 Marek Safar <marek.safar@seznam.cz>
5921 * interface.cs (FindMembers): The operation is performed on all base
5922 interfaces and not only on the first. It is required for future CLS Compliance patch.
5924 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
5926 * statement.cs, codegen.cs:
5927 This patch deals with patterns such as:
5929 public class List : IEnumerable {
5931 public MyEnumerator GetEnumerator () {
5932 return new MyEnumerator(this);
5935 IEnumerator IEnumerable.GetEnumerator () {
5939 public struct MyEnumerator : IEnumerator {
5944 Before, there were a few things we did wrong:
5945 1) we would emit callvirt on a struct, which is illegal
5946 2) we emited ldarg when we needed to emit ldarga
5947 3) we would mistakenly call the interface methods on an enumerator
5948 type that derived from IEnumerator and was in another assembly. For example:
5950 public class MyEnumerator : IEnumerator
5952 Would have the interface methods called, even if there were public impls of the
5953 method. In a struct, this lead to invalid IL code.
5955 2004-02-11 Marek Safar <marek.safar@seznam.cz>
5957 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
5960 * delegate.cs (Define): Fixed crash when delegate type is undefined.
5962 2004-02-11 Miguel de Icaza <miguel@ximian.com>
5964 * cs-parser.jay: Fix small regression: we were not testing V2
5965 compiler features correctly.
5967 * interface.cs: If the emit context is null, then create one
5969 2004-02-09 Marek Safar <marek.safar@seznam.cz>
5971 * decl.cs (GetSignatureForError): New virtual method to get full name
5974 * attribute.cs (IAttributeSupport): New interface for attribute setting.
5975 Now it is possible to rewrite ApplyAttributes method to be less if/else.
5977 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
5978 Duplicated members and code in these classes has been removed.
5979 Better encapsulation in these classes.
5981 2004-02-07 Miguel de Icaza <miguel@ximian.com>
5983 * assign.cs (Assign.DoResolve): When dealing with compound
5984 assignments, there is a new rule in ECMA C# 2.4 (might have been
5985 there before, but it is documented here) that states that in:
5989 If b is of type int, and the `op' is a shift-operator, then the
5990 above is evaluated as:
5994 * expression.cs (Binary.ResolveOperator): Instead of testing for
5995 int/uint/long/ulong, try to implicitly convert to any of those
5996 types and use that in pointer arithmetic.
5998 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
5999 method to print information for from the type, not from the
6000 null-method we were given.
6002 2004-02-01 Duncan Mak <duncan@ximian.com>
6004 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
6005 parsing for cmd, fixes bug #53694.
6007 2004-02-04 Marek Safar <marek.safar@seznam.cz>
6009 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
6010 in the member name duplication tests. Property and operator name duplication
6011 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
6013 2004-02-03 Marek Safar <marek.safar@seznam.cz>
6015 * interface.cs (PopulateMethod): Fixed crash when interface method
6016 returns not existing type (error test cs0246-3.cs).
6018 2004-02-02 Ravi Pratap M <ravi@ximian.com>
6020 * cs-parser.jay (interface_accessors): Re-write actions to also
6021 store attributes attached to get and set methods. Fix spelling
6024 (inteface_property_declaration): Modify accordingly.
6026 (InterfaceAccessorInfo): New helper class to store information to pass
6027 around between rules that use interface_accessors.
6029 * interface.cs (Emit): Apply attributes on the get and set
6030 accessors of properties and indexers too.
6032 * attribute.cs (ApplyAttributes): Modify accordingly to use the
6033 right MethodBuilder when applying attributes to the get and set accessors.
6035 2004-01-31 Miguel de Icaza <miguel@ximian.com>
6037 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
6039 2004-01-26 Miguel de Icaza <miguel@ximian.com>
6041 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
6043 2004-01-25 Miguel de Icaza <miguel@ximian.com>
6045 * cs-parser.jay: Remove YIELD token, instead use the new grammar
6046 changes that treat `yield' specially when present before `break'
6049 * cs-tokenizer.cs: yield is no longer a keyword.
6051 2004-01-23 Marek Safar <marek.safar@seznam.cz>
6053 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
6054 setting for default constructors.
6055 For default constructors are almost every time set wrong Modifier. The
6056 generated IL code has been alright. But inside mcs this values was
6057 wrong and this was reason why several of my CLS Compliance tests
6060 2004-01-22 Martin Baulig <martin@ximian.com>
6062 * cs-parser.jay (namespace_or_type_name): Return an Expression,
6063 not a QualifiedIdentifier. This is what `type_name_expression'
6064 was previously doing.
6065 (type_name_expression): Removed; the code is now in
6066 `namespace_or_type_name'.
6067 (qualified_identifier): Removed, use `namespace_or_type_name'
6069 (QualifiedIdentifier): Removed this class.
6071 2004-01-22 Martin Baulig <martin@ximian.com>
6073 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
6074 not a string as alias name.
6076 2004-01-21 Miguel de Icaza <miguel@ximian.com>
6078 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
6079 #52730 bug, and instead compute correctly the need to use a
6080 temporary variable when requesting an address based on the
6081 static/instace modified of the field and the constructor.
6083 2004-01-21 Martin Baulig <martin@ximian.com>
6085 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
6086 class and namespace before looking up aliases. Fixes #52517.
6088 2004-01-21 Martin Baulig <martin@ximian.com>
6090 * flowanalysis.cs (UsageVector.Merge): Allow variables being
6091 assinged in a 'try'; fixes exception4.cs.
6093 2004-01-21 Marek Safar <marek.safar@seznam.cz>
6094 * class.cs : Implemented parameter-less constructor for TypeContainer
6096 * decl.cs: Attributes are now stored here. New property OptAttributes
6098 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
6100 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
6102 2004-01-21 Marek Safar <marek.safar@seznam.cz>
6104 * typemanager.cs (CSharpSignature): Now reports also inner class name.
6105 (CSharpSignature): New method for indexer and property signature.
6107 2004-01-21 Marek Safar <marek.safar@seznam.cz>
6109 * pending.cs (IsVirtualFilter): Faster implementation.
6111 2004-01-21 Marek Safar <marek.safar@seznam.cz>
6113 * typemanager.cs: Avoid inclusion of same assembly more than once.
6115 2004-01-21 Marek Safar <marek.safar@seznam.cz>
6117 * cs-parser.jay: Fixed problem where the last assembly attribute
6118 has been applied also to following declaration (class, struct, etc.)
6120 2004-01-21 Marek Safar <marek.safar@seznam.cz>
6122 * class.cs: Added error CS0538, CS0539 reporting.
6123 Fixed crash on Microsoft runtime when field type is void.
6125 * cs-parser.jay: Added error CS0537 reporting.
6127 * pending.cs: Added error CS0535 reporting.
6128 Improved error report for errors CS0536, CS0534.
6130 2004-01-20 Miguel de Icaza <miguel@ximian.com>
6132 Merge a few bits from the Anonymous Method MCS tree.
6134 * statement.cs (ToplevelBlock): New class for toplevel methods,
6135 will hold anonymous methods, lifted variables.
6137 * cs-parser.jay: Create toplevel blocks for delegates and for
6138 regular blocks of code.
6140 2004-01-20 Martin Baulig <martin@ximian.com>
6142 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
6143 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
6144 and `NeedExplicitReturn'; added `IsLastStatement'.
6145 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
6146 have a `ReturnLabel' or we're not unreachable.
6148 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
6149 child's reachability; don't just override ours with it. Fixes
6150 #58058 (lluis's example).
6151 (FlowBranching): Added public InTryOrCatch(), InCatch(),
6152 InFinally(), InLoop(), InSwitch() and
6153 BreakCrossesTryCatchBoundary() methods.
6155 * statement.cs (Return): Do all error checking in Resolve().
6156 Unless we are the last statement in a top-level block, always
6157 create a return label and jump to it.
6158 (Break, Continue): Do all error checking in Resolve(); also make
6159 sure we aren't leaving a `finally'.
6160 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
6161 statement in a top-level block.
6162 (Block.Flags): Added `IsDestructor'.
6163 (Block.IsDestructor): New public property.
6165 2004-01-20 Martin Baulig <martin@ximian.com>
6167 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
6169 2004-01-20 Martin Baulig <martin@ximian.com>
6171 * statement.cs (Statement.ResolveUnreachable): New public method.
6172 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
6173 (Block.Resolve): Resolve unreachable statements.
6175 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
6177 * expression.cs: We need to fix the case where we do
6178 not have a temp variable here.
6180 * assign.cs: Only expression compound assignments need
6181 temporary variables.
6183 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
6185 * flowanalysis.cs: Reduce memory allocation in a few ways:
6186 - A block with no variables should not allocate a bit
6188 - A method with no out parameters does not need any tracking
6189 for assignment of the parameters, so we need not allocate
6192 public readonly Type[] VariableTypes;
6193 public readonly string[] VariableNames;
6194 Are redundant. The data is already stored in the variable
6195 map, so we need not allocate another array for it.
6196 - We need to add alot of checks for if (params | locals) == null
6197 due to the first two changes.
6199 2004-01-18 Miguel de Icaza <miguel@ximian.com>
6201 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
6202 implement IMemoryLocation, we store a copy on a local variable and
6203 take the address of it. Patch from Benjamin Jemlich
6205 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
6206 to use a special "type_name_expression" rule which reduces the
6207 number of "QualifiedIdentifier" classes created, and instead
6208 directly creates MemberAccess expressions.
6210 2004-01-17 Miguel de Icaza <miguel@ximian.com>
6212 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
6213 that fixes #52853. Null literal assignment to ValueType
6215 * class.cs (MethodData.Emit): Instead of checking the name of the
6216 method to determine if its a destructor, create a new derived
6217 class from Method called Destructor, and test for that.
6219 * cs-parser.jay: Create a Destructor object instead of a Method.
6221 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
6225 2004-01-16 Miguel de Icaza <miguel@ximian.com>
6227 * expression.cs (Binary.ResolveOperator): Perform an implicit
6228 conversion from MethodGroups to their delegate types on the
6231 * delegate.cs: Introduce a new class DelegateCreation that is the
6232 base class for `NewDelegate' and `ImplicitDelegateCreation',
6233 factor some code in here.
6235 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
6236 conversion from MethodGroups to compatible delegate types.
6238 * ecore.cs (Expression.Resolve): Do not flag error 654
6239 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
6240 we allow conversions from MethodGroups to delegate types now.
6242 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
6243 assignments in v2 either.
6245 2004-01-10 Miguel de Icaza <miguel@ximian.com>
6247 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
6248 static read-only fields in ctors.
6250 Applied patch from Benjamin Jemlich
6252 * expression.cs (UnaryMutator): Avoid leaking local variables.
6254 2004-01-09 Miguel de Icaza <miguel@ximian.com>
6256 * cs-tokenizer.cs (IsCastToken): Allow the various native types
6257 here to return true, as they can be used like this:
6261 Fixed 49836 and all the other dups
6263 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
6265 * driver.cs: Implement /win32res and /win32icon.
6267 2004-01-08 Miguel de Icaza <miguel@ximian.com>
6269 * cs-parser.jay: Add a rule to improve error handling for the
6270 common mistake of placing modifiers after the type.
6272 2004-01-07 Miguel de Icaza <miguel@ximian.com>
6274 * cs-parser.jay (interface_event_declaration): Catch
6275 initialization of events on interfaces, and report cs0068
6277 * cs-parser.jay (interface_event_declaration): Catch
6278 initialization of events.
6280 * ecore.cs: Better report missing constructors.
6282 * expression.cs (Binary.ResolveOperator): My previous bug fix had
6283 the error reporting done in the wrong place. Fix.
6285 * expression.cs (Binary.ResolveOperator): Catch the
6286 operator + (E x, E y) error earlier, and later allow for implicit
6287 conversions in operator +/- (E e, U x) from U to the underlying
6290 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
6291 52596, if the container class is abstract, the default constructor
6292 is protected otherwise its public (before, we were always public).
6294 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
6297 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
6298 Jemlich that fixes bug #52597, MCS was generating invalid code for
6299 idisposable structs. Thanks to Ben for following up with this
6302 2004-01-06 Miguel de Icaza <miguel@ximian.com>
6304 * driver.cs: Allow assemblies without code to be generated, fixes
6307 2004-01-07 Nick Drochak <ndrochak@gol.com>
6309 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
6311 2004-01-05 Miguel de Icaza <miguel@ximian.com>
6313 * cs-parser.jay: Add rules to improve error reporting if fields or
6314 methods are declared at the namespace level (error 116)
6316 * Add rules to catch event add/remove
6318 2004-01-04 David Sheldon <dave-mono@earth.li>
6320 * expression.cs: Added matching ")" to error message for
6323 2004-01-03 Todd Berman <tberman@gentoo.org>
6325 * ecore.cs, attribute.cs:
6326 Applying fix from #52429.
6328 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
6330 * ecore.cs, expression.cs, statement.cs:
6331 Total rewrite of how we handle branching. We
6332 now handle complex boolean expressions with fewer
6333 jumps. As well if (x == 0) no longer emits a ceq.
6335 if (x is Foo) is much faster now, because we generate
6338 Overall, we get a pretty big improvement on our benchmark
6339 tests. The code we generate is smaller and more readable.
6341 I did a full two-stage bootstrap. The patch was reviewed
6342 by Martin and Miguel.
6344 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
6346 * cs-parser.jay: Make primary_expression not take a QI.
6347 we dont need this because the member_access rule covers
6348 us here. So we replace the rule with just IDENTIFIER.
6350 This has two good effects. First, we remove a s/r conflict.
6351 Second, we allocate many fewer QualifiedIdentifier objects.
6353 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
6355 * attribute.cs: Handle MarshalAs attributes as pseudo, and
6356 set the correct information via SRE. This prevents
6357 hanging on the MS runtime. Fixes #29374.
6359 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
6361 * convert.cs: correctly handle conversions to value types
6362 from Enum and ValueType as unboxing conversions.
6364 Fixes bug #52569. Patch by Benjamin Jemlich.
6366 2004-01-02 Ravi Pratap <ravi@ximian.com>
6368 * expression.cs (BetterConversion): Prefer int -> uint
6369 over int -> ulong (csc's behaviour). This fixed bug #52046.
6371 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
6373 * decl.cs (MemberCache.FindMembers): now returns a
6376 * typemanager.cs: In general, go with with ^^.
6377 (CopyNewMethods): take an IList.
6378 (RealMemberLookup): Only allocate an arraylist
6379 if we copy from two sets of methods.
6381 This change basically does two things:
6382 1) Fewer array lists allocated due to CopyNewMethods.
6383 2) the explicit cast in MemberList costed ALOT.
6385 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
6387 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
6388 a hashtable to avoid needless string allocations when an identifier is
6389 used more than once (the common case).
6391 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
6393 * pending.cs: MS's TypeBuilder.GetInterfaces ()
6394 is broken, it will not return anything. So, we
6395 have to use the information we have in mcs to
6398 * typemanager.cs: Add a cache for GetInterfaces,
6399 since this will now be used more often (due to ^^)
6401 (GetExplicitInterfaces) New method that gets the
6402 declared, not effective, interfaces on a type
6403 builder (eg, if you have interface IFoo, interface
6404 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
6407 This patch makes MCS able to bootstrap itself on
6410 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
6412 * expression.cs: Remove the Nop's that Miguel put
6415 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
6417 * report.cs, codegen.cs: Give the real stack trace to
6418 the error when an exception is thrown.
6420 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
6422 * decl.cs: only allocate hashtables for ifaces if
6425 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
6427 * expression.cs: fix the error from cs0121-2.cs
6428 (a parent interface has two child interfaces that
6429 have a function with the same name and 0 params
6430 and the function is called through the parent).
6432 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
6434 * class.cs, rootcontext.cs, typmanager.cs: do not
6437 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
6439 * codegen.cs: remove stack for the ec flow branching.
6440 It is already a linked list, so no need.
6442 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
6444 * Makefile: Allow custom profiler here.
6446 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
6448 * typemanager.cs (LookupType):
6449 - Use a static char [], because split takes
6450 a param array for args, so it was allocating
6452 - Do not store true in a hashtable, it boxes.
6454 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
6456 * flowanalysis.cs: bytify common enums.
6458 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
6460 * modifiers.cs: Add a new set of flags for the
6461 flags allowed on explicit interface impls.
6462 * cs-parser.jay: catch the use of modifiers in
6463 interfaces correctly.
6464 * class.cs: catch private void IFoo.Blah ().
6466 All related to bug #50572.
6468 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
6470 * decl.cs: Rewrite the consistant accessability checking.
6471 Accessability is not linear, it must be implemented in
6472 a tableish way. Fixes #49704.
6474 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
6476 * expression.cs: Handle negation in a checked context.
6477 We must use subtraction from zero. Fixes #38674.
6479 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
6481 * class.cs: Ignore static void main in DLLs.
6482 * rootcontext.cs: Handle the target type here,
6483 since we are have to access it from class.cs
6484 * driver.cs: account for the above.
6486 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
6488 * report.cs: Give line numbers and files if available.
6490 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
6492 * driver.cs: Implement /addmodule.
6494 * typemanager.cs: Change 'modules' field so it now contains Modules not
6497 2003-12-20 Martin Baulig <martin@ximian.com>
6499 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
6500 (FieldBase.IsAssigned): Removed this field.
6501 (FieldBase.SetAssigned): New public method.
6502 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
6504 2003-12-20 Martin Baulig <martin@ximian.com>
6506 * expression.cs (LocalVariableReference.DoResolve): Don't set
6507 `vi.Used' if we're called from DoResolveLValue().
6509 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
6510 returns the usage vector it just merged into the current one -
6511 pass this one to UsageWarning().
6512 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
6513 of the `EmitContext', don't call this recursively on our children.
6515 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
6517 * driver.cs: Implement /target:module.
6519 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
6521 * support.cs (CharArrayHashtable): New helper class.
6523 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
6524 char arrays, not strings, so we can avoid creating a string in
6525 consume_identifier if the identifier is a keyword.
6527 2003-12-16 Martin Baulig <martin@ximian.com>
6529 * statement.cs (LocalInfo.Assigned): Removed this property.
6530 (LocalInfo.Flags): Removed `Assigned'.
6531 (LocalInfo.IsAssigned): New public method; takes the EmitContext
6532 and uses flow analysis.
6533 (Block.UsageWarning): Made this method private.
6534 (Block.Resolve): Call UsageWarning() if appropriate.
6536 * expression.cs (LocalVariableReference.DoResolve): Always set
6537 LocalInfo.Used here.
6539 2003-12-13 Martin Baulig <martin@ximian.com>
6541 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
6542 any value here; we're now using flow analysis to figure out
6543 whether a statement/block returns a value.
6545 2003-12-13 Martin Baulig <martin@ximian.com>
6547 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
6549 (FlowBranching.MergeFinally): Don't call
6550 `branching.CheckOutParameters()' here, this is called in
6552 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
6553 when adding the `finally' vector.
6555 2003-12-13 Martin Baulig <martin@ximian.com>
6558 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
6559 actually work and also fix #48962.
6561 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
6563 * decl.cs: Do not check System.Object for nested types,
6564 since we know it does not have any. Big bang for buck:
6569 corlib: 17.99 seconds
6573 corlib: 17.39 seconds
6575 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
6577 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
6578 time we are returning 0 members, so we save alot here.
6580 2003-12-11 Martin Baulig <martin@ximian.com>
6582 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
6583 `MergeChild()', also just take the `FlowBranching' as argument;
6584 call Merge() on it and return the result.
6585 (FlowBranching.Merge): We don't need to do anything if we just
6588 2003-12-11 Martin Baulig <martin@ximian.com>
6590 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
6591 them in an `ArrayList' to reduce memory usage. Thanks to Ben
6592 Maurer for this idea.
6594 2003-12-11 Martin Baulig <martin@ximian.com>
6596 * flowanalysis.cs (MergeResult): This class is now gone; we now
6597 use the `UsageVector' for this. The reason for this is that if a
6598 branching just has one sibling, we don't need to "merge" them at
6599 all - that's the next step to do.
6600 (FlowBranching.Merge): We now return a `UsageVector' instead of a
6603 2003-12-11 Martin Baulig <martin@ximian.com>
6605 Reworked flow analyis and made it more precise and bug-free. The
6606 most important change is that we're now using a special `Reachability'
6607 class instead of having "magic" meanings of `FlowReturns'. I'll
6608 do some more cleanups and optimizations and also add some more
6609 documentation this week.
6611 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
6612 largely reworked this class.
6613 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
6614 the new `Reachability' class instead of having "magic" values here.
6615 (FlowBranching): We're now using an instance of `Reachability'
6616 instead of having separate `Returns', `Breaks' etc. fields.
6618 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
6619 based on flow analysis; ignore the return value of block.Emit ().
6621 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
6623 * driver.cs typemanager.cs: Find the mono extensions to corlib even
6624 if they are private.
6626 2003-12-09 Martin Baulig <martin@ximian.com>
6628 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
6629 call them directly on the UsageVector.
6631 2003-12-09 Martin Baulig <martin@ximian.com>
6633 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
6634 Changed return type from `FlowReturns' to `Reachability'.
6636 2003-12-09 Martin Baulig <martin@ximian.com>
6638 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
6639 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
6640 `Reachable' fields with a single `Reachability' one.
6642 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
6644 * class.cs (FindMembers): Remove foreach's.
6657 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
6662 This patch does a few things:
6663 1. EmptyStatement is now a singleton, so it is never reallocated.
6664 2. All blah is EmptyStatement constructs have been changed to
6665 blah == EmptyStatement.Value, which is much faster and valid
6666 now that EmptyStatement is a singleton.
6667 3. When resolving a block, rather than allocating a new array for
6668 the non-empty statements, empty statements are replaced with
6669 EmptyStatement.Value
6670 4. Some recursive functions have been made non-recursive.
6671 Mainly the performance impact is from (3), however (1) and (2) are needed for
6672 this to work. (4) does not make a big difference in normal situations, however
6673 it makes the profile look saner.
6678 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
6679 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
6680 Total memory allocated: 56397 KB
6683 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
6684 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
6685 Total memory allocated: 55666 KB
6687 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
6689 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
6690 than the hashtable in a hashtable version
6692 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
6693 we always end up concating a string. This results in a huge perf
6694 loss, because many strings have to be tracked by the GC. In this
6695 patch, we first use a hashtable that works with two keys, so that
6696 the strings do not need to be concat'ed.
6707 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
6709 * Makefile: Add a new target `do-time' that does a quick and simple
6710 profile, leaving easy to parse output.
6712 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
6714 * codegen.cs (Init): Create the dynamic assembly with
6715 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
6717 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
6719 * support.cs: Make the PtrHashtable use only one
6720 instance of its comparer.
6722 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
6724 * typemanager.cs: Fix lookup of GetNamespaces.
6726 2003-11-29 Miguel de Icaza <miguel@ximian.com>
6728 * expression.cs: Removed redundant line.
6730 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
6731 ArrayLists, use for loops with bounds.
6733 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
6736 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
6737 arraylists, use for loop with bounds.
6739 The above three changes give us a 0.071 second performance
6740 improvement out of 3.294 seconds down to 3.223. On my machine
6741 the above changes reduced the memory usage by 1,387 KB during
6744 * cs-parser.jay (QualifiedIdentifier): New class used to represent
6745 QualifiedIdentifiers. Before we created a new string through
6746 concatenation, and mostly later on, the result would be
6747 manipulated by DecomposeQI through string manipulation.
6749 This reduced the compiler memory usage for bootstrapping from
6750 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
6751 compile times in 0.05 seconds.
6753 2003-11-28 Dick Porter <dick@ximian.com>
6755 * support.cs: Do string compares with the Invariant culture.
6763 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
6764 the comparison is done with the Invariant culture.
6766 2003-11-27 Miguel de Icaza <miguel@ximian.com>
6768 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
6769 GetEnumerator method.
6771 (ProbeCollectionType): Iterate starting at the most specific type
6772 upwards looking for a GetEnumerator
6774 * expression.cs: Shift count can be up to 31 for int/uint and 63
6777 2003-11-26 Miguel de Icaza <miguel@ximian.com>
6779 * statement.cs (Block.LookupLabel): Also look for the label on the
6780 children blocks. Use a hash table to keep track of visited
6783 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
6784 we actually did transform the other operand, otherwise fall back
6785 to the common codepath that casts to long.
6787 * cs-tokenizer.cs: Use the same code pattern as the int case.
6788 Maybe I should do the parsing myself, and avoid depending on the
6789 Parse routines to get this done.
6791 2003-11-25 Miguel de Icaza <miguel@ximian.com>
6793 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
6794 which fixes bug 51347. This time test it.
6796 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
6797 attributes for example can not tell the difference between these.
6798 The difference was only a syntax feature of the language.
6800 * attribute.cs: Apply attributes to delegates.
6802 * delegate.cs: Call the apply attributes method.
6804 2003-11-24 Miguel de Icaza <miguel@ximian.com>
6806 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
6807 comparing 0 vs Byte.MinValue, not the value
6809 (ImplicitConversionRequired): When reporting a conversion error,
6810 use error 31 to print out the constant error instead of the
6813 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
6814 which fixes bug 51347.
6816 2003-11-22 Miguel de Icaza <miguel@ximian.com>
6818 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
6819 which fixes the -warnaserror command line option.
6821 2003-11-21 Miguel de Icaza <miguel@ximian.com>
6823 * cfold.cs (DoNumericPromotions): During constant folding of
6824 additions on UIntConstant, special case intconstants with
6825 IntConstants like we do on the expression binary operator.
6827 2003-11-12 Miguel de Icaza <miguel@ximian.com>
6829 * convert.cs (ImplicitReferenceConversion): We were missing a case
6830 (System.Enum are not value types or class types, so we need to
6831 classify them separatedly).
6833 * driver.cs: We do not support error 2007.
6835 2003-11-12 Jackson Harper <jackson@ximian.com>
6837 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
6838 system directory. Also use the full file name so users can
6839 libraries names mscorlib-o-tron.dll in a non system dir.
6841 2003-11-10 Martin Baulig <martin@ximian.com>
6843 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
6844 (TypeManager.InitCoreTypes): Initialize them here, but instead of
6845 calling `ResolveType()' on them, directly assign their `Type'.
6847 2003-11-08 Martin Baulig <martin@ximian.com>
6849 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
6850 return value and the `out parent' parameter.
6851 (TypeContainer.DefineType): Moved the CS0644 check into
6852 GetClassBases(). Don't pass the interface types to the
6853 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
6854 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
6856 * ecore.cs (TypeExpr.IsAttribute): New property.
6857 (TypeExpr.GetInterfaces): New method.
6859 * interface.cs (Interface.GetInterfaceTypeByName): Return a
6860 TypeExpr instead of a Type.
6861 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
6862 (Interface.DefineType): Don't pass the interface types to the
6863 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
6864 them later and then call `TypeBulider.AddInterfaceImplementation()'.
6866 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
6867 instead of a `Type[]'.
6868 (TypeManager.RegisterBuilder): Likewise.
6869 (TypeManager.AddUserInterface): Likewise.
6870 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
6871 `Type[]' and also return a `TypeExpr[]'.
6872 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
6874 2003-11-08 Martin Baulig <martin@ximian.com>
6876 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
6879 2003-11-08 Martin Baulig <martin@ximian.com>
6881 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
6882 TypeManager.ResolveExpressionTypes().
6884 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
6885 instead of an Expression.
6886 (TypeExpr): This is now an abstract base class for `TypeExpression'.
6887 (TypeExpression): New public class; formerly known as `TypeExpr'.
6889 * expression.cs (ComposedCast): Derive from TypeExpr.
6891 * typemanager.cs (TypeManager.system_*_expr): These are now
6892 TypExpr's instead of Expression's.
6893 (TypeManager.ResolveExpressionTypes): New public static function;
6894 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
6897 2003-11-06 Miguel de Icaza <miguel@ximian.com>
6899 * expression.cs (New.DoResolve): Do not dereference value that
6900 might be a null return.
6902 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
6903 sure that the constant value has the right type. Fixes an
6904 unreported bug, similar to 50425.
6906 * const.cs (Const.LookupConstantValue): Call
6907 ImplicitStandardConversionExists before doing a conversion to
6908 avoid havng the TypeManager.ChangeType do conversions.
6910 Reduced the number of casts used
6912 (Const.ChangeType): New routine to enable reuse of the constant
6913 type changing code from statement.
6915 * typemanager.cs (ChangeType): Move common initialization to
6916 static global variables.
6920 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
6921 every value type to go through, even if it was void. Fix that.
6923 * cs-tokenizer.cs: Use is_identifier_start_character on the start
6924 character of the define, and the is_identifier_part_character for
6925 the rest of the string.
6927 2003-11-05 Miguel de Icaza <miguel@ximian.com>
6929 * expression.cs (UnaryMutator.EmitCode): When I updated
6930 LocalVariableReference.DoResolve, I overdid it, and dropped an
6931 optimization done on local variable references.
6933 2003-11-04 Miguel de Icaza <miguel@ximian.com>
6935 * ecore.cs: Convert the return from Ldlen into an int.
6937 2003-10-20 Miguel de Icaza <miguel@ximian.com>
6939 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
6940 the accessibility, this is a special case for toplevel non-public
6941 classes (internal for instance).
6943 2003-10-20 Nick Drochak <ndrochak@gol.com>
6945 * ecore.cs: Fix typo and build. Needed another right paren.
6947 2003-10-19 Miguel de Icaza <miguel@ximian.com>
6949 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
6950 `internal' case regular and protected, but not allowing protected
6951 to be evaluated later. Bug 49840
6953 2003-10-15 Miguel de Icaza <miguel@ximian.com>
6955 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
6956 to kb.Nlast, and not the kb.nFirst to isolate the switch
6959 Extract the underlying type, so enumerations of long/ulong are
6960 treated like long/ulong.
6962 2003-10-14 Miguel de Icaza <miguel@ximian.com>
6964 * expression.cs (New): Overload the meaning of RequestedType to
6965 track the possible creation of the NewDelegate type, since
6966 DoResolve is invoked more than once for new constructors on field
6969 See bugs: #48800 and #37014
6971 * cs-parser.jay (declare_local_constants): Take an arraylist
6972 instead of a single constant.
6974 (local_constant_declaration): It should take a
6975 constant_declarators, not a constant_declarator. Fixes 49487
6977 * convert.cs: Fix error report.
6979 2003-10-13 Jackson Harper <jackson@ximian.com>
6981 * typemanager.cs (TypeToCoreType): Add float and double this fixes
6984 2003-10-09 Martin Baulig <martin@ximian.com>
6986 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
6988 (MethodCore.DoDefineParameters): Removed the TypeContainer
6989 argument; use the DeclSpace which was passed to the .ctor instead.
6990 (MethodCore.CheckParameter): Take a DeclSpace instead of a
6991 TypeContainer; we only need a DeclSpace here.
6993 2003-10-09 Martin Baulig <martin@ximian.com>
6995 * class.cs (MethodData): Added additional `DeclSpace ds' argument
6997 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
6998 EmitContext's .ctor.
7000 2003-10-09 Martin Baulig <martin@ximian.com>
7002 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
7003 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
7004 AsAccessible(), moved them as well.
7006 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
7008 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
7010 * cs-parser.jay : Renamed yyName to yyNames related to jay.
7012 2003-10-07 Miguel de Icaza <miguel@ximian.com>
7014 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
7015 generation for >=, as spotted by Paolo, bug 48679.
7016 Patch from David Waite.
7018 * cs-tokenizer.cs: Add handling for #pragma.
7020 * cs-parser.jay: Allow for both yield and yield return in the
7021 syntax. The anti-cobolization of C# fight will go on!
7023 * class.cs (TypeBuilder.DefineType): Catch error condition here
7024 (Parent.DefineType erroring out and returning null).
7026 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
7027 coping with enumerations variables, we were mistakenly processing
7028 them as a regular value type instead of built-in types. Fixes the
7031 * typemanager.cs (IsBuiltinOrEnum): New method.
7033 2003-09-30 Miguel de Icaza <miguel@ximian.com>
7035 * cs-parser.jay: Upgrade: yield now needs the return clause.
7037 2003-09-19 Martin Baulig <martin@ximian.com>
7039 * decl.cs (MemberCache.SetupCacheForInterface): Take a
7040 `MemberCache parent' argument. Normally, an interface doesn't
7041 have a parent type except System.Object, but we use this in gmcs
7042 for generic type parameters.
7044 2003-09-18 Martin Baulig <martin@ximian.com>
7046 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
7047 on `type.IsInterface'; don't check whether the type has a parent
7048 to determine whether it's an interface.
7050 2003-09-15 Martin Baulig <martin@ximian.com>
7052 * class.cs (TypeContainer.DefineType): Added an error flag to
7053 avoid reporting duplicate CS0146's ("class definition is
7056 * driver.cs (Driver.MainDriver): Abort if
7057 RootContext.ResolveTree() reported any errors.
7059 2003-09-07 Martin Baulig <martin@ximian.com>
7061 * report.cs (Error, Warning): Added overloaded versions which take
7062 a `params object[] args' and call String.Format().
7064 2003-09-07 Martin Baulig <martin@ximian.com>
7066 * decl.cs (DeclSpace..ctor): Don't call
7067 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
7068 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
7069 (DeclSpace.RecordDecl): New method.
7071 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
7073 2003-09-02 Ravi Pratap <ravi@ximian.com>
7075 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
7076 value attributes to be applied to ParameterBuilders.
7078 * class.cs (MethodCore.LabelParameters): Make static and more
7079 generic so that it can be used from other places - like interface
7080 methods, for instance.
7082 * interface.cs (Interface.Emit): Call LabelParameters before
7083 emitting attributes on the InterfaceMethod.
7085 2003-08-26 Martin Baulig <martin@ximian.com>
7087 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
7088 resolving aliases; fixes #47927.
7090 2003-08-26 Martin Baulig <martin@ximian.com>
7092 * statement.cs (Using.DoResolve): This is internally emitting a
7093 try/finally clause, so we need to set ec.NeedExplicitReturn if we
7094 do not always return. Fixes #47681.
7096 2003-08-26 Martin Baulig <martin@ximian.com>
7098 * decl.cs (MemberCore): Moved WarningNotHiding(),
7099 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
7101 (AdditionResult): Make this nested in DeclSpace.
7102 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
7103 argument; call NamespaceEntry.Define() unless we're nested in a
7106 * namespace.cs (Namespace.DefineName): New public function. This
7107 is called from DeclSpace's .ctor to add
7108 (Namespace.Lookup): Include DeclSpaces in the lookup.
7110 * class.cs (Operator): Derive from MemberBase, not MemberCore.
7112 * const.cs (Const): Derive from MemberBase, not MemberCore.
7114 2003-08-25 Martin Baulig <martin@ximian.com>
7116 * convert.cs (Convert.ExplicitReferenceConversion): When
7117 converting from an interface type to a class, unbox if the target
7118 type is a struct type. Fixes #47822.
7120 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
7122 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
7125 2003-08-22 Martin Baulig <martin@ximian.com>
7127 * class.cs (TypeManager.DefineType): When defining a nested type,
7128 call DefineType() on our parent; fixes #47801.
7130 2003-08-22 Martin Baulig <martin@ximian.com>
7132 * class.cs (MethodData.Define): While checking if a method is an
7133 interface implementation, improve the test a bit more to fix #47654.
7135 2003-08-22 Martin Baulig <martin@ximian.com>
7137 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
7138 correctly; fixes #47722.
7140 2003-08-22 Martin Baulig <martin@ximian.com>
7142 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
7143 LocalVariableReference, ensure it's not read-only. Fixes #47536.
7145 * statement.cs (Fixed.DoResolve): Make all variables read-only.
7147 2003-08-22 Martin Baulig <martin@ximian.com>
7149 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
7150 can only be assigned in static constructors. Fixes #47161.
7152 2003-08-22 Martin Baulig <martin@ximian.com>
7154 Rewrote and improved the flow analysis code.
7156 * flowbranching.cs (FlowBranching): Make this class abstract.
7157 (FlowBranching.CreateBranching): New static function to create a
7159 (FlowBranchingBlock, FlowBranchingException): New classes.
7160 (FlowBranching.UsageVector.Type): New public readonly field.
7161 (FlowBranching.UsageVector.Breaks): Removed the setter.
7162 (FlowBranching.UsageVector.Returns): Removed the setter.
7163 (FlowBranching.UsageVector): Added Break(), Return(),
7164 NeverReachable() and Throw() methods to modify the reachability.
7165 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
7166 done by FlowBranching.Merge().
7167 (FlowBranching.UsageVector.MergeChild): New method; merges the
7168 merge result into the current vector.
7169 (FlowBranching.Merge): New abstract method to merge a branching.
7171 2003-08-12 Martin Baulig <martin@ximian.com>
7173 * expression.cs (Indirection.CacheTemporaries): Create the
7174 LocalTemporary with the pointer type, not its element type.
7176 2003-08-10 Miguel de Icaza <miguel@ximian.com>
7178 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
7179 token was a keyword or not.
7181 Add `error' options where an IDENTIFIER was expected; Provide
7182 CheckToken and CheckIdentifierToken convenience error reporting
7185 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
7187 * decl.cs: Rename `NamespaceEntry Namespace' public field into
7188 NameSpaceEntry NameSpaceEntry.
7190 (LookupInterfaceOrClass): Avoid creating a full qualified name
7191 from namespace and name: avoid doing lookups when we know the
7192 namespace is non-existant. Use new Tree.LookupByNamespace which
7193 looks up DeclSpaces based on their namespace, name pair.
7195 * driver.cs: Provide a new `parser verbose' to display the
7196 exception thrown during parsing. This is turned off by default
7197 now, so the output of a failure from mcs is more graceful.
7199 * namespace.cs: Track all the namespaces defined in a hashtable
7202 (IsNamespace): New method
7204 2003-08-09 Miguel de Icaza <miguel@ximian.com>
7206 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
7207 we know that we need to concatenate (full typename can never be
7212 * statement.cs: Use a bitfield; Do not initialize to null things
7213 which are done by the constructor by default.
7215 * cs-parser.jay: bug fix, parameter was 4, not 3.
7217 * expression.cs: Just use the property;
7219 * statement.cs: No need for GetVariableInfo method.
7221 2003-08-08 Martin Baulig <martin@ximian.com>
7223 * flowanalysis.cs (FlowReturns): This is now nested in the
7224 `FlowBranching' class.
7225 (MyBitVector): Moved this here from statement.cs.
7226 (FlowBranching.SiblingType): New enum type.
7227 (FlowBranching.CreateSibling): Added `SiblingType' argument.
7229 2003-08-07 Martin Baulig <martin@ximian.com>
7231 * flowanalysis.cs (FlowBranchingType): This is now nested in the
7232 `FlowBranching' class and called `BranchingType'.
7234 2003-08-07 Martin Baulig <martin@ximian.com>
7236 * flowanalysis.cs: Moved all the control flow analysis code into
7239 2003-08-07 Martin Baulig <martin@ximian.com>
7241 * assign.cs (Assign.DoResolve): `target' must either be an
7242 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
7245 2003-08-07 Miguel de Icaza <miguel@ximian.com>
7247 * expression.cs (BinaryMethod): This kind of expression is created by the
7248 Binary class if it determines that the operator has to be handled
7251 (BinaryDelegate): This kind of expression is created if we are
7252 dealing with a + or - operator on delegates.
7254 (Binary): remove method, argumetns, and DelegateOperator: when
7255 dealing with methods,
7257 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
7259 * statement.cs (Block): use bitfields for the three extra booleans
7260 we had in use. Remove unused topblock parameter.
7262 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
7264 * assign.cs: Drop extra unneeded tests.
7266 2003-08-06 Miguel de Icaza <miguel@ximian.com>
7268 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
7270 * statement.cs (Foreach): Use VariableStorage instead of
7273 * codegen.cs (VariableStorage): New class used by clients that
7274 require a variable stored: locals or fields for variables that
7275 need to live across yield.
7277 Maybe provide a convenience api for EmitThis+EmitLoad?
7279 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
7282 2003-08-05 Miguel de Icaza <miguel@ximian.com>
7284 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
7285 RemapParameterLValue): New methods that are used to turn a
7286 precomputed FieldInfo into an expression like this:
7290 The idea is to use this instead of making LocalVariableReference
7291 have more than one meaning.
7293 * cs-parser.jay: Add error production to BASE.
7295 * ecore.cs: Deal with TypeManager.GetField returning null, which
7296 is now a valid return value.
7298 (FieldExprNoAddress): New expression for Fields whose address can
7301 * expression.cs (LocalVariableReference): During the resolve
7302 phases, create new expressions if we are in a remapping context.
7303 Remove code that dealt with remapping here.
7305 (ParameterReference): same.
7307 (ProxyInstance): New expression, like the `This' expression, but
7308 it is born fully resolved. We know what we are doing, so remove
7309 the errors that are targeted to user-provided uses of `this'.
7311 * statement.cs (Foreach): our variable is now stored as an
7312 Expression; During resolution, follow the protocol, dont just
7313 assume it will return this.
7315 2003-08-06 Martin Baulig <martin@ximian.com>
7317 * support.cs (SeekableStreamReader.cs): New public class.
7319 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
7320 SeekableStreamReader instead of the normal StreamReader.
7322 2003-08-04 Martin Baulig <martin@ximian.com>
7324 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
7325 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
7326 deambiguate casts and delegate invocations.
7327 (parenthesized_expression): Use the new tokens to ensure this is
7328 not a cast of method invocation.
7330 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
7331 when reading a `)' and Deambiguate_CloseParens () was previously
7334 * expression.cs (ParenthesizedExpression): New class. This is
7335 just used for the CS0075 test.
7336 (Binary.DoResolve): Check for CS0075.
7338 2003-07-29 Ravi Pratap <ravi@ximian.com>
7340 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
7341 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
7342 reference comparison.
7344 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
7345 examine the ReturnType for equality - this is necessary in the
7346 cases of implicit and explicit operators whose signature also
7347 includes the return type.
7349 2003-07-26 Miguel de Icaza <miguel@ximian.com>
7351 * namespace.cs: Cache the result of the namespace computation,
7352 instead of computing it every time.
7354 2003-07-24 Miguel de Icaza <miguel@ximian.com>
7356 * decl.cs: Use a global arraylist that we reuse over invocations
7357 to avoid excesive memory consumption. Reduces memory usage on an
7358 mcs compile by one meg (45 average).
7360 * typemanager.cs (LookupTypeReflection): In .NET pointers are
7361 private, work around that.
7363 2003-07-23 Miguel de Icaza <miguel@ximian.com>
7365 * literal.cs (IntLiteral): Define Zero and One static literals.
7367 * cs-parser.jay (integer_literal): use static literals to reduce
7368 memory usage for the most used literals (0, 1 and -1). 211kb
7369 reduced in memory usage.
7371 Replace all calls to `new ArrayList' with `new
7372 ArrayList(4)' which is a good average number for most allocations,
7373 and also requires only 16 bytes of memory for its buffer by
7376 This reduced MCS memory usage in seven megabytes for the RSS after
7379 2003-07-28 Ravi Pratap <ravi@ximian.com>
7381 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
7382 handle params methods the correct way by forming only one
7383 applicable set with params and normal methods in them. Earlier we
7384 were looking at params methods only if we found no normal methods
7385 which was not the correct thing to do.
7387 (Invocation.BetterFunction): Take separate arguments indicating
7388 when candidate and the best method are params methods in their
7391 This fixes bugs #43367 and #46199.
7393 * attribute.cs: Documentation updates.
7395 (CheckAttribute): Rename to CheckAttributeTarget.
7396 (GetValidPlaces): Rename to GetValidTargets.
7398 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
7399 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
7403 2003-07-28 Martin Baulig <martin@ximian.com>
7405 * class.cs (TypeContainer.DefineMembers): Use the base type's full
7406 name when looking up the base class of a nested class. Fixes #46977.
7408 2003-07-26 Martin Baulig <martin@ximian.com>
7410 * expression.cs (Indexers.Indexer): New nested struct; contains
7411 getter, setter and the indexer's type.
7412 (Indexers.Properties): This is now an ArrayList of
7414 (IndexerAccess.DoResolveLValue): Correctly set the type if the
7415 indexer doesn't have any getters.
7417 * assign.cs (Assign.DoResolve): Also do the implicit conversions
7418 for embedded property and indexer assignments.
7420 2003-07-26 Martin Baulig <martin@ximian.com>
7422 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
7423 preprocessor directive is not the first non-whitespace character
7426 2003-07-26 Martin Baulig <martin@ximian.com>
7428 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
7429 namespace parsing, follow the spec more closely.
7431 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
7432 NamespaceEntry.Lookup().
7434 2003-07-25 Martin Baulig <martin@ximian.com>
7436 * MethodCore.cs (OverridesSomething): New public field; it's set
7437 from TypeContainer.DefineMembers if this method overrides
7438 something (which doesn't need to be a method). Fix #39462.
7440 2003-07-25 Ravi Pratap <ravi@ximian.com>
7442 * typemanager.cs (GetMembers): Ensure that the list of members is
7443 reversed. This keeps things in sync.
7445 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
7446 find an AttributeUsage attribute.
7448 * expression.cs (Invocation.OverloadResolve): Perform the check
7449 which disallows Invoke to be directly called on a Delegate.
7451 (Error_InvokeOnDelegate): Report error cs1533.
7453 2003-07-25 Martin Baulig <martin@ximian.com>
7455 * expression.cs (Indexers.GetIndexersForType): Only look in the
7456 interface hierarchy if the requested type is already an
7457 interface. Fixes #46788 while keeping #46502 fixed.
7459 2003-07-25 Martin Baulig <martin@ximian.com>
7461 * class.cs (TypeContainer.DefineMembers): Check whether all
7462 readonly fields have been assigned and report warning CS0649 if
7465 * statement.cs (LocalInfo.IsFixed): Always return true if this is
7468 2003-07-24 Ravi Pratap <ravi@ximian.com>
7470 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
7471 returned from GetMethods to make things consistent with the
7472 assumptions MCS makes about ordering of methods.
7474 This should comprehensively fix bug #45127 and it does :-)
7476 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
7477 ordering is actually reverse.
7479 * Clean up some debug messages I left lying around.
7481 * interface.cs (Populate*): Get rid of code which emits attributes
7482 since the stage in which we emit attributes is the 'Emit' stage,
7483 not the define stage.
7485 (Emit): Move attribute emission for interface members here.
7487 2003-07-22 Ravi Pratap <ravi@ximian.com>
7489 * expression.cs (Invocation.OverloadResolve): Follow the spec more
7490 closely: we eliminate methods in base types when we have an
7491 applicable method in a top-level type.
7493 Please see section 14.5.5.1 for an exact description of what goes
7496 This fixes bug #45127 and a host of other related to corlib compilation.
7498 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
7499 array is the method corresponding to the top-level type (this is
7500 because of the changes made to icall.c) so we change this
7503 (MethodGroupExpr.Name): This too.
7505 * typemanager.cs (GetElementType): New method which does the right
7506 thing when compiling corlib.
7508 * everywhere: Make use of the above in the relevant places.
7510 2003-07-22 Martin Baulig <martin@ximian.com>
7512 * cs-parser.jay (invocation_expression): Moved
7513 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
7514 `cast_expression', but create a InvocationOrCast which later
7515 resolves to either an Invocation or a Cast.
7517 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
7518 method; call this before EmitStatement() to make sure that this
7519 expression can be used as a statement.
7521 * expression.cs (InvocationOrCast): New class; resolves to either
7522 an Invocation or a Cast.
7524 * statement.cs (StatementExpression): Call ResolveStatement() on
7525 the ExpressionStatement before emitting it.
7527 2003-07-21 Martin Baulig <martin@ximian.com>
7529 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
7530 `ref' and `out' attributes match; fixes #46220.
7531 (MemberAccess.ResolveMemberAccess): You can't reference a type
7532 through an expression; fixes #33180.
7533 (Indexers.GetIndexersForType): Don't return the indexers from
7534 interfaces the class implements; fixes #46502.
7536 2003-07-21 Martin Baulig <martin@ximian.com>
7538 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
7539 CS0661 checks; fixes bug #30442.
7541 2003-07-21 Martin Baulig <martin@ximian.com>
7543 * decl.cs (AdditionResult): Added `Error'.
7545 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
7547 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
7548 makes cs0031.cs actually work.
7550 2003-07-20 Martin Baulig <martin@ximian.com>
7552 * namespace.cs: Fixed that bug which caused a crash when compiling
7555 2003-07-20 Miguel de Icaza <miguel@ximian.com>
7557 * typemanager.cs (LookupTypeReflection): Never expose types which
7558 are NotPublic, NestedPrivate, NestedAssembly, or
7559 NestedFamANDAssem. We used to return these, and later do a check
7560 that would report a meaningful error, but the problem is that we
7561 would not get the real match, if there was a name override.
7563 2003-07-18 Miguel de Icaza <miguel@ximian.com>
7565 * namespace.cs (Namespace, Name): Do not compute the namespace
7566 name dynamically, compute it in the constructor. This reduced
7567 memory usage by 1697 KB.
7569 * driver.cs: Use --pause to pause at the end.
7571 2003-07-17 Peter Williams <peter@newton.cx>
7573 * Makefile: Change the name of the test target so that it doesn't
7574 conflict with the recursive test target.
7576 2003-07-17 Miguel de Icaza <miguel@ximian.com>
7578 * expression.cs (LocalVariableReference.Emit, EmitAssign,
7579 AddressOf): Do not use EmitThis, that was wrong, use the actual
7582 2003-07-15 Miguel de Icaza <miguel@ximian.com>
7584 * class.cs (MethodData.Define): While checking if a method is an
7585 interface implementation, improve the test: If we are not public
7586 (use new test here: use the computed MethodAttributes directly,
7587 instead of the parsed modifier flags) check if the `implementing'
7588 method comes from an interface or not.
7590 * pending.cs (VerifyPendingMethods): Slightly better error
7593 * makefile: add test target that does the mcs bootstrap.
7595 2003-07-16 Ravi Pratap <ravi@ximian.com>
7597 * interface.cs (Define): Do nothing here since there are no
7598 members to populate etc. Move the attribute emission out of here
7599 since this was just totally the wrong place to put it. Attribute
7600 application happens during the 'Emit' phase, not in the 'Define'
7603 (Emit): Add this method and move the attribute emission here
7605 * rootcontext.cs (EmitCode): Call the Emit method on interface
7608 2003-07-14 Ravi Pratap M <ravi@ximian.com>
7610 * expression.cs (OverloadResolve): Report error only if Location
7611 is not 'Null' which means that there was a probe going on.
7613 2003-07-14 Martin Baulig <martin@ximian.com>
7615 * expression.cs (ConditionalLogicalOperator): New public class to
7616 implement user defined conditional logical operators.
7617 This is section 14.11.2 in the spec and bug #40505.
7619 2003-07-14 Martin Baulig <martin@ximian.com>
7621 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
7623 2003-07-14 Martin Baulig <martin@ximian.com>
7625 * codegen.cs (EmitContext.InFixedInitializer): New public field.
7627 * ecore.cs (IVariable.VerifyFixed): New interface method.
7629 * expression.cs (Unary.ResolveOperator): When resolving the `&'
7630 operator, check whether the variable is actually fixed. Fixes bug
7631 #36055. Set a variable definitely assigned when taking its
7632 address as required by the spec.
7634 * statement.cs (LocalInfo.IsFixed): New field.
7635 (LocalInfo.MakePinned): Set `IsFixed' to true.
7637 2003-07-14 Ravi Pratap M <ravi@ximian.com>
7639 * attribute.cs (Attribute.Resolve): While doing a Member lookup
7640 for .ctors, ensure that we only ask for members declared in the
7641 attribute type (BindingFlags.DeclaredOnly).
7645 * expression.cs (Error_WrongNumArguments): Report error 1501
7646 correctly the way CSC does.
7648 2003-07-13 Martin Baulig <martin@ximian.com>
7650 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
7651 lookup on the fully qualified name, to make things like "X.X" work
7652 where "X.X" is a fully qualified type name, but we also have a
7653 namespace "X" in the using list. Fixes #41975.
7655 2003-07-13 Martin Baulig <martin@ximian.com>
7657 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
7658 function. If we're a CompoundAssign, we need to create an embedded
7659 CompoundAssign, not an embedded Assign.
7660 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
7663 2003-07-13 Martin Baulig <martin@ximian.com>
7665 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
7666 work to fix bug #46088.
7668 2003-07-13 Ravi Pratap <ravi@ximian.com>
7670 * class.cs (Operator.Emit): Do not emit attributes here - it is
7671 taken care of by the Method class that we delegate too. This takes
7674 2003-07-10 Martin Baulig <martin@ximian.com>
7676 * expression.cs (TypeOfVoid): New class.
7677 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
7679 2003-07-10 Martin Baulig <martin@ximian.com>
7681 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
7684 2003-07-10 Martin Baulig <martin@ximian.com>
7686 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
7687 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
7689 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
7691 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
7693 2003-07-10 Martin Baulig <martin@ximian.com>
7695 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
7696 of decimal. Fixes #42850.
7698 NOTE: I also fixed the created byte blob, but this doesn't work on
7699 the MS runtime and csc never produces any byte blobs for decimal
7702 2003-07-10 Martin Baulig <martin@ximian.com>
7704 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
7705 structs; fixes #32068.
7706 (Block.AddChildVariableNames): Fixed #44302.
7708 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
7710 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
7712 2003-07-07 Miguel de Icaza <miguel@ximian.com>
7714 * attribute.cs: And this test is onger needed.
7716 2003-07-08 Martin Baulig <martin@ximian.com>
7718 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
7719 inaccessible types. Fixes #36313.
7721 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
7723 * namespace.cs (NamespaceEntry): Create implicit entries for all
7724 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
7725 implicit entries for N1.N2 and N1.
7727 2003-07-08 Martin Baulig <martin@ximian.com>
7729 Rewrote the handling of namespaces to fix a lot of the issues
7730 wrt. `using' aliases etc.
7732 * namespace.cs (Namespace): Splitted this class into a
7733 per-assembly `Namespace' and a per-file `NamespaceEntry'.
7735 * typemanager.cs (TypeManager.IsNamespace): Removed.
7736 (TypeManager.ComputeNamespaces): Only compute namespaces from
7737 loaded assemblies here, not the namespaces from the assembly we're
7738 currently compiling.
7740 2003-07-08 Martin Baulig <martin@ximian.com>
7742 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
7744 2003-07-07 Miguel de Icaza <miguel@ximian.com>
7746 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
7749 I thought about the memory savings here, but LookupTypeReflection
7750 is used under already very constrained scenarios. Compiling
7751 corlib or mcs only exposes one hit, so it would not really reduce
7752 any memory consumption.
7754 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
7756 * typemanager.cs: fixes bug #45889 by only adding public types from
7757 other assemblies to the list of known types.
7759 2003-07-07 Miguel de Icaza <miguel@ximian.com>
7761 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
7762 on the type we resolved.
7764 2003-07-05 Martin Baulig <martin@ximian.com>
7766 * pending.cs (PendingImplementation.ParentImplements): Don't
7767 create the proxy if the parent is abstract.
7769 * class.cs (TypeContainer.DefineIndexers): Process explicit
7770 interface implementations first. Fixes #37714.
7772 2003-07-04 Miguel de Icaza <miguel@ximian.com>
7774 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
7775 defined recursively; but since we modify the input parameters
7776 (left is set to `this' temporarily), we reset this value if the
7777 left_is_explicit is false, which gives the original semantics to
7780 * literal.cs (NullPointer): new class used to represent a null
7781 literal in a pointer context.
7783 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
7784 type is a pointer, use a NullPointer object instead of a
7785 NullLiteral. Closes 43687
7787 (ExplicitConversion): Convert pointer values using
7788 the conv opcode to the proper type.
7790 * ecore.cs (New): change ValueTypeVariable property into a method,
7791 that returns whether the valuetype is suitable for being used.
7793 * expression.cs (Binary.DoNumericPromotions): Only return if we
7794 the int constant was a valid uint, and we can return both left and
7795 right as uints. If not, we continue processing, to trigger the
7796 type conversion. This fixes 39018.
7798 * statement.cs (Block.EmitMeta): During constant resolution, set
7799 the CurrentBlock property on the emitcontext, so that we resolve
7800 constants propertly.
7802 2003-07-02 Martin Baulig <martin@ximian.com>
7804 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
7805 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
7807 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
7808 than emitting it here.
7810 * statement.cs: Fixed some more flow analysis bugs.
7812 2003-07-02 Martin Baulig <martin@ximian.com>
7814 * class.cs (MethodData.Define): When implementing interface
7815 methods, set Final unless we're Virtual.
7817 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
7818 check work for interface methods.
7820 2003-07-01 Martin Baulig <martin@ximian.com>
7822 * ecore.cs (EmitContext.This): Replaced this property with a
7823 GetThis() method which takes a Location argument. This ensures
7824 that we get the correct error location for a CS0188.
7826 2003-07-01 Miguel de Icaza <miguel@ximian.com>
7828 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
7829 ImplicitStandardConversion.
7831 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
7833 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
7835 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
7838 2003-06-30 Miguel de Icaza <miguel@ximian.com>
7840 * class.cs (Constructor.Define): Turn off initlocals for unsafe
7843 (MethodData.Define): Turn off initlocals for unsafe methods.
7845 2003-06-29 Miguel de Icaza <miguel@ximian.com>
7847 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
7848 complete; Fixes #37521.
7850 * delegate.cs: Use Modifiers.TypeAttr to compute the
7851 TypeAttributes, instead of rolling our own. This makes the flags
7852 correct for the delegates.
7854 2003-06-28 Miguel de Icaza <miguel@ximian.com>
7856 * class.cs (Constructor.Define): Set the private flag for static
7857 constructors as well.
7859 * cs-parser.jay (statement_expression): Set the return value to
7860 null, to avoid a crash when we catch an error.
7862 2003-06-24 Miguel de Icaza <miguel@ximian.com>
7864 * cs-parser.jay: Applied patch from Jackson that adds support for
7865 extern and unsafe modifiers to destructor declarations.
7867 * expression.cs: Report error 21 if the user is trying to index a
7870 * driver.cs: Add an error message, suggested by the bug report.
7872 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
7873 if we do not have a ": this ()" constructor initializer. Fixes 45149
7875 2003-06-14 Miguel de Icaza <miguel@ximian.com>
7877 * namespace.cs: Add some information to reduce FAQs.
7879 2003-06-13 Miguel de Icaza <miguel@ximian.com>
7881 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
7882 underlying enumeration types. Fixes #43915.
7884 * expression.cs: Treat ushort/short as legal values to be used in
7887 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
7889 * delegate.cs: transfer custom attributes for paramenters from
7890 the delegate declaration to Invoke and BeginInvoke.
7892 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
7894 * attribute.cs: handle custom marshalers and emit marshal info
7897 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
7899 * makefile.gnu: Added anonymous.cs to the compiler sources.
7901 2003-05-28 Miguel de Icaza <miguel@ximian.com>
7903 * iterators.cs: Change the name of the proxy class to include two
7906 * cs-parser.jay: Update grammar to include anonymous methods.
7908 * anonymous.cs: new file.
7910 2003-05-27 Miguel de Icaza <miguel@ximian.com>
7912 * class.cs (Field.Define): Add missing test for pointers and
7915 2003-05-27 Ravi Pratap <ravi@ximian.com>
7917 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
7918 we use the stobj opcode.
7920 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
7921 since it wasn't the correct fix.
7923 It still is puzzling that we are required to use stobj for IntPtr
7924 which seems to be a ValueType.
7926 2003-05-26 Miguel de Icaza <miguel@ximian.com>
7928 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
7929 during regular simple name resolution. Now, the trick is that
7930 instead of returning for processing the simplename, we do a
7931 TypeManager.LookupType (ie, a rooted lookup as opposed to a
7932 contextual lookup type). If a match is found, return that, if
7933 not, return for further composition.
7935 This fixes long-standing 30485.
7937 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
7938 using the address to initialize an object, do an Stobj instead of
7939 using the regular Stelem.
7941 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
7942 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
7943 Because if we are a BaseIndexerAccess that value will be true.
7946 * statement.cs (GotoCase.Resolve): Return after reporting an
7947 error, do not attempt to continue.
7949 * expression.cs (PointerArithmetic.Emit): If our operand is a
7950 long, convert our constants to match the operand before
7951 multiplying. Convert to I type before adding. Fixes 43670.
7953 2003-05-14 Ravi Pratap <ravi@ximian.com>
7955 * enum.cs (ImplicitConversionExists) : Rename to
7956 ImplicitEnumConversionExists to remove ambiguity.
7958 * ecore.cs (NullCast): New type of cast expression class which
7959 basically is very similar to EmptyCast with the difference being
7960 it still is a constant since it is used only to cast a null to
7964 * convert.cs (ImplicitReferenceConversion): When casting a null
7965 literal, we return a NullCast.
7967 * literal.cs (NullLiteralTyped): Remove - I don't see why this
7968 should be around anymore.
7970 The renaming (reported was slightly wrong). Corrections:
7972 ConvertImplicitStandard -> ImplicitConversionStandard
7973 ConvertExplicitStandard -> ExplicitConversionStandard
7975 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
7976 before passing them in !
7978 * convert.cs (ImplicitConversionStandard): When comparing for
7979 equal expr and target types, ensure that expr is not a
7982 In general, we must not be checking (expr_type ==
7983 target_type) in the top level conversion methods
7984 (ImplicitConversion, ExplicitConversion etc). This checking is
7985 done in the methods that they delegate to.
7987 2003-05-20 Miguel de Icaza <miguel@ximian.com>
7989 * convert.cs: Move Error_CannotConvertType,
7990 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
7991 ImplicitNumericConversion, ImplicitConversionExists,
7992 ImplicitUserConversionExists, StandardConversionExists,
7993 FindMostEncompassedType, FindMostSpecificSource,
7994 FindMostSpecificTarget, ImplicitUserConversion,
7995 ExplicitUserConversion, GetConversionOperators,
7996 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
7997 TryImplicitIntConversion, Error_CannotConvertImplicit,
7998 ConvertImplicitRequired, ConvertNumericExplicit,
7999 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
8000 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
8003 Perform the following renames:
8005 StandardConversionExists -> ImplicitStandardConversionExists
8006 ConvertImplicit -> ImplicitConversion
8007 ConvertImplicitStandard -> ImplicitStandardConversion
8008 TryImplicitIntConversion -> ImplicitIntConversion
8009 ConvertImplicitRequired -> ImplicitConversionRequired
8010 ConvertNumericExplicit -> ExplicitNumericConversion
8011 ConvertReferenceExplicit -> ExplicitReferenceConversion
8012 ConvertExplicit -> ExplicitConversion
8013 ConvertExplicitStandard -> ExplicitStandardConversion
8015 2003-05-19 Martin Baulig <martin@ximian.com>
8017 * statement.cs (TypeInfo.StructInfo): Made this type protected.
8018 (TypeInfo): Added support for structs having structs as fields.
8020 * ecore.cs (FieldExpr): Implement IVariable.
8021 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
8022 VariableInfo for the field.
8024 2003-05-18 Martin Baulig <martin@ximian.com>
8026 * expression.cs (This.DoResolve): Report a CS0027 if we're
8027 emitting a field initializer.
8029 2003-05-18 Martin Baulig <martin@ximian.com>
8031 * expression.cs (This.ResolveBase): New public function.
8032 (This.DoResolve): Check for CS0188.
8034 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
8037 * ecore.cs (MethodGroupExpr.DoResolve): Set the
8038 `instance_expression' to null if we don't have any non-static
8041 2003-05-18 Martin Baulig <martin@ximian.com>
8043 Reworked the way how local variables and parameters are handled by
8044 the flow analysis code.
8046 * statement.cs (TypeInfo, VariableMap): New public classes.
8047 (VariableInfo): New public class. This is now responsible for
8048 checking whether a variable has been assigned. It is used for
8049 parameters and local variables.
8050 (Block.EmitMeta): Take the InternalParameters as argument; compute
8051 the layout of the flow vectors here.
8052 (Block.LocalMap, Block.ParameterMap): New public properties.
8053 (FlowBranching): The .ctor doesn't get the InternalParameters
8054 anymore since Block.EmitMeta() now computes the layout of the flow
8056 (MyStructInfo): This class is now known as `StructInfo' and nested
8057 in `TypeInfo'; we don't access this directly anymore.
8059 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
8060 property and removed IsAssigned(), IsFieldAssigned(),
8061 SetAssigned() and SetFieldAssigned(); we now call them on the
8062 VariableInfo so we don't need to duplicate this code everywhere.
8064 * expression.cs (ParameterReference): Added `Block block' argument
8066 (LocalVariableReference, ParameterReference, This): The new
8067 VariableInfo class is now responsible for all the definite
8070 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
8071 IsParameterAssigned, SetParameterAssigned): Removed.
8073 2003-05-18 Martin Baulig <martin@ximian.com>
8075 * typemanager.cs (InitCoreTypes): Try calling
8076 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
8077 the 3-args-version. Corlib now also needs our `void_type'.
8078 (GetMethod): Added overloaded version which takes an optional
8079 `bool report_errors' to allow lookups of optional methods.
8081 2003-05-12 Martin Baulig <martin@ximian.com>
8083 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
8084 only used for locals and not for parameters.
8086 2003-05-12 Miguel de Icaza <miguel@ximian.com>
8088 * support.cs (InternalParameters.ParameterType): Return the
8089 ExternalType of the parameter.
8091 * parameter.cs (Parameter.ExternalType): drop the two arguments,
8094 2003-05-11 Miguel de Icaza <miguel@ximian.com>
8096 * class.cs (MethodData.Define): Do not set the `newslot' on
8097 interface members, if they are also flagged as "override".
8099 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
8100 better code for ++i and i++. This only works for static fields
8101 and local variables.
8103 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
8104 want to pull the DeclSpace out of the builder_to_declspace instead
8105 of the TypeBuilder (like in TypeContainer.FindMembers).
8107 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
8108 instead of LookupTypeContainer. Fixes the crash on .NET for
8109 looking up interface members.
8111 * const.cs: Create our own emit context during the Definition
8112 stage, so that constants are evaluated in the proper context, when
8113 a recursive definition happens.
8115 2003-05-11 Martin Baulig <martin@ximian.com>
8117 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
8118 new block for a switch section.
8119 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
8120 the adding/lookup in the switch block. Fixes #39828.
8122 2003-05-09 Miguel de Icaza <miguel@ximian.com>
8124 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
8125 functionality: I needed to convert the data after I had performed
8126 the add/sub operation into the operands type size.
8128 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
8129 pass the type for the box operation, otherwise the resulting
8130 object would have been of type object.
8132 (BoxedCast): Add constructor to specify the type to box as.
8134 2003-05-07 Miguel de Icaza <miguel@ximian.com>
8136 * iterators.cs: I was reusing the `count' variable inadvertently,
8137 take steps to not allow this to happen.
8139 2003-05-06 Miguel de Icaza <miguel@ximian.com>
8141 * attribute.cs (Attribute.Resolve): Params attributes are encoded
8142 by creating an array at the point where the params starts and
8143 putting all those arguments there, then adjusting the size of the
8146 2003-05-05 Miguel de Icaza <miguel@ximian.com>
8148 * expression.cs (New.AddressOf): Implement interface
8149 IMemoryLocation. This is used when the `new' operator is used in
8150 the context of an invocation to a method on a value type.
8152 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
8155 * namespace.cs: Also check the using aliases here.
8157 * driver.cs: Move the test for using validity after the types have
8158 been entered, so we do a single pass that also includes the using
8161 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
8162 in the regular case. CreateSiblingForFinally is doing extra
8165 * attribute.cs (GetAttributeArgumentExpression): Store the result
8166 on an out value, and use the return value to indicate failure
8167 instead of using null (which is a valid return for Constant.GetValue).
8169 * statement.cs: Perform the analysis flow for the increment
8170 portion after the statement, because this will be the real flow of
8171 execution. Fixes #42385
8173 * codegen.cs (EmitContext.EmitArgument,
8174 EmitContext.EmitStoreArgument): New helper functions when the
8175 RemapToProxy flag is set.
8177 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
8180 Add support for remapping parameters.
8182 * iterators.cs: Propagate parameter values; Store parameter
8183 values in the proxy classes.
8185 2003-05-04 Miguel de Icaza <miguel@ximian.com>
8187 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
8188 need a proxy reference; I do not know what I was thinking
8190 * cs-parser.jay (constructor_initializer): catch another error,
8191 and display nice message.
8193 (field_declaration): catch void field declaration
8194 to flag a better error.
8196 * class.cs (MemberBase.CheckBase): Report an error instead of a
8197 warning if a new protected member is declared in a struct.
8198 (Field.Define): catch the error of readonly/volatile.
8200 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
8202 (FieldExpr.AddressOf): ditto. Catch error where the address of a
8203 volatile variable is taken
8205 2003-05-02 Miguel de Icaza <miguel@ximian.com>
8207 * statement.cs (Fixed.Resolve): Report an error if we are not in
8210 2003-05-01 Miguel de Icaza <miguel@ximian.com>
8212 * typemanager.cs: reuse the code that handles type clashes for
8213 delegates and enumerations.
8215 * class.cs (Report28): Always report.
8217 * expression.cs (EncodeAsAttribute): Allow nulls here.
8219 2003-04-28 Miguel de Icaza <miguel@ximian.com>
8221 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
8222 the functionality for testing whether an expression is valid for
8223 an attribute here. Also handle the case of arrays of elements
8226 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
8227 encoding a linear array into an array of objects that are suitable
8228 to be passed to an CustomAttributeBuilder.
8230 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
8232 * ecore.cs: (FieldExpr): Handle field remapping here.
8234 * iteratators.cs: Pass the instance variable (if the method is an
8235 instance method) to the constructors, so we can access the field
8236 variables on the class.
8238 TODO: Test this with structs. I think the THIS variable on
8239 structs might have to be a pointer, and not a refenrece
8241 2003-04-27 Miguel de Icaza <miguel@ximian.com>
8243 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
8244 local variables to fields in a proxy class.
8246 * iterators.cs (PopulateProxy): Rename our internal fields to
8248 Create a <THIS> field if we are an instance method, so we can
8249 reference our parent container variables.
8250 (MapVariable): Called back from the EmitContext code to enter a
8251 new variable to field mapping into the proxy class (we just create
8255 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
8256 for using the remapped locals to fields.
8258 I placed the code here, because that gives the same semantics to
8259 local variables, and only changes the Emit code.
8261 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
8262 statements inside iterators.
8263 (VariableInfo): Add a FieldBuilder for the cases when we are
8264 remapping local variables to fields in a proxy class
8266 * ecore.cs (SimpleNameResolve): Avoid testing two times for
8267 current_block != null.
8269 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
8270 not cope with strings, as it has been moved to the
8271 TableSwitchEmit. Fixed bug in switch generation.
8273 * expression.cs (New.DoResolve): Provide more context for the user
8274 when reporting an error.
8276 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
8279 * expression.cs (MemberAccess.DoResolve): When we get a type back,
8280 check the permissions for it. Note than in a type-resolution
8281 context the check was already present in DeclSpace.ResolveType,
8282 but was missing from the MemberAccess.
8284 (ArrayCreation.CheckIndices): warn if the user has
8285 more nested levels of expressions, but there are no more
8286 dimensions specified. Avoids crash on bug 41906.
8288 2003-04-26 Miguel de Icaza <miguel@ximian.com>
8290 * statement.cs (Block): replace Implicit bool, for a generic
8292 New flag: `Unchecked'. This is used during the EmitMeta phase
8293 (which is out-of-line with the regular Resolve/Emit process for a
8294 statement, as this is done ahead of time, but still gets a chance
8295 to call constant resolve).
8297 (Block.Flags): new enum for adding a new flag.
8299 (Block.EmitMeta): track the state of unchecked.
8301 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
8302 to enable constant resolution to work there as well.
8304 2003-04-22 Miguel de Icaza <miguel@ximian.com>
8306 * typemanager.cs (ienumerable_type): Also look up
8307 System.Collections.IEnumerable.
8309 2003-04-21 Miguel de Icaza <miguel@ximian.com>
8311 TODO: Test more than one conditional per method.
8313 * class.cs (Indexer.Define): Report the location where the user is
8314 referencing the unsupported feature.
8316 (MethodData): Overload the use of `conditionals' to
8317 minimize the creation of needless ArrayLists. This saves roughly
8318 212kb on my machine.
8320 (Method): Implement the new IIteratorContainer interface.
8321 (Method.SetYields): Implement the method by setting the ModFlags
8322 to contain METHOD_YIELDS.
8324 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
8325 which just got set to null.
8327 * iterators.cs: New file.
8329 (Yield, YieldBreak): New statements.
8331 * statement.cs (Return.Resolve): Flag an error if we are used in
8334 * codegen.cs (InIterator): New flag set if the code is being
8335 compiled in an iterator method.
8337 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
8338 internal modifier, and we just use it to avoid adding extra
8339 fields, as this is seldom used.
8341 * cs-parser.jay: Add yield_statement (yield and yield break).
8343 * driver.cs: New flag -v2 to turn on version 2 features.
8345 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
8346 hashtable when v2 is enabled.
8348 2003-04-20 Miguel de Icaza <miguel@ximian.com>
8350 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
8351 there is already a namespace defined with this name.
8353 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
8354 people upgraded their corlibs.
8356 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
8357 always use fully qualified types, no need to use the compiler
8360 (TypeManager.IsNamespace): Use binarysearch.
8362 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
8363 AddDelegate): I did not quite use the new IsValid API properly: I
8364 have to pass the short-name and the fullname. I was passing only
8365 the basename instead of the fullname sometimes.
8367 (TypeContainer.DefineType): call NamespaceClash.
8369 * interface.cs (Interface.DefineType): use NamespaceClash before
8372 * delegate.cs (Delegate.DefineType): use NamespaceClash before
8375 * enum.cs: (Enum.DefineType): use NamespaceClash before
8378 * typemanager.cs (: 3-line patch that gives us some tasty 11%
8379 speed increase. First, use the negative_hits cache when we get a
8380 negative. Second, add the type with its full original name
8381 instead of the new . and + encoded name (reflection uses + to
8382 separate type from a nested type). Use LookupTypeReflection
8383 directly which bypasses the type->name hashtable (that we already
8384 know does not contain the type.
8386 * decl.cs (DeclSpace.ResolveTypeExpr): track the
8387 location/container type.
8389 * driver.cs: When passing utf8, use directly the UTF8Encoding.
8391 2003-04-19 Miguel de Icaza <miguel@ximian.com>
8393 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
8395 * delegate.cs (NewDelegate.Resolve): Test whether an instance
8396 method is being referenced in the method group from a static
8397 context, and report error 120 if so.
8399 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
8402 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
8403 is created, we create the A namespace).
8405 * cs-parser.jay: A namespace also introduces a DeclarationFound.
8408 2003-04-18 Miguel de Icaza <miguel@ximian.com>
8410 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
8411 invocation to ModuleBuilder.GetType with the same values will
8412 return a new type instance, so we need to cache its return
8415 * expression.cs (Binary.ResolveOperator): Only allow the compare
8416 operators on enums if they are of the same type.
8418 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
8419 types of ValueType on their own case. Before we were giving them
8420 the same treatment as objects.
8422 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
8423 fullname. Short name is used to compare against container name.
8424 Fullname is used to check against defined namespace names.
8426 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
8427 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
8429 (Method.CheckBase): Call parent.
8430 (MemberBase.CheckBase): Check for protected members on sealed
8432 (PropertyBase.CheckBase): Call parent.
8433 (Field.Define): Call parent.
8435 * report.cs: Negative error codes are now mapped to 8000 - code,
8436 so that the display is render more nicely.
8438 * typemanager.cs: Do not use try/catch, instead report a regular
8441 (GetPointerType, GetReferenceType): These methods provide
8442 mechanisms to obtain the T* and T& from a T. We had the code
8443 previously scattered around the code base, and it also used
8444 TypeManager.LookupType that would go through plenty of caches.
8445 This one goes directly to the type source.
8447 In some places we did the Type.GetType followed by
8448 ModuleBuilder.GetType, but not in others, so this unifies the
8451 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
8452 statements now that we have namespace information.
8454 * typemanager.cs (IsNamespace): New method, returns whether the
8455 string presented is a namespace or not.
8457 (ComputeNamespaces): New public entry point, computes the list of
8458 available namespaces, using the GetNamespaces API call in Mono, or
8459 the slower version in MS.NET.
8461 Now before we start the semantic analysis phase, we have a
8462 complete list of namespaces including everything that the user has
8465 Deleted old code to cache namespaces in .nsc files.
8467 2003-04-17 Miguel de Icaza <miguel@ximian.com>
8469 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
8470 class/struct location definition Location for the implicit
8471 constructor location.
8473 (Operator.Define): Use the location of the operator for the
8474 implicit Method definition.
8476 (Constructor.Emit): use the constructor location for the implicit
8477 base initializer constructor.
8479 * ecore.cs: Remove ITypeExpression. This interface is now gone,
8480 and the Expression class now contains two new methods:
8482 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
8483 isolate type lookup from the rest of the resolution process.
8485 Since we use Expressions to hold type definitions due to the way
8486 we parse the input we have historically overloaded Resolve to
8487 perform the Type lookups if a special flag is passed. Now this is
8488 eliminated and two methods take their place.
8490 The differences in the two methods between xStep and xTerminal is
8491 that xStep is involved in our current lookup system that uses
8492 SimpleNames to compose a name, while xTerminal is used just to
8493 catch the case where the simplename lookup failed.
8495 2003-04-16 Miguel de Icaza <miguel@ximian.com>
8497 * expression.cs (ResolveMemberAccess): Remove redundant code.
8498 TypeExpr expressions are always born fully resolved.
8500 * interface.cs (PopulateMethod): Do not lookup the types twice.
8501 We were doing it once during SemanticAnalysis and once during
8504 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
8505 in local variable type definitions, were being returned as a
8506 SimpleName (we decomposed everything into a string), that is
8507 because primary_expression was being used instead of a type in the
8508 grammar (reduce/reduce conflicts).
8510 The part that was wrong is that we converted the expression into a
8511 string (an oversimplification in one hand, compounded with primary
8512 expressions doing string concatenation).
8518 Would return "A.B.C[]" as a SimpleName. This stopped things like
8519 using clauses from working on this particular context. And a type
8520 was being matched directly against "A.B.C[]".
8522 We now use the correct approach, and allow for ComposedCast to be
8523 part of the unary expression. So the "A.B.C []" become a composed
8524 cast of "A.B.C" (as a nested group of MemberAccess with a
8525 SimpleName at the end) plus the rank composition "[]".
8529 2003-04-10 Miguel de Icaza <miguel@ximian.com>
8531 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
8532 for the access level checking.
8534 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
8535 `TypeContainer container', because I kept getting confused when I
8536 was debugging this code.
8538 * expression.cs (Indexers): Instead of tracking getters/setters,
8539 we now track them in parallel. We create one arraylist less, but
8540 most importantly it is possible now for the LValue code to find a
8541 matching get for a set.
8543 (IndexerAccess.DoResolveLValue): Update the code.
8544 GetIndexersForType has been modified already to extract all the
8545 indexers from a type. The code assumed it did not.
8547 Also make the code set the correct return type for the indexer.
8548 This was fixed a long time ago for properties, but was missing for
8549 indexers. It used to be void_type.
8551 (Binary.Emit): Test first for doubles instead of
8552 floats, as they are more common.
8554 (Binary.EmitBranchable): Use the .un version of the branch opcodes
8555 when dealing with floats and the <=, >= operators. This fixes bug
8558 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
8559 to load the array value by emitting a load on the foreach variable
8560 type. This was incorrect.
8562 We now emit the code to load an element using the the array
8563 variable type, and then we emit the conversion operator.
8567 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
8569 * attribute.cs: Avoid allocation of ArrayLists in the common case.
8571 2003-04-09 Miguel de Icaza <miguel@ximian.com>
8573 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
8574 test for protection before we test for signatures.
8576 (MethodSignature.ToString): implement.
8578 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
8579 to the case where we reduced into a LongConstant.
8581 * decl.cs (CheckAccessLevel): If the type is an array, we can not
8582 depend on whether the information is acurrate, because the
8583 Microsoft runtime will always claim that the array type is public,
8584 regardless of the real state.
8586 If the type is a pointer, another problem happens: the type is
8587 reported as non-public in Microsoft.
8589 In both cases we have to call CheckAccessLevel recursively with
8590 the underlying type as the argument to be tested.
8592 2003-04-08 Miguel de Icaza <miguel@ximian.com>
8594 * assign.cs (Assign.Emit): If we are dealing with a compound
8595 assignment expression, we should use the code path that stores the
8596 intermediate result in a temporary value. This fixes #40903.
8598 *expression.cs (Indirection.ToString): Provide ToString method for
8601 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
8603 * class.cs: Null out fields holding references to Block objects so
8604 they can be garbage collected.
8606 * expression.cs (OverloadResolve): Remove unused local.
8608 2003-04-07 Martin Baulig <martin@ximian.com>
8610 * codegen.cs (EmitContext.CurrentFile): New public field.
8611 (EmitContext.Mark): Use the CurrentFile to check whether the
8612 location is in the correct file.
8613 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
8615 2003-04-07 Martin Baulig <martin@ximian.com>
8617 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
8619 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
8620 location. [FIXME: The location argument which gets passed to this
8621 method is sometimes wrong!]
8623 2003-04-07 Nick Drochak <ndrochak@gol.com>
8625 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
8627 2003-04-07 Miguel de Icaza <miguel@ximian.com>
8629 * expression.cs (Indirection.EmitAssign): We were using the
8630 temporary, but returning immediately instead of continuing the
8633 2003-04-06 Martin Baulig <martin@ximian.com>
8635 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
8636 if it's a nested child, but also deriving from the outer class.
8639 * typemanager.cs (IsNestedChildOf): Make this work if it's a
8640 nested child, but also deriving from the outer class. See
8642 (FilterWithClosure): We may access private members of the outer
8643 class if we're a nested child and deriving from the outer class.
8644 (RealMemberLookup): Only set `closure_private_ok' if the
8645 `original_bf' contained BindingFlags.NonPublic.
8647 2003-04-05 Martin Baulig <martin@ximian.com>
8649 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
8651 2003-04-02 Miguel de Icaza <miguel@ximian.com>
8653 * class.cs (Event.Define): Do not allow abstract events to have
8656 2003-04-01 Miguel de Icaza <miguel@ximian.com>
8658 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
8659 block in event declarations.
8661 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
8662 value type, get its address.
8664 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
8665 leaving a class on the stack instead of a boolean value (int
8666 0/1). Change the code so we compare against null, and then the
8667 result against zero.
8669 * class.cs (TypeContainer.GetClassBases): We were checking for the
8670 parent class being sealed too late.
8672 * expression.cs (Binary.Emit): For <= and >= when dealing with
8673 floating point values, use cgt.un and clt.un instead of cgt and
8676 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
8678 * statement.cs: Apply the same optimization as MS: skip the
8679 GetEnumerator returning an IEnumerator, and use the one returning a
8680 CharEnumerator instead. This allows us to avoid the try-finally block
8683 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
8685 * cs-parser.jay: Attributes cannot be applied to
8686 namespaces. Fixes #40473
8688 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
8691 (Add*): check if the name is valid using the full name for constants,
8692 fields, properties and events.
8694 2003-03-28 Miguel de Icaza <miguel@ximian.com>
8696 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
8697 char constants to be part of the enumeration.
8699 * expression.cs (Conditional.DoResolve): Add support for operator
8700 true. Implements the missing functionality from 14.12
8702 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
8703 operator true/false as required by the spec.
8705 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
8706 implicit conversion to boolean.
8708 * statement.cs (Statement.ResolveBoolean): A boolean expression is
8709 also one where the type implements `operator true'.
8711 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
8712 get an expression that will invoke operator true based on an
8715 (GetConversionOperators): Removed the hack that called op_True
8718 (Expression.ResolveBoolean): Move this from Statement.
8720 2003-03-17 Miguel de Icaza <miguel@ximian.com>
8722 * ecore.cs (FieldExpr): do not allow initialization of initonly
8723 fields on derived classes
8725 2003-03-13 Martin Baulig <martin@ximian.com>
8727 * statement.cs (Block.Emit): Call ig.BeginScope() and
8728 ig.EndScope() when compiling with debugging info; call
8729 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
8731 2003-03-08 Miguel de Icaza <miguel@ximian.com>
8733 * expression.cs (Indexers): Do not construct immediately, allow
8734 for new members to be appended as we go. Fixes 38143
8736 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
8738 * expression.cs: save/restore context when resolving an unchecked
8741 2003-03-05 Miguel de Icaza <miguel@ximian.com>
8743 * cfold.cs: Catch division by zero in modulus operator during
8746 2003-03-03 Miguel de Icaza <miguel@ximian.com>
8748 * interface.cs (Interface.DefineMembers): Avoid defining members
8751 2003-02-27 Miguel de Icaza <miguel@ximian.com>
8753 * driver.cs: handle the +/- options for -noconfig
8755 * statement.cs (Unckeched.Resolve): Also track the state of
8756 unchecked in the Resolve phase.
8758 2003-02-27 Martin Baulig <martin@ximian.com>
8760 * ecore.cs (Expression.MemberLookup): Don't create a
8761 MethodGroupExpr for something which is not a method. Fixes #38291.
8763 2003-02-25 Miguel de Icaza <miguel@ximian.com>
8765 * class.cs (MemberBase.CheckParameters): Also check that the type
8766 is unmanaged if it is a pointer.
8768 * expression.cs (SizeOf.Resolve): Add location information.
8770 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
8771 a managed type is declared.
8773 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
8774 parameter modifiers as well. Fixes bug 38606
8776 * class.cs: Very sad. Am backing out the speed up changes
8777 introduced by the ArrayList -> Array in the TypeContainer, as they
8778 were not actually that much faster, and introduced a bug (no error
8779 reports on duplicated methods).
8781 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
8782 source first, this will guarantee that we have a valid expression
8783 before calling in lower levels functions that will require a
8784 resolved object. Then use this original_source in the
8785 target.ResolveLValue instead of the original source that was
8788 Another change. Use target.Resolve instead of LValueResolve.
8789 Although we are resolving for LValues, we will let the Assign code
8790 take care of that (it will be called again from Resolve). This
8791 basically allows code like this:
8793 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
8794 class Y { void A (X x) { x [0] += o; }
8796 The problem was that the indexer was trying to resolve for
8797 set_Item (idx, object o) and never finding one. The real set_Item
8798 was set_Item (idx, X). By delaying the process we get the right
8803 2003-02-23 Martin Baulig <martin@ximian.com>
8805 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
8806 while calling DoEmit ().
8808 * codegen.cs (EmitContext.Mark): Don't mark locations in other
8809 source files; if you use the #line directive inside a method, the
8810 compiler stops emitting line numbers for the debugger until it
8811 reaches the end of the method or another #line directive which
8812 restores the original file.
8814 2003-02-23 Martin Baulig <martin@ximian.com>
8816 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
8818 2003-02-23 Martin Baulig <martin@ximian.com>
8820 * statement.cs (Block.AddChildVariableNames): We need to call this
8821 recursively, not just for our immediate children.
8823 2003-02-23 Martin Baulig <martin@ximian.com>
8825 * class.cs (Event.Define): Always make the field private, like csc does.
8827 * typemanager.cs (TypeManager.RealMemberLookup): Make events
8828 actually work, fixes bug #37521.
8830 2003-02-23 Miguel de Icaza <miguel@ximian.com>
8832 * delegate.cs: When creating the various temporary "Parameters"
8833 classes, make sure that we call the ComputeAndDefineParameterTypes
8834 on those new parameters (just like we do with the formal ones), to
8835 allow them to be resolved in the context of the DeclSpace.
8837 This fixes the bug that Dick observed in Bugzilla #38530.
8839 2003-02-22 Miguel de Icaza <miguel@ximian.com>
8841 * expression.cs (ResolveMemberAccess): When resolving a constant,
8842 do not attempt to pull a constant if the value was not able to
8843 generate a valid constant.
8845 * const.cs (LookupConstantValue): Do not report more errors than required.
8847 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
8849 * expression.cs: fixes bug #38328.
8851 2003-02-18 Miguel de Icaza <miguel@ximian.com>
8853 * class.cs: Changed all the various members that can be part of a
8854 class from being an ArrayList to be an Array of the right type.
8855 During the DefineType type_list, interface_list, delegate_list and
8856 enum_list are turned into types, interfaces, delegates and enums
8859 And during the member population, indexer_list, event_list,
8860 constant_list, field_list, instance_constructor_list, method_list,
8861 operator_list and property_list are turned into their real arrays.
8863 Although we could probably perform this operation earlier, for
8864 good error reporting we need to keep the lists and remove the
8865 lists for longer than required.
8867 This optimization was triggered by Paolo profiling the compiler
8868 speed on the output of `gen-sample-program.pl' perl script.
8870 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
8871 not crash in methods like MemberLookupFailed that use this field.
8873 This problem arises when the compiler fails to resolve a type
8874 during interface type definition for example.
8876 2003-02-18 Miguel de Icaza <miguel@ximian.com>
8878 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
8879 inherit from System.Object, so we have to stop at null, not only
8880 when reaching System.Object.
8882 2003-02-17 Miguel de Icaza <miguel@ximian.com>
8884 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
8885 DeclaredOnly because the parent indexer might have had a different
8886 name, but did not loop until the top of the hierarchy was reached.
8888 The problem this one fixes is 35492: when a class implemented an
8889 indexer from an interface, we were getting the interface method
8890 (which was abstract) and we were flagging an error (can not invoke
8893 This also keeps bug 33089 functioning, and test-148 functioning.
8895 * typemanager.cs (IsSpecialMethod): The correct way of figuring
8896 out if a method is special is to see if it is declared in a
8897 property or event, or whether it is one of the predefined operator
8898 names. This should fix correctly #36804.
8900 2003-02-15 Miguel de Icaza <miguel@ximian.com>
8902 The goal here is to remove the dependency on EmptyCast.Peel ().
8903 Killing it completely.
8905 The problem is that currently in a number of places where
8906 constants are expected, we have to "probe" for an EmptyCast, and
8907 Peel, which is not the correct thing to do, as this will be
8908 repetitive and will likely lead to errors.
8910 The idea is to remove any EmptyCasts that are used in casts that
8911 can be reduced to constants, so we only have to cope with
8914 This bug hunt was triggered by Bug 37363 and the desire to remove
8915 the duplicate pattern where we were "peeling" emptycasts to check
8916 whether they were constants. Now constants will always be
8919 * ecore.cs: Use an enumconstant here instead of wrapping with
8922 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
8923 throwing me off. By handling this we can get rid of a few hacks.
8925 * statement.cs (Switch): Removed Peel() code.
8927 2003-02-14 Miguel de Icaza <miguel@ximian.com>
8929 * class.cs: Location information for error 508
8931 * expression.cs (New.DoResolve): Add a guard against double
8932 resolution of an expression.
8934 The New DoResolve might be called twice when initializing field
8935 expressions (see EmitFieldInitializers, the call to
8936 GetInitializerExpression will perform a resolve on the expression,
8937 and later the assign will trigger another resolution
8939 This leads to bugs (#37014)
8941 * delegate.cs: The signature for EndInvoke should contain any ref
8942 or out parameters as well. We were not doing this in the past.
8944 * class.cs (Field.Define): Do not overwrite the type definition
8945 inside the `volatile' group. Turns out that volatile enumerations
8946 were changing the type here to perform a validity test, which
8949 2003-02-12 Miguel de Icaza <miguel@ximian.com>
8951 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
8952 and structs, we do not want to load the instance variable
8954 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
8955 enum_type has to be handled like an object reference (implicit
8956 conversions exists from this to object), but the regular IsClass
8957 and IsValueType tests will never return true for this one.
8959 Also we use TypeManager.IsValueType instead of type.IsValueType,
8960 just for consistency with the rest of the code (this is only
8961 needed if we ever use the construct exposed by test-180.cs inside
8962 corlib, which we dont today).
8964 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
8966 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
8969 2003-02-09 Martin Baulig <martin@ximian.com>
8971 * namespace.cs (Namespace..ctor): Added SourceFile argument.
8972 (Namespace.DefineNamespaces): New static public method; this is
8973 called when we're compiling with debugging to add all namespaces
8976 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
8977 pass it to the Namespace's .ctor.
8979 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
8980 and MethodBase arguments; pass the namespace ID to the symwriter;
8981 pass the MethodBase instead of the token to the symwriter.
8982 (SymbolWriter.DefineNamespace): New method to add a namespace to
8985 2003-02-09 Martin Baulig <martin@ximian.com>
8987 * symbolwriter.cs: New file. This is a wrapper around
8988 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
8989 methods here in near future.
8991 2003-02-09 Martin Baulig <martin@ximian.com>
8993 * codegen.cs (EmitContext.Mark): Just pass the arguments to
8994 ILGenerator.MarkSequencePoint() which are actually used by the
8997 2003-02-09 Martin Baulig <martin@ximian.com>
8999 * location.cs (SourceFile): New public sealed class. This
9000 contains the name and an index which is used in the location's token.
9001 (Location): Reserve an appropriate number of bits in the token for
9002 the source file instead of walking over that list, this gives us a
9003 really huge performance improvement when compiling with debugging.
9005 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
9006 `SourceFile' argument instead of a string.
9007 (Driver.ProcessFile): Add all the files via Location.AddFile(),
9008 but don't parse/tokenize here, we need to generate the list of all
9009 source files before we do that.
9010 (Driver.ProcessFiles): New static function. Parses/tokenizes all
9013 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
9014 instead of a string.
9016 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
9019 2003-02-09 Martin Baulig <martin@ximian.com>
9021 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
9022 filename on `#line default'.
9024 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
9026 * statement.cs: don't clear the pinned var when the fixed statement
9027 returns from the method (fixes bug#37752).
9029 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
9031 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
9034 2003-02-07 Martin Baulig <martin@ximian.com>
9036 * driver.cs: Removed the `--debug-args' command line argument.
9038 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
9039 automatically by the AsssemblyBuilder.
9040 (CodeGen.InitializeSymbolWriter): We don't need to call any
9041 initialization function on the symbol writer anymore. This method
9042 doesn't take any arguments.
9044 2003-02-03 Miguel de Icaza <miguel@ximian.com>
9046 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
9047 from referenced assemblies as well.
9049 2003-02-02 Martin Baulig <martin@ximian.com>
9051 * class.cs (MethodData.Emit): Generate debugging info for external methods.
9053 2003-02-02 Martin Baulig <martin@ximian.com>
9055 * class.cs (Constructor.Emit): Open the symbol writer before
9056 emitting the constructor initializer.
9057 (ConstructorInitializer.Emit): Call ec.Mark() to allow
9058 single-stepping through constructor initializers.
9060 2003-01-30 Miguel de Icaza <miguel@ximian.com>
9062 * class.cs: Handle error 549: do not allow virtual methods in
9065 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
9067 * decl.cs: Check access levels when resolving types
9069 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
9071 * statement.cs: Add parameters and locals set in catch blocks that might
9072 return to set vector
9074 2003-01-29 Miguel de Icaza <miguel@ximian.com>
9076 * class.cs (Operator): Set the SpecialName flags for operators.
9078 * expression.cs (Invocation.DoResolve): Only block calls to
9079 accessors and operators on SpecialName methods.
9081 (Cast.TryReduce): Handle conversions from char constants.
9084 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
9086 * statement.cs: small memory and time optimization in FlowBranching.
9088 2003-01-28 Pedro Mart <yoros@wanadoo.es>
9090 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
9091 problem that the last fix but in the other sid (Set).
9093 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
9094 access when there is no indexer in the hierarchy.
9096 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
9098 * class.cs: Combine some if statements.
9100 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9102 * driver.cs: fixed bug #37187.
9104 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
9106 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
9107 any indexer, it's needed to build a list with all the indexers in the
9108 hierarchy (AllGetters), else we have problems. Fixes #35653.
9110 2003-01-23 Miguel de Icaza <miguel@ximian.com>
9112 * class.cs (MethodData.Define): It is wrong for an interface
9113 implementation to be static in both cases: explicit and implicit.
9114 We were only handling this in one case.
9116 Improve the if situation there to not have negations.
9118 * class.cs (Field.Define): Turns out that we do not need to check
9119 the unsafe bit on field definition, only on usage. Remove the test.
9121 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9123 * driver.cs: use assembly.Location instead of Codebase (the latest
9124 patch made mcs fail when using MS assemblies).
9126 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
9128 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
9129 get the path to *corlib.dll.
9131 2003-01-21 Nick Drochak <ndrochak@gol.com>
9135 * typemanager.cs: Remove compiler warnings
9137 2003-01-20 Duncan Mak <duncan@ximian.com>
9139 * AssemblyInfo.cs: Bump the version number to 0.19.
9141 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9143 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
9145 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
9147 * class.cs (Constructor::Emit): Emit debugging info for constructors.
9149 2003-01-17 Miguel de Icaza <miguel@ximian.com>
9151 * cs-parser.jay: Small fix: we were not comparing the constructor
9152 name correctly. Thanks to Zoltan for the initial pointer.
9154 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
9156 * cs-tokenizer.cs: Set file name when specified with #line
9158 2003-01-15 Miguel de Icaza <miguel@ximian.com>
9160 * cs-parser.jay: Only perform the constructor checks here if we
9161 are named like the class; This will help provider a better
9162 error. The constructor path is taken when a type definition is
9163 not found, but most likely the user forgot to add the type, so
9164 report that rather than the constructor error.
9166 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
9168 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
9171 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
9173 * cs-parser.jay: Add cleanup call.
9175 2003-01-13 Duncan Mak <duncan@ximian.com>
9177 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
9178 consistent with other methods.
9180 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
9182 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
9184 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
9186 * attribute.cs: only set GuidAttr to true when we have a
9189 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9193 * typemanager.cs: fixes to allow mcs compile corlib with the new
9194 Type.IsSubclassOf fix.
9196 2003-01-08 Miguel de Icaza <miguel@ximian.com>
9198 * expression.cs (LocalVariableReference.DoResolve): Classify a
9199 constant as a value, not as a variable. Also, set the type for
9202 * cs-parser.jay (fixed_statement): take a type instead of a
9203 pointer_type, so we can produce a better error message later.
9205 * statement.cs (Fixed.Resolve): Flag types that are not pointers
9208 (For.DoEmit): Make inifinite loops have a
9209 non-conditional branch back.
9211 (Fixed.DoEmit): First populate the pinned variables, then emit the
9212 statement, then clear the variables. Before I was emitting the
9213 code once for each fixed piece.
9216 2003-01-08 Martin Baulig <martin@ximian.com>
9218 * statement.cs (FlowBranching.MergeChild): A break in a
9219 SWITCH_SECTION does not leave a loop. Fixes #36155.
9221 2003-01-08 Martin Baulig <martin@ximian.com>
9223 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
9224 lives in the same number space than `param_map'. Fixes #36154.
9226 2003-01-07 Miguel de Icaza <miguel@ximian.com>
9228 * cs-parser.jay (constructor_declaration): Set the
9229 Constructor.ModFlags before probing for it. This makes the
9230 compiler report 514, 515 and 132 (the code was there, but got
9233 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
9234 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
9235 (GotoCase.Resolve): Set `Returns' to ALWAYS.
9237 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
9239 * enum.cs: create the enum static fields using the enum type.
9241 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
9243 * class.cs: don't try to create the ParamBuilder for the return
9244 type if it's not needed (and handle it breaking for the ms runtime
9247 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
9249 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
9251 2002-12-29 Miguel de Icaza <miguel@ximian.com>
9253 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
9254 the command. This showed up while compiling the JANET source
9255 code, which used \r as its only newline separator.
9257 2002-12-28 Miguel de Icaza <miguel@ximian.com>
9259 * class.cs (Method.Define): If we are an operator (because it
9260 reuses our code), then set the SpecialName and HideBySig. #36128
9262 2002-12-22 Miguel de Icaza <miguel@ximian.com>
9264 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
9265 exception, report error 120 `object reference required'.
9267 * driver.cs: Add --pause option, used during to measure the size
9268 of the process as it goes with --timestamp.
9270 * expression.cs (Invocation.DoResolve): Do not allow methods with
9271 SpecialName to be invoked.
9273 2002-12-21 Miguel de Icaza <miguel@ximian.com>
9275 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
9276 number before adding it.
9278 2002-12-21 Ravi Pratap <ravi@ximian.com>
9280 * ecore.cs (StandardImplicitConversion): When in an unsafe
9281 context, we allow conversion between void * to any other pointer
9282 type. This fixes bug #35973.
9284 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
9286 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
9287 is not thrown when extensionless outputs are used
9289 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9291 * rootcontext.cs: fixed compilation of corlib.
9293 2002-12-19 Miguel de Icaza <miguel@ximian.com>
9295 * attribute.cs (Attributes.Contains): Add new method.
9297 * class.cs (MethodCore.LabelParameters): if the parameter is an
9298 `out' parameter, check that no attribute `[In]' has been passed.
9300 * enum.cs: Handle the `value__' name in an enumeration.
9302 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
9304 * decl.cs: Added special case to allow overrides on "protected
9307 2002-12-18 Ravi Pratap <ravi@ximian.com>
9309 * attribute.cs (Attributes.AddAttributeSection): Rename to this
9310 since it makes much more sense.
9312 (Attributes.ctor): Don't require a Location parameter.
9314 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
9316 * attribute.cs (ApplyAttributes): Remove extra Location parameters
9317 since we already have that information per attribute.
9319 * everywhere : make appropriate changes.
9321 * class.cs (LabelParameters): Write the code which actually
9322 applies attributes to the return type. We can't do this on the MS
9323 .NET runtime so we flag a warning in the case an exception is
9326 2002-12-18 Miguel de Icaza <miguel@ximian.com>
9328 * const.cs: Handle implicit null conversions here too.
9330 2002-12-17 Ravi Pratap <ravi@ximian.com>
9332 * class.cs (MethodCore.LabelParameters): Remove the extra
9333 Type [] parameter since it is completely unnecessary. Instead
9334 pass in the method's attributes so that we can extract
9335 the "return" attribute.
9337 2002-12-17 Miguel de Icaza <miguel@ximian.com>
9339 * cs-parser.jay (parse): Use Report.Error to flag errors instead
9340 of ignoring it and letting the compile continue.
9342 * typemanager.cs (ChangeType): use an extra argument to return an
9343 error condition instead of throwing an exception.
9345 2002-12-15 Miguel de Icaza <miguel@ximian.com>
9347 * expression.cs (Unary.TryReduce): mimic the code for the regular
9348 code path. Perform an implicit cast in the cases where we can
9349 implicitly convert to one of the integral types, and then reduce
9350 based on that constant. This fixes bug #35483.
9352 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9354 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
9356 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9358 * namespace.cs: fixed bug #35489.
9360 2002-12-12 Miguel de Icaza <miguel@ximian.com>
9362 * class.cs: Remove some dead code.
9364 * cs-parser.jay: Estimate the number of methods needed
9365 (RootContext.MethodCount);
9367 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
9368 numbers instead of StringBuilders.
9370 * support.cs (PtrHashtable): Add constructor with initial size;
9371 We can now reduce reallocations of the method table.
9373 2002-12-10 Ravi Pratap <ravi@ximian.com>
9375 * attribute.cs (ApplyAttributes): Keep track of the emitted
9376 attributes on a per-target basis. This fixes bug #35413.
9378 2002-12-10 Miguel de Icaza <miguel@ximian.com>
9380 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
9381 default to the Windows 1252 encoding.
9383 (UnixParseOption): Support version, thanks to Alp for the missing
9386 * AssemblyInfo.cs: Add nice assembly information.
9388 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
9391 * cs-parser.jay: Allow a trailing comma before the close bracked
9392 in the attribute_section production.
9394 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
9395 address of the instance was being taken, I will take this out,
9396 because we take the address of the object immediately here.
9398 2002-12-09 Ravi Pratap <ravi@ximian.com>
9400 * typemanager.cs (AreMultipleAllowed): Take care of the most
9401 obvious case where attribute type is not in the current assembly -
9404 2002-12-08 Miguel de Icaza <miguel@ximian.com>
9406 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
9407 definitions, instead of doing that afterwards.
9409 Also we use a nice little hack, depending on the constructor, we
9410 know if we are a "composed" name or a simple name. Hence, we
9411 avoid the IndexOf test, and we avoid
9413 * codegen.cs: Add code to assist in a bug reporter to track down
9414 the source of a compiler crash.
9416 2002-12-07 Ravi Pratap <ravi@ximian.com>
9418 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
9419 types have been emitted for a given element and flag an error
9420 if something which does not have AllowMultiple set is used more
9423 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
9424 attribute types and their corresponding AllowMultiple properties
9426 (AreMultipleAllowed): Check the property for a given type.
9428 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
9429 property in the case we have a TypeContainer.
9431 (Attributes.AddAttribute): Detect duplicates and just skip on
9432 adding them. This trivial fix catches a pretty gross error in our
9433 attribute emission - global attributes were being emitted twice!
9435 Bugzilla bug #33187 is now fixed.
9437 2002-12-06 Miguel de Icaza <miguel@ximian.com>
9439 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
9442 * expression.cs (Binary.ResolveOperator): I can only use the
9443 Concat (string, string, string) and Concat (string, string,
9444 string, string) if the child is actually a concatenation of
9447 2002-12-04 Miguel de Icaza <miguel@ximian.com>
9449 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
9450 context where we need a 2-character lookahead.
9452 * pending.cs (PendingImplementation): Rework so we can keep track
9453 of interface types all the time, and flag those which were
9454 implemented by parents as optional.
9456 2002-12-03 Miguel de Icaza <miguel@ximian.com>
9458 * expression.cs (Binary.ResolveOperator): Use
9459 String.Concat(string,string,string) or
9460 String.Concat(string,string,string,string) when possible.
9462 * typemanager: More helper methods.
9465 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
9467 * pending.cs: remove the bogus return from GetMissingInterfaces()
9468 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
9470 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9472 * namespace.cs: avoid duplicated 'using xxx' being added to
9473 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
9474 when we get more than one 'using' statement for the same namespace.
9475 Report a CS0105 warning for it.
9477 2002-11-30 Miguel de Icaza <miguel@ximian.com>
9479 * cs-tokenizer.cs (consume_identifier): use read directly, instead
9480 of calling getChar/putback, uses internal knowledge of it.
9482 (xtoken): Reorder tokenizer so most common patterns are checked
9483 first. This reduces the compilation time in another 5% (from 8.11s
9484 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
9486 The parsing time is 22% of the compilation in mcs, and from that
9487 64% is spent on the tokenization process.
9489 I tried using a binary search for keywords, but this is slower
9490 than the hashtable. Another option would be to do a couple of
9493 * Not use a StringBuilder, instead use an array of chars,
9494 with a set value. Notice that this way we could catch
9495 the 645 error without having to do it *afterwards*.
9497 * We could write a hand-parser to avoid the hashtable
9498 compares altogether.
9500 The identifier consumption process takes 37% of the tokenization
9501 time. Another 15% is spent on is_number. 56% of the time spent
9502 on is_number is spent on Int64.Parse:
9504 * We could probably choose based on the string length to
9505 use Int32.Parse or Int64.Parse and avoid all the 64-bit
9508 Another 3% is spend on wrapping `xtoken' in the `token' function.
9510 Handle 0xa0 as whitespace (#34752)
9512 2002-11-26 Miguel de Icaza <miguel@ximian.com>
9514 * typemanager.cs (IsCLRType): New routine to tell whether a type
9515 is one of the builtin types.
9517 Maybe it needs to use TypeCodes to be faster. Maybe we could use
9518 typecode in more places instead of doing pointer comparissions.
9519 We could leverage some knowledge about the way the typecodes are
9522 New code to cache namespaces in assemblies, it is currently not
9523 invoked, to be used soon.
9525 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
9527 * expression.cs (Binary.ResolveOperator): specially handle
9528 strings, and do not perform user-defined operator overloading for
9531 2002-11-24 Miguel de Icaza <miguel@ximian.com>
9533 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
9534 internalcall as it is a pretty simple operation; Avoid whenever
9535 possible to call Char.IsLetter.
9537 (consume_identifier): Cut by half the number of
9538 hashtable calls by merging the is_keyword and GetKeyword behavior.
9540 Do not short-circuit, because if we do, we
9541 report errors (ie, #if false && true would produce an invalid
9545 2002-11-24 Martin Baulig <martin@ximian.com>
9547 * expression.cs (Cast.TryReduce): If we're in checked syntax,
9548 check constant ranges and report a CS0221. Fixes #33186.
9550 2002-11-24 Martin Baulig <martin@ximian.com>
9552 * cs-parser.jay: Make this work for uninitialized variable
9553 declarations in the `for' initializer. Fixes #32416.
9555 2002-11-24 Martin Baulig <martin@ximian.com>
9557 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
9558 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
9560 2002-11-24 Martin Baulig <martin@ximian.com>
9562 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
9563 argument; if true, we also check for user-defined conversions.
9564 This is only needed if both arguments are of a user-defined type.
9565 Fixes #30443, added test-175.cs.
9566 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
9568 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
9570 2002-11-24 Martin Baulig <martin@ximian.com>
9572 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
9573 function to get the store opcode.
9574 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
9575 only emit the Ldelema if the store opcode is Stobj. You must run
9576 both test-34 and test-167 to test this. Fixes #34529.
9578 2002-11-23 Martin Baulig <martin@ximian.com>
9580 * ecore.cs (Expression.MemberLookup): Added additional
9581 `qualifier_type' argument which is used when we're being called
9582 from MemberAccess.DoResolve() and null if we're called from a
9584 (Expression.MemberLookupFailed): New method to report errors; this
9585 does the CS1540 check and reports the correct error message.
9587 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
9588 argument for the CS1540 check and redone the way how we're dealing
9589 with private members. See the comment in the source code for details.
9590 (FilterWithClosure): Reverted this back to revision 1.197; renamed
9591 `closure_start_type' to `closure_qualifier_type' and check whether
9592 it's not null. It was not this filter being broken, it was just
9593 being called with the wrong arguments.
9595 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
9596 and pass it the correct `qualifier_type'; this also does the error
9599 2002-11-22 Miguel de Icaza <miguel@ximian.com>
9601 * expression.cs (Invocation.EmitParams): If the we are dealing
9602 with a non-built-in value type, load its address as well.
9604 (ArrayCreation): Use a a pretty constant instead
9605 of the hardcoded value 2. Use 6 instead of 2 for the number of
9606 static initializers.
9608 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
9609 because they are not really value types, just glorified integers.
9611 * driver.cs: Do not append .exe, the CSC compiler does not do it.
9613 * ecore.cs: Remove redundant code for enumerations, make them use
9614 the same code path as everything else, fixes the casting issue
9615 with enumerations in Windows.Forms.
9617 * attribute.cs: Do only cast to string if it is a string, the
9618 validation happens later.
9620 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
9621 people upgrade their corlibs.
9623 * ecore.cs: Oops, enumerations were not following the entire code path
9625 2002-11-21 Miguel de Icaza <miguel@ximian.com>
9627 * typemanager.cs (FilterWithClosure): Commented out the test for
9628 1540 in typemanager.cs, as it has problems when accessing
9629 protected methods from a parent class (see test-174.cs).
9631 * attribute.cs (Attribute.ValidateGuid): new method.
9632 (Attribute.Resolve): Use above.
9634 2002-11-19 Miguel de Icaza <miguel@ximian.com>
9636 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
9638 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
9639 handling for enumerations, as we only needed the TypeContainer
9640 functionality to begin with (this is required for the fix below to
9641 work for enums that reference constants in a container class for
9644 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
9646 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
9647 a valid TypeBuilder to perform lookups on.o
9649 * class.cs (InheritableMemberSignatureCompare): Use true in the
9650 call to GetGetMethod and GetSetMethod, because we are comparing
9651 the signature, and we need to get the methods *even* if they are
9654 (PropertyBase.CheckBase): ditto.
9656 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
9657 GotoCase.Resolve): Use Peel on EmpytCasts.
9659 * ecore.cs (EmptyCast): drop child, add Peel method.
9661 2002-11-17 Martin Baulig <martin@ximian.com>
9663 * ecore.cs (EmptyCast.Child): New public property.
9665 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
9666 label resolved to an EmptyCast. Fixes #34162.
9667 (GotoCase.Resolve): Likewise.
9668 (Block.EmitMeta): Likewise.
9670 2002-11-17 Martin Baulig <martin@ximian.com>
9672 * expression.cs (Invocation.BetterConversion): Prefer int over
9673 uint; short over ushort; long over ulong for integer literals.
9674 Use ImplicitConversionExists instead of StandardConversionExists
9675 since we also need to check for user-defined implicit conversions.
9676 Fixes #34165. Added test-173.cs.
9678 2002-11-16 Martin Baulig <martin@ximian.com>
9680 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
9681 with the `true' and `false' literals. Fixes #33151.
9683 2002-11-16 Martin Baulig <martin@ximian.com>
9685 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
9686 October 22nd; don't do the cs1540 check for static members.
9688 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
9689 now using our own filter here and doing the cs1540 check again.
9691 2002-11-16 Martin Baulig <martin@ximian.com>
9693 * support.cs (InternalParameters): Don't crash if we don't have
9694 any fixed parameters. Fixes #33532.
9696 2002-11-16 Martin Baulig <martin@ximian.com>
9698 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
9699 when looking up static methods to make this work on Windows.
9702 2002-11-16 Martin Baulig <martin@ximian.com>
9704 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
9705 a setter rather than using PropertyInfo.CanWrite.
9707 2002-11-15 Nick Drochak <ndrochak@gol.com>
9709 * class.cs: Allow acces to block member by subclasses. Fixes build
9712 2002-11-14 Martin Baulig <martin@ximian.com>
9714 * class.cs (Constructor.Emit): Added the extern/block check.
9717 2002-11-14 Martin Baulig <martin@ximian.com>
9719 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
9720 iteration while looking for indexers, this is needed because the
9721 indexer may have a different name in our base classes. Fixed the
9722 error reporting (no indexers at all, not get accessor, no
9723 overloaded match). Fixes bug #33089.
9724 (IndexerAccess.DoResolveLValue): Likewise.
9726 2002-11-14 Martin Baulig <martin@ximian.com>
9728 * class.cs (PropertyBase.CheckBase): Make this work for multiple
9729 indexers. Fixes the first part of bug #33089.
9730 (MethodSignature.InheritableMemberSignatureCompare): Added support
9733 2002-11-13 Ravi Pratap <ravi@ximian.com>
9735 * attribute.cs (Attribute.Resolve): Catch the
9736 NullReferenceException and report it since it isn't supposed to
9739 2002-11-12 Miguel de Icaza <miguel@ximian.com>
9741 * expression.cs (Binary.EmitBranchable): Also handle the cases for
9742 LogicalOr and LogicalAnd that can benefit from recursively
9743 handling EmitBranchable. The code now should be nice for Paolo.
9745 2002-11-08 Miguel de Icaza <miguel@ximian.com>
9747 * typemanager.cs (LookupType): Added a negative-hit hashtable for
9748 the Type lookups, as we perform quite a number of lookups on
9749 non-Types. This can be removed once we can deterministically tell
9750 whether we have a type or a namespace in advance.
9752 But this might require special hacks from our corlib.
9756 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
9757 and double which avoids a conversion from an integer to a double.
9759 * expression.cs: tiny optimization, avoid calling IsConstant,
9760 because it effectively performs the lookup twice.
9762 2002-11-06 Miguel de Icaza <miguel@ximian.com>
9764 But a bogus return here to keep the semantics of the old code
9765 until the Mono runtime is fixed.
9767 * pending.cs (GetMissingInterfaces): New method used to remove all
9768 the interfaces that are already implemented by our parent
9769 classes from the list of pending methods.
9771 * interface.cs: Add checks for calls after ResolveTypeExpr.
9773 2002-11-05 Miguel de Icaza <miguel@ximian.com>
9775 * class.cs (Class.Emit): Report warning 67: event not used if the
9776 warning level is beyond 3.
9778 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
9779 being a NullLiteral.
9781 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
9784 * class.cs (TypeContainer.GetClassBases): Cover a missing code
9785 path that might fail if a type can not be resolved.
9787 * expression.cs (Binary.Emit): Emit unsigned versions of the
9790 * driver.cs: use error 5.
9792 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
9794 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
9796 2002-11-01 Miguel de Icaza <miguel@ximian.com>
9798 * cs-parser.jay (switch_section): A beautiful patch from Martin
9799 Baulig that fixed 33094.
9801 2002-10-31 Miguel de Icaza <miguel@ximian.com>
9803 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
9804 Check whether the base is abstract and report an error if so.
9806 * expression.cs (IndexerAccess.DoResolveLValue,
9807 IndexerAccess.DoResolve): ditto.
9809 (Invocation.DoResolve): ditto.
9811 (Invocation.FullMethodDesc): Improve the report string.
9813 * statement.cs (Block): Eliminate IsVariableDefined as it is
9814 basically just a wrapper for GetVariableInfo.
9816 * ecore.cs (SimpleName): Use new
9818 * support.cs (ReflectionParamter.ParameterType): We unwrap the
9819 type, as we return the actual parameter ref/unref state on a
9822 2002-10-30 Miguel de Icaza <miguel@ximian.com>
9824 * support.cs: Return proper flags REF/OUT fixing the previous
9827 * expression.cs: Reverted last patch, that was wrong. Is_ref is
9828 not used to mean `ref' but `ref or out' in ParameterReference
9830 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
9831 full type signature instead of calling TypeManger.CSharpName
9834 * support.cs (InternalParameters.ParameterDesc): Do not compare
9835 directly to the modflags, because REF/OUT will actually be bitsets
9838 * delegate.cs (VerifyMethod): Check also the modifiers.
9840 * cs-tokenizer.cs: Fix bug where floating point values with an
9841 exponent where a sign was missing was ignored.
9843 * driver.cs: Allow multiple assemblies to be specified in a single
9846 2002-10-28 Miguel de Icaza <miguel@ximian.com>
9848 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
9849 because identifiers after a parenthesis would end up in this kind
9850 of production, and we needed to desamiguate it for having casts
9853 (UserDefinedType *) xxx
9855 2002-10-24 Miguel de Icaza <miguel@ximian.com>
9857 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
9858 we should set on the Bindingflags.NonPublic, but not turn on
9859 private_ok. private_ok controls whether a Private member is
9860 returned (this is chekced on the filter routine), while the
9861 BindingFlags.NonPublic just controls whether private/protected
9862 will be allowed. This fixes the problem part of the problem of
9863 private properties being allowed to be used in derived classes.
9865 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
9866 so we can call the children DoResolveLValue method (this will
9867 properly signal errors on lvalue assignments to base properties)
9869 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
9870 getter are null, and we have a property info, we know that this
9871 happened because the lookup failed, so we report an error 122 for
9872 protection level violation.
9874 We also silently return if setter and getter are null in the
9875 resolve functions, this condition only happens if we have flagged
9876 the error before. This is the other half of the problem.
9878 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
9879 not have accessibility information, that is why we were returning
9880 true in the filter function in typemanager.cs.
9882 To properly report 122 (property is inaccessible because of its
9883 protection level) correctly, we report this error in ResolveAccess
9884 by failing if both the setter and the getter are lacking (ie, the
9887 DoResolve and DoLResolve have been modified to check for both
9888 setter/getter being null and returning silently, the reason being
9889 that I did not want to put the knowledge about this error in upper
9892 int old = Report.Errors;
9893 x = new PropertyExpr (...);
9894 if (old != Report.Errors)
9899 So the property expr is returned, but it is invalid, so the error
9900 will be flagged during the resolve process.
9902 * class.cs: Remove InheritablePropertySignatureCompare from the
9903 class, as we no longer depend on the property signature to compute
9904 whether it is possible to implement a method or not.
9906 The reason is that calling PropertyInfo.GetGetMethod will return
9907 null (in .NET, in Mono it works, and we should change this), in
9908 cases where the Get Method does not exist in that particular
9913 class X { public virtual int A { get { return 1; } } }
9915 class Z : Y { public override int A { get { return 2; } } }
9917 Would fail in Z because the parent (Y) would not have the property
9918 defined. So we avoid this completely now (because the alternative
9919 fix was ugly and slow), and we now depend exclusively on the
9922 (PropertyBase.CheckBase): Use a method-base mechanism to find our
9923 reference method, instead of using the property.
9925 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
9926 routines are gone now.
9928 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
9929 names, they were incorrectly named.
9931 * cs-tokenizer.cs: Return are more gentle token on failure.
9933 * pending.cs (PendingImplementation.InterfaceMethod): This routine
9934 had an out-of-sync index variable, which caused it to remove from
9935 the list of pending methods the wrong method sometimes.
9937 2002-10-22 Miguel de Icaza <miguel@ximian.com>
9939 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
9940 CanWrite, because those refer to this particular instance of the
9941 property, and do not take into account the fact that we can
9942 override single members of a property.
9944 Constructor requires an EmitContext. The resolution process does
9945 not happen here, but we need to compute the accessors before,
9946 because the resolution does not always happen for properties.
9948 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
9949 subclass, before we did not update this flag, but we did update
9952 (GetAccessors): Drop this routine, as it did not work in the
9953 presence of partially overwritten set/get methods.
9955 Notice that this broke the cs1540 detection, but that will require
9958 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9962 * driver.cs: issue a warning instead of an error if we don't support
9963 debugging for the platform. Also ignore a couple of errors that may
9964 arise when trying to write the symbols. Undo my previous patch.
9966 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9968 * driver.cs: ignore /debug switch except for Unix platforms.
9970 2002-10-23 Nick Drochak <ndrochak@gol.com>
9972 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
9974 2002-10-21 Miguel de Icaza <miguel@ximian.com>
9976 * driver.cs: Do not make mcs-debug conditional, so we do not break
9979 * statement.cs (UsageVector.MergeChildren): I would like Martin to
9980 review this patch. But basically after all the children variables
9981 have been merged, the value of "Breaks" was not being set to
9982 new_breaks for Switch blocks. I think that it should be set after
9983 it has executed. Currently I set this to the value of new_breaks,
9984 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
9985 conservative, but I do not understand this code very well.
9987 I did not break anything in the build, so that is good ;-)
9989 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
9991 2002-10-20 Mark Crichton <crichton@gimp.org>
9993 * cfold.cs: Fixed compile blocker. Really fixed it this time.
9995 2002-10-20 Nick Drochak <ndrochak@gol.com>
9997 * cfold.cs: Fixed compile blocker.
9999 2002-10-20 Miguel de Icaza <miguel@ximian.com>
10001 * driver.cs: I was chekcing the key, not the file.
10003 2002-10-19 Ravi Pratap <ravi@ximian.com>
10005 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
10006 message that we were generating - we just need to silently return
10009 2002-10-19 Miguel de Icaza <miguel@ximian.com>
10011 * class.cs (Event.Define): Change my previous commit, as this
10012 breaks the debugger. This is a temporary hack, as it seems like
10013 the compiler is generating events incorrectly to begin with.
10015 * expression.cs (Binary.ResolveOperator): Added support for
10016 "U operator - (E x, E y)"
10018 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
10021 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
10022 init-only variables, but this path did not take into account that
10023 there might be also instance readonly variables. Correct this
10026 This fixes bug 32253
10028 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
10031 * driver.cs: Change the extension for modules to `netmodule'
10033 * cs-parser.jay: Improved slightly the location tracking for
10034 the debugger symbols.
10036 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
10037 modifiers that were specified instead of the hardcoded value
10038 (FamAndAssem). This was basically ignoring the static modifier,
10039 and others. Fixes 32429.
10041 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
10042 fixed a bug in the process (32476)
10044 * expression.cs (ArrayAccess.EmitAssign): Patch from
10045 hwang_rob@yahoo.ca that fixes bug 31834.3
10047 2002-10-18 Miguel de Icaza <miguel@ximian.com>
10049 * driver.cs: Make the module extension .netmodule.
10051 2002-10-16 Miguel de Icaza <miguel@ximian.com>
10053 * driver.cs: Report an error if the resource file is not found
10054 instead of crashing.
10056 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
10057 false, like Emit does.
10059 2002-10-16 Nick Drochak <ndrochak@gol.com>
10061 * typemanager.cs: Remove unused private member. Also reported mcs
10062 bug to report this as a warning like csc.
10064 2002-10-15 Martin Baulig <martin@gnome.org>
10066 * statement.cs (Statement.Emit): Made this a virtual method; emits
10067 the line number info and calls DoEmit().
10068 (Statement.DoEmit): New protected abstract method, formerly knows
10069 as Statement.Emit().
10071 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
10073 2002-10-11 Miguel de Icaza <miguel@ximian.com>
10075 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
10076 have fixed a remaining problem: not every AddXXXX was adding a
10077 fully qualified name.
10079 Now everyone registers a fully qualified name in the DeclSpace as
10080 being defined instead of the partial name.
10082 Downsides: we are slower than we need to be due to the excess
10083 copies and the names being registered this way.
10085 The reason for this is that we currently depend (on the corlib
10086 bootstrap for instance) that types are fully qualified, because
10087 we dump all the types in the namespace, and we should really have
10088 types inserted into the proper namespace, so we can only store the
10089 basenames in the defined_names array.
10091 2002-10-10 Martin Baulig <martin@gnome.org>
10093 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
10094 from bug #31834, see the bug report for a testcase which is
10097 2002-10-10 Martin Baulig <martin@gnome.org>
10099 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
10100 flow analysis code for this.
10102 * statement.cs (Do, While, For): Tell the flow analysis code about
10104 (FlowBranching.UsageVector): Added support for infinite loops.
10105 (Block.Resolve): Moved the dead code elimination here and use flow
10108 2002-10-09 Miguel de Icaza <miguel@ximian.com>
10110 * class.cs (Field.Define): Catch cycles on struct type
10113 * typemanager.cs (IsUnmanagedtype): Do not recursively check
10114 fields if the fields are static. We only need to check instance
10117 * expression.cs (As.DoResolve): Test for reference type.
10119 * statement.cs (Using.ResolveExpression): Use
10120 ConvertImplicitRequired, not ConvertImplicit which reports an
10122 (Using.ResolveLocalVariableDecls): ditto.
10124 * expression.cs (Binary.ResolveOperator): Report errors in a few
10125 places where we had to.
10127 * typemanager.cs (IsUnmanagedtype): Finish implementation.
10129 2002-10-08 Miguel de Icaza <miguel@ximian.com>
10131 * expression.cs: Use StoreFromPtr instead of extracting the type
10132 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
10134 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
10135 an enumeration value to a System.Enum, but System.Enum is not a
10136 value type, but an class type, so we need to box.
10138 (Expression.ConvertExplicit): One codepath could return
10139 errors but not flag them. Fix this. Fixes #31853
10141 * parameter.cs (Resolve): Do not allow void as a parameter type.
10143 2002-10-06 Martin Baulig <martin@gnome.org>
10145 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
10146 if it's a class type and not a struct. Fixes #31815.
10148 2002-10-06 Martin Baulig <martin@gnome.org>
10150 * statement.cs: Reworked the flow analysis code a bit to make it
10151 usable for dead code elimination.
10153 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10155 * cs-parser.jay: allow empty source files. Fixes bug #31781.
10157 2002-10-04 Miguel de Icaza <miguel@ximian.com>
10159 * expression.cs (ComposedCast.DoResolveType): A quick workaround
10160 to fix the test 165, will investigate deeper.
10162 2002-10-04 Martin Baulig <martin@gnome.org>
10164 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
10165 finally blocks actually work.
10166 (Try.Resolve): We don't need to create a sibling for `finally' if
10167 there is no finally block.
10169 2002-10-04 Martin Baulig <martin@gnome.org>
10171 * class.cs (Constructor.Define): The default accessibility for a
10172 non-default constructor is private, not public.
10174 2002-10-04 Miguel de Icaza <miguel@ximian.com>
10176 * class.cs (Constructor): Make AllowedModifiers public, add
10179 * cs-parser.jay: Perform the modifiers test here, as the
10180 constructor for the Constructor class usually receives a zero
10181 because of the way we create it (first we create, later we
10182 customize, and we were never checking the modifiers).
10184 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
10185 is a version of LookupTypeReflection that includes the type-name
10186 cache. This can be used as a fast path for functions that know
10187 the fully qualified name and are only calling into *.GetType() to
10188 obtain a composed type.
10190 This is also used by TypeManager.LookupType during its type
10193 (LookupType): We now also track the real type name, as sometimes
10194 we can get a quey for the real type name from things like
10195 ComposedCast. This fixes bug 31422.
10197 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
10198 complete type fullname, it does not have to go through the type
10199 resolution system to obtain the composed version of the type (for
10200 obtaining arrays or pointers).
10202 (Conditional.Emit): Use the EmitBoolExpression to
10203 generate nicer code, as requested by Paolo.
10205 (ArrayCreation.CheckIndices): Use the patch from
10206 hwang_rob@yahoo.ca to validate the array initializers.
10208 2002-10-03 Miguel de Icaza <miguel@ximian.com>
10210 * class.cs (ConstructorInitializer.Emit): simplify code by using
10211 Invocation.EmitCall, and at the same time, fix the bugs in calling
10212 parent constructors that took variable arguments.
10214 * ecore.cs (Expression.ConvertNumericExplicit,
10215 Expression.ImplicitNumericConversion): Remove the code that
10216 manually wrapped decimal (InternalTypeConstructor call is now gone
10219 * expression.cs (Cast.TryReduce): Also handle decimal types when
10220 trying to perform a constant fold on the type.
10222 * typemanager.cs (IsUnmanagedtype): Partially implemented.
10224 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
10225 that only turned off an error report, and did nothing else.
10227 2002-10-02 Miguel de Icaza <miguel@ximian.com>
10229 * driver.cs: Handle and ignore /fullpaths
10231 2002-10-01 Miguel de Icaza <miguel@ximian.com>
10233 * expression.cs (Binary.ResolveOperator): Catch the case where
10234 DoNumericPromotions returns true,
10236 (Binary.DoNumericPromotions): Simplify the code, and the tests.
10238 2002-09-27 Miguel de Icaza <miguel@ximian.com>
10240 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
10243 2002-09-26 Miguel de Icaza <miguel@ximian.com>
10245 * ecore.cs (ConvertNumericExplicit): It is not enough that the
10246 conversion exists, but it is also required that the conversion be
10247 performed. This manifested in "(Type64Enum) 2".
10249 * class.cs (TypeManager.AddMethod): The fix is not to change
10250 AddEnum, because that one was using a fully qualified name (every
10251 DeclSpace derivative does), but to change the AddMethod routine
10252 that was using an un-namespaced name. This now correctly reports
10253 the duplicated name.
10255 Revert patch until I can properly fix it. The issue
10256 is that we have a shared Type space across all namespaces
10257 currently, which is wrong.
10259 Options include making the Namespace a DeclSpace, and merge
10260 current_namespace/current_container in the parser.
10262 2002-09-25 Miguel de Icaza <miguel@ximian.com>
10264 * cs-parser.jay: Improve error reporting when we get a different
10265 kind of expression in local_variable_type and
10266 local_variable_pointer_type.
10268 Propagate this to avoid missleading errors being reported.
10270 * ecore.cs (ImplicitReferenceConversion): treat
10271 TypeManager.value_type as a target just like object_type. As
10276 Is valid, and needs to result in the int 1 being boxed before it
10277 is assigned to the value type v.
10279 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
10280 to validate the enumeration name.
10282 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
10283 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
10284 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
10286 * ecore.cs (TryImplicitIntConversion): When doing an
10287 implicit-enumeration-conversion, check if the type is 64-bits and
10288 perform a conversion before passing to EnumConstant.
10290 2002-09-23 Miguel de Icaza <miguel@ximian.com>
10292 * decl.cs (Error_AmbiguousTypeReference); New routine used to
10293 report ambiguous type references. Unlike the MS version, we
10294 report what the ambiguity is. Innovation at work ;-)
10296 (DeclSpace.FindType): Require a location argument to
10297 display when we display an ambiguous error.
10299 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
10301 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
10303 * expression.cs (EmitDynamicInitializers): Apply patch from
10304 hwang_rob@yahoo.ca that fixes the order in which we emit our
10307 2002-09-21 Martin Baulig <martin@gnome.org>
10309 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
10310 delegate takes no arguments.
10312 2002-09-20 Miguel de Icaza <miguel@ximian.com>
10314 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
10317 * expression.cs: Extract the underlying type.
10319 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
10321 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
10323 2002-09-19 Miguel de Icaza <miguel@ximian.com>
10325 * class.cs (TypeContainer.DefineType): We can not use the nice
10326 PackingSize with the size set to 1 DefineType method, because it
10327 will not allow us to define the interfaces that the struct
10330 This completes the fixing of bug 27287
10332 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
10333 means also structs. This fixes part of the problem.
10334 (Expresion.ImplicitReferenceConversionExists): ditto.
10336 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
10337 error if there were no errors reported during the type lookup
10338 process, to avoid duplicates or redundant errors. Without this
10339 you would get an ambiguous errors plus a type not found. We have
10340 beaten the user enough with the first error.
10342 (DeclSparce.FindType): Emit a warning if we have an ambiguous
10345 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
10346 during the resolution process, stop the lookup, this avoids
10347 repeated error reports (same error twice).
10349 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
10351 * typemanager.cs (LookupType): Redo the type lookup code to match
10352 the needs of System.Reflection.
10354 The issue is that System.Reflection requires references to nested
10355 types to begin with a "+" sign instead of a dot. So toplevel
10356 types look like: "NameSpace.TopLevelClass", and nested ones look
10357 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
10360 2002-09-19 Martin Baulig <martin@gnome.org>
10362 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
10363 says that a method always returns or always throws an exception,
10364 don't report the CS0161.
10366 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
10367 set `Returns = new_returns'.
10369 2002-09-19 Martin Baulig <martin@gnome.org>
10371 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
10372 to an enum constant, check for a CS0176.
10374 2002-09-18 Miguel de Icaza <miguel@ximian.com>
10376 * class.cs (TypeContainer.CheckPairedOperators): Now we check
10377 for operators that must be in pairs and report errors.
10379 * ecore.cs (SimpleName.DoResolveType): During the initial type
10380 resolution process, when we define types recursively, we must
10381 check first for types in our current scope before we perform
10382 lookups in the enclosing scopes.
10384 * expression.cs (MakeByteBlob): Handle Decimal blobs.
10386 (Invocation.VerifyArgumentsCompat): Call
10387 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
10388 I thought we were supposed to always call this, but there are a
10389 few places in the code where we dont do it.
10391 2002-09-17 Miguel de Icaza <miguel@ximian.com>
10393 * driver.cs: Add support in -linkres and -resource to specify the
10394 name of the identifier.
10396 2002-09-16 Miguel de Icaza <miguel@ximian.com>
10398 * ecore.cs (StandardConversionExists): Sync with the conversion
10399 code: allow anything-* to void* conversions.
10401 (FindMostSpecificSource): Use an Expression argument
10402 instead of a Type, because we might be handed over a Literal which
10403 gets a few more implicit conversions that plain types do not. So
10404 this information was being lost.
10406 Also, we drop the temporary type-holder expression when not
10409 2002-09-17 Martin Baulig <martin@gnome.org>
10411 * class.cs (PropertyBase.CheckBase): Don't check the base class if
10412 this is an explicit interface implementation.
10414 2002-09-17 Martin Baulig <martin@gnome.org>
10416 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
10417 different `IndexerName' attributes.
10419 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
10420 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
10421 virtual CommonResolve().
10423 2002-09-16 Miguel de Icaza <miguel@ximian.com>
10425 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
10426 and convert that to the UnderlyingType.
10428 * statement.cs (Foreach.Resolve): Indexers are just like variables
10429 or PropertyAccesses.
10431 * cs-tokenizer.cs (consume_string): Track line numbers and columns
10432 inside quoted strings, we were not doing this before.
10434 2002-09-16 Martin Baulig <martin@gnome.org>
10436 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
10437 resolve it. This is needed for the definite assignment check of the
10438 instance expression, fixes bug #29846.
10439 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
10441 2002-09-16 Nick Drochak <ndrochak@gol.com>
10443 * parameter.cs: Fix compile error. Cannot reference static member
10444 from an instance object. Is this an mcs bug?
10446 2002-09-14 Martin Baulig <martin@gnome.org>
10448 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
10449 multiple times. Fixes bug #30295, added test-166.cs.
10451 2002-09-14 Martin Baulig <martin@gnome.org>
10453 * statement.cs (Block.Emit): Don't emit unreachable code.
10454 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
10455 `break' statements.
10456 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
10458 2002-09-14 Martin Baulig <martin@gnome.org>
10460 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
10463 2002-09-14 Martin Baulig <martin@gnome.org>
10465 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
10466 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
10467 be false on the ms runtime.
10469 2002-09-13 Martin Baulig <martin@gnome.org>
10471 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
10472 the CS0038 error message.
10474 2002-09-12 Miguel de Icaza <miguel@ximian.com>
10476 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
10477 constant inside, return it.
10479 2002-09-12 Martin Baulig <martin@gnome.org>
10481 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
10482 implicit conversion can be done between enum types.
10484 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
10485 check whether an implicit conversion to the current enum's UnderlyingType
10486 exists and report an error if not.
10488 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
10489 without debugging support.
10491 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
10492 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
10494 2002-09-12 Martin Baulig <martin@gnome.org>
10496 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
10498 * ecore.cs (IMemberExpr.DeclaringType): New property.
10499 (SimpleName.SimpleNameResolve): Check whether we're accessing a
10500 nonstatic member of an outer type (CS0038).
10502 2002-09-11 Miguel de Icaza <miguel@ximian.com>
10504 * driver.cs: Activate the using-error detector at warning level
10505 4 (at least for MS-compatible APIs).
10507 * namespace.cs (VerifyUsing): Small buglett fix.
10509 * pending.cs (PendingImplementation): pass the container pointer.
10511 * interface.cs (GetMethods): Allow for recursive definition. Long
10512 term, I would like to move every type to support recursive
10513 definitions, not the current ordering mechanism that we have right
10516 The situation is this: Attributes are handled before interfaces,
10517 so we can apply attributes to interfaces. But some attributes
10518 implement interfaces, we will now handle the simple cases
10519 (recursive definitions will just get an error).
10521 * parameter.cs: Only invalidate types at the end if we fail to
10524 2002-09-09 Martin Baulig <martin@gnome.org>
10526 * ecore.cs (PropertyExpr.Emit): Also check for
10527 TypeManager.system_int_array_get_length so this'll also work when
10528 compiling corlib. Fixes #30003.
10530 2002-09-09 Martin Baulig <martin@gnome.org>
10532 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
10533 and throw an exception if we can't get the type's size. Fixed #30040,
10536 2002-09-09 Martin Baulig <martin@gnome.org>
10538 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
10540 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
10541 context. Fixes bug #30027.
10543 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
10544 virtual functions. Fixes bug #30043, added test-164.cs.
10546 2002-09-08 Ravi Pratap <ravi@ximian.com>
10548 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
10550 2002-09-08 Nick Drochak <ndrochak@gol.com>
10552 * driver.cs: Use an object to get the windows codepage since it's not a
10555 2002-09-08 Miguel de Icaza <miguel@ximian.com>
10557 * statement.cs (For.Emit): for infinite loops (test == null)
10558 return whether there is a break inside, not always "true".
10560 * namespace.cs (UsingEntry): New struct to hold the name of the
10561 using definition, the location where it is defined, and whether it
10562 has been used in a successful type lookup.
10564 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
10569 2002-09-06 Ravi Pratap <ravi@ximian.com>
10571 * attribute.cs : Fix incorrect code which relied on catching
10572 a NullReferenceException to detect a null being passed in
10573 where an object was expected.
10575 2002-09-06 Miguel de Icaza <miguel@ximian.com>
10577 * statement.cs (Try): flag the catch variable as assigned
10579 * expression.cs (Cast): Simplified by using ResolveType instead of
10580 manually resolving.
10582 * statement.cs (Catch): Fix bug by using ResolveType.
10584 2002-09-06 Ravi Pratap <ravi@ximian.com>
10586 * expression.cs (BetterConversion): Special case for when we have
10587 a NullLiteral as the argument and we have to choose between string
10588 and object types - we choose string the way csc does.
10590 * attribute.cs (Attribute.Resolve): Catch the
10591 NullReferenceException and report error #182 since the Mono
10592 runtime no more has the bug and having this exception raised means
10593 we tried to select a constructor which takes an object and is
10596 2002-09-05 Ravi Pratap <ravi@ximian.com>
10598 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
10599 message (1502, 1503) when we can't locate a method after overload
10600 resolution. This is much more informative and closes the bug
10603 * interface.cs (PopulateMethod): Return if there are no argument
10604 types. Fixes a NullReferenceException bug.
10606 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
10607 expressions too. Previously we were checking only in one place for
10608 positional arguments leaving out named arguments.
10610 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
10611 type to the enum type is not allowed. Remove code corresponding to
10614 (ConvertNumericExplicit): Allow explicit conversions from
10615 the underlying type to enum type. This precisely follows the spec
10616 and closes a bug filed by Gonzalo.
10618 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10621 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
10623 2002-09-03 Miguel de Icaza <miguel@ximian.com>
10625 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
10626 it was important that we stored the right value after the
10627 reduction in `converted'.
10629 2002-09-04 Martin Baulig <martin@gnome.org>
10631 * location.cs (Location.SymbolDocument): Use full pathnames for the
10634 2002-08-30 Miguel de Icaza <miguel@ximian.com>
10636 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
10637 of the expression resolve mechanism, because that will catch the
10638 SimpleName error failures.
10640 (Conditional): If we can not resolve the
10641 expression, return, do not crash.
10643 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10646 (location): display token name instead of its number.
10648 2002-08-28 Martin Baulig <martin@gnome.org>
10650 * expression.cs (Binary.ResolveOperator): Don't silently return
10651 but return an error if an operator cannot be applied between two
10654 2002-08-28 Martin Baulig <martin@gnome.org>
10656 * class.cs (Constructor.Define): Set the permission attributes
10657 correctly instead of making all constructors public.
10659 2002-08-28 Martin Baulig <martin@gnome.org>
10661 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
10662 for private members before reporting a CS0103; if we find anything,
10665 2002-08-28 Martin Baulig <martin@gnome.org>
10667 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
10668 to check whether `closure_start_type == closure_invocation_type',
10669 we also need to check whether `m.DeclaringType == closure_invocation_type'
10670 before bypassing the permission checks. We might be accessing
10671 protected/private members from the base class.
10672 (TypeManager.RealMemberLookup): Only set private_ok if private
10673 members were requested via BindingFlags.NonPublic.
10675 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
10677 * expression.cs (MemberAccess.ResolveMemberAccess): Set
10678 MethodGroupExpr.IsExplicitImpl if appropriate.
10679 (Invocation.DoResolve): Don't report the CS0120 for explicit
10680 interface implementations.
10682 2002-08-27 Martin Baulig <martin@gnome.org>
10684 * expression.cs (Invocation.DoResolve): If this is a static
10685 method and we don't have an InstanceExpression, we must report
10688 2002-08-25 Martin Baulig <martin@gnome.org>
10690 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
10691 `==' between a valuetype and an object.
10693 2002-08-25 Miguel de Icaza <miguel@ximian.com>
10695 * ecore.cs (TypeExpr): Provide a ToString method.
10697 2002-08-24 Martin Baulig <martin@gnome.org>
10699 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
10700 now called proggie.dbg and it's a binary file.
10702 2002-08-23 Martin Baulig <martin@gnome.org>
10704 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
10706 2002-08-23 Martin Baulig <martin@gnome.org>
10708 * struct.cs (MyStructInfo.ctor): Make this work with empty
10709 structs; it's not allowed to use foreach() on null.
10711 2002-08-23 Martin Baulig <martin@gnome.org>
10713 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
10714 writer the full pathname of the generated assembly.
10716 2002-08-23 Martin Baulig <martin@gnome.org>
10718 * statements.cs (FlowBranching.UsageVector.MergeChildren):
10719 A `finally' block never returns or breaks; improved handling of
10722 2002-08-23 Martin Baulig <martin@gnome.org>
10724 * statement.cs (Throw.Resolve): Allow `throw null'.
10726 2002-08-23 Martin Baulig <martin@gnome.org>
10728 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
10729 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
10730 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
10731 MemberLookup would return a wrong event if this is an explicit
10732 interface implementation and the class has an event with the same
10735 2002-08-23 Martin Baulig <martin@gnome.org>
10737 * statement.cs (Block.AddChildVariableNames): New public method.
10738 (Block.AddChildVariableName): Likewise.
10739 (Block.IsVariableNameUsedInChildBlock): Likewise.
10740 (Block.AddVariable): Check whether a variable name has already
10741 been used in a child block.
10743 * cs-parser.jay (declare_local_variables): Mark all variable names
10744 from the current block as being used in a child block in the
10747 2002-08-23 Martin Baulig <martin@gnome.org>
10749 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
10750 find the symbol writer.
10752 * driver.cs: csc also allows the arguments to /define being
10753 separated by commas, not only by semicolons.
10755 2002-08-23 Martin Baulig <martin@gnome.org>
10757 * interface.cs (Interface.GetMembers): Added static check for events.
10759 2002-08-15 Martin Baulig <martin@gnome.org>
10761 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
10762 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
10764 * ecore.cs (Expression.MemberLookup): Added documentation and explained
10765 why the MethodData.EmitDestructor() change was necessary.
10767 2002-08-20 Martin Baulig <martin@gnome.org>
10769 * class.cs (TypeContainer.FindMembers): Added static check for events.
10771 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
10773 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
10774 use Type.GetEvents(), not Type.FindMembers().
10776 2002-08-20 Martin Baulig <martin@gnome.org>
10778 * decl.cs (MemberCache): Added a special method cache which will
10779 be used for method-only searched. This ensures that a method
10780 search will return a MethodInfo with the correct ReflectedType for
10783 2002-08-20 Martin Baulig <martin@gnome.org>
10785 * decl.cs (DeclSpace.FindMembers): Made this public.
10787 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10789 * delegate.cs: fixed build on windows.
10790 [FIXME: Filed as bug #29150: MCS must report these errors.]
10792 2002-08-19 Ravi Pratap <ravi@ximian.com>
10794 * ecore.cs (StandardConversionExists): Return a false
10795 if we are trying to convert the void type to anything else
10796 since that is not allowed.
10798 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
10799 we flag error 70 in the event an event is trying to be accessed
10800 directly from outside the declaring type.
10802 2002-08-20 Martin Baulig <martin@gnome.org>
10804 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
10805 MemberCache from typemanager.cs to decl.cs.
10807 2002-08-19 Martin Baulig <martin@gnome.org>
10809 * class.cs (TypeContainer): Implement IMemberContainer.
10810 (TypeContainer.DefineMembers): Create the MemberCache.
10811 (TypeContainer.FindMembers): Do better BindingFlags checking; only
10812 return public members if BindingFlags.Public was given, check
10813 whether members are static.
10815 2002-08-16 Martin Baulig <martin@gnome.org>
10817 * decl.cs (DeclSpace.Define): Splitted this in Define and
10818 DefineMembers. DefineMembers is called first and initializes the
10821 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
10822 DefineMembers() on all our DeclSpaces.
10824 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
10825 but call DefineMembers() on all nested interfaces. We call their
10826 Define() in our new Define() function.
10828 * interface.cs (Interface): Implement IMemberContainer.
10829 (Interface.Define): Moved all code except the attribute stuf to
10831 (Interface.DefineMembers): Initialize the member cache.
10833 * typemanager.cs (IMemberFinder): Removed this interface, we don't
10834 need this anymore since we can use MemberCache.FindMembers directly.
10836 2002-08-19 Martin Baulig <martin@gnome.org>
10838 * typemanager.cs (MemberCache): When creating the cache for an
10839 interface type, add all inherited members.
10840 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
10841 to `out bool used_cache' and documented it.
10842 (TypeManager.MemberLookup): If we already used the cache in the first
10843 iteration, we don't need to do the interfaces check.
10845 2002-08-19 Martin Baulig <martin@gnome.org>
10847 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
10848 here from IMemberFinder and don't implement this interface anymore.
10849 (DeclSpace.MemberCache): Moved here from IMemberFinder.
10851 * typemanager.cs (IMemberFinder): This interface is now only used by
10852 classes which actually support the member cache.
10853 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
10854 since we only put DeclSpaces into this Hashtable.
10855 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
10856 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
10858 2002-08-16 Martin Baulig <martin@gnome.org>
10860 * typemanager.cs (ICachingMemberFinder): Removed.
10861 (IMemberFinder.MemberCache): New property.
10862 (TypeManager.FindMembers): Merged this with RealFindMembers().
10863 This function will never be called from TypeManager.MemberLookup()
10864 so we can't use the cache here, just the IMemberFinder.
10865 (TypeManager.MemberLookup_FindMembers): Check whether the
10866 IMemberFinder has a MemberCache and call the cache's FindMembers
10868 (MemberCache): Rewrote larger parts of this yet another time and
10869 cleaned it up a bit.
10871 2002-08-15 Miguel de Icaza <miguel@ximian.com>
10873 * driver.cs (LoadArgs): Support quoting.
10875 (Usage): Show the CSC-like command line arguments.
10877 Improved a few error messages.
10879 2002-08-15 Martin Baulig <martin@gnome.org>
10881 * typemanager.cs (IMemberContainer.Type): New property.
10882 (IMemberContainer.IsInterface): New property.
10884 The following changes are conditional to BROKEN_RUNTIME, which is
10885 defined at the top of the file.
10887 * typemanager.cs (MemberCache.MemberCache): Don't add the base
10888 class'es members, but add all members from TypeHandle.ObjectType
10889 if we're an interface.
10890 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
10891 is the current type.
10892 (MemberCache.CacheEntry.Container): Removed this field.
10893 (TypeHandle.GetMembers): Include inherited members.
10895 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10897 * typemanager.cs: fixed compilation and added a comment on a field that
10900 2002-08-15 Martin Baulig <martin@gnome.org>
10902 * class.cs (ConstructorInitializer.Resolve): In the
10903 Expression.MemberLookup call, use the queried_type as
10906 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
10907 declared' attribute, it's always true.
10908 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
10909 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
10910 temporary wrapper for FindMembers which tells MemberLookup whether
10911 members from the base classes are included in the return value.
10912 This will go away soon.
10913 (TypeManager.MemberLookup): Use this temporary hack here; once the
10914 new MemberCache is completed, we don't need to do the DeclaredOnly
10915 looping here anymore since the MemberCache will take care of this.
10916 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
10917 (MemberCache): When creating the MemberCache for a class, get
10918 members from the current class and all its base classes.
10919 (MemberCache.CacheEntry.Container): New field. This is a
10920 temporary hack until the Mono runtime is fixed to distinguish
10921 between ReflectedType and DeclaringType. It allows us to use MCS
10922 with both the MS runtime and the unfixed Mono runtime without
10923 problems and without accecting performance.
10924 (MemberCache.SearchMembers): The DeclaredOnly looping from
10925 TypeManager.MemberLookup is now done here.
10927 2002-08-14 Martin Baulig <martin@gnome.org>
10929 * statement.cs (MyStructInfo.MyStructInfo): Don't call
10930 Type.GetFields on dynamic types but get the fields from the
10931 corresponding TypeContainer.
10932 (MyStructInfo.GetStructInfo): Added check for enum types.
10934 * typemanager.cs (MemberList.IsSynchronized): Implemented.
10935 (MemberList.SyncRoot): Implemented.
10936 (TypeManager.FilterWithClosure): No need to check permissions if
10937 closure_start_type == closure_invocation_type, don't crash if
10938 closure_invocation_type is null.
10940 2002-08-13 Martin Baulig <martin@gnome.org>
10942 Rewrote TypeContainer.FindMembers to use a member cache. This
10943 gives us a speed increase of about 35% for the self-hosting MCS
10944 build and of about 15-20% for the class libs (both on GNU/Linux).
10946 * report.cs (Timer): New class to get enhanced profiling. This
10947 whole class is "TIMER" conditional since it remarkably slows down
10950 * class.cs (MemberList): New class. This is an IList wrapper
10951 which we're now using instead of passing MemberInfo[]'s around to
10952 avoid copying this array unnecessarily.
10953 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
10954 (ICachingMemberFinder, IMemberContainer): New interface.
10955 (TypeManager.FilterWithClosure): If `criteria' is null, the name
10956 has already been checked, otherwise use it for the name comparision.
10957 (TypeManager.FindMembers): Renamed to RealMemberFinder and
10958 provided wrapper which tries to use ICachingMemberFinder.FindMembers
10959 if possible. Returns a MemberList, not a MemberInfo [].
10960 (TypeHandle): New class, implements IMemberContainer. We create
10961 one instance of this class per type, it contains a MemberCache
10962 which is used to do the member lookups.
10963 (MemberCache): New class. Each instance of this class contains
10964 all members of a type and a name-based hash table.
10965 (MemberCache.FindMembers): This is our new member lookup
10966 function. First, it looks up all members of the requested name in
10967 the hash table. Then, it walks this list and sorts out all
10968 applicable members and returns them.
10970 2002-08-13 Martin Baulig <martin@gnome.org>
10972 In addition to a nice code cleanup, this gives us a performance
10973 increase of about 1.4% on GNU/Linux - not much, but it's already
10974 half a second for the self-hosting MCS compilation.
10976 * typemanager.cs (IMemberFinder): New interface. It is used by
10977 TypeManager.FindMembers to call FindMembers on a TypeContainer,
10978 Enum, Delegate or Interface.
10979 (TypeManager.finder_to_member_finder): New PtrHashtable.
10980 (TypeManager.finder_to_container): Removed.
10981 (TypeManager.finder_to_delegate): Removed.
10982 (TypeManager.finder_to_interface): Removed.
10983 (TypeManager.finder_to_enum): Removed.
10985 * interface.cs (Interface): Implement IMemberFinder.
10987 * delegate.cs (Delegate): Implement IMemberFinder.
10989 * enum.cs (Enum): Implement IMemberFinder.
10991 * class.cs (TypeContainer): Implement IMemberFinder.
10993 2002-08-12 Martin Baulig <martin@gnome.org>
10995 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
10997 2002-08-12 Martin Baulig <martin@gnome.org>
10999 * ecore.cs (ITypeExpression): New interface for expressions which
11001 (TypeExpression): Renamed to TypeLookupExpression.
11002 (Expression.DoResolve): If we're doing a types-only lookup, the
11003 expression must implement the ITypeExpression interface and we
11004 call DoResolveType() on it.
11005 (SimpleName): Implement the new ITypeExpression interface.
11006 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
11007 hack, the situation that we're only looking up types can't happen
11008 anymore when this method is called. Moved the type lookup code to
11009 DoResolveType() and call it.
11010 (SimpleName.DoResolveType): This ITypeExpression interface method
11011 is now doing the types-only lookup.
11012 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
11013 (ResolveFlags): Added MaskExprClass.
11015 * expression.cs (MemberAccess): Implement the ITypeExpression
11017 (MemberAccess.DoResolve): Added support for a types-only lookup
11018 when we're called via ITypeExpression.DoResolveType().
11019 (ComposedCast): Implement the ITypeExpression interface.
11021 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
11022 Expression.Resolve() with ResolveFlags.Type instead.
11024 2002-08-12 Martin Baulig <martin@gnome.org>
11026 * interface.cs (Interface.Define): Apply attributes.
11028 * attribute.cs (Attribute.ApplyAttributes): Added support for
11029 interface attributes.
11031 2002-08-11 Martin Baulig <martin@gnome.org>
11033 * statement.cs (Block.Emit): Only check the "this" variable if we
11034 do not always throw an exception.
11036 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
11037 whether the property has a set accessor.
11039 2002-08-11 Martin Baulig <martin@gnome.org>
11041 Added control flow analysis support for structs.
11043 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
11044 with control flow analysis turned off.
11045 (IVariable): New interface.
11046 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
11047 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
11048 (FieldExpr.DoResolve): Resolve the instance expression with flow
11049 analysis turned off and do the definite assignment check after the
11050 resolving when we know what the expression will resolve to.
11052 * expression.cs (LocalVariableReference, ParameterReference):
11053 Implement the new IVariable interface, only call the flow analysis
11054 code if ec.DoFlowAnalysis is true.
11055 (This): Added constructor which takes a Block argument. Implement
11056 the new IVariable interface.
11057 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
11058 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
11059 This does the definite assignment checks for struct members.
11061 * class.cs (Constructor.Emit): If this is a non-static `struct'
11062 constructor which doesn't have any initializer, call
11063 Block.AddThisVariable() to tell the flow analysis code that all
11064 struct elements must be initialized before control returns from
11067 * statement.cs (MyStructInfo): New public class.
11068 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
11069 argument to this indexer. If non-zero, check an individual struct
11070 member, not the whole struct.
11071 (FlowBranching.CheckOutParameters): Check struct members.
11072 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
11073 overloaded versions of these methods which take an additional
11074 `int field_idx' argument to check struct members.
11075 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
11076 overloaded versions of these methods which take an additional
11077 `string field_name' argument to check struct member.s
11078 (VariableInfo): Implement the IVariable interface.
11079 (VariableInfo.StructInfo): New public property. Returns the
11080 MyStructInfo instance of the variable if it's a struct or null.
11081 (Block.AddThisVariable): New public method. This is called from
11082 Constructor.Emit() for non-static `struct' constructor which do
11083 not have any initializer. It creates a special variable for the
11084 "this" instance variable which will be checked by the flow
11085 analysis code to ensure that all of the struct's fields are
11086 initialized before control returns from the constructor.
11087 (UsageVector): Added support for struct members. If a
11088 variable/parameter is a struct with N members, we reserve a slot
11089 in the usage vector for each member. A struct is considered fully
11090 initialized if either the struct itself (slot 0) or all its
11091 members are initialized.
11093 2002-08-08 Martin Baulig <martin@gnome.org>
11095 * driver.cs (Driver.MainDriver): Only report an error CS5001
11096 if there were no compilation errors.
11098 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
11099 `UnsafeContext' property to determine whether the parent is in
11100 unsafe context rather than checking the parent's ModFlags:
11101 classes nested in an unsafe class are unsafe as well.
11103 2002-08-08 Martin Baulig <martin@gnome.org>
11105 * statement.cs (UsageVector.MergeChildren): Distinguish between
11106 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
11107 we return. Added test17() and test18() to test-154.cs.
11109 2002-08-08 Martin Baulig <martin@gnome.org>
11111 * typemanager.cs (TypeManager.FilterWithClosure): If we have
11112 Family access, make sure the invoking type isn't a subclass of the
11113 queried type (that'd be a CS1540).
11115 * ecore.cs (Expression.MemberLookup): Added overloaded version of
11116 this method which takes an additional `Type invocation_type'.
11118 * expression.cs (BaseAccess.DoResolve): Use the base type as
11119 invocation and query type.
11120 (MemberAccess.DoResolve): If the lookup failed and we're about to
11121 report a CS0122, try a lookup with the ec.ContainerType - if this
11122 succeeds, we must report a CS1540.
11124 2002-08-08 Martin Baulig <martin@gnome.org>
11126 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
11127 (MethodGroupExpr): Implement the IMemberExpr interface.
11129 * expression (MemberAccess.ResolveMemberAccess): No need to have
11130 any special code for MethodGroupExprs anymore, they're now
11133 2002-08-08 Martin Baulig <martin@gnome.org>
11135 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
11136 Family, FamANDAssem and FamORAssem permissions.
11137 (TypeManager.IsSubclassOrNestedChildOf): New public method.
11139 2002-08-08 Martin Baulig <martin@gnome.org>
11141 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
11142 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
11145 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
11147 * driver.cs: implemented /resource option to embed managed resources.
11149 2002-08-07 Martin Baulig <martin@gnome.org>
11151 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
11152 (FieldBase.HasFieldInitializer): New public property.
11153 (FieldBase.GetInitializerExpression): New public method. Resolves and
11154 returns the field initializer and makes sure it is only resolved once.
11155 (TypeContainer.EmitFieldInitializers): Call
11156 FieldBase.GetInitializerExpression to get the initializer, this ensures
11157 that it isn't resolved multiple times.
11159 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
11160 the resolving process (SimpleName/MemberLookup) that we're currently
11161 emitting a field initializer (which must not access any instance members,
11162 this is an error CS0236).
11164 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
11165 argument, if the `IsFieldInitializer' flag is set, we must report and
11166 error CS0236 and not an error CS0120.
11168 2002-08-07 Martin Baulig <martin@gnome.org>
11170 * ecore.cs (IMemberExpr): New public interface.
11171 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
11172 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
11173 if the expression is an IMemberExpr.
11175 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
11176 to be null, implicitly default to `this' if we're non-static in
11177 this case. Simplified the code a lot by using the new IMemberExpr
11178 interface. Also fixed bug #28176 here.
11180 2002-08-06 Martin Baulig <martin@gnome.org>
11182 * cs-parser.jay (SimpleLookup): Removed. We need to create
11183 ParameterReferences during semantic analysis so that we can do a
11184 type-only search when resolving Cast, TypeOf and SizeOf.
11185 (block): Pass the `current_local_parameters' to the Block's
11188 * class.cs (ConstructorInitializer): Added `Parameters parameters'
11189 argument to the constructor.
11190 (ConstructorInitializer.Resolve): Create a temporary implicit
11191 block with the parameters.
11193 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
11194 references here if we aren't doing a type-only search.
11196 * statement.cs (Block): Added constructor which takes a
11197 `Parameters parameters' argument.
11198 (Block.Parameters): New public property.
11200 * support.cs (InternalParameters.Parameters): Renamed `parameters'
11201 to `Parameters' and made it public readonly.
11203 2002-08-06 Martin Baulig <martin@gnome.org>
11205 * ecore.cs (Expression.Warning): Made this public as well.
11207 * report.cs (Report.Debug): Print the contents of collections.
11209 2002-08-06 Martin Baulig <martin@gnome.org>
11211 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
11212 used to tell Resolve() which kinds of expressions it may return.
11213 (Expression.Resolve): Added overloaded version of this method which
11214 takes a `ResolveFlags flags' argument. This can be used to tell
11215 Resolve() which kinds of expressions it may return. Reports a
11217 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
11218 ResolveFlags.SimpleName.
11219 (Expression.Error118): Added overloaded version of this method which
11220 takes a `ResolveFlags flags' argument. It uses the flags to determine
11221 which kinds of expressions are allowed.
11223 * expression.cs (Argument.ResolveMethodGroup): New public method.
11224 Resolves an argument, but allows a MethodGroup to be returned.
11225 This is used when invoking a delegate.
11227 * TODO: Updated a bit.
11229 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11231 Fixed compilation with csc.
11233 * ecore.cs: Expression.Error made public. Is this correct? Should
11234 Warning be made public too?
11236 * expression.cs: use ea.Location instead of ea.loc.
11237 [FIXME: Filed as bug #28607: MCS must report these errors.]
11239 2002-08-06 Martin Baulig <martin@gnome.org>
11241 * ecore.cs (Expression.loc): Moved the location here instead of
11242 duplicating it in all derived classes.
11243 (Expression.Location): New public property.
11244 (Expression.Error, Expression.Warning): Made them non-static and
11245 removed the location argument.
11246 (Expression.Warning): Added overloaded version which takes an
11247 `int level' argument.
11248 (Expression.Error118): Make this non-static and removed the
11249 expression and location arguments.
11250 (TypeExpr): Added location argument to the constructor.
11252 * expression.cs (StaticCallExpr): Added location argument to
11254 (Indirection, PointerArithmetic): Likewise.
11255 (CheckedExpr, UnCheckedExpr): Likewise.
11256 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
11257 (StringPtr): Likewise.
11260 2002-08-05 Martin Baulig <martin@gnome.org>
11262 * expression.cs (BaseAccess.DoResolve): Actually report errors.
11264 * assign.cs (Assign.DoResolve): Check whether the source
11265 expression is a value or variable.
11267 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
11268 while resolving the corresponding blocks.
11270 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
11271 an error, don't silently return null.
11273 * statement.cs (Block.AddVariable): Do the error reporting here
11274 and distinguish between CS0128 and CS0136.
11275 (Block.DoResolve): Report all unused labels (warning CS0164).
11276 (LabeledStatement): Pass the location to the constructor.
11277 (LabeledStatement.HasBeenReferenced): New property.
11278 (LabeledStatement.Resolve): Set it to true here.
11280 * statement.cs (Return.Emit): Return success even after reporting
11281 a type mismatch error (CS0126 or CS0127), this is what csc does and
11282 it avoids confusing the users with any consecutive errors.
11284 2002-08-05 Martin Baulig <martin@gnome.org>
11286 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
11288 * const.cs (Const.LookupConstantValue): Catch circular definitions.
11290 * expression.cs (MemberAccess.DoResolve): Silently return if an
11291 error has already been reported.
11293 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
11294 error has already been reported.
11296 2002-08-05 Martin Baulig <martin@gnome.org>
11298 * statement.cs (UsageVector): Only initialize the `parameters'
11299 vector if we actually have any "out" parameters.
11301 2002-08-05 Martin Baulig <martin@gnome.org>
11303 * expression.cs (Binary.ResolveOperator): When combining delegates,
11304 they must have the same type.
11306 2002-08-05 Martin Baulig <martin@gnome.org>
11308 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
11309 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
11310 work with the ms runtime and we also don't need it: if we're a
11311 PropertyBuilder and not in the `indexer_arguments' hash, then we
11312 are a property and not an indexer.
11314 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
11315 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
11316 since the latter one doesn't work with the ms runtime.
11318 2002-08-03 Martin Baulig <martin@gnome.org>
11320 Fixed bugs #27998 and #22735.
11322 * class.cs (Method.IsOperator): New public field.
11323 (Method.CheckBase): Report CS0111 if there's already a method
11324 with the same parameters in the current class. Report CS0508 when
11325 attempting to change the return type of an inherited method.
11326 (MethodData.Emit): Report CS0179 if a method doesn't have a body
11327 and it's not marked abstract or extern.
11328 (PropertyBase): New abstract base class for Property and Indexer.
11329 (PropertyBase.CheckBase): Moved here from Property and made it work
11331 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
11332 the same so we can reuse it there.
11333 (Property, Indexer): Derive from PropertyBase.
11334 (MethodSignature.inheritable_property_signature_filter): New delegate
11335 to find properties and indexers.
11337 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
11338 argument and improved error reporting.
11340 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
11341 EmptyReadOnlyParameters and made it a property.
11343 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
11344 version of this method which takes a `PropertyInfo indexer'.
11345 (TypeManager.RegisterIndexer): New method.
11347 * class.cs: Added myself as author of this file :-)
11349 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11351 * class.cs: fixed compilation on windoze.
11353 2002-08-03 Martin Baulig <martin@gnome.org>
11355 * interface.cs (Interface.GetInterfaceBases): Check whether all
11356 base interfaces are at least as accessible than the current one.
11358 * class.cs (TypeContainer.GetClassBases): Check whether base types
11359 are at least as accessible than the current type.
11360 (TypeContainer.AsAccessible): Implemented and made non-static.
11361 (MemberBase.CheckParameters): Report errors if the accessibility
11364 * delegate.cs (Delegate.Delegate): The default visibility is
11365 internal for top-level types and private for nested types.
11366 (Delegate.Define): Report errors if the accessibility checks fail.
11368 * enum.cs (Enum.Enum): The default visibility is internal for
11369 top-level types and private for nested types.
11370 (Enum.DefineType): Compute the correct visibility.
11372 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
11373 function which takes a `bool is_toplevel' instead of a TypeContainer.
11375 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
11378 2002-08-02 Martin Baulig <martin@gnome.org>
11380 * expression.cs (LocalVariableReferenc): Added constructor which
11381 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
11382 (LocalVariableReference.IsReadOnly): New property.
11383 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
11384 variable is readonly, use our own readonly flag to do this; you can
11385 use the new constructor to get a writable reference to a read-only
11388 * cs-parser.jay (foreach_statement, using_statement): Get a writable
11389 reference to the local variable.
11391 2002-08-01 Miguel de Icaza <miguel@ximian.com>
11393 * rootcontext.cs (ResolveCore): Also include System.Exception
11395 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
11396 we reach an EmptyStatement.
11398 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
11401 * expression.cs (Binary.ResolveOperator): Check error result in
11404 use brtrue/brfalse directly and avoid compares to null.
11406 2002-08-02 Martin Baulig <martin@gnome.org>
11408 * class.cs (TypeContainer.Define): Define all nested interfaces here.
11409 Fixes bug #28407, added test-155.cs.
11411 2002-08-01 Martin Baulig <martin@gnome.org>
11413 * class.cs (Event.EmitDefaultMethod): Make this work with static
11414 events. Fixes #28311, added verify-3.cs.
11416 2002-08-01 Martin Baulig <martin@gnome.org>
11418 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
11419 `is_disposable' fields.
11420 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
11421 `hm.is_disposable' if we're using the collection pattern.
11422 (Foreach.EmitCollectionForeach): Use the correct type for the
11423 enumerator's local variable, only emit the try/finally block if
11424 necessary (fixes #27713).
11426 2002-08-01 Martin Baulig <martin@gnome.org>
11428 * ecore.cs (Expression.report118): Renamed to Error118 and made
11431 * statement.cs (Throw.Resolve): Check whether the expression is of
11432 the correct type (CS0118) and whether the type derives from
11433 System.Exception (CS0155).
11434 (Catch.Resolve): New method. Do the type lookup here and check
11435 whether it derives from System.Exception (CS0155).
11436 (Catch.CatchType, Catch.IsGeneral): New public properties.
11438 * typemanager.cs (TypeManager.exception_type): Added.
11440 2002-07-31 Miguel de Icaza <miguel@ximian.com>
11442 * driver.cs: Updated About function.
11444 2002-07-31 Martin Baulig <martin@gnome.org>
11446 Implemented Control Flow Analysis.
11448 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
11449 (EmitContext.CurrentBranching): Added.
11450 (EmitContext.StartFlowBranching): Added.
11451 (EmitContext.EndFlowBranching): Added.
11452 (EmitContext.KillFlowBranching): Added.
11453 (EmitContext.IsVariableAssigned): Added.
11454 (EmitContext.SetVariableAssigned): Added.
11455 (EmitContext.IsParameterAssigned): Added.
11456 (EmitContext.SetParameterAssigned): Added.
11457 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
11458 Added control flow analysis stuff here.
11460 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
11461 resolve the expression as lvalue.
11462 (LocalVariableReference.DoResolve): Check whether the variable has
11463 already been assigned.
11464 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
11465 the parameter as assigned here.
11466 (ParameterReference.DoResolve): Check whether the parameter has already
11468 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
11469 expression as lvalue.
11471 * statement.cs (FlowBranching): New class for the flow analysis code.
11472 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
11473 (LabeledStatement.IsDefined): New public property.
11474 (LabeledStatement.AddUsageVector): New public method to tell flow
11475 analyis that the label may be reached via a forward jump.
11476 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
11478 (VariableInfo.Number): New public field. This is used by flow analysis
11479 to number all locals of a block.
11480 (Block.CountVariables): New public property. This is the number of
11481 local variables in this block (including the locals from all parent
11483 (Block.EmitMeta): Number all the variables.
11485 * statement.cs: Added flow analysis support to all classes.
11487 2002-07-31 Martin Baulig <martin@gnome.org>
11489 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
11490 To get debugging messages, compile mcs with /define:MCS_DEBUG and
11491 then use this argument.
11493 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
11495 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
11496 use this to specify /define options.
11498 2002-07-29 Martin Baulig <martin@gnome.org>
11500 * statement.cs (Fixed): Moved all code that does variable lookups
11501 and resolvings from Emit to Resolve.
11503 * statement.cs (For): Moved all code that does variable lookups
11504 and resolvings from Emit to Resolve.
11506 * statement.cs (Using): Moved all code that does variable lookups
11507 and resolvings from Emit to Resolve.
11509 2002-07-29 Martin Baulig <martin@gnome.org>
11511 * attribute.cs (Attribute.Resolve): Explicitly catch a
11512 System.NullReferenceException when creating the
11513 CustromAttributeBuilder and report a different warning message.
11515 2002-07-29 Martin Baulig <martin@gnome.org>
11517 * support.cs (ParameterData.ParameterName): Added method to
11518 get the name of a parameter.
11520 * typemanager.cs (TypeManager.IsValueType): New public method.
11522 2002-07-29 Martin Baulig <martin@gnome.org>
11524 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
11525 is a flag which specifies that it's either ref or out.
11526 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
11527 the out parameter to `out Parameter.Modifier mod', also set the
11528 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
11530 * support.cs (InternalParameters.ParameterModifier): Distinguish
11531 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
11532 Parameter.Modifier.ISBYREF flag if it's either ref or out.
11534 * expression.cs (Argument.GetParameterModifier): Distinguish
11535 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
11536 Parameter.Modifier.ISBYREF flag if it's either ref or out.
11538 2002-07-29 Martin Baulig <martin@gnome.org>
11540 * expression.cs (ParameterReference.ParameterReference): Added
11541 `Location loc' argument to the constructor.
11543 * cs-parser.jay: Pass location to ParameterReference.
11545 2002-07-28 Miguel de Icaza <miguel@ximian.com>
11547 * statement.cs (Try): Initialize the location.
11549 * cs-parser.jay: pass location to Try.
11551 * expression.cs (Unary.Reduce): Change the prototype to return
11552 whether a constant fold could be performed or not. The result is
11553 returned in an out parameters. In the case of Indirection and
11554 AddressOf, we want to perform the full tests.
11556 2002-07-26 Miguel de Icaza <miguel@ximian.com>
11558 * statement.cs (Statement.Emit): Flag dead code.
11560 2002-07-27 Andrew Birkett <andy@nobugs.org>
11562 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
11564 2002-07-27 Martin Baulig <martin@gnome.org>
11566 * class.cs (MethodData.Define): Put back call to
11567 TypeManager.AddMethod(), accidentally commented this out.
11569 * report.cs (Debug): New public method to print debugging information,
11570 this is `[Conditional ("DEBUG")]'.
11572 2002-07-26 Martin Baulig <martin@gnome.org>
11574 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
11575 (switch_statement): Push the current_block to the switch_stack and
11576 pop it again when we're done with the switch.
11577 (switch_section): The new block is a child of the current_block.
11578 Fixes bug #24007, added test-152.cs.
11580 2002-07-27 Martin Baulig <martin@gnome.org>
11582 * expression.cs (Invocation.EmitArguments): When calling a varargs
11583 function with only its fixed arguments, we need to pass an empty
11586 2002-07-27 Martin Baulig <martin@gnome.org>
11588 Mono 0.13 has been released.
11590 2002-07-25 Miguel de Icaza <miguel@ximian.com>
11592 * driver.cs: Rename --resource to --linkres, because that is what
11593 we do currently, we dont support --resource yet.
11595 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
11597 2002-07-25 Martin Baulig <martin@gnome.org>
11599 * class.cs (MethodData): New public class. This is a `method builder'
11600 class for a method or one accessor of a Property/Indexer/Event.
11601 (MethodData.GetMethodFlags): Moved here from MemberBase.
11602 (MethodData.ApplyAttributes): Likewise.
11603 (MethodData.ApplyObsoleteAttribute): Likewise.
11604 (MethodData.ApplyConditionalAttribute): Likewise.
11605 (MethodData.ApplyDllImportAttribute): Likewise.
11606 (MethodData.CheckAbstractAndExternal): Likewise.
11607 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
11608 (MethodData.Emit): Formerly known as Method.Emit().
11609 (MemberBase): Moved everything which was specific to a single
11610 accessor/method to MethodData.
11611 (Method): Create a new MethodData and call Define() and Emit() on it.
11612 (Property, Indexer, Event): Create a new MethodData objects for each
11613 accessor and call Define() and Emit() on them.
11615 2002-07-25 Martin Baulig <martin@gnome.org>
11617 Made MethodCore derive from MemberBase to reuse the code from there.
11618 MemberBase now also checks for attributes.
11620 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
11621 (MemberBase.GetMethodFlags): Moved here from class Method and marked
11623 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
11624 `CallingConventions cc' and `Attributes opt_attrs' arguments.
11625 (MemberBase.ApplyAttributes): New virtual method; applies the
11626 attributes to a method or accessor.
11627 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
11628 (MemberBase.ApplyConditionalAttribute): Likewise.
11629 (MemberBase.ApplyDllImportAttribute): Likewise.
11630 (MemberBase.CheckAbstractAndExternal): Likewise.
11631 (MethodCore.ParameterTypes): This is now a property instead of a
11632 method, it's initialized from DoDefineParameters().
11633 (MethodCore.ParameterInfo): Removed the set accessor.
11634 (MethodCore.DoDefineParameters): New protected virtual method to
11635 initialize ParameterTypes and ParameterInfo.
11636 (Method.GetReturnType): We can now simply return the MemberType.
11637 (Method.GetMethodFlags): Override the MemberBase version and add
11638 the conditional flags.
11639 (Method.CheckBase): Moved some code from Define() here, call
11640 DoDefineParameters() here.
11641 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
11642 here to avoid some larger code duplication.
11643 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
11644 ensure that abstract and external accessors don't declare a body.
11646 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
11647 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
11648 lookup in the attribute's parent classes, so we need to abort as soon
11649 as we found the first match.
11650 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
11651 the attribute has no arguments.
11653 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
11656 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11658 * cs-parser.jay: reverted previous patch.
11660 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11662 * cs-parser.jay: fixed bug #22119.
11664 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11666 * attribute.cs: fixed compilation. The error was:
11667 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
11668 be assigned to before control leaves the current method."
11669 [FIXME: Filed as bug #28186: MCS must report this error.]
11671 2002-07-25 Martin Baulig <martin@gnome.org>
11673 * attribute.cs (Attribute.Conditional_GetConditionName): New static
11674 method to pull the condition name ouf of a Conditional attribute.
11675 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
11676 the obsolete message and error flag out of an Obsolete attribute.
11678 * class.cs (Method.GetMethodFlags): New public method to get the
11679 TypeManager.MethodFlags for this method.
11680 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
11682 (Method.Define): Get and apply the Obsolete and Conditional attributes;
11683 if we're overriding a virtual function, set the new private variable
11684 `parent_method'; call the new TypeManager.AddMethod().
11686 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
11687 the MethodBuilder and the Method in a PtrHashtable.
11688 (TypeManager.builder_to_method): Added for this purpose.
11689 (TypeManager.MethodFlags): Added IsObsoleteError.
11690 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
11691 Obsolete and Conditional arguments in MethodBuilders. If we discover
11692 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
11693 the message from the attribute.
11695 2002-07-24 Martin Baulig <martin@gnome.org>
11697 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
11698 preprocessor directives, ensure that the argument to #define/#undef is
11699 exactly one identifier and that it's actually an identifier.
11701 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
11704 2002-07-24 Martin Baulig <martin@gnome.org>
11706 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
11707 initialize it to TypeManager.object_type in the constructor.
11708 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
11709 of the `hm.get_current' method if we're using the collection pattern.
11710 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
11711 for the explicit conversion to make it work when we're using the collection
11712 pattern and the `Current' property has a different return type than `object'.
11715 2002-07-24 Martin Baulig <martin@gnome.org>
11717 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
11718 does not match, but don't report any errors. This method is called in
11719 order for all methods in a MethodGroupExpr until a matching method is
11720 found, so we don't want to bail out if the first method doesn't match.
11721 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
11722 matches, report the 123. Fixes #28070.
11724 2002-07-24 Martin Baulig <martin@gnome.org>
11726 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
11727 TypeManager.TypeToCoreType() to the top of the method so the
11728 following equality checks will work. Fixes #28107.
11730 2002-07-24 Martin Baulig <martin@gnome.org>
11732 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
11733 operand is of type uint, and the other operand is of type sbyte,
11734 short or int, the operands are converted to type long." -
11735 Actually do what this comment already told us. Fixes bug #28106,
11738 2002-07-24 Martin Baulig <martin@gnome.org>
11740 * class.cs (MethodBase): New abstract class. This is now a base
11741 class for Property, Indexer and Event to avoid some code duplication
11742 in their Define() and DefineMethods() methods.
11743 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
11744 generic methods for Define() and DefineMethods().
11745 (FieldBase): Derive from MemberBase, not MemberCore.
11746 (Property): Derive from MemberBase, not MemberCore.
11747 (Property.DefineMethod): Moved all the code from this method to the
11748 new MethodBase.DefineAccessor(), just call it with appropriate
11750 (Property.Define): Call the new Property.DoDefine(), this does some
11751 sanity checks and we don't need to duplicate the code everywhere.
11752 (Event): Derive from MemberBase, not MemberCore.
11753 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
11754 accessors, this will also make them work with interface events.
11755 (Indexer): Derive from MemberBase, not MemberCore.
11756 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
11757 (Indexer.Define): Use the new MethodBase functions.
11759 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
11760 argument to the constructor.
11761 (Interface.FindMembers): Added support for interface events.
11762 (Interface.PopluateEvent): Implemented.
11764 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
11766 2002-07-22 Miguel de Icaza <miguel@ximian.com>
11768 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
11769 but this is required to check for a method name being the same as
11770 the containing class.
11774 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11776 * interface.cs: initialize variable.
11778 2002-07-23 Martin Baulig <martin@gnome.org>
11780 Implemented the IndexerName attribute in interfaces.
11782 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
11783 name if this is an explicit interface implementation.
11784 (Indexer.InterfaceIndexerName): New public variable. If we're
11785 implementing an interface indexer, this is the IndexerName in that
11786 interface. Otherwise, it's the IndexerName.
11787 (Indexer.DefineMethod): If we're implementing interface indexer,
11788 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
11789 and Pending.ImplementIndexer methods.
11790 (Indexer.Define): Also define the PropertyBuilder if we're
11791 implementing an interface indexer and this is neither an explicit
11792 interface implementation nor do the IndexerName match the one in
11795 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
11796 If a method is defined here, then we always need to create a proxy
11797 for it. This is used when implementing interface indexers.
11798 (Pending.IsInterfaceIndexer): New public method.
11799 (Pending.ImplementIndexer): New public method.
11800 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
11801 This is used when implementing interface indexers to define a proxy
11803 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
11804 define a proxy if necessary.
11806 * interface.cs (Interface.IndexerName): New public variable.
11807 (Interface.PopulateIndexer): Set the IndexerName.
11808 (Interface.DefineIndexers): New private method. Populate all the
11809 indexers and make sure their IndexerNames match.
11811 * typemanager.cs (IndexerPropertyName): Added support for interface
11814 2002-07-22 Martin Baulig <martin@gnome.org>
11816 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
11817 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
11818 ret if HasReturnLabel.
11819 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
11822 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
11823 and set the ec.LoopBeginTryCatchLevel.
11824 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
11825 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
11826 the current ec.TryCatchLevel, the branch goes out of an exception
11827 block. In this case, we need to use Leave and not Br.
11829 2002-07-22 Martin Baulig <martin@gnome.org>
11831 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
11832 block unless the block does not always return or it is contained in
11833 another try { ... } catch { ... } block. Fixes bug #26506.
11834 Added verify-1.cs to the test suite.
11836 2002-07-22 Martin Baulig <martin@gnome.org>
11838 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
11839 then we do not always return. Fixes bug #24985.
11841 2002-07-22 Martin Baulig <martin@gnome.org>
11843 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
11844 lookup on a per-class level; ie. walk up the class hierarchy until we
11845 found at least one applicable method, then choose the best among them.
11846 Fixes bug #24463 and test-29.cs.
11848 2002-07-22 Martin Baulig <martin@gnome.org>
11850 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
11851 return types of the methods. The return type is not part of the
11852 signature and we must not check it to make the `new' modifier work.
11853 Fixes bug #27999, also added test-147.cs.
11854 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
11856 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
11857 on the method's return type.
11859 2002-07-21 Martin Baulig <martin@gnome.org>
11861 * assign.cs: Make this work if the rightmost source is a constant and
11862 we need to do an implicit type conversion. Also adding a few more tests
11863 to test-38.cs which should have caught this.
11865 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
11866 target in the makefile for this. The makefile.gnu is primarily intended
11867 for end-users who don't want to debug the compiler.
11869 2002-07-21 Martin Baulig <martin@gnome.org>
11871 * assign.cs: Improved the Assign class so it can now handle embedded
11872 assignments (X = Y = Z = something). As a side-effect this'll now also
11873 consume less local variables. test-38.cs now passes with MCS, added
11874 a few new test cases to that test.
11876 2002-07-20 Martin Baulig <martin@gnome.org>
11878 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
11879 instructions. Fixes bug #27977, also added test-146.cs.
11881 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11883 * cs-tokenizer.cs: fixed getHex ().
11885 2002-07-19 Martin Baulig <martin@gnome.org>
11887 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
11888 not Type.GetType() to lookup the array type. This is needed when
11889 we're constructing an array of a user-defined type.
11890 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
11891 single-dimensional arrays, but also for single-dimensial arrays of
11894 2002-07-19 Martin Baulig <martin@gnome.org>
11896 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
11897 this function is called, it's not allowed to share LocalBuilders
11898 among ILGenerators.
11900 2002-07-19 Martin Baulig <martin@gnome.org>
11902 * expression.cs (Argument.Resolve): Report an error 118 when trying
11903 to pass a type as argument.
11905 2002-07-18 Martin Baulig <martin@gnome.org>
11907 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
11908 Conv_R_Un for the signed `long' type.
11910 2002-07-15 Miguel de Icaza <miguel@ximian.com>
11912 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
11913 `expr' for the temporary result, as that will fail if we do
11914 multiple resolves on the same expression.
11916 2002-07-05 Miguel de Icaza <miguel@ximian.com>
11918 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
11919 ec.TypeContainer for looking up aliases.
11921 * class.cs (TypeContainer): Remove LookupAlias from here.
11923 * decl.cs (DeclSpace); Move here.
11925 2002-07-01 Miguel de Icaza <miguel@ximian.com>
11927 * class.cs (FindMembers): Only call filter if the constructor
11928 bulider is not null.
11930 Also handle delegates in `NestedTypes' now. Now we will perform
11931 type lookups using the standard resolution process. This also
11934 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
11935 This uses Expressions (the limited kind that can be parsed by the
11936 tree) instead of strings.
11938 * expression.cs (ComposedCast.ToString): Implement, used to flag
11939 errors since now we have to render expressions.
11941 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
11944 * ecore.cs (SimpleName.ToString): ditto.
11946 * cs-parser.jay: Instead of using strings to assemble types, use
11947 Expressions to assemble the type (using SimpleName, ComposedCast,
11948 MemberAccess). This should fix the type lookups in declarations,
11949 because we were using a different code path for this.
11951 * statement.cs (Block.Resolve): Continue processing statements
11952 even when there is an error.
11954 2002-07-17 Miguel de Icaza <miguel@ximian.com>
11956 * class.cs (Event.Define): Also remove the `remove' method from
11957 the list of pending items.
11959 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
11960 generate more compact code.
11962 2002-07-17 Martin Baulig <martin@gnome.org>
11964 * const.cs (Const.LookupConstantValue): Add support for constant
11965 `unchecked' and `checked' expressions.
11966 Also adding test case test-140.cs for this.
11968 2002-07-17 Martin Baulig <martin@gnome.org>
11970 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
11971 check whether mi.ReturnType implements the IEnumerator interface; the
11972 `==' and the IsAssignableFrom() will fail in this situation.
11974 2002-07-16 Ravi Pratap <ravi@ximian.com>
11976 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
11979 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11981 * expression.cs: fixed bug #27811.
11983 2002-07-14 Miguel de Icaza <miguel@ximian.com>
11985 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
11986 Molaro: when we are a ref, the value already contains a pointer
11987 value, do not take the address of it.
11989 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
11990 * removed mb-parser.jay and mb-tokenizer.cs
11992 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
11994 * expression.cs: check against the building corlib void type.
11996 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
11998 * ecore.cs: fix for valuetype static readonly fields: when
11999 initializing them, we need their address, not the address of a copy.
12001 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
12003 * typemanager.cs: register also enum_type in corlib.
12005 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
12007 * class.cs: allow calling this (but not base) initializers in structs.
12009 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
12011 * ecore.cs: make sure we compare against the building base types
12014 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
12016 * typemanager.cs: fix TypeToCoreType() to handle void and object
12017 (corlib gets no more typerefs after this change).
12019 2002-07-12 Miguel de Icaza <miguel@ximian.com>
12021 * expression.cs (ArrayCreation.EmitArrayArguments): use
12022 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
12024 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
12025 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
12026 array indexes, the runtime actually forbids them.
12028 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
12029 for array arguments here.
12031 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
12032 instead of the default for ValueTypes.
12034 (New.DoEmit): Use IsValueType instead of
12035 IsSubclassOf (value_type)
12036 (New.DoResolve): ditto.
12037 (Invocation.EmitCall): ditto.
12039 * assign.cs (Assign): ditto.
12041 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
12042 Statements *are* currently doing part of their resolution during
12045 Expressions do always resolve during resolve, but statements are
12046 only required to propagate resolution to their children.
12048 2002-07-11 Miguel de Icaza <miguel@ximian.com>
12050 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
12052 (LoadAssembly): Do not add the dll if it is already specified
12054 (MainDriver): Add the System directory to the link path at the end,
12055 after all the other -L arguments.
12057 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
12058 wrong opcode for loading bytes and bools (ldelem.i1 instead of
12059 ldelem.u1) and using the opposite for sbytes.
12061 This fixes Digger, and we can finally run it.
12063 * driver.cs (UnixParseOption): Move the option parsing here.
12064 (CSCParseOption): Implement CSC-like parsing of options.
12066 We now support both modes of operation, the old Unix way, and the
12067 new CSC-like way. This should help those who wanted to make cross
12068 platform makefiles.
12070 The only thing broken is that /r:, /reference: and /lib: are not
12071 implemented, because I want to make those have the same semantics
12072 as the CSC compiler has, and kill once and for all the confussion
12073 around this. Will be doing this tomorrow.
12075 * statement.cs (Unsafe.Resolve): The state is checked during
12076 resolve, not emit, so we have to set the flags for IsUnsfe here.
12078 2002-07-10 Miguel de Icaza <miguel@ximian.com>
12080 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
12081 not catch the Error_ObjectRefRequired in SimpleName (as it is
12082 possible to have a class/instance variable name that later gets
12083 deambiguated), we have to check this here.
12085 2002-07-10 Ravi Pratap <ravi@ximian.com>
12087 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
12088 make static and put into Expression.
12090 (Event.Define): Register the private field of the event with the
12091 TypeManager so that GetFieldFromEvent can get at it.
12093 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
12094 keep track of the private field associated with an event which
12097 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
12100 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
12102 2002-07-10 Miguel de Icaza <miguel@ximian.com>
12104 * expression.cs (Binary.EmitBranchable): this routine emits the
12105 Binary expression in a branchable context. This basically means:
12106 we need to branch somewhere, not just get the value on the stack.
12108 This works together with Statement.EmitBoolExpression.
12110 * statement.cs (Statement.EmitBoolExpression): Use
12113 2002-07-09 Miguel de Icaza <miguel@ximian.com>
12115 * statement.cs (For): Reduce the number of jumps in loops.
12117 (For): Implement loop inversion for the For statement.
12119 (Break): We can be breaking out of a Try/Catch controlled section
12120 (foreach might have an implicit try/catch clause), so we need to
12121 use Leave instead of Br.
12123 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
12124 now). If the instace expression supports IMemoryLocation, we use
12125 the AddressOf method from the IMemoryLocation to extract the
12126 address instead of emitting the instance.
12128 This showed up with `This', as we were emitting the instance
12129 always (Emit) instead of the Address of This. Particularly
12130 interesting when This is a value type, as we dont want the Emit
12131 effect (which was to load the object).
12133 2002-07-08 Miguel de Icaza <miguel@ximian.com>
12135 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
12137 * statement.cs (Checked): Set the CheckedState during the resolve
12138 process too, as the ConvCast operations track the checked state on
12139 the resolve process, and not emit.
12141 * cs-parser.jay (namespace_member_declaration): Flag that we have
12142 found a declaration when we do. This is used to flag error 1529
12144 * driver.cs: Report ok when we display the help only.
12146 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
12148 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
12150 2002-07-04 Miguel de Icaza <miguel@ximian.com>
12152 * cs-tokenizer.cs (define): We also have to track locally the
12153 defines. AllDefines is just used for the Conditional Attribute,
12154 but we also need the local defines for the current source code.
12156 2002-07-03 Miguel de Icaza <miguel@ximian.com>
12158 * statement.cs (While, For, Do): These loops can exit through a
12159 Break statement, use this information to tell whether the
12160 statement is the last piece of code.
12162 (Break): Flag that we break.
12164 * codegen.cs (EmitContexts): New `Breaks' state variable.
12166 2002-07-03 Martin Baulig <martin@gnome.org>
12168 * class.cs (TypeContainer.MethodModifiersValid): Allow override
12169 modifiers in method declarations in structs. Otherwise, you won't
12170 be able to override things like Object.Equals().
12172 2002-07-02 Miguel de Icaza <miguel@ximian.com>
12174 * class.cs (Method, Property, Indexer): Do not allow the public
12175 modifier to be used in explicit interface implementations.
12177 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
12178 override modifiers in method declarations in structs
12180 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
12182 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
12183 integer or real overflow, report an error
12185 2002-07-02 Martin Baulig <martin@gnome.org>
12187 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
12188 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
12189 to tell the runtime about our newly created System.Object and
12190 System.ValueType types.
12192 2002-07-02 Miguel de Icaza <miguel@ximian.com>
12194 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
12195 struct instead of Ldarg/Starg.
12197 2002-07-02 Martin Baulig <martin@gnome.org>
12199 * expression.cs (Indirection.Indirection): Call
12200 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
12202 2002-07-02 Martin Baulig <martin@gnome.org>
12204 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
12205 ValueType, call TypeManager.TypeToCoreType() on it.
12206 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
12207 the OpCodes.Newarr argument.
12209 2002-07-02 Martin Baulig <martin@gnome.org>
12211 * expression.cs (Invocation.EmitCall): When compiling corlib,
12212 replace all calls to the system's System.Array type to calls to
12213 the newly created one.
12215 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
12216 System.Array methods.
12217 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
12218 from the system's System.Array type which must be replaced.
12220 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
12222 * typemanager.cs: load unverifiable_code_ctor so we can build
12223 corlib using the correct type. Avoid using GetTypeCode() with
12225 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
12226 TypeManager.object_type to allow building corlib.
12228 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
12230 * ecore.cs: handle System.Enum separately in LoadFromPtr().
12232 2002-07-01 Martin Baulig <martin@gnome.org>
12234 * class.cs: Make the last change actually work, we need to check
12235 whether `ifaces != null' to avoid a crash.
12237 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
12239 * class.cs: when we build structs without fields that implement
12240 interfaces, we need to add the interfaces separately, since there is
12241 no API to both set the size and add the interfaces at type creation
12244 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
12246 * expression.cs: the dimension arguments to the array constructors
12247 need to be converted if they are a long.
12249 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
12251 * class.cs: don't emit ldarg.0 if there is no parent constructor
12252 (fixes showstopper for corlib).
12254 2002-06-29 Martin Baulig <martin@gnome.org>
12256 MCS now compiles corlib on GNU/Linux :-)
12258 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
12259 ie. check for MethodImplOptions.InternalCall.
12261 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
12262 and TypeManager.attribute_type are null, so we must explicitly check
12263 whether parent is not null to find out whether it's an attribute type.
12264 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
12265 and SetBuilder, not only if the property is neither abstract nor external.
12266 This is necessary to set the MethodImplOptions on the accessor methods.
12267 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
12268 SetBuilder, see Property.Emit().
12270 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
12271 populate "System.Object", "System.ValueType" and "System.Attribute" since
12272 they've already been populated from BootCorlib_PopulateCoreTypes().
12274 2002-06-29 Martin Baulig <martin@gnome.org>
12276 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
12277 is the NullLiteral, we also need to make sure that target_type is not
12280 2002-06-29 Martin Baulig <martin@gnome.org>
12282 * rootcontext.cs (RootContext.ResolveCore): We must initialize
12283 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
12284 before calling BootstrapCorlib_ResolveDelegate ().
12286 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12288 * statement.cs: fixed build-breaker. All tests passed ok.
12290 2002-06-27 Martin Baulig <martin@gnome.org>
12292 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
12293 for System.Decimal when compiling corlib.
12295 2002-06-27 Martin Baulig <martin@gnome.org>
12297 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
12298 switch blocks which contain nothing but a default clause.
12300 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
12302 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
12304 2002-06-27 Martin Baulig <martin@gnome.org>
12306 * ecore.cs (PropertyExpr.PropertyExpr): Call
12307 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
12309 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
12310 is already a TypeBuilder.
12312 2002-06-27 Martin Baulig <martin@gnome.org>
12314 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
12315 `target_type == TypeManager.array_type', not IsAssignableFrom() in
12316 the "from an array-type to System.Array" case. This makes it work
12317 when compiling corlib.
12319 2002-06-27 Martin Baulig <martin@gnome.org>
12321 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
12322 non-static PropertyExpr, set its InstanceExpression. This makes
12323 the `ICollection.Count' property work in System/Array.cs.
12325 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
12327 * driver.cs: Made error handling more consistent. Errors now
12328 tracked by Report class, so many methods which used to return int
12329 now return void. Main() now prints success/failure and
12330 errors/warnings message.
12332 Renamed '--probe' compiler argument to '--expect-error'. Removed
12333 the magic number return values (123 and 124). Now, if the
12334 expected error occurs, the compiler exits with success (exit value
12335 0). If the compilation completes without seeing that particular
12336 error, the compiler exits with failure (exit value 1). The
12337 makefile in mcs/errors has been changed to handle the new behaviour.
12339 * report.cs: Made 'expected error' number a property and renamed
12340 it from 'Probe' to 'ExpectedError'.
12342 * genericparser.cs: Removed error handling support, since it is
12343 now all done by Report class.
12345 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
12346 class, so parse() no longer returns an int.
12348 * namespace.cs: Use Report.Error instead of GenericParser.error
12350 2002-06-22 Miguel de Icaza <miguel@ximian.com>
12352 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
12353 TypeContainer.AddOperator): At the front of the list put the
12354 explicit implementations, so they get resolved/defined first.
12356 2002-06-21 Miguel de Icaza <miguel@ximian.com>
12358 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
12359 interface type is implemented by this TypeContainer. Used during
12360 explicit interface implementation.
12362 (Property.Define, Indexer.Define, Method.Define): Validate that
12363 the given interface in the explicit implementation is one of the
12364 base classes for the containing type.
12366 Also if we are explicitly implementing an interface, but there is
12367 no match in the pending implementation table, report an error.
12369 (Property.Define): Only define the property if we are
12370 not explicitly implementing a property from an interface. Use the
12371 correct name also for those properties (the same CSC uses,
12372 although that is really not needed).
12374 (Property.Emit): Do not emit attributes for explicitly implemented
12375 properties, as there is no TypeBuilder.
12377 (Indexer.Emit): ditto.
12379 Hiding then means that we do not really *implement* a pending
12380 implementation, which makes code fail.
12382 2002-06-22 Martin Baulig <martin@gnome.org>
12384 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
12385 the return value of Object.GetType(). [FIXME: we need to do this whenever
12386 we get a type back from the reflection library].
12388 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
12390 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
12392 2002-06-20 Miguel de Icaza <miguel@ximian.com>
12394 * attribute.cs: Return null if we can not look up the type.
12396 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
12397 the interface types found.
12399 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
12400 interface types found.
12402 * typemanager.cs (GetInterfaces): Make this routine returns alll
12403 the interfaces and work around the lame differences between
12404 System.Type and System.Reflection.Emit.TypeBuilder in the results
12405 result for GetInterfaces.
12407 (ExpandInterfaces): Given an array of interface types, expand and
12408 eliminate repeated ocurrences of an interface. This expands in
12409 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
12412 2002-06-21 Martin Baulig <martin@gnome.org>
12414 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
12417 2002-06-21 Martin Baulig <martin@gnome.org>
12419 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
12420 and called with one of the core types, return the corresponding typebuilder for
12423 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
12426 2002-06-21 Martin Baulig <martin@gnome.org>
12428 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
12429 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
12430 (Expression.ConvertReferenceExplicit): Likewise.
12432 * expression.cs (ElementAccess.DoResolve): Likewise.
12433 (ElementAccess.DoResolveLValue): Likewise.
12435 2002-06-10 Martin Baulig <martin@gnome.org>
12437 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
12438 add the "value" parameter to the parameter list.
12440 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
12443 2002-06-19 Miguel de Icaza <miguel@ximian.com>
12445 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
12446 the argument to an int, uint, long or ulong, per the spec. Also
12447 catch negative constants in array creation.
12449 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
12451 * class.cs: do not allow the same interface to appear twice in
12452 the definition list.
12454 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
12456 * ecore.cs: don't use ldlen with System.Array.
12458 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
12460 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
12462 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
12464 * modifiers.cs: produce correct field attributes for protected
12465 internal. Easy fix so miguel can work on ther harder stuff:-)
12467 2002-06-18 Miguel de Icaza <miguel@ximian.com>
12469 * pending.cs: New file. Move the code from class.cs here.
12470 Support clearning the pending flag for all methods (when not doing
12471 explicit interface implementation).
12473 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
12475 * rootcontext.cs: added a couple more types needed to bootstrap.
12477 2002-06-17 Miguel de Icaza <miguel@ximian.com>
12479 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
12480 constructor in the type, instead of any constructor in the type
12481 hierarchy. Thanks to Paolo for finding this bug (it showed up as
12482 a bug in the Mono runtime when applying the params attribute).
12484 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
12485 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
12487 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
12489 * expression.cs (Unary.ResolveOperator): Use TypeManager
12490 to resolve the type.
12492 2002-06-13 Ravi Pratap <ravi@ximian.com>
12494 * cs-parser.jay (enum_member_declaration): Pass in the attributes
12497 * enum.cs (AddEnumMember): Add support to store the attributes associated
12498 with each member too.
12500 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
12501 field builders too - this takes care of the enum member case.
12503 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
12505 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
12506 address-of operator on both value types and pointers.
12508 2002-06-10 Martin Baulig <martin@gnome.org>
12510 * interface.cs (Interface.PopulateIndexer): Add the indexer's
12511 PropertyBuilder to the `property_builders' list.
12513 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
12514 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
12515 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
12516 find any indexers which are inherited from an interface.
12518 2002-06-09 Martin Baulig <martin@gnome.org>
12520 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
12521 the same type as the constant if necessary. There's also a test-130.cs
12524 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
12526 * typemanager.cs (TypeManager.ChangeType): Previously known as
12527 Enum.ChangeEnumType().
12529 2002-06-09 Martin Baulig <martin@gnome.org>
12531 * expression.cs (Cast.TryReduce): Added support for consts.
12533 2002-06-08 Ravi Pratap <ravi@ximian.com>
12535 * class.cs (Accessor): Hold attributes information so we can pass
12538 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
12539 Modify to pass in attributes attached to the methods.
12541 (add_accessor_declaration, remove_accessor_declaration): Ditto.
12543 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
12544 to handle the Accessor kind :-)
12546 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
12548 2002-06-08 Martin Baulig <martin@gnome.org>
12550 * expression.cs (Unary.TryReduceNegative): Added support for
12553 2002-06-08 Martin Baulig <martin@gnome.org>
12555 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
12556 name can't be found in the `defined_names' - the caller will do a
12557 MemberLookup in this case and thus find methods in System.Enum
12558 such as Enum.IsDefined().
12560 2002-06-08 Martin Baulig <martin@gnome.org>
12562 * enum.cs (Enum.ChangeEnumType): This is a custom version of
12563 Convert.ChangeType() which works with TypeBuilder created types.
12564 (Enum.LookupEnumValue, Enum.Define): Use it here.
12566 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
12567 `TypeBuilder.BaseType != null' check.
12568 (TypeContainer.FindMembers): Only lookup parent members if we
12569 actually have a parent.
12570 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
12571 (ConstructorInitializer.Resolve): Likewise.
12573 * interface.cs (Interface.FindMembers): Added
12574 `TypeBuilder.BaseType != null' check.
12576 * rootcontext.cs (RootContext.ResolveCore): Added
12577 "System.Runtime.CompilerServices.IndexerNameAttribute" to
12578 classes_second_stage.
12580 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
12581 debug_type and trace_type when compiling with --nostdlib.
12583 2002-06-07 Martin Baulig <martin@gnome.org>
12585 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
12586 (AddField): Set it to true when adding a non-static field.
12587 (DefineType): Use `have_nonstatic_fields' to find out whether we
12588 have non-static fields, not `Fields != null'.
12590 2002-06-02 Miguel de Icaza <miguel@ximian.com>
12592 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
12593 dereferencing a null on the static-field code path)
12595 2002-05-30 Martin Baulig <martin@gnome.org>
12597 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
12598 to take command line arguments. Use reflection to call the new
12599 custom `Initialize' function on the symbol writer and pass it the
12600 command line arguments.
12602 * driver.cs (--debug-args): New command line argument to pass command
12603 line arguments to the symbol writer.
12605 2002-05-28 Miguel de Icaza <miguel@ximian.com>
12607 * assign.cs (DoResolve): Forgot to do the implicit conversion to
12608 the target type for indexers and properties. Thanks to Joe for
12611 2002-05-27 Miguel de Icaza <miguel@ximian.com>
12613 * typemanager.cs (MethodFlags): returns the method flags
12614 (Obsolete/ShouldIgnore) that control warning emission and whether
12615 the invocation should be made, or ignored.
12617 * expression.cs (Invocation.Emit): Remove previous hack, we should
12618 not do this on matching a base type, we should do this based on an attribute
12620 Only emit calls to System.Diagnostics.Debug and
12621 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
12622 on the command line.
12624 * rootcontext.cs: Global settings for tracing and debugging.
12626 * cs-tokenizer.cs (define): New utility function to track
12627 defines. Set the global settings for TRACE and DEBUG if found.
12629 2002-05-25 Ravi Pratap <ravi@ximian.com>
12631 * interface.cs (Populate*): Pass in the TypeContainer as well as
12632 the DeclSpace as parameters so that we can create EmitContexts and
12633 then use that to apply attributes etc.
12635 (PopulateMethod, PopulateEvent, PopulateProperty)
12636 (PopulateIndexer): Apply attributes everywhere.
12638 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
12641 (ApplyAttributes): Update accordingly.
12643 We now apply interface attributes for all members too.
12645 2002-05-26 Miguel de Icaza <miguel@ximian.com>
12647 * class.cs (Indexer.Define); Correctly check if we are explicit
12648 implementation (instead of checking the Name for a ".", we
12649 directly look up if the InterfaceType was specified).
12651 Delay the creation of the PropertyBuilder.
12653 Only create the PropertyBuilder if we are not an explicit
12654 interface implementation. This means that explicit interface
12655 implementation members do not participate in regular function
12656 lookups, and hence fixes another major ambiguity problem in
12657 overload resolution (that was the visible effect).
12659 (DefineMethod): Return whether we are doing an interface
12662 * typemanager.cs: Temporary hack until we get attributes in
12663 interfaces (Ravi is working on that) and we get IndexerName
12664 support in interfaces.
12666 * interface.cs: Register the indexers as properties.
12668 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
12669 warning, I have verified that this is a bug in the .NET runtime
12670 (JavaScript suffers of the same problem).
12672 * typemanager.cs (MemberLookup): When looking up members for
12673 interfaces, the parent of an interface is the implicit
12674 System.Object (so we succeed in searches of Object methods in an
12675 interface method invocation. Example: IEnumerable x; x.ToString
12678 2002-05-25 Miguel de Icaza <miguel@ximian.com>
12680 * class.cs (Event): Events should also register if they do
12681 implement the methods that an interface requires.
12683 * typemanager.cs (MemberLookup); use the new GetInterfaces
12686 (GetInterfaces): The code used to lookup interfaces for a type is
12687 used in more than one place, factor it here.
12689 * driver.cs: Track the errors at the bottom of the file, we kept
12692 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
12693 instance if the method we are calling is static!
12695 2002-05-24 Miguel de Icaza <miguel@ximian.com>
12697 * attribute.cs (ApplyAttributes): Make this function filter out
12698 the IndexerName attribute (as that attribute in reality is never
12699 applied) and return the string constant for the IndexerName
12702 * class.cs (TypeContainer.Emit): Validate that all the indexers
12703 have the same IndexerName attribute, and if so, set the
12704 DefaultName attribute on the class.
12706 * typemanager.cs: The return value might contain other stuff (not
12707 only methods). For instance, consider a method with an "Item"
12708 property and an Item method.
12710 * class.cs: If there is a problem with the parameter types,
12713 2002-05-24 Ravi Pratap <ravi@ximian.com>
12715 * ecore.cs (ImplicitConversionExists): Wrapper function which also
12716 looks at user defined conversion after making a call to
12717 StandardConversionExists - we need this for overload resolution.
12719 * expression.cs : Update accordingly the various method calls.
12721 This fixes 2 bugs filed against implicit user defined conversions
12723 2002-05-22 Miguel de Icaza <miguel@ximian.com>
12725 * statement.cs: Track the result of the assignment.
12727 2002-05-21 Miguel de Icaza <miguel@ximian.com>
12729 * expression.cs (MemberAccess): Improved error reporting for
12730 inaccessible members.
12732 2002-05-22 Martin Baulig <martin@gnome.org>
12734 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
12735 itself with debugging support.
12737 2002-05-22 Martin Baulig <martin@gnome.org>
12739 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
12740 Removed, this isn't needed anymore.
12742 2002-05-20 Martin Baulig <martin@gnome.org>
12744 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
12745 be underlying type for an enum.
12747 2002-05-20 Miguel de Icaza <miguel@ximian.com>
12749 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
12750 that splits out the loading of just the core types.
12752 * rootcontext.cs (ResolveCore): Split the struct resolution in
12753 two, so we can load the enumeration underlying types before any
12756 * expression.cs (Is): Bandaid until we fix properly Switch (see
12757 bug #24985 for details).
12759 * typemanager.cs (ImplementsInterface): The hashtable will contain
12760 a null if there are no interfaces implemented.
12762 2002-05-18 Miguel de Icaza <miguel@ximian.com>
12764 * cs-parser.jay (indexer_declarator): It is fine to have array
12767 2002-05-17 Miguel de Icaza <miguel@ximian.com>
12769 * typemanager.cs: (RegisterBuilder): New function used to register
12770 TypeBuilders that implement interfaces. Since
12771 TypeBuilder.GetInterfaces (as usual) does not work with lame
12773 (AddUserType): register interfaces.
12775 (ImplementsInterface): Use the builder_to_ifaces hash if we are
12776 dealing with TypeBuilder. Also, arrays are showing up as
12777 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
12778 methods can not be invoked on them!
12780 * ecore.cs (ExplicitReferenceConversionExists): Made public.
12781 (ImplicitReferenceConversionExists): Split out from
12782 StandardConversionExists.
12784 * expression.cs (As): We were only implementing one of the three
12785 cases for the as operator. We now implement them all.
12786 (Is): Implement the various other cases for Is as well.
12788 * typemanager.cs (CACHE): New define used to control if we want or
12789 not the FindMembers cache. Seems to have a negative impact on
12790 performance currently
12792 (MemberLookup): Nested types have full acess to
12793 enclosing type members
12795 Remove code that coped with instance/static returns for events, we
12796 now catch this in RealFindMembers.
12798 (RealFindMembers): only perform static lookup if the instance
12799 lookup did not return a type or an event.
12801 2002-05-17 Miguel de Icaza <miguel@ximian.com>
12803 * assign.cs (CompoundAssign): We pass more semantic information
12804 now to Compound Assignments than we did before: now we have all
12805 the information at hand, and now we resolve the target *before* we
12806 do the expression expansion, which allows the "CacheValue" method
12807 to have the effect we intended (before, a [x] += 1 would generate
12808 two differen ArrayAccess expressions from the ElementAccess,
12809 during the resolution process).
12811 (CompoundAssign.DoResolve): Resolve target and original_source here.
12813 2002-05-16 Miguel de Icaza <miguel@ximian.com>
12815 * expression.cs (ArrayAccess): dropped debugging information.
12817 * typemanager.cs: Small bug fix: I was always returning i_members,
12818 instead of one of i_members or s_members (depending on which had
12821 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
12822 method is invoked before any code generation takes place, and it
12823 is a mechanism to inform that the expression will be invoked more
12824 than once, and that the method should use temporary values to
12825 avoid having side effects
12827 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
12829 * ecore.cs (Expression.CacheTemporaries): Provide empty default
12832 * expression.cs (Indirection, ArrayAccess): Add support for
12833 CacheTemporaries in these two bad boys.
12835 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
12836 ldobj or ldind_ref.
12837 (StoreFromPtr): Handle stobj as well.
12839 * expression.cs (UnaryMutator): Share more code.
12841 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
12842 down: I was not tracking the Filter function as well, which
12843 was affecting the results of the cache.
12845 2002-05-15 Miguel de Icaza <miguel@ximian.com>
12847 * attribute.cs: Remove the hack to handle the CharSet property on
12850 2002-05-14 Miguel de Icaza <miguel@ximian.com>
12852 * attribute.cs (DoResolve): More uglyness, we now only try to
12853 resolve the attribute partially, to extract the CharSet
12854 information (only if we are a StructLayout attribute). Otherwise
12856 (GetExtraTypeInfo): Add some code to conditionally kill in the
12857 future this. I am more and more convinced that the .NET
12858 framework has special code to handle the attribute setting on
12861 * expression.cs (IsParamsMethodApplicable): Revert my previous
12862 foreach change here, it was wrong.
12864 2002-05-13 Miguel de Icaza <miguel@ximian.com>
12866 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
12867 (pp_expr): do not abort on unknown input, just return.
12868 (eval): abort if there are pending chars.
12870 * attribute.cs (Attribute.Resolve): Positional parameters are
12871 optional. Deal with that case.
12873 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
12874 the Ansi/Unicode/Auto information for the type.
12876 (TypeContainer.DefineType): instantiate the EmitContext here, as
12877 we will be using it during the type definition (to resolve
12878 attributes) and during the emit phase.
12880 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
12881 to pull type information out of the attributes
12883 (Attribute.Resolve): track the constructor builder, and allow for
12884 multiple invocations (structs and classes will use this).
12886 * ecore.cs (MemberLookupFinal): new version with all the
12887 parameters customizable.
12889 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
12890 constructors. Return if the result value is null (as the error
12891 would have been flagged already by MemberLookupFinal)
12893 Do not allow instances of abstract classes or interfaces to be
12896 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
12897 We have to compare the assembly property here when dealing with
12898 FamANDAssem and Assembly access modifiers, because we might be
12899 creating an assembly from *modules* (that means that we are not
12900 getting TypeBuilders for types defined in other modules that are
12901 part of this assembly).
12903 (Method.Emit): If the method is marked abstract and has a body,
12906 (TypeContainer.DefineMembers): If both the defined member and the
12907 parent name match are methods, then do not emit any warnings: let
12908 the Method.Define routine take care of flagging warnings. But if
12909 there is a mismatch (method overrides something else, or method is
12910 overriwritten by something, then emit warning).
12912 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
12913 set to null, this means `do not check for the return type on the
12916 (Method.Define): set the return type for the method signature to
12917 null, so that we get methods with the same name and parameters and
12918 different return types. This is used to flag warning 114 (you are
12919 hiding a method, and you probably want to use the new/override
12922 * typemanager.cs (MemberLookup): Implemented proper access
12923 control, closing a long standing set of bug reports. The problem
12924 was that the Framework only has two bits: Public and NonPublic,
12925 and NonPublic includes private and protected methods, but we need
12926 to enforce the FamANDAssem, FamOrAssem and Family.
12928 2002-05-11 Miguel de Icaza <miguel@ximian.com>
12930 * statement.cs (GotoCase): Return true: Ammounts to giving up
12931 knowledge on whether we return or not, and letting the other case
12932 be responsible for it.
12934 2002-05-10 Miguel de Icaza <miguel@ximian.com>
12936 * driver.cs: Do not load directories for each file processed, only
12937 do it if there is a pattern.
12939 * ecore.cs: Report readonly assigns here as well, as we might have
12940 been resolved only by MemberAccess.
12942 (SimpleName.SimpleNameResolve): Also be useful for LValue
12943 resolution. We need this to propagate assign to local readonly variables
12945 * typemanager.cs: Use a ptrhashtable for the criteria, because we
12946 do not want to reuse potential criteria memory.
12948 * class.cs (MyEventBuilder): Set reflected_type;
12950 * ecore.cs (Constantify): Added support for constifying bools.
12952 (RootContext.LookupType): Added a cache for values looked up in
12953 the declaration space.
12955 * typemanager.cs (FindMembers): Now is a front-end to
12956 RealFindMembers, and provides a two-level hashtable-based cache to
12959 15% performance improvement: from 22.5 to 19.2 seconds.
12961 * expression.cs (IsParamsMethodApplicable): use foreach.
12962 (Invocation.DoResolve): ditto.
12963 (New.DoResolve): ditto.
12964 (ArrayCreation.DoResolve): ditto.
12966 * ecore.cs (FindMostEncompassingType): use foreach.
12968 * delegate.cs (NewDelegate.DoResolve): Use foreach
12970 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
12971 (RemoveMethods): use foreach.
12973 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
12974 nested foreach statements instead of for, and also break out of
12975 the inner loop once a match is found.
12977 (Invocation.OverloadResolve): Use foreach, simplify the code.
12979 2002-05-08 Miguel de Icaza <miguel@ximian.com>
12981 * cfold.cs (BinaryFold): During an enumeration evaluation context,
12982 we actually unwrap the expression to allow for extra information
12985 * expression.cs: Use Shr_Un on unsigned operations.
12987 2002-05-08 Ravi Pratap <ravi@ximian.com>
12989 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
12990 applicable operators was not being considered correctly. This closes
12991 the bug Miguel reported.
12993 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
12995 * attribute.cs: check that the type derives from System.Attribute
12996 and report the correct error in that case (moved the duplicate code to
12997 its own method, too).
12999 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
13001 * attribute.cs: lookup attribute type name as the spec says: first the
13002 bare attribute name and then name + "Attribute" (nant compiles with
13003 mcs after this fix).
13005 2002-05-07 Miguel de Icaza <miguel@ximian.com>
13007 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
13008 Because of the way we parse things, we should try to see if a
13009 UIntConstant can fit in an integer.
13011 2002-05-07 Ravi Pratap <ravi@ximian.com>
13013 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
13014 when we are in an explicit context.
13016 (ConvertReferenceExplicit): When converting from Iface type S to Class
13017 T make sure the rules are implemented as an OR.
13019 * parameter.cs (ParameterType): Make it a property for now although the
13020 purpose really isn't anything immediate.
13022 * expression.cs (Is*Applicable): Do better checking on the parameter type
13023 of a ref/out parameter. The ones from the system assemblies are already
13024 marked with the correct type so we don't need to do any correction.
13026 * ecore.cs (StandardConversionExists): Conversion from Interface types to
13027 the object type is standard too so include that.
13029 2002-05-06 Miguel de Icaza <miguel@ximian.com>
13031 * ecore.cs (StandardConversionExists): Augment with missing code:
13032 deal with IntConstant, LongConstants and Enumerations.
13034 * assign.cs: Report the error, instead of failing silently
13036 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
13037 typecontainer that they are declared, because the
13038 typecontainer/namespace will have the list of using clauses that
13039 need to be applied.
13041 Assembly Attributes were escaping the normal registration
13044 (EmitCode): Apply attributes within an EmitContext that represents
13045 the container they were declared on.
13047 * cs-parser.jay: Track bases for structs. How did I get this wrong?
13049 2002-05-06 Ravi Pratap <ravi@ximian.com>
13051 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
13052 Revamp completely - make much cleaner as we now operate only
13055 (FindMostSpecificSource, FindMostSpecificTarget): New methods
13056 to implement the logic detailed in the spec more correctly.
13058 (UserDefinedConversion): Update accordingly.
13060 2002-05-06 Miguel de Icaza <miguel@ximian.com>
13062 * statement.cs: Return flow analysis information up.
13064 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
13067 (token): Do not consume an extra character before calling
13070 2002-05-06 Piers Haken <piersh@friskit.com>
13072 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
13074 2002-05-06 Miguel de Icaza <miguel@ximian.com>
13076 * class.cs (Constructor.Emit): Set the IsStatic flag in the
13077 EmitContext during the instance constructor initializer
13078 resolution, to stop access to instance variables.
13080 This is mandated by the spec, last paragraph of the `constructor
13081 initializers' section.
13083 2002-05-05 Miguel de Icaza <miguel@ximian.com>
13085 * cs-parser.jay, class.cs (Accessor): new class used to represent
13086 an accessor (get or set). In the past we used `null' to represent
13087 a missing accessor. But this is ambiguous because there was no
13088 way to tell in abstract indexers/properties if one of them was
13091 Now there is a way of addressing that.
13093 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
13094 instead of FindMembers.
13096 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
13097 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
13099 * attribute.cs: Treat indexers and properties as the same in terms
13100 of applying attributes
13102 * ecore.cs (FindMostEncompassedType): Use statically initialized
13103 EmptyExpressions()s like we do elsewhere to avoid creating useless
13104 objects (and we take this out of the tight loop).
13106 (GetConversionOperators): Move the code to extract the actual
13107 operators to a separate routine to clean things up.
13109 2002-05-04 Miguel de Icaza <miguel@ximian.com>
13111 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
13112 events are always registered FieldBuilders.
13114 * class.cs (FieldBase): New class shared by Fields
13116 * delegate.cs: If we are a toplevel delegate, use our full name.
13117 If we are a nested delegate, then only use our tail name.
13119 2002-05-02 Ravi Pratap <ravi@ximian.com>
13121 * expression.cs (IsApplicable): Ensure that we add the "&" to
13122 ref/out types before comparing it with the type of the argument.
13124 (IsParamsMethodApplicable): Ditto.
13126 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
13129 * delegate.cs : Handle the case when we have more than one applicable
13130 method. Flag an error only when we finish checking all.
13132 2002-05-02 Miguel de Icaza <miguel@ximian.com>
13134 * expression.cs: Add support for boolean static initializers.
13136 2002-05-01 Miguel de Icaza <miguel@ximian.com>
13138 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
13140 * parameter.cs (ComputeParameterTypes,
13141 ComputeAndDefineParameterTypes): Better error handling: now we
13142 clear the `types' cache if we fail during any of the type lookups.
13143 We also return the status code correctly to our caller
13145 * delegate.cs: If we fail to define a delegate, abort the extra
13148 * expression.cs (Binary.ResolveOperator): for
13149 operator==(object,object) and operator !=(object, object) we also
13150 have to verify that there is an implicit conversion from one to
13153 (ArrayAccess.DoResolve): Array Access can operate on
13156 2002-04-30 Miguel de Icaza <miguel@ximian.com>
13158 * assign.cs (CompoundAssign): A new class used as a "flag" that
13159 the assignment actually is happening as part of a compound
13160 assignment operator.
13162 During compound assignment, a few new rules exist to enable things
13169 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
13170 to the type of x) if y is implicitly convertible to the type of x,
13171 and the operator is a builtin operator and the return type of the
13172 operator is explicitly convertible to the type of x.
13174 * rootcontext.cs: Reset warning level to 2. 4 catches various
13175 "interesting" features in mcs, we must clean this up at some
13176 point, but currently am trying to kill other bugs ;-)
13178 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
13179 in container classes as well.
13181 * expression.cs (Binary.ResolveOperator): Handle string case
13182 before anything else (as operator overloading does emit an error
13183 before doing anything else).
13185 This code could go away when we move to a table driven model, but
13186 i could not come up with a good plan last night.
13188 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
13190 * typemanager.cs (CSharpName): reimplementation using regex.
13191 * class.cs: added null check for fields in Emit
13192 * rootcontext.cs: set warninglevel to 4
13194 2002-04-29 Miguel de Icaza <miguel@ximian.com>
13196 * typemanager.cs (CSharpName): reimplemented with Lupus
13199 2002-04-28 Miguel de Icaza <miguel@ximian.com>
13201 * statement.cs (If): correclty implement Resolve, because we were
13202 not catching sem errors in there. The same process is needed
13204 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
13207 (Statement.Warning_DeadCodeFound): Factorize code.
13208 (While): Report dead code here too.
13210 (Statement): Added Resolve virtual method to allow
13211 for resolution split from the emit code.
13213 2002-04-26 Miguel de Icaza <miguel@ximian.com>
13215 * statement.cs (EmitBoolExpression): No longer try to resolve the
13217 (MakeBoolean): New utility function that resolve, implicitly
13218 converts to boolean and tags the expression.
13221 (If, Do): Implement dead code elimination.
13222 (While): Implement loop inversion
13224 (Do, While, For, If): Resolve the expression prior to calling our
13227 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
13230 - added method Report28 (warning: program has more than one entry point)
13231 - added method IsEntryPoint, implements paragraph 10.1 of the spec
13232 - modified method Method.Define, the part at the end of the method
13234 * rootcontext.cs: added static public Location EntryPointLocation;
13236 * ../errors/cs0028.cs : Add test case for the above warning.
13239 - modified method CSharpName to allow arrays of primitive type to
13240 be printed nicely (e.g. instead of System.Int32[][] it now prints
13242 - added method CSharpSignature: returns the signature of a method
13243 in string format to be used in reporting errors, warnings, etc.
13245 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
13248 2002-04-26 Ravi Pratap <ravi@ximian.com>
13250 * delegate.cs (Define): Fix extremely silly bug where I was
13251 setting the type of the 'object' parameter of the BeginInvoke
13252 method to System.IAsyncResult instead of System.Object ;-)
13254 2002-04-26 Miguel de Icaza <miguel@ximian.com>
13256 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
13259 (Constructor.Emit): return if we fail to initialize the
13260 constructor. Another door closed!
13262 * expression.cs (New.DoResolve): Improve error message (from -6 to
13263 1501). Use DeclaredOnly lookup to find the exact constructor.
13265 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
13266 loop. This is useful.
13268 * cs-parser.jay: Adjust the default parameters so that destructors
13269 have the proper signature.
13271 2002-04-26 Martin Baulig <martin@gnome.org>
13273 * driver.cs (LoadAssembly): If `assembly' contains any characters
13274 which are only valid in path names and not in assembly names
13275 (currently slash, backslash and point), use Assembly.LoadFrom ()
13276 instead of Assembly.Load () on the `assembly' (before iteration
13277 over the link_paths).
13279 2002-04-26 Martin Baulig <martin@gnome.org>
13281 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
13283 2002-04-25 Miguel de Icaza <miguel@ximian.com>
13285 * class.cs (Property): use the new typemanager.MemberLookup
13287 (TypeContainer.MemberLookup): Implement using the
13288 TypeManager.MemberLookup now.
13290 * typemanager.cs: Make MemberLookup a function of the TypeManager,
13291 and return MemberInfos, so that these can be used without an
13292 EmitContext (what we had before).
13294 2002-04-24 Miguel de Icaza <miguel@ximian.com>
13296 * expression.cs: Fix the case where the argument to params if the
13297 type of the params. I omitted handling this before. Fixed
13299 2002-04-22 Miguel de Icaza <miguel@ximian.com>
13301 * driver.cs: Call BootCorlib_PopulateCoreType
13303 * class.cs (Property.CheckBase): Check for properties only, not
13306 * interface.cs: Temporary hack: try/catch around the
13307 CustomAttributeBuilder, because I am getting an exception that I
13310 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
13311 types whose definitions are required to be there (attributes are
13312 defined before standard types).
13314 Compute definitions as we boot the various types, as they are used
13315 immediately (value_type class will need object_type, but if we do
13316 not initialize object_type, we will pass a null, which will let
13317 the runtime pick the System.Object from the existing corlib, which
13318 is not what we want).
13320 2002-04-22 Patrik Torstensson <totte@labs2.com>
13322 * cs-tokenizer.cs: fixed a number of trim() issues.
13324 2002-04-22 Ravi Pratap <ravi@ximian.com>
13326 * expression.cs (Argument.Type): Ensure that we return the correct
13327 type when we have out or ref parameters [in which case we
13330 2002-04-22 Miguel de Icaza <miguel@ximian.com>
13332 * class.cs (Property, Indexer): Allow extern modifier in there.
13334 * typemanager.cs (InitBaseTypes): Initializes object_type and
13335 value_type, since those will be used early on during the bootstrap
13336 process to compile corlib.
13338 (InitCoreTypes): Move code from here to InitBaseTypes.
13340 2002-04-21 Miguel de Icaza <miguel@ximian.com>
13342 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
13343 single-dimension arrays as using the ldlen opcode.
13345 Daniel Lewis discovered this optimization.
13347 * typemanager.cs: Add signature for System.Array::get_Length
13349 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13351 * statement.cs: report the error when the foreach does not apply to an
13352 array nor a collection.
13354 2002-04-19 Miguel de Icaza <miguel@ximian.com>
13356 * expression.cs: Add implicit conversions to the operator ~.
13358 * constant.cs (DecimalConstant.Emit): Emit decimal value.
13360 * typemanager.cs: Locate the decimal constructor.
13362 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13364 * attribute.cs: use the new property of TypeOf.
13365 * expression.cs: added 'get' property around typearg.
13367 These changes fix a build breaker reported by NickD. Is this the
13368 correct way to fix? If not, please, revert my changes and make it
13371 2002-04-17 Miguel de Icaza <miguel@ximian.com>
13373 * attribute.cs: Add support for typeof in attribute invocations.
13374 I am not sure that this is right though.
13376 2002-04-14 Duncan Mak <duncan@ximian.com>
13378 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
13379 Binary.Operator.Division case.
13381 2002-04-13 Ravi Pratap <ravi@ximian.com>
13383 * class.cs (DefineType): Ensure that we do a proper check on
13384 attribute types and also register it with the TypeManager.
13386 (TypeContainer.Targets): The default for attribute types is
13387 AttributeTargets.All.
13389 * attribute.cs (ApplyAttributes): Registering the attribute type
13390 is done elsewhere, not when we discover we have a Usage attribute.
13392 2002-04-12 Ravi Pratap <ravi@ximian.com>
13394 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
13395 and get rid of is_delegate parameter.
13397 * everywhere : update.
13399 2002-04-12 Ravi Pratap <ravi@ximian.com>
13401 * cs-parser.jay (compilation_unit): Revamp completely to use
13402 some new ideas that I got from Rhys' grammar to solve the problems
13403 with assembly level attributes.
13405 (outer_declaration): New grammar production.
13407 (attribute_sections): Add.
13409 (opt_attributes): Base on attribute_sections
13411 (namespace_declaration): Allow opt_attributes to tackle the case
13412 when we have assembly level attributes - we are clever in this
13415 * attribute.cs (ApplyAttributes): Do not worry about assembly
13416 attributes in the non-global context.
13418 * rootcontext.cs (AddGlobalAttributes): Go back to using this
13419 instead of SetGlobalAttributes.
13421 * class.cs, rootcontext.cs : Ensure we define and generate
13422 attribute types before anything else.
13424 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
13425 and flag the new error -20 for the case when the attribute type
13426 does not have valid targets specified. csc does not catch this.
13428 * ../errors/errors.txt : update for error # -20
13430 2002-04-11 Ravi Pratap <ravi@ximian.com>
13432 * support.cs (InternalParameters.ParameterModifier): Do some null
13433 checking and return sane values.
13435 * class.cs (Method.Define): If we are a PInvoke method, ensure
13436 that we are static and extern. Report error # 601
13438 * ../errors/cs0601.cs : Add test case for the above error.
13440 2002-04-07 Ravi Pratap <ravi@ximian.com>
13442 * rootcontext.cs (attribute_types): We need to keep type of
13443 all attribute types separately and emit code for them first.
13445 (RegisterAttribute) : Implement.
13447 * class.cs (DefineType): Check if the current Type is a custom
13448 attribute type and register it accordingly.
13450 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
13451 adding the first attribute twice and rename to
13453 (SetGlobalAttributes): this.
13455 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
13458 * attribute.cs (ApplyAttributes): Take an additional argument telling us
13459 if we are processing global arguments. Hmm, I am unsure of this.
13461 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13463 * expression.cs: added static array of strings to avoid calling
13464 Enum.ToString () for Operator in Binary. Significant recover of
13467 2002-04-10 Miguel de Icaza <miguel@ximian.com>
13469 * class.cs (FindMembers): Allow the Builders of the various
13470 members to be null. If they are skip them. This only happens
13471 during the PInvoke declaration.
13473 2002-04-09 Miguel de Icaza <miguel@ximian.com>
13475 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
13476 failure, so we do not keep going afterwards.
13478 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
13479 wanted to pass `false' as the `is_delegate' argument. If this is
13480 the case, why not use delegate_type == null to mean `is_delegate =
13481 false' and anything else as is_delegate = true.
13483 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
13485 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
13486 code for the section, not the beginning of the tests.
13488 2002-04-08 Miguel de Icaza <miguel@ximian.com>
13490 * cfold.cs: Handle operator + (Enum x, Underlying x)
13492 * expression.cs (Binary): same. Warn about errors where we have
13493 Enum/Enum in operator + as well.
13495 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
13498 - added support for switch(bool)
13499 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
13500 - add TableSwitchEmit() to handle table-based switch statements
13502 2002-04-05 Ravi Pratap <ravi@ximian.com>
13504 * expression.cs (Invocation.OverloadResolve): Factor out code which
13505 does parameter compatibility checking with arguments so that we can
13506 re-use the code even from Delegate.VerifyApplicability
13508 (VerifyArgumentsCompat): Move above code here.
13510 * delegate.cs (VerifyApplicability): Get rid of duplicate code
13511 and instead make a call to the above method.
13513 2002-03-31 Ravi Pratap <ravi@ximian.com>
13515 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
13516 We use it to keep track of classes which are attribute types.
13518 2002-04-02 Miguel de Icaza <miguel@ximian.com>
13520 * delegate.cs (Delegate.Define): Correctly define the types in the
13521 presence of fixed and array parameters.
13523 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
13526 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
13527 include NonPublic after the first iteration.
13529 * class.cs (Indexer.CheckBase): Only check if both parents are
13532 * cs-parser.jay (accessor_body): If empty, set to null.
13534 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
13535 same code path here to resolve constants names that we did have in
13536 MemberAccess.DoResolve. There is too much code duplicated here.
13538 2002-04-01 Miguel de Icaza <miguel@ximian.com>
13540 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
13542 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
13545 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
13546 tokens, numbers and strings.
13548 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
13551 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
13552 asyncronous parameters and the regular parameters.
13554 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
13555 specify the target directory.
13557 * expression.cs: (This.DoResolve): Simplify
13558 (As.Emit): Optimize, do not generate IsInst if the expression is
13559 always of the given type.
13561 (Is.DoResolve): Bug fix, we were reporting both always/never for
13564 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
13565 creating too many unnecessary arrays.
13567 2002-03-31 Miguel de Icaza <miguel@ximian.com>
13569 * class.cs (EmitFieldInitializer): Use Assign expression to assign
13570 fields instead of rolling our own initializer. Takes care of all
13571 implicit conversions, and drops unnecessary static checks/argument.
13573 2002-03-31 Dick Porter <dick@ximian.com>
13575 * driver.cs: use the GetDirectories() return values properly, and
13576 use "/" as path separator.
13578 2002-03-30 Miguel de Icaza <miguel@ximian.com>
13580 * expression.cs (Unary): Optimize - - expr into expr.
13581 (Binary): Optimize a + (-b) into a -b.
13583 * codegen.cs (CodeGen): Made all methods static.
13585 2002-03-29 Miguel de Icaza <miguel@ximian.com>
13589 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
13590 TypeBuilder property.
13592 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
13595 * tree.cs: Removed the various RecordXXXX, and replaced with a
13596 single RecordDecl. Removed all the accessor methods, and just
13597 left a single access point Type
13599 * enum.cs: Rename DefineEnum to DefineType.
13601 * decl.cs: New abstract method `DefineType' used to unify the
13602 Defines for Enumerations, Interfaces, TypeContainers and
13605 (FindType): Moved LookupInterfaceOrClass here. Moved the
13606 LookupBaseClasses method that used to live in class.cs and
13607 interface.cs here, and renamed to FindType.
13609 * delegate.cs: Implement DefineType. Take advantage of the
13610 refactored pattern for locating the parent builder without taking
13611 the parent_builder argument (which we know does not work if we are
13612 nested, and triggering a toplevel definition).
13614 2002-03-28 Miguel de Icaza <miguel@ximian.com>
13616 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
13617 accessibility of a member has changed during override and report
13620 * class.cs (Method.Define, Property.Define): Only complain on
13621 overrides if the method is private, any other accessibility is
13622 fine (and since we just checked the permission is the same, we are
13625 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
13626 and elif are processed always. The other pre-processing
13627 directives are only processed if we are "taking" the path
13629 2002-03-29 Martin Baulig <martin@gnome.org>
13631 * class.cs (Method.Emit): Only emit symbolic debugging info if the
13632 current location is not Null.
13634 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
13635 a separate method so we can profile it.
13637 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
13638 `span.Seconds' are just seconds, but no minutes or hours.
13639 (MainDriver): Profile the CodeGen.SaveSymbols calls.
13641 2002-03-28 Miguel de Icaza <miguel@ximian.com>
13643 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
13644 Remove the gratuitous set of Final:
13646 // If an interface implementation, then we can set Final.
13647 if (((flags & MethodAttributes.Abstract) == 0) &&
13648 implementing.DeclaringType.IsInterface)
13649 flags |= MethodAttributes.Final;
13651 I do not know what I was smoking when I used that.
13654 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
13655 step into fixing the name resolution issues for delegates and
13656 unifying the toplevel name resolution.
13658 2002-03-28 Martin Baulig <martin@gnome.org>
13660 * class.cs (Method.Emit): If we have a symbol writer, call its
13661 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
13662 tell it about the current method.
13664 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
13665 writer that we're going to emit the first byte of IL code for a new
13666 statement (a new source line).
13667 (EmitContext.EmitTopBlock): If we have a symbol writer, call
13668 EmitContext.Mark() before emitting any code.
13670 * location.cs (SymbolDocument): Return null when we're Null.
13672 * statement.cs (Statement): Moved the `Location loc' variable here.
13673 (Statement.EmitBoolExpression): If we have a symbol writer, call
13674 ec.Mark() before emitting any code to tell it that we're at the
13675 beginning of a new statement.
13676 (StatementExpression): Added `Location' argument to the constructor.
13677 (Block): Added public readonly variable `StartLocation' and public
13678 variable `EndLocation'. The latter is to be set using SetEndLocation().
13679 (Block): Added constructor which takes a start and end location.
13680 (Block.SetEndLocation): New method. This sets the end location.
13681 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
13682 local variables we create.
13683 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
13684 each statement and do also mark the begin and end of the block.
13686 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
13687 tell it the current lexer.Location, use Location.Null for the end of the
13689 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
13690 current block, set its end location using SetEndLocation().
13691 (statement_expression): StatementExpression constructor now takes the
13692 lexer.Location as additional argument.
13693 (for_statement, declare_local_variables): Likewise.
13694 (declare_local_variables): When creating a new implicit block, use the
13695 new Block constructor and pass it the lexer.Location.
13697 2002-03-28 Miguel de Icaza <miguel@ximian.com>
13699 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
13700 members also on the parent interfaces recursively.
13702 2002-03-27 Miguel de Icaza <miguel@ximian.com>
13704 * report.cs: Use new formats, since Gonzalo finished the missing
13707 * expression.cs (Binary.ResolveOperator): added missing operator|
13708 operator& and operator^ for bool/bool.
13710 * cs-parser.jay: CheckDef now takes a Location argument that is
13711 used to report errors more precisly (instead of reporting the end
13712 of a definition, we try to track something which is a lot closer
13713 to the source of the problem).
13715 * cs-tokenizer.cs: Track global token use, so we can properly flag
13716 the use of #define/#undef after the first token has been seen.
13718 Also, rename the reportXXXX to Error_DescriptiveName
13720 * decl.cs (DeclSpace.IsTopLevel): Move property here from
13721 TypeContainer, so that Enum and Interface can use this too.
13723 * class.cs (TypeContainer.LookupInterfaceOrClass,
13724 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
13725 `builder' argument. Typically this was used to pass the parent
13726 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
13729 The problem is that a nested class could trigger the definition of
13730 a toplevel class, and the builder would be obviously wrong in that
13733 So we drop this argument, and we compute dynamically the
13734 TypeBuilder/ModuleBuilder (the correct information was available
13735 to us anyways from DeclSpace.Parent)
13737 * interface.cs (Interface.DefineInterface): Drop builder
13738 parameter cleanup like class.cs
13740 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
13743 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
13746 (Try.Emit): Propagate the returns value from the statement.
13748 (Return.Emit): Even if we are leavning
13750 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
13752 * modifiers.cs: Fix the computation of MethodAttributes flags.
13754 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
13756 * driver.cs: allow compilation of files that start with '/'.
13757 Add a default case when checking the argument of --target.
13759 2002-03-25 Miguel de Icaza <miguel@ximian.com>
13761 * interface.cs: Implement the same search algorithm for types in
13762 the interface code.
13764 * delegate.cs: Do not allow multiple definition.
13766 * Recovered ChangeLog that got accidentally amputated
13768 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
13770 * rootcontext.cs: Load manually enum to allow core classes to
13771 contain enumerations.
13773 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
13774 Update to new static methods in TypeManager.
13776 * typemanager.cs (GetMethod, GetConstructor): Use our
13777 implementation of FindMembers to find the members, since during
13778 corlib compilation, the types are TypeBuilders and GetMethod and
13779 GetConstructor do not work.
13781 Make all methods in TypeManager static.
13783 (InitCodeHelpers): Split the functionality from
13784 the InitCodeTypes function.
13786 * driver.cs: Call InitCodeHelpers after we have populated the
13789 * cs-parser.jay (delegate_declaration): we did not used to compute
13790 the delegate name correctly for void delegates.
13792 2002-03-24 Miguel de Icaza <miguel@ximian.com>
13794 * rootcontext.cs (RootContext): Init the interface_resolve_order
13795 and type_container_resolve_order always.
13797 (ResolveCore, BootstrapCorlib_ResolveClass,
13798 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
13799 compiler when compiling with --nostdlib
13801 * class.cs (TypeContainer.DefineType): Check that our parent is
13802 not null. This test is most important when we are bootstraping
13805 * codegen.cs: Split out the symbol writing code.
13807 2002-03-25 Martin Baulig <martin@gnome.org>
13809 * driver.cs (-g): Made -g an alias for --debug.
13811 2002-03-24 Martin Baulig <martin@gnome.org>
13813 * codegen.cs (SymbolWriter): New public variable. Returns the
13814 current symbol writer.
13815 (CodeGen): Added `bool want_debugging_support' argument to the
13816 constructor. If true, tell the ModuleBuild that we want debugging
13817 support and ask it for the ISymbolWriter.
13818 (Save): If we have a symbol writer, call it's Close() method after
13819 saving the assembly.
13821 * driver.c (--debug): New command line argument to create a
13822 debugger information file.
13824 * location.cs (SymbolDocument): New public property. Returns an
13825 ISymbolDocumentWriter object for the current source file or null
13826 if we don't have a symbol writer.
13828 2002-03-21 Miguel de Icaza <miguel@ximian.com>
13830 * driver.cs (LoadAssembly): Correctly return when all the paths
13831 have been tried and not before.
13833 * statement.cs (Switch.Emit): return the actual coverage for this
13834 statement (returns/not-returns)
13836 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
13837 switch of the statement if we are the last switch section. That
13838 kills two problems: try/catch problems (we used to emit an empty
13839 nop at the end) and switch statements where all branches would
13842 2002-03-19 Miguel de Icaza <miguel@ximian.com>
13844 * driver.cs: Add default assemblies (the equivalent to the
13845 Microsoft CSC.RSP file)
13847 * cs-tokenizer.cs: When updating `cols and setting it to zero,
13848 also update tokens_seen and set it to false.
13850 * driver.cs: Implement --recurse for Mike.
13852 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
13853 correctly splitting out the paths.
13855 2002-03-18 Miguel de Icaza <miguel@ximian.com>
13857 * interface.cs (Interface.PopulateProperty): Instead of using
13858 `parent' as the declaration space for the set parameters, use
13861 * support.cs (InternalParameters): InternalParameters constructor
13862 takes a DeclSpace instead of a TypeContainer.
13864 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
13865 types are being initialized, load the address of it before calling
13868 (New): Provide a mechanism to disable the generation of local
13869 value type temporaries when the caller will be providing us with
13870 an address to store it.
13872 (ArrayCreation.EmitDynamicInitializers): Use it.
13874 2002-03-17 Miguel de Icaza <miguel@ximian.com>
13876 * expression.cs (Invocation.EmitArguments): Only probe for array
13877 property if there is more than one argument. Sorry about that.
13879 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
13880 empty param arrays.
13882 * class.cs (Method.LabelParameters): Fix incorrect code path that
13883 prevented the `ParamArrayAttribute' from being applied to the
13886 2002-03-16 Miguel de Icaza <miguel@ximian.com>
13888 * support.cs (ReflectionParameters): Correctly compute whether the
13889 last argument is a params array. Fixes the problem with
13892 * typemanager.cs: Make the assemblies array always be non-null
13893 (empty, but non-null)
13895 * tree.cs (RecordDecl): New function that abstracts the recording
13896 of names. This reports error 101, and provides a pointer to the
13897 previous declaration. Fixes a crash in the compiler.
13899 * cs-parser.jay (constructor_declaration): Update to new grammar,
13900 and provide a constructor_body that can be empty.
13902 2002-03-15 Miguel de Icaza <miguel@ximian.com>
13904 * driver.cs: Add support for --resources.
13906 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
13907 Make all types for the various array helper methods be integer.
13909 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
13910 CheckState to ConvCast.
13912 (ConvCast): Now it takes a `checked' state argument, to avoid
13913 depending on the emit context for the conversion, and just using
13914 the resolve time setting.
13916 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
13917 instead of Invocation.EmitArguments. We do not emit the original
13918 arguments, instead we emit those which have been converted to
13919 unsigned int expressions.
13921 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
13923 * codegen.cs: ditto.
13925 * expression.cs (LocalVariableReference): Drop the use of the
13926 Store function that depended on the variable index.
13928 * statement.cs (VariableInfo): Drop the `Idx' property from this
13929 class, as this is not taking into account the indexes for
13930 temporaries tat we generate during the execution, getting the
13933 * class.cs: First emit class initializers, then call the parent
13936 * expression.cs (Binary): Fix opcode emision.
13937 (UnaryMutator.EmitCode): Support checked code generation
13939 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
13940 matches for events for both the Static and Instance scans,
13941 pointing to the same element. Fix that.
13943 2002-03-14 Miguel de Icaza <miguel@ximian.com>
13945 * rootcontext.cs (ResolveTree): Always set the
13946 interface_resolve_order, because nested interfaces will be calling
13949 * class.cs (GetInterfaceOrClass): Track the same resolution
13950 process used by TypeManager.LookupType. This fixes the nested
13951 type lookups in class declarations (separate path from
13954 (TypeContainer.DefineType): Also define nested interfaces.
13955 (TypeContainer.RegisterOrder): New public function used to
13956 register the order in which child interfaces need to be closed.
13958 Nested interfaces need to be closed after their parents have been
13961 * interface.cs (InterfaceAttr): Put all the logic for computing
13962 the interface attribute here.
13964 (DefineInterface): Register our interface order with the
13965 RootContext or with the TypeContainer depending on the case.
13967 2002-03-12 Miguel de Icaza <miguel@ximian.com>
13969 * cs-parser.jay: rework foreach statement to work with the new
13970 changes to the policy on SimpleNames.
13972 * report.cs: support Stacktrace on warnings as well.
13974 * makefile: drop --unsafe and /unsafe from the compile.
13976 2002-03-13 Ravi Pratap <ravi@ximian.com>
13978 * ecore.cs (StandardConversionExists): Modify to take an Expression
13979 as the first parameter. Ensure we do null -> reference type conversion
13982 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
13983 temporary Expression objects.
13985 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
13987 * interface.cs: workaround bug in method overloading resolution
13988 (there is already a bugzilla bug for it).
13990 2002-03-12 Miguel de Icaza <miguel@ximian.com>
13992 We could also solve this problem by having a separate path for
13993 performing type lookups, instead of DoResolve, we could have a
13994 ResolveType entry point, and only participating pieces of the
13995 production (simplename, deref, array) would implement this.
13997 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
13998 signal SimpleName to only resolve type names and not attempt to
13999 resolve anything else.
14001 * expression.cs (Cast): Set the flag.
14003 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
14005 * class.cs: Only report 108 if there is no `new' modifier.
14007 * cs-parser.jay: rework foreach statement to work with the new
14008 changes to the policy on SimpleNames.
14010 * report.cs: support Stacktrace on warnings as well.
14012 * makefile: drop --unsafe and /unsafe from the compile.
14014 2002-03-11 Miguel de Icaza <miguel@ximian.com>
14016 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
14017 lookups here, instead of doing that at parse time. This means
14018 that our grammar will not introduce `LocalVariableReferences' as
14019 expressions at this point. That solves the problem of code like
14023 static void Main ()
14027 This is only half the fix. The full fix requires parameters to
14028 also be handled in this way.
14030 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
14031 makes the use more obvious of the DeclSpace. The
14032 ec.TypeContainer.TypeBuilder is now only used to pull the
14033 TypeBuilder for it.
14035 My theory is that I can get rid of the TypeBuilder completely from
14036 the EmitContext, and have typecasts where it is used (from
14037 DeclSpace to where it matters).
14039 The only pending problem is that the code that implements Aliases
14040 is on TypeContainer, and probably should go in DeclSpace.
14042 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
14043 lookups here, instead of doing that at parse time. This means
14044 that our grammar will not introduce `LocalVariableReferences' as
14045 expressions at this point. That solves the problem of code like
14049 static void Main ()
14053 This is only half the fix. The full fix requires parameters to
14054 also be handled in this way.
14056 * class.cs (Property.DefineMethod): When implementing an interface
14057 method, set newslot, when implementing an abstract method, do not
14058 set the flag (before we tried never setting it, or always setting
14059 it, which is the difference).
14060 (Indexer.DefineMethod): same.
14061 (Method.DefineMethod): same.
14063 * ecore.cs: Only set the status used flag if we get back a Field.
14065 * attribute.cs: Temporary hack, so Paolo can keep working.
14067 2002-03-08 Ravi Pratap <ravi@ximian.com>
14069 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
14070 the unmanaged type in the case we have a MarshalAs attribute.
14072 (Resolve): Handle the case when we are parsing the special MarshalAs
14073 attribute [we need to store the unmanaged type to use later]
14075 * typemanager.cs (marshal_as_attr_type): Built in type for the
14076 MarshalAs Attribute.
14078 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
14079 on parameters and accordingly set the marshalling info.
14081 2002-03-09 Miguel de Icaza <miguel@ximian.com>
14083 * class.cs: Optimizing slightly by removing redundant code after
14084 we switched to the `NoTypes' return value.
14085 (Property.DefineMethod): use NoTypes here too.
14087 This fixes the bug I introduced in my last batch of changes.
14089 2002-03-05 Ravi Pratap <ravi@ximian.com>
14091 * tree.cs (RecordEnum): Add. We now keep track of enums too.
14093 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
14094 Enums since those are types too.
14096 * cs-parser.jay (enum_declaration): Record enums as we parse them.
14098 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
14099 thanks to a call during the lookup process.
14101 2002-03-07 Miguel de Icaza <miguel@ximian.com>
14103 * statement.cs (Foreach): Lots of work to accomodate a particular
14104 kind of foreach statement that I had not kept in mind. It is
14105 possible to have foreachs on classes that provide a GetEnumerator
14106 method that return objects that implement the "pattern" for using
14107 a foreach, there is no need to support GetEnumerator
14110 This is needed to compile nant.
14112 * decl.cs: Only report 114 if the member is not `Finalize' and if
14113 the warning level is at least 2.
14115 * class.cs: Moved the compare function from Method to
14118 (MethodSignature.InheritableMemberSignatureCompare): Add new
14119 filter function that is used to extract inheritable methods from a
14122 (Method.Define): Use the new `inheritable_method_signature_filter'
14125 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
14128 2002-03-06 Miguel de Icaza <miguel@ximian.com>
14130 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
14132 * cs-parser.jay: Add opt_semicolon to the interface declaration.
14134 * expression.cs: Pass location information to
14135 ConvertImplicitStandard.
14137 * class.cs: Added debugging code to track return values from
14140 2002-03-05 Miguel de Icaza <miguel@ximian.com>
14142 * expression.cs (Is.DoResolve): If either side of the `is' is an
14143 interface, do not flag the warning.
14145 * ecore.cs (ImplicitReferenceConversion): We need a separate test
14148 * report.cs: Allow for --fatal to be used with --probe.
14150 * typemanager.cs (NoTypes): Move the definition for the empty Type
14153 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
14155 (TypeContainer.DefineProxy): New function used to proxy to parent
14156 implementations when implementing interfaces.
14157 (TypeContainer.ParentImplements): used to lookup if our parent
14158 implements a public function that is required by an interface.
14159 (TypeContainer.VerifyPendingMethods): Hook this up.
14161 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
14162 `modules' and `assemblies' arraylists into arrays. We only grow
14163 these are the very early start up of the program, so this improves
14164 the speedof LookupType (nicely measured).
14166 * expression.cs (MakeByteBlob): Replaced unsafe code with
14167 BitConverter, as suggested by Paolo.
14169 * cfold.cs (ConstantFold.Binary): Special case: perform constant
14170 folding of string concatenation, but if either side is a string,
14171 and the other is not, then return null, and let the runtime use
14172 the concatenation on the string plus the object (using
14173 `Object.ToString').
14175 2002-03-04 Miguel de Icaza <miguel@ximian.com>
14177 Constant Folding has been implemented now.
14179 * expression.cs (Unary.Reduce): Do not throw an exception, catch
14180 the error instead on types that are not supported in one's
14183 * constant.cs (Constant and all children): New set of functions to
14184 perform implict and explicit conversions.
14186 * ecore.cs (EnumConstant): Implement the new functions to perform
14187 conversion by proxying to the child expression.
14189 * codegen.cs: (ConstantCheckState): Constant evaluation has its
14190 own separate setting that can not be turned off from the command
14191 line using --unchecked or --checked and is only controlled using
14192 the checked/unchecked statements and expressions. This setting is
14193 used by the constant folder to flag errors.
14195 * expression.cs (CheckedExpr, UncheckedExpr): Set the
14196 ConstantCheckState as well.
14198 During Resolve, they also have to flag the state, because the
14199 constant folder runs completely in the Resolve phase.
14201 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
14204 2002-03-01 Miguel de Icaza <miguel@ximian.com>
14206 * cfold.cs: New file, this file contains the constant folder.
14208 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
14209 argument to track whether we are using the resulting address to
14210 load or store a value and provide better error messages.
14212 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
14213 new AddressOf arguments.
14215 * statement.cs (Foreach.EmitCollectionForeach): Update
14217 * expression.cs (Argument.Emit): Call AddressOf with proper
14218 arguments to track usage.
14220 (New.DoEmit): Call AddressOf with new arguments.
14222 (Unary.Emit): Adjust AddressOf call.
14224 2002-03-01 Ravi Pratap <ravi@ximian.com>
14226 * cs-parser.jay (member_access): Change the case for pre-defined types
14227 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
14230 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
14233 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
14234 essentially like methods and apply attributes like MethodImplOptions to them too.
14236 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
14239 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
14240 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
14243 * Update code everywhere accordingly.
14245 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
14247 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
14249 2002-02-28 Ravi Pratap <ravi@ximian.com>
14251 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
14252 try performing lookups against those instead of jumping straight into using
14253 the 'using' clauses.
14255 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
14257 (LookupType): Perform lookups in implicit parents too.
14259 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
14260 sequence as RootContext.LookupType.
14262 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
14263 the various cases of namespace lookups into this method.
14265 2002-03-01 Miguel de Icaza <miguel@ximian.com>
14267 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
14268 in positional arguments)
14270 * class.cs (Operator): Update the AllowedModifiers to contain
14273 * cs-parser.jay: Update operator declaration to allow for the
14274 operator body to be empty.
14276 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
14279 2002-02-27 Miguel de Icaza <miguel@ximian.com>
14281 * class.cs (Method.Emit): Label parameters.
14283 * driver.cs: Return 1 or 0 as the program exit code.
14285 2002-02-26 Miguel de Icaza <miguel@ximian.com>
14287 * expression.cs: Special case the `null' object when trying to
14288 auto-compute the type, as anything can be explicitly converted to
14291 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
14292 spotting this Paolo.
14294 (Expression.ImplicitNumericConversion): Perform comparissions of
14295 the type using the underlying type in the case of an enumeration
14296 rather than using the enumeration type for the compare.
14298 Cope with the underlying == type case, which is not possible to
14301 (Expression.ConvertNumericExplicit): Perform comparissions of
14302 the type using the underlying type in the case of an enumeration
14303 rather than using the enumeration type for the compare.
14305 * driver.cs: If the user does not supply an extension, assume .exe
14307 * cs-parser.jay (if_statement): Rewrote so that we can track the
14308 location for the if statement.
14310 * expression.cs (Binary.ConstantFold): Only concat strings when
14311 the operation is "+", not everything ;-)
14313 * statement.cs (Statement.EmitBoolExpression): Take a location
14315 (If, While, Do): Track location.
14317 * expression.cs (Binary.ResolveOperator): In the object + string
14318 case, I was missing a call to ConvertImplicit
14320 2002-02-25 Ravi Pratap <ravi@ximian.com>
14322 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
14323 Location arguments. Ensure we use RootContext.LookupType to do our work
14324 and not try to do a direct Type.GetType and ModuleBuilder.GetType
14326 * interface.cs (PopulateMethod): Handle the type of the parameter being
14329 * expression.cs (Invocation.BetterFunction): Handle the case when we
14330 have a params method with no fixed arguments and a call is made with no
14333 2002-02-25 Miguel de Icaza <miguel@ximian.com>
14335 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
14336 the verbatim-string-literal
14338 * support.cs (InternalParameters.ParameterModifier): handle null
14340 (InternalParameters.ParameterType): ditto.
14342 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
14343 duplicating the name of the variable parameter.
14344 (GetParameterByName): Fix bug where we were not looking up array
14345 paramters if they were the only present (thanks Paolo!).
14346 (GetParameterInfo): We only have an empty set of types if both
14347 fixed and array are set to null.
14348 (GetParameterInfo-idx): Handle FixedParameter == null
14350 * cs-parser.jay: Handle the case where there is no catch
14351 statements (missing null test).
14353 2002-02-22 Miguel de Icaza <miguel@ximian.com>
14355 * driver.cs (MainDriver): Be conservative on our command line
14358 Catch DirectoryNotFoundException when calling GetFiles.
14360 (SplitPathAndPattern): Used to split the input specification into
14361 a path and a pattern that we can feed to Directory.GetFiles.
14363 2002-02-21 Miguel de Icaza <miguel@ximian.com>
14365 * statement.cs (Fixed): Implement the last case of the Fixed
14366 statement (string handling).
14368 * expression.cs (StringPtr): New class used to return a char * to
14369 a string; Used by the Fixed statement.
14371 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
14373 * expression.cs (Binary.ResolveOperator): Remove redundant
14374 MemberLookup pn parent type.
14375 Optimize union call, we do not need a union if the types are the same.
14376 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
14379 Specialize the use of MemberLookup everywhere, instead of using
14380 the default settings.
14382 (StackAlloc): Implement stackalloc keyword.
14384 * cs-parser.jay: Add rule to parse stackalloc.
14386 * driver.cs: Handle /h, /help, /?
14388 * expression.cs (MakeByteBlob): Removed the hacks we had in place
14389 before we supported unsafe code.
14391 * makefile: add --unsafe to the self compilation of mcs.
14393 2002-02-20 Miguel de Icaza <miguel@ximian.com>
14395 * expression.cs (PointerArithmetic): New class that is used to
14396 perform pointer arithmetic.
14397 (Binary.Resolve): Handle pointer arithmetic
14398 Handle pointer comparission.
14399 (ArrayPtr): Utility expression class that is used to take the
14400 address of an array.
14402 (ElementAccess): Implement array access for pointers
14404 * statement.cs (Fixed): Implement fixed statement for arrays, we
14405 are missing one more case before we are done.
14407 * expression.cs (Indirection): Implement EmitAssign and set the
14408 ExprClass to Variable. This allows pointer dereferences to be
14409 treated as variables, and to have values assigned to them.
14411 * ecore.cs (Expression.StoreFromPtr): New utility function to
14412 store values dereferencing.
14414 2002-02-20 Ravi Pratap <ravi@ximian.com>
14416 * expression.cs (Binary.ResolveOperator): Ensure that we are
14417 not trying to operate on a void type - this fixes the reported
14420 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
14421 the parent implementation is sealed.
14423 * ../errors/cs0239.cs : Add.
14425 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
14427 * typemanager.cs (unverifiable_code_type): Corresponds to
14428 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
14429 which have unsafe code in them.
14431 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
14434 2002-02-19 Miguel de Icaza <miguel@ximian.com>
14436 * cs-tokenizer.cs: Add support for @"litreal strings"
14438 Make tokenizer accept pre-processor directives
14439 on any column (remove the old C-like limitation).
14441 * rootcontext.cs (EmitCode): Emit any global attributes.
14442 (AddGlobalAttributes): Used to keep track of assembly attributes.
14444 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
14446 * cs-parser.jay: Add support for global attributes.
14448 2002-02-17 Miguel de Icaza <miguel@ximian.com>
14450 * expression.cs (Indirection): New helper class. Unary will
14451 create Indirection classes to be able to implement the
14452 IMemoryLocation interface on it.
14454 2002-02-16 Miguel de Icaza <miguel@ximian.com>
14456 * cs-parser.jay (fixed_statement): reference the right statement.
14458 * statement.cs (Fixed.Emit): Finish implementing the fixed
14459 statement for the &x case.
14461 2002-02-14 Miguel de Icaza <miguel@ximian.com>
14463 * class.cs (Property.Define, Method.Define): Remove newslot when
14466 * modifiers.cs: My use of NewSlot when `Abstract' was set was
14467 wrong. NewSlot should only be used if the `new' keyword is present.
14469 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
14470 locating our system dir. Sorry about this.
14472 2002-02-13 Miguel de Icaza <miguel@ximian.com>
14474 * driver.cs (GetSystemDir): Compute correctly the location of our
14475 system assemblies. I was using the compiler directory instead of
14476 the library directory.
14478 2002-02-13 Ravi Pratap <ravi@ximian.com>
14480 * expression.cs (BetterFunction): Put back in what Miguel commented out
14481 since it is the correct fix. The problem is elsewhere ;-)
14483 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
14484 parameters of the parms method are themselves compatible or not !
14486 (StandardConversionExists): Fix very dangerous bug where we were forgetting
14487 to check that a class implements an interface before saying that an implicit
14488 conversion was allowed. Use ImplementsInterface to do the checking.
14490 2002-02-13 Miguel de Icaza <miguel@ximian.com>
14492 * class.cs (Method.Define): Track whether we are an explicit
14493 implementation or not. And only call DefineMethodOverride if we
14494 are an explicit implementation.
14496 (Property.DefineMethod): Ditto.
14498 2002-02-11 Ravi Pratap <ravi@ximian.com>
14500 * expression.cs (BetterFunction): Catch hideous bug which was
14501 preventing us from detecting ambiguous calls due to implicit casts i.e
14504 2002-01-29 Miguel de Icaza <miguel@ximian.com>
14506 * support.cs (Pair): Remove un-needed method. I figured why I was
14507 getting the error in cs-parser.jay, the variable in a foreach loop
14508 is readonly, and the compiler does not really treat this as a variable.
14510 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
14511 instead of EQUALS in grammar.
14513 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
14515 * expression.cs (Unary.DoResolve): Check whether the argument is
14518 2002-01-28 Miguel de Icaza <miguel@ximian.com>
14520 * support.cs: Api for Pair to set a value. Despite the fact that
14521 the variables are public the MS C# compiler refuses to compile
14522 code that accesses the field if the variable is part of a foreach
14525 * statement.cs (Fixed): Begin implementation of the fixed
14528 (Block.AddVariable): Return the VariableInfo on success and null
14529 on failure instead of true/false.
14531 * cs-parser.jay (foreach): Catch errors on variables already
14532 defined (we were ignoring this value before) and properly unwind
14533 the block hierarchy
14535 (fixed_statement): grammar for the fixed statement.
14537 2002-01-25 Miguel de Icaza <miguel@ximian.com>
14539 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
14540 pointer types to be incretemented.
14542 (SizeOf): Implement.
14544 * cs-parser.jay (pointer_member_access): Implement
14545 expr->IDENTIFIER production.
14547 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
14548 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
14551 (Unary): Implement indirection.
14553 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
14554 use in non-unsafe context).
14556 (SimpleName.DoResolve): Check for pointers in field access on safe
14559 (Expression.LoadFromPtr): Factor the load-indirect code in this
14560 function. This was duplicated in UnboxCast and ParameterReference
14562 2002-01-24 Miguel de Icaza <miguel@ximian.com>
14564 * expression.cs (ComposedCast): report an error if a pointer cast
14565 is used in a safe region.
14567 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
14568 pointer type casts in unsafe context.
14570 * codegen.cs (EmitContext): Set up IsUnsafe.
14572 * cs-parser.jay (non_expression_type): Add productions for pointer
14575 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
14576 code. We should not use force into static mode if the method is
14577 not virtual. Fixes bug in MIS
14579 * statement.cs (Do.Emit, While.Emit, For.Emit,
14580 Statement.EmitBoolExpression): Add support to Do and While to
14581 propagate infinite loop as `I do return' semantics.
14583 Improve the For case to also test for boolean constants.
14585 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
14586 to the list of attributes we can add.
14588 Remove `EmitContext' argument.
14590 * class.cs (Method.Define): Apply parameter attributes.
14591 (Constructor.Define): Apply parameter attributes.
14592 (MethodCore.LabelParameters): Move here the core of labeling
14595 * support.cs (ReflectionParameters.ParameterModifier,
14596 InternalParameters.ParameterModifier): Use IsByRef on the type and
14597 only return the OUT bit for these parameters instead of in/out/ref
14600 This is because I miss-understood things. The ParameterInfo.IsIn
14601 and IsOut represent whether the parameter has the [In] and [Out]
14604 2002-01-22 Miguel de Icaza <miguel@ximian.com>
14606 * ecore.cs (FieldExpr.Emit): Release temporaries.
14608 * assign.cs (LocalTemporary.Release): new function.
14610 * codegen.cs (EmitContext.GetTemporaryStorage,
14611 EmitContext.FreeTemporaryStorage): Rework the way we deal with
14612 temporary storage. Now we can "put back" localbuilders when we
14615 2002-01-21 Miguel de Icaza <miguel@ximian.com>
14617 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
14618 need to make a copy of the variable to generate verifiable code.
14620 2002-01-19 Miguel de Icaza <miguel@ximian.com>
14622 * driver.cs: Compute dynamically the system directory.
14624 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
14625 Slower, but more generally useful. Used by the abstract
14626 registering implementation.
14628 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
14629 the rules for the special rule on Type/instances. First check if
14630 we have the same name, and if so, try that special static path
14631 rather than the instance path.
14633 2002-01-18 Miguel de Icaza <miguel@ximian.com>
14635 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
14638 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
14639 Enum, ValueType, Delegate or Array for non-corlib compiles.
14641 * cs-tokenizer.cs: Catch long identifiers (645)
14643 * typemanager.cs (IndexerPropetyName): Ravi never tested this
14646 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
14647 fix, we were returning too early, so we were not registering
14648 pending methods from abstract classes.
14650 Do not register pending methods if the class is abstract.
14652 * expression.cs (Conditional.DoResolve): Report circular implicit
14653 conversions when we neecd to compute it for conditional
14656 (Is.DoResolve): If the expression is always of the provided type,
14657 flag warning 183. If the expression can not ever be of the
14658 provided type flag warning 184.
14660 * class.cs: Catch 169 as well.
14662 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
14665 2002-01-18 Nick Drochak <ndrochak@gol.com>
14667 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
14669 2002-01-17 Miguel de Icaza <miguel@ximian.com>
14671 * interface.cs: (PopulateMethod): Check for pointers being defined
14672 only if the unsafe context is active.
14673 (PopulateProperty): ditto.
14674 (PopulateIndexer): ditto.
14676 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
14677 specified. If pointers are present, make sure that they are
14678 present in an unsafe context.
14679 (Constructor, Constructor.Define): ditto.
14680 (Field, Field.Define): ditto.
14681 (Property, Property.Define): ditto.
14682 (Event, Event.Define): ditto.
14684 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
14685 hashtable if there are classes or structs defined.
14687 * expression.cs (LocalVariableReference.DoResolve): Simplify this
14688 code, as the constant resolution moved.
14690 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
14691 the metadata, so we can flag error 133.
14693 * decl.cs (MemberCore.UnsafeOK): New function to test that a
14694 pointer is being declared in an unsafe context.
14696 2002-01-16 Miguel de Icaza <miguel@ximian.com>
14698 * modifiers.cs (Modifiers.Check): Require a Location argument.
14699 Report error 227 for Unsafe use.
14701 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
14703 * statement.cs (For.Emit): If the test is null, then report that
14704 we do `return', as we wont reach anything afterwards.
14706 (Switch.SwitchGoverningType): Track the expression that matched
14709 * driver.cs: Allow negative numbers as an error code to flag.
14711 * cs-parser.jay: Handle 1551.
14713 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
14715 2002-01-15 Miguel de Icaza <miguel@ximian.com>
14717 * cs-parser.jay: Report 1518 (type declaration can only contain
14718 class, struct, interface, enum or delegate)
14720 (switch_label): Report 1523 (keywords `case' or `default' must
14723 (opt_switch_sections): Report 1522 (empty switch)
14725 * driver.cs: Report 1515 (response file specified multiple times)
14726 Report 1516 (Source file specified multiple times).
14728 * expression.cs (Argument.Resolve): Signal 1510
14730 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
14731 access not allowed in static code)
14733 2002-01-11 Ravi Pratap <ravi@ximian.com>
14735 * typemanager.cs (IsPointerType): Utility method which we are going
14738 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
14739 the object type, so we take care of that.
14741 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
14743 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
14744 added to non-params parameters :-)
14746 * typemanager.cs (CSharpName): Include 'void' type too.
14748 (void_ptr_type): Include in the set of core types.
14750 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
14753 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
14756 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
14757 completely forgotten about it.
14759 2002-01-10 Ravi Pratap <ravi@ximian.com>
14761 * cs-parser.jay (pointer_type): Add. This begins our implementation
14762 of parsing rules for unsafe code.
14764 (unsafe_statement): Implement.
14766 (embedded_statement): Modify to include the above.
14768 * statement.cs (Unsafe): Implement new class for unsafe blocks.
14770 * codegen.cs (EmitContext.InUnsafe): Add. This determines
14771 if the current context is an unsafe one.
14773 * cs-parser.jay (local_variable_pointer_type): Since local variable types
14774 are handled differently, we need separate rules for them.
14776 (local_variable_declaration): Update to use local_variable_pointer_type
14777 to allow variable declarations of unmanaged pointer types.
14779 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
14780 in unsafe contexts.
14782 * ../errors/cs0214.cs : Add.
14784 2002-01-16 Nick Drochak <ndrochak@gol.com>
14786 * makefile: remove 'response' file when cleaning.
14788 2002-01-15 Miguel de Icaza <miguel@ximian.com>
14790 * cs-parser.jay: Report 1524.
14792 2002-01-14 Miguel de Icaza <miguel@ximian.com>
14794 * typemanager.cs (RegisterMethod): drop checking if we have
14795 registered this from here
14797 2002-01-12 Miguel de Icaza <miguel@ximian.com>
14799 * class.cs (Method.EmitDestructor): Implement calling our base
14802 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
14803 value of InFinally.
14805 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
14806 this routine and will wrap the call in a try/catch block. Deal
14809 2002-01-11 Miguel de Icaza <miguel@ximian.com>
14811 * ecore.cs (Expression.MemberLookup): instead of taking a
14812 parameter `same_type' that was used to tell whether we could
14813 access private members we compute our containing type from the
14816 (FieldExpr): Added partial support for volatile fields. This does
14817 not work for volatile fields exposed from assemblies, as I can not
14818 figure out how to extract the modreq from it.
14820 Updated all the source files to use this.
14822 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
14823 because it is referenced by MemberLookup very often.
14825 2002-01-09 Ravi Pratap <ravi@ximian.com>
14827 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
14828 TypeBuilder.GetCustomAttributes to retrieve what we need.
14830 Get rid of redundant default_member_attr_type as this is the same as
14831 default_member_type which already exists.
14833 * interface.cs, attribute.cs : Update accordingly.
14835 2002-01-08 Miguel de Icaza <miguel@ximian.com>
14837 * typemanager.cs: Enable IndexerPropertyName again. It does not
14838 work for TYpeBuilders though. Ravi, can you please fix this?
14840 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
14842 * expression.cs (Argument.Emit): Handle the case of ref objects
14843 being passed to ref functions;
14845 (ParameterReference.EmitLoad): Loads the content of the pointer
14846 without dereferencing.
14848 2002-01-07 Miguel de Icaza <miguel@ximian.com>
14850 * cs-tokenizer.cs: Implemented the pre-processing expressions.
14852 2002-01-08 Ravi Pratap <ravi@ximian.com>
14854 * class.cs (Indexer.DefineMethod): Incorporate the interface
14855 type in the name of the method if we are doing explicit interface
14858 * expression.cs (ConversionExists): Remove as it is completely obsolete.
14860 (BetterConversion): Fix extremely trivial bug where we were referring to
14861 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
14864 * ../errors/bug16.cs : Add although we have fixed it.
14866 2002-01-07 Miguel de Icaza <miguel@ximian.com>
14868 * expression.cs (BaseIndexer): Begin implementation.
14870 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
14872 * cs-parser.jay (indexer_declarator): Use qualified_identifier
14873 production directly to remove a shift/reduce, and implement
14874 explicit interface implementation.
14876 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
14877 after a floating point suffix.
14879 * expression.cs (DoNumericPromotions): Improved the conversion for
14880 uint/uint. If we have a constant, we avoid doing a typecast to a
14883 * class.cs (Indexer): Implement explicit interface implementation
14886 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
14888 * class.cs: make the default instance constructor public and hidebysig.
14890 2001-01-03 Ravi Pratap <ravi@ximian.com>
14892 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
14893 so we can call it from elsewhere.
14895 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
14896 we emit it internally if the class has a defined indexer; otherwise the user
14897 emits it by decorating the class definition with the DefaultMemberAttribute.
14899 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
14900 attribute is not used on a type which defines an indexer.
14902 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
14903 character when we skip whitespace.
14905 * ../errors/cs0646.cs : Add.
14907 2002-01-03 Miguel de Icaza <miguel@ximian.com>
14909 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
14912 * makefile: Add practical target `mcs3.exe' which builds the third
14913 generation compiler.
14915 * expression.cs (New): Fix structures constructor calling.
14917 * class.cs (Property, Method, Indexer): Emit Final flag on the
14918 method if we are an interface implementation and we are not
14921 * ecore.cs (PropertyExpr): New public field `IsBase', tells
14922 whether this property is referencing a `base' method.
14924 * expression.cs (Invocation.EmitCall): take an extra argument:
14925 is_base, this is used to determine whether the `call' or
14926 `callvirt' opcode should be used.
14929 * delegate.cs: update EmitCall.
14931 * class.cs (Method.Define): Set NewSlot for the cases where we are
14932 not implementing an interface method.
14934 (Property.Define): ditto.
14936 2002-01-02 Miguel de Icaza <miguel@ximian.com>
14938 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
14939 'r'. Allows mcs to parse itself fully.
14941 2002-01-02 Ravi Pratap <ravi@ximian.com>
14943 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
14944 of the number of initializers that require the InitializeArray method.
14946 (CheckIndices): Store the Expression in all cases - not the plain value. Also
14947 update the above field where necessary.
14949 (MakeByteBlob): Update accordingly.
14951 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
14954 (EmitDynamicInitializers): Update in accordance with the new optimization.
14956 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
14957 same OpCode applies.
14959 * cs-parser.jay : Fix some glaring errors I introduced.
14961 2002-01-01 Ravi Pratap <ravi@ximian.com>
14963 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
14964 so that we can check for name clashes there too.
14966 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
14967 for interface indexers.
14969 * interfaces.cs (Define): Emit the default member attribute.
14971 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
14972 variable was being referred to while setting the value ;-)
14974 2002-01-01 Miguel de Icaza <miguel@ximian.com>
14976 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
14977 byte-by-byte information when we know the data is zero.
14979 Make the block always a multiple of 4, because
14980 DefineInitializedData has a bug.
14982 * assign.cs: Fix, we should assign from the temporary, not from
14985 * expression.cs (MakeByteBlob): Fix my incorrect code.
14987 2001-12-31 Miguel de Icaza <miguel@ximian.com>
14989 * typemanager.cs (EnumToUnderlying): This function is used to get
14990 the underlying type from an enumeration, because it does not
14993 * constant.cs: Use the I4_S form for values between -128 and 127.
14995 * statement.cs (Block.LookupLabel): Looks up a label.
14996 (Block): Drop support for labeled blocks.
14998 (LabeledStatement): New kind of statement that represents a label
15001 (Goto): Finally implement this bad boy.
15003 * cs-parser.jay: Update to reflect new mechanism to implement
15006 2001-12-30 Miguel de Icaza <miguel@ximian.com>
15008 * codegen.cs (EmitContext.This): a codegen property that keeps the
15009 a single instance of this instead of creating many different this
15012 * delegate.cs (Delegate.DoResolve): Update to use the property;
15014 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
15016 * expression.cs (BaseAccess.DoResolve): Ditto.
15018 2001-12-29 Ravi Pratap <ravi@ximian.com>
15020 * typemanager.cs (methodimpl_attr_type): Add to hold the type
15021 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
15023 (InitCoreTypes): Update accordingly.
15025 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
15026 so we can quickly store the state.
15028 (ApplyAttributes): Set the correct implementation flags
15029 for InternalCall methods.
15031 2001-12-29 Miguel de Icaza <miguel@ximian.com>
15033 * expression.cs (EmitCall): if a method is not virtual, then do
15034 not use callvirt on it.
15036 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
15037 user defined stuff) requires the use of stobj, which takes an
15038 address on the stack instead of an array and an index. So emit
15039 the Ldelema operation for it.
15041 (EmitStoreOpcode): Use stobj for valuetypes.
15043 (UnaryMutator.EmitCode): Use the right 1 value depending on
15044 whether we are dealing with int64/uint64, float or doubles.
15046 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
15047 constructors that I implemented last night.
15049 (Constructor.IsDefault): Fix to work properly for static
15052 * cs-parser.jay (CheckDef): report method signature errors.
15053 Update error number 103 to be 132.
15055 * decl.cs: New AdditionResult enumeration value: MethodExists.
15056 Although we do this check for methods later on in the semantic
15057 analysis, catching repeated default constructors is so easy that
15058 we catch these here.
15060 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
15063 (ParameterReference.EmitAssign, Emit): handle
15066 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
15067 (ArrayAccess.EmitStoreOpcode): ditto.
15069 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
15071 * expression.cs (MakeByteBlob): Complete all the missing types
15072 (uint, short, ushort, byte, sbyte)
15074 * class.cs: Only init instance field initializers on instance
15077 Rename `constructors' to instance_constructors.
15079 (TypeContainer.AddConstructor): Only add constructors to the list
15080 if it is not static.
15082 Make sure that we handle default_static_constructor independently
15083 everywhere where we handle instance_constructors
15085 2001-12-28 Miguel de Icaza <miguel@ximian.com>
15087 * class.cs: Do not lookup or create a base initializer for a
15088 static constructor.
15090 (ConstructorInitializer.Resolve): use the proper type to lookup
15093 * cs-parser.jay: Report error 1585 (modifiers between type and name).
15095 * enum.cs, interface.cs: Remove CloseType, this is taken care by
15098 * decl.cs: CloseType is now an virtual method, the default
15099 implementation just closes this type.
15101 2001-12-28 Ravi Pratap <ravi@ximian.com>
15103 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
15104 to PreserveSig by default. Also emit HideBySig on such methods.
15106 Basically, set the defaults to standard values.
15108 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
15109 argument, if candidate is better, it can't be worse than the best !
15111 (Invocation): Re-write bits to differentiate between methods being
15112 applicable in their expanded form and their normal form - for params
15115 Get rid of use_standard everywhere as only standard conversions are allowed
15116 in overload resolution.
15118 More spec conformance.
15120 2001-12-27 Miguel de Icaza <miguel@ximian.com>
15122 * driver.cs: Add --timestamp, to see where the compiler spends
15125 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
15126 `this' in static code.
15128 (SimpleName.DoResolve): Implement in terms of a helper function
15129 that allows static-references to be passed upstream to
15132 (Expression.ResolveWithSimpleName): Resolve specially simple
15133 names when called by MemberAccess to implement the special
15136 (Expression.ImplicitReferenceConversion): Handle conversions from
15137 Null to reference types before others, as Null's type is
15140 * expression.cs (Invocation.EmitCall): Handle the special case of
15141 calling methods declared on a reference type from a ValueType
15142 (Base classes System.Object and System.Enum)
15144 (MemberAccess.Resolve): Only perform lookups on Enumerations if
15145 the left hand side is a TypeExpr, not on every enumeration.
15147 (Binary.Resolve): If types are reference types, then do a cast to
15148 object on operators != and == of both arguments.
15150 * typemanager.cs (FindMembers): Extract instance and static
15151 members if requested.
15153 * interface.cs (PopulateProperty): Use void_type instead of null
15154 as the return type for the setter method.
15156 (PopulateIndexer): ditto.
15158 2001-12-27 Ravi Pratap <ravi@ximian.com>
15160 * support.cs (ReflectionParameters): Fix minor bug where we
15161 were examining the wrong parameter for the ParamArray attribute.
15163 Cope with requests for the type of the parameter at position
15164 greater than the params parameter's. We now return the element
15165 type of the params array as that makes more sense.
15167 * expression.cs (Invocation.IsParamsMethodApplicable): Update
15168 accordingly as we no longer have to extract the element type
15171 (Invocation.OverloadResolve): Update.
15173 2001-12-27 Miguel de Icaza <miguel@ximian.com>
15175 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
15176 against IEnumerator, test whether the return value is a descendant
15177 of the IEnumerator interface.
15179 * class.cs (Indexer.Define): Use an auxiliary method to implement
15180 the other bits of the method definition. Begin support for
15181 explicit interface implementation.
15183 (Property.DefineMethod): Use TypeManager.void_type instead of null
15184 for an empty return value.
15186 2001-12-26 Miguel de Icaza <miguel@ximian.com>
15188 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
15189 dealing with a FieldExpr which is composed of a FieldBuilder, in
15190 the code path we did extract the constant, but we should have
15191 obtained the underlying value to be able to cast it (otherwise we
15192 end up in an infinite loop, this is what Ravi was running into).
15194 (ArrayCreation.UpdateIndices): Arrays might be empty.
15196 (MemberAccess.ResolveMemberAccess): Add support for section
15197 14.5.4.1 that deals with the special case of E.I when E is a type
15198 and something else, that I can be a reference to a static member.
15200 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
15201 handle a particular array type to create byte blobs, it is just
15202 something we dont generate byteblobs for.
15204 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
15207 * location.cs (Push): remove the key from the hashtable that we
15208 are about to add. This happens for empty files.
15210 * driver.cs: Dispose files after we have parsed them.
15212 (tokenize): new function that only runs the tokenizer on its
15213 input, for speed testing.
15215 2001-12-26 Ravi Pratap <ravi@ximian.com>
15217 * class.cs (Event.Define): Define the private field only if there
15218 are no accessors defined.
15220 * expression.cs (ResolveMemberAccess): If there is no associated
15221 field with the event, that means we have an event defined with its
15222 own accessors and we should flag error cs0070 since transforming
15223 ourselves into a field is not valid in that case.
15225 * ecore.cs (SimpleName.DoResolve): Same as above.
15227 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
15228 and charset to sane values.
15230 2001-12-25 Ravi Pratap <ravi@ximian.com>
15232 * assign.cs (DoResolve): Perform check on events only if they
15233 are being accessed outside the declaring type.
15235 * cs-parser.jay (event_declarations): Update rules to correctly
15236 set the type of the implicit parameter etc.
15238 (add_accessor, remove_accessor): Set current local parameters.
15240 * expression.cs (Binary): For delegate addition and subtraction,
15241 cast the return value from the method into the appropriate delegate
15244 2001-12-24 Ravi Pratap <ravi@ximian.com>
15246 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
15247 of these as the workaround is unnecessary.
15249 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
15250 delegate data - none of that is needed at all.
15252 Re-write bits to extract the instance expression and the delegate method
15255 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
15258 * attribute.cs (ApplyAttributes): New method to take care of common tasks
15259 of attaching attributes instead of duplicating code everywhere.
15261 * everywhere : Update code to do attribute emission using the above method.
15263 2001-12-23 Miguel de Icaza <miguel@ximian.com>
15265 * expression.cs (IsParamsMethodApplicable): if there are not
15266 parameters, return immediately.
15268 * ecore.cs: The 0 literal can be implicity converted to an enum
15271 (SimpleName.DoResolve): First lookup the type, then lookup the
15274 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
15275 want to get its address. If the InstanceExpression is not
15276 addressable, store the result in a temporary variable, then get
15279 * codegen.cs: Only display 219 errors on warning level or above.
15281 * expression.cs (ArrayAccess): Make it implement the
15282 IMemoryLocation interface.
15284 (Binary.DoResolve): handle the operator == (object a, object b)
15285 and operator != (object a, object b) without incurring into a
15286 BoxedCast (because 5 != o should never be performed).
15288 Handle binary enumerator operators.
15290 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
15291 value type, otherwise use Ldelem_ref.
15293 Use precomputed names;
15295 (AddressOf): Implement address of
15297 * cs-parser.jay (labeled_statement): Fix recursive block
15298 addition by reworking the production.
15300 * expression.cs (New.DoEmit): New has a special case:
15302 If we are dealing with a ValueType, we have a few
15303 situations to deal with:
15305 * The target of New is a ValueType variable, that is
15306 easy, we just pass this as the variable reference
15308 * The target of New is being passed as an argument,
15309 to a boxing operation or a function that takes a
15312 In this case, we need to create a temporary variable
15313 that is the argument of New.
15316 2001-12-23 Ravi Pratap <ravi@ximian.com>
15318 * rootcontext.cs (LookupType): Check that current_type is not null before
15319 going about looking at nested types.
15321 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
15322 not implement the IAssignMethod interface any more.
15324 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
15325 where we tranform them into FieldExprs if they are being resolved from within
15326 the declaring type.
15328 * ecore.cs (SimpleName.DoResolve): Do the same here.
15330 * assign.cs (DoResolve, Emit): Clean up code considerably.
15332 * ../errors/bug10.cs : Add.
15334 * ../errors/cs0070.cs : Add.
15336 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
15338 * assign.cs : Get rid of EventIsLocal everywhere.
15340 2001-12-23 Miguel de Icaza <miguel@ximian.com>
15342 * ecore.cs (ConvertIntLiteral): finished the implementation.
15344 * statement.cs (SwitchLabel): Convert the value we are using as a
15345 key before looking up the table.
15347 2001-12-22 Miguel de Icaza <miguel@ximian.com>
15349 * codegen.cs (EmitTopBlock): Require a Location argument now.
15351 * cs-parser.jay (constructor_declarator): We need to setup
15352 current_local_parameters before we parse the
15353 opt_constructor_initializer, to allow the variables to be bound
15354 to the constructor arguments.
15356 * rootcontext.cs (LookupType): First lookup nested classes in our
15357 class and our parents before we go looking outside our class.
15359 * expression.cs (ConstantFold): Extract/debox the values at the
15362 * rootcontext.cs (EmitCode): Resolve the constants first before we
15363 resolve the types. This is not really needed, but it helps debugging.
15365 * statement.cs: report location.
15367 * cs-parser.jay: pass location to throw statement.
15369 * driver.cs: Small bug fix.
15371 * report.cs: Updated format to be 4-zero filled digits.
15373 2001-12-22 Ravi Pratap <ravi@ximian.com>
15375 * expression.cs (CheckIndices): Fix minor bug where the wrong
15376 variable was being referred to ;-)
15378 (DoEmit): Do not call EmitStaticInitializers when the
15379 underlying type is System.Object.
15381 2001-12-21 Ravi Pratap <ravi@ximian.com>
15383 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
15384 and do the usual workaround for SRE.
15386 * class.cs (MyEventBuilder.EventType): New member to get at the type
15387 of the event, quickly.
15389 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
15391 * assign.cs (Assign.DoResolve): Handle the case when the target
15392 is an EventExpr and perform the necessary checks.
15394 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
15397 (SimpleName.MemberStaticCheck): Include check for EventExpr.
15399 (EventExpr): Set the type in the constructor itself since we
15400 are meant to be born fully resolved.
15402 (EventExpr.Define): Revert code I wrote earlier.
15404 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
15405 instance expression is null. The instance expression is a This in that case
15406 or a null, depending on whether it is a static method or not.
15408 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
15409 refers to more than one method.
15411 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
15412 and accordingly flag errors.
15414 2001-12-21 Miguel de Icaza <miguel@ximian.com>
15416 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
15418 2001-12-22 Miguel de Icaza <miguel@ximian.com>
15420 * location.cs (ToString): Provide useful rutine.
15422 2001-12-21 Miguel de Icaza <miguel@ximian.com>
15424 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
15425 objects, return the actual integral boxed.
15427 * statement.cs (SwitchLabel): define an ILLabel for each
15430 (Switch.CheckSwitch): If the value is a Literal, extract
15431 the underlying literal.
15433 Also in the unused hashtable we had, add the SwitchLabel so we can
15434 quickly look this value up.
15436 * constant.cs: Implement a bunch of new constants. Rewrite
15437 Literal based on this. Made changes everywhere to adapt to this.
15439 * expression.cs (Expression.MakeByteBlob): Optimize routine by
15440 dereferencing array only once, and also copes with enumrations.
15442 bytes are two bytes wide, not one.
15444 (Cast): Perform constant conversions.
15446 * ecore.cs (TryImplicitIntConversion): Return literals instead of
15447 wrappers to the literals here.
15449 * expression.cs (DoNumericPromotions): long literals can converted
15450 to ulong implicity (this is taken care of elsewhere, but I was
15451 missing this spot).
15453 * ecore.cs (Expression.Literalize): Make the return type Literal,
15454 to improve type checking.
15456 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
15458 2001-12-20 Miguel de Icaza <miguel@ximian.com>
15460 * literal.cs: Revert code from ravi that checked the bounds. The
15461 bounds are sane by the definition of the type itself.
15463 * typemanager.cs: Fix implementation of ImplementsInterface. We
15464 need to actually look up in our parent hierarchy for interfaces
15467 * const.cs: Use the underlying type for enumerations
15469 * delegate.cs: Compute the basename for the delegate creation,
15470 that should fix the delegate test case, and restore the correct
15471 Type Lookup semantics in rootcontext
15473 * rootcontext.cs: Revert Ravi's last patch. The correct way of
15474 referencing a nested type with the Reflection API is using the "+"
15477 * cs-parser.jay: Do not require EOF token at the end.
15479 2001-12-20 Ravi Pratap <ravi@ximian.com>
15481 * rootcontext.cs (LookupType): Concatenate type names with
15482 a '.' instead of a '+' The test suite passes again.
15484 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
15485 field of the enumeration.
15487 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
15488 the case when the member is an EventExpr.
15490 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
15491 static has an associated instance expression.
15493 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
15495 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
15497 * class.cs (Event.Define): Register event and perform appropriate checks
15500 We define the Add and Remove methods even if the use provides none because
15501 in that case, we provide default implementations ourselves.
15503 Define a private field of the type of the event. This is done by the CSC compiler
15504 and we should be doing it too ;-)
15506 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
15507 More methods we use in code we generate.
15509 (multicast_delegate_type, delegate_type): Two separate types since the distinction
15512 (InitCoreTypes): Update accordingly for the above.
15514 * class.cs (Event.Emit): Generate code for default accessors that we provide
15516 (EmitDefaultMethod): Do the job in the above.
15518 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
15521 2001-12-20 Miguel de Icaza <miguel@ximian.com>
15523 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
15524 builders even if we were missing one.
15526 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
15527 pass the Basename as our class name instead of the Name. The
15528 basename will be correctly composed for us.
15530 * parameter.cs (Paramters): Now takes a Location argument.
15532 * decl.cs (DeclSpace.LookupType): Removed convenience function and
15533 make all the code call directly LookupType in RootContext and take
15534 this chance to pass the Location information everywhere.
15536 * Everywhere: pass Location information.
15538 2001-12-19 Miguel de Icaza <miguel@ximian.com>
15540 * class.cs (Constructor.Define): Updated way of detecting the
15541 length of the parameters.
15543 (TypeContainer.DefineType): Use basename as the type name for
15546 (TypeContainer.Define): Do not recursively define types here, as
15547 definition is taken care in order by the RootContext.
15549 * tree.cs: Keep track of namespaces in a per-file basis.
15551 * parameter.cs (Parameter.ComputeSignature): Update to use
15554 (Parameters.GetSignature): ditto.
15556 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
15557 instead of a TypeContainer.
15559 (Interface.SemanticAnalysis): Use `this' instead of our parent to
15560 resolve names. Because we need to be resolve in our context, not
15563 * driver.cs: Implement response files.
15565 * class.cs (TypeContainer.DefineType): If we are defined, do not
15566 redefine ourselves.
15568 (Event.Emit): Emit the code for add/remove handlers.
15569 (Event.Define): Save the MethodBuilders for add/remove.
15571 * typemanager.cs: Use pair here too.
15573 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
15574 DictionaryEntry requires the first argument to be non-null.
15576 (enum_declaration): Compute full name for registering the
15579 (delegate_declaration): Instead of using
15580 formal_parameter_list, use opt_formal_parameter_list as the list
15583 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
15584 (EventParsing): New property that controls whether `add' and
15585 `remove' are returned as tokens or identifiers (for events);
15587 2001-12-19 Ravi Pratap <ravi@ximian.com>
15589 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
15590 use MyEventBuilder only and let it wrap the real builder for us.
15592 (MyEventBuilder): Revamp constructor etc.
15594 Implement all operations that we perform on EventBuilder in precisely the same
15597 (FindMembers): Update to use the EventBuilder member.
15599 (Event.Emit): Update accordingly.
15601 2001-12-18 Ravi Pratap <ravi@ximian.com>
15603 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
15604 by calling the appropriate methods.
15606 (GetCustomAttributes): Make stubs as they cannot possibly do anything
15609 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
15611 2001-12-17 Ravi Pratap <ravi@ximian.com>
15613 * delegate.cs (Delegate.Populate): Check that the return type
15614 and various parameters types are indeed accessible.
15616 * class.cs (Constructor.Define): Same here.
15618 (Field.Define): Ditto.
15620 (Event.Define): Ditto.
15622 (Operator.Define): Check that the underlying Method defined itself
15623 correctly - so it's MethodBuilder should not be null.
15625 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
15626 expression happens to be null.
15628 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
15629 members but as of now we don't seem to be able to do anything really useful with it.
15631 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
15632 not the EventBuilder.
15634 2001-12-18 Miguel de Icaza <miguel@ximian.com>
15636 * cs-tokenizer.cs: Add support for defines.
15637 Add support for #if, #elif, #else, #endif
15639 (eval_var): evaluates a variable.
15640 (eval): stubbed for evaluating functions.
15642 * cs-parser.jay: Pass the defines information
15644 * driver.cs: Add --define command line option.
15646 * decl.cs: Move MemberCore here.
15648 Make it the base class for DeclSpace. This allows us to catch and
15649 report 108 and 109 for everything now.
15651 * class.cs (TypeContainer.Define): Extract all the members
15652 before populating and emit the warning 108 (new keyword required
15653 to override) instead of having each member implement this.
15655 (MemberCore.Define): New abstract method, we will be using this in
15656 the warning reporting engine in Populate.
15658 (Operator.Define): Adjust to new MemberCore protocol.
15660 * const.cs (Const): This does not derive from Expression, it is a
15661 temporary object we use to create fields, it is a MemberCore.
15663 * class.cs (Method.Define): Allow the entry point to be in a
15666 * driver.cs: Rewrite the argument handler to clean it up a bit.
15668 * rootcontext.cs: Made it just an auxiliary namespace feature by
15669 making everything static.
15671 * driver.cs: Adapt code to use RootContext type name instead of
15674 * delegate.cs: Remove RootContext argument.
15676 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
15679 * class.cs (Event.Define): The lookup can fail.
15681 * cs-tokenizer.cs: Begin implementation of pre-procesor.
15683 * expression.cs: Resolve the this instance before invoking the code.
15685 2001-12-17 Miguel de Icaza <miguel@ximian.com>
15687 * cs-parser.jay: Add a production in element_access that allows
15688 the thing to become a "type" reference. This way we can parse
15689 things like "(string [])" as a type.
15691 Note that this still does not handle the more complex rules of
15695 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
15697 * ecore.cs: (CopyNewMethods): new utility function used to
15698 assemble the list of methods from running FindMembers.
15700 (MemberLookup): Rework FindMembers so that
15702 2001-12-16 Miguel de Icaza <miguel@ximian.com>
15704 * class.cs (TypeContainer): Remove Delegates who fail to be
15707 * delegate.cs (Populate): Verify that we dont get null return
15708 values. TODO: Check for AsAccessible.
15710 * cs-parser.jay: Use basename to emit error 574 (destructor should
15711 have the same name as container class), not the full name.
15713 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
15714 possible representation.
15716 Also implements integer type suffixes U and L.
15718 2001-12-15 Miguel de Icaza <miguel@ximian.com>
15720 * expression.cs (ArrayCreation.DoResolve): We need to do the
15721 argument resolution *always*.
15723 * decl.cs: Make this hold the namespace. Hold the root context as
15725 (LookupType): Move here.
15727 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
15729 * location.cs (Row, Name): Fixed the code, it was always returning
15730 references to the first file.
15732 * interface.cs: Register properties defined through interfaces.
15734 * driver.cs: Add support for globbing on the command line
15736 * class.cs (Field): Make it derive from MemberCore as well.
15739 2001-12-15 Ravi Pratap <ravi@ximian.com>
15741 * class.cs (Event::Define): Check that the type of the event is a delegate
15742 type else flag error #66.
15744 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
15747 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
15748 values of EntryPoint, CharSet etc etc.
15750 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
15752 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
15753 be null and we should ignore this. I am not sure if this is really clean. Apparently,
15754 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
15755 which needs this to do its work.
15757 * ../errors/cs0066.cs : Add.
15759 2001-12-14 Miguel de Icaza <miguel@ximian.com>
15761 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
15764 * class.cs: (MethodSignature.MethodSignature): Removed hack that
15765 clears out the parameters field.
15766 (MemberSignatureCompare): Cleanup
15768 (MemberCore): New base class used to share code between MethodCore
15771 (RegisterRequiredImplementations) BindingFlags.Public requires
15772 either BindingFlags.Instace or Static. Use instance here.
15774 (Property): Refactored code to cope better with the full spec.
15776 * parameter.cs (GetParameterInfo): Return an empty array instead
15779 * class.cs (Property): Abstract or extern properties have no bodies.
15781 * parameter.cs (GetParameterInfo): return a zero-sized array.
15783 * class.cs (TypeContainer.MethodModifiersValid): Move all the
15784 method modifier validation to the typecontainer so we can reuse
15785 this on properties.
15787 (MethodCore.ParameterTypes): return an empty sized array of types.
15789 (Property.Define): Test property modifier validity.
15791 Add tests for sealed/override too.
15793 (Method.Emit): abstract or extern methods have no bodies.
15795 2001-12-14 Ravi Pratap <ravi@ximian.com>
15797 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
15800 (Method::Define, ::Emit): Modify accordingly.
15802 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
15804 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
15806 * makefile: Pass in /unsafe.
15808 2001-12-13 Miguel de Icaza <miguel@ximian.com>
15810 * class.cs (MakeKey): Kill routine.
15812 * class.cs (TypeContainer.Define): Correctly define explicit
15813 method implementations (they require the full interface name plus
15816 * typemanager.cs: Deply the PtrHashtable here and stop using the
15817 lame keys. Things work so much better.
15819 This of course broke everyone who depended on `RegisterMethod' to
15820 do the `test for existance' test. This has to be done elsewhere.
15822 * support.cs (PtrHashtable): A hashtable that avoid comparing with
15823 the object stupid Equals method (because, that like fails all over
15824 the place). We still do not use it.
15826 * class.cs (TypeContainer.SetRequiredInterface,
15827 TypeContainer.RequireMethods): Killed these two routines and moved
15828 all the functionality to RegisterRequiredImplementations.
15830 (TypeContainer.RegisterRequiredImplementations): This routine now
15831 registers all the implementations required in an array for the
15832 interfaces and abstract methods. We use an array of structures
15833 which can be computed ahead of time to reduce memory usage and we
15834 also assume that lookups are cheap as most classes will not
15835 implement too many interfaces.
15837 We also avoid creating too many MethodSignatures.
15839 (TypeContainer.IsInterfaceMethod): Update and optionally does not
15840 clear the "pending" bit if we find that there are problems with
15843 (TypeContainer.VerifyPendingMethods): Update to report errors of
15844 methods that look like implementations but are not.
15846 (TypeContainer.Define): Add support for explicit interface method
15849 2001-12-12 Miguel de Icaza <miguel@ximian.com>
15851 * typemanager.cs: Keep track of the parameters here instead of
15852 being a feature of the TypeContainer.
15854 * class.cs: Drop the registration of parameters here, as
15855 InterfaceMethods are also interface declarations.
15857 * delegate.cs: Register methods with the TypeManager not only with
15858 the TypeContainer. This code was buggy.
15860 * interface.cs: Full registation here.
15862 2001-12-11 Miguel de Icaza <miguel@ximian.com>
15864 * expression.cs: Remove reducer for binary expressions, it can not
15867 * const.cs: Put here the code that used to go into constant.cs
15869 * constant.cs: Put here the code for constants, this is a new base
15870 class for Literals.
15872 * literal.cs: Make Literal derive from Constant.
15874 2001-12-09 Miguel de Icaza <miguel@ximian.com>
15876 * statement.cs (Return.Emit): Report error 157 if the user
15877 attempts to return from a finally block.
15879 (Return.Emit): Instead of emitting a return, jump to the end of
15882 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
15883 LocalBuilder to store the result of the function. ReturnLabel is
15884 the target where we jump.
15887 2001-12-09 Radek Doulik <rodo@ximian.com>
15889 * cs-parser.jay: remember alias in current namespace
15891 * ecore.cs (SimpleName::DoResolve): use aliases for types or
15894 * class.cs (LookupAlias): lookup alias in my_namespace
15896 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
15898 (LookupAlias): lookup alias in this and if needed in parent
15901 2001-12-08 Miguel de Icaza <miguel@ximian.com>
15905 * rootcontext.cs: (ModuleBuilder) Made static, first step into
15906 making things static. I need this to avoid passing the
15907 TypeContainer when calling ParameterType.
15909 * support.cs (InternalParameters.ParameterType): Remove ugly hack
15910 that did string manipulation to compute the type and then call
15911 GetType. Use Parameter.ParameterType instead.
15913 * cs-tokenizer.cs: Consume the suffix for floating values.
15915 * expression.cs (ParameterReference): figure out whether this is a
15916 reference parameter or not. Kill an extra variable by computing
15917 the arg_idx during emission.
15919 * parameter.cs (Parameters.GetParameterInfo): New overloaded
15920 function that returns whether a parameter is an out/ref value or not.
15922 (Parameter.ParameterType): The type of the parameter (base,
15923 without ref/out applied).
15925 (Parameter.Resolve): Perform resolution here.
15926 (Parameter.ExternalType): The full type (with ref/out applied).
15928 * statement.cs (Using.Emit, Using.EmitExpression): Implement
15929 support for expressions on the using statement.
15931 2001-12-07 Miguel de Icaza <miguel@ximian.com>
15933 * statement.cs (Using.EmitLocalVariableDecls): Split the
15934 localvariable handling of the using statement.
15936 (Block.EmitMeta): Keep track of variable count across blocks. We
15937 were reusing slots on separate branches of blocks.
15939 (Try.Emit): Emit the general code block, we were not emitting it.
15941 Check the type of the declaration to be an IDisposable or
15942 something that can be implicity converted to it.
15944 Emit conversions if required.
15946 * ecore.cs (EmptyExpression): New utility class.
15947 (Expression.ImplicitConversionExists): New utility function.
15949 2001-12-06 Miguel de Icaza <miguel@ximian.com>
15951 * statement.cs (Using): Implement.
15953 * expression.cs (LocalVariableReference): Support read only variables.
15955 * statement.cs: Remove the explicit emit for the Leave opcode.
15956 (VariableInfo): Add a readonly field.
15958 2001-12-05 Miguel de Icaza <miguel@ximian.com>
15960 * ecore.cs (ConvCast): new class used to encapsulate the various
15961 explicit integer conversions that works in both checked and
15962 unchecked contexts.
15964 (Expression.ConvertNumericExplicit): Use new ConvCast class to
15965 properly generate the overflow opcodes.
15967 2001-12-04 Miguel de Icaza <miguel@ximian.com>
15969 * statement.cs: The correct type for the EmptyExpression is the
15970 element_type, not the variable type. Ravi pointed this out.
15972 2001-12-04 Ravi Pratap <ravi@ximian.com>
15974 * class.cs (Method::Define): Handle PInvoke methods specially
15975 by using DefinePInvokeMethod instead of the usual one.
15977 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
15978 above to do the task of extracting information and defining the method.
15980 2001-12-04 Ravi Pratap <ravi@ximian.com>
15982 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
15983 of the condition for string type.
15985 (Emit): Move that here.
15987 (ArrayCreation::CheckIndices): Keep string literals in their expression
15990 (EmitDynamicInitializers): Handle strings appropriately.
15992 2001-12-04 Miguel de Icaza <miguel@ximian.com>
15994 * codegen.cs (EmitContext): Replace multiple variables with a
15995 single pointer to the current Switch statement.
15997 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
16000 2001-12-03 Miguel de Icaza <miguel@ximian.com>
16004 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
16007 (Foreach.Emit): Foreach on arrays was not setting
16008 up the loop variables (for break/continue).
16010 (GotoCase): Semi-implented.
16012 2001-12-03 Ravi Pratap <ravi@ximian.com>
16014 * attribute.cs (CheckAttribute): Handle system attributes by using
16015 Attribute.GetAttributes to examine information we need.
16017 (GetValidPlaces): Same here.
16019 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
16021 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
16023 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
16025 (Method::Define): Set appropriate flags if we have a DllImport attribute.
16027 (Method::Emit): Handle the case when we are a PInvoke method.
16029 2001-12-03 Miguel de Icaza <miguel@ximian.com>
16031 * expression.cs: Use ResolveWithSimpleName on compound names.
16033 2001-12-02 Ravi Pratap <ravi@ximian.com>
16035 * constant.cs (EmitConstant): Make sure we resolve the associated expression
16036 before trying to reduce it.
16038 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
16040 * constant.cs (LookupConstantValue): Implement.
16042 (EmitConstant): Use the above in emitting the constant.
16044 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
16045 that are user-defined by doing a LookupConstantValue on them.
16047 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
16050 2001-11-29 Miguel de Icaza <miguel@ximian.com>
16052 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
16054 (BaseAccess.DoResolve): Implement.
16056 (MemberAccess.DoResolve): Split this routine into a
16057 ResolveMemberAccess routine that can be used independently
16059 2001-11-28 Miguel de Icaza <miguel@ximian.com>
16061 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
16062 As that share bits of the implementation. Is returns a boolean,
16063 while As returns the Type that is being probed.
16065 2001-12-01 Ravi Pratap <ravi@ximian.com>
16067 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
16068 instead of a Literal - much easier.
16070 (EnumInTransit): Remove - utterly useless :-)
16072 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
16074 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
16076 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
16077 chain when we have no associated expression.
16079 2001-11-30 Ravi Pratap <ravi@ximian.com>
16081 * constant.cs (Define): Use Location while reporting the errror.
16083 Also emit a warning when 'new' is used and there is no inherited
16086 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
16089 (LookupEnumValue): Implement to lookup an enum member's value and define it
16092 (Populate): Re-write accordingly to use the above routine.
16094 2001-11-27 Miguel de Icaza <miguel@ximian.com>
16096 * expression.cs (This): Fix prototype for DoResolveLValue to
16097 override the base class DoResolveLValue.
16099 * cs-parser.cs: Report errors cs574 and cs575 (destructor
16102 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
16103 (we need to load the address of the field here). This fixes
16106 (FieldExpr.DoResolveLValue): Call the DoResolve
16107 function to initialize the Instance expression.
16109 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
16110 correctly the GetEnumerator operation on a value type.
16112 * cs-parser.jay: Add more simple parsing error catches.
16114 * statement.cs (Switch): Add support for string switches.
16115 Handle null specially.
16117 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
16119 2001-11-28 Ravi Pratap <ravi@ximian.com>
16121 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
16123 (declare_local_constant): New helper function.
16125 * statement.cs (AddConstant): Keep a separate record of constants
16127 (IsConstant): Implement to determine if a variable is a constant.
16129 (GetConstantExpression): Implement.
16131 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
16133 * statement.cs (IsVariableDefined): Re-write.
16135 2001-11-27 Ravi Pratap <ravi@ximian.com>
16137 * class.cs (TypeContainer::FindMembers): Look for constants
16138 in the case when we are looking for MemberTypes.Field
16140 * expression.cs (MemberAccess::DoResolve): Check that in the
16141 case we are a FieldExpr and a Literal, we are not being accessed
16142 by an instance reference.
16144 * cs-parser.jay (local_constant_declaration): Implement.
16146 (declaration_statement): Implement for constant declarations.
16148 2001-11-26 Miguel de Icaza <miguel@ximian.com>
16150 * statement.cs (Switch): Catch double defaults.
16152 (Switch): More work on the switch() statement
16153 implementation. It works for integral values now, need to finish
16157 2001-11-24 Miguel de Icaza <miguel@ximian.com>
16159 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
16160 integer literals into other integer literals. To be used by
16163 2001-11-24 Ravi Pratap <ravi@ximian.com>
16165 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
16168 (EmitDynamicInitializers): Cope with the above since we extract data
16169 directly from ArrayData now.
16171 (ExpectInitializers): Keep track of whether initializers are mandatory
16174 (Bounds): Make it a hashtable to prevent the same dimension being
16175 recorded for every element in that dimension.
16177 (EmitDynamicInitializers): Fix bug which prevented the Set array method
16180 Also fix bug which was causing the indices to be emitted in the reverse
16183 2001-11-24 Miguel de Icaza <miguel@ximian.com>
16185 * expression.cs (ArrayCreation): Implement the bits that Ravi left
16186 unfinished. They do not work, because the underlying code is
16189 2001-11-22 Miguel de Icaza <miguel@ximian.com>
16191 * cs-parser.jay: Remove bogus fixme.
16193 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
16194 on Switch statement.
16196 2001-11-23 Ravi Pratap <ravi@ximian.com>
16198 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
16201 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
16202 parameter. Apparently, any expression is allowed.
16204 (ValidateInitializers): Update accordingly.
16206 (CheckIndices): Fix some tricky bugs thanks to recursion.
16208 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
16209 I was being completely brain-dead.
16211 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
16212 and re-write acordingly.
16214 (DelegateInvocation): Re-write accordingly.
16216 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
16218 (MakeByteBlob): Handle types more correctly.
16220 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
16221 initialization from expressions but it is incomplete because I am a complete
16224 2001-11-22 Miguel de Icaza <miguel@ximian.com>
16226 * statement.cs (If.Emit): Fix a bug that generated incorrect code
16227 on If. Basically, we have to return `true' (ie, we do return to
16228 our caller) only if both branches of the if return.
16230 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
16231 short-circuit operators, handle them as short circuit operators.
16233 (Cast.DoResolve): Resolve type.
16234 (Cast.Cast): Take an expression as the target type.
16236 * cs-parser.jay (cast_expression): Remove old hack that only
16237 allowed a limited set of types to be handled. Now we take a
16238 unary_expression and we resolve to a type during semantic
16241 Use the grammar productions from Rhys to handle casts (this is
16242 not complete like Rhys syntax yet, we fail to handle that corner
16243 case that C# has regarding (-x), but we will get there.
16245 2001-11-22 Ravi Pratap <ravi@ximian.com>
16247 * class.cs (EmitFieldInitializer): Take care of the case when we have a
16248 field which is an array type.
16250 * cs-parser.jay (declare_local_variables): Support array initialization too.
16252 * typemanager.cs (MakeKey): Implement.
16254 (everywhere): Use the above appropriately.
16256 * cs-parser.jay (for_statement): Update for array initialization while
16257 declaring variables.
16259 * ecore.cs : The error message was correct, it's the variable's names that
16260 were misleading ;-) Make the code more readable.
16262 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
16263 the correct type etc.
16265 (ConvertExplicit): Handle Enum types by examining the underlying type.
16267 2001-11-21 Ravi Pratap <ravi@ximian.com>
16269 * parameter.cs (GetCallingConvention): Always return
16270 CallingConventions.Standard for now.
16272 2001-11-22 Miguel de Icaza <miguel@ximian.com>
16274 * expression.cs (Binary.ResolveOperator): Update the values of `l'
16275 and `r' after calling DoNumericPromotions.
16277 * ecore.cs: Fix error message (the types were in the wrong order).
16279 * statement.cs (Foreach.ProbeCollectionType): Need to pass
16280 BindingFlags.Instance as well
16282 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
16283 implicit int literal conversion in an empty cast so that we
16284 propagate the right type upstream.
16286 (UnboxCast): new class used to unbox value types.
16287 (Expression.ConvertExplicit): Add explicit type conversions done
16290 (Expression.ImplicitNumericConversion): Oops, forgot to test for
16291 the target type before applying the implicit LongLiterals to ULong
16294 2001-11-21 Miguel de Icaza <miguel@ximian.com>
16296 * cs-parser.jay (for_statement): Reworked the way For works: now
16297 we declare manually any variables that are introduced in
16298 for_initializer to solve the problem of having out-of-band code
16299 emition (that is what got for broken).
16301 (declaration_statement): Perform the actual variable declaration
16302 that used to be done in local_variable_declaration here.
16304 (local_variable_declaration): Do not declare anything, just pass
16305 the information on a DictionaryEntry
16307 2001-11-20 Ravi Pratap <ravi@ximian.com>
16309 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
16310 re-write of the logic to now make it recursive.
16312 (UpdateIndices): Re-write accordingly.
16314 Store element data in a separate ArrayData list in the above methods.
16316 (MakeByteBlob): Implement to dump the array data into a byte array.
16318 2001-11-19 Ravi Pratap <ravi@ximian.com>
16320 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
16323 * constant.cs (Define): Implement.
16325 (EmitConstant): Re-write fully.
16327 Pass in location info.
16329 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
16332 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
16333 DictionaryEntry since we need location info too.
16335 (constant_declaration): Update accordingly.
16337 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
16338 code into another method : UpdateIndices.
16340 2001-11-18 Ravi Pratap <ravi@ximian.com>
16342 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
16343 some type checking etc.
16345 2001-11-17 Ravi Pratap <ravi@ximian.com>
16347 * expression.cs (ArrayCreation::ValidateInitializers): Implement
16348 bits to provide dimension info if the user skips doing that.
16350 Update second constructor to store the rank correctly.
16352 2001-11-16 Ravi Pratap <ravi@ximian.com>
16354 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
16355 and try to implement.
16357 * ../errors/cs0150.cs : Add.
16359 * ../errors/cs0178.cs : Add.
16361 2001-11-16 Miguel de Icaza <miguel@ximian.com>
16363 * statement.cs: Implement foreach on multi-dimensional arrays.
16365 * parameter.cs (Parameters.GetParameterByName): Also lookup the
16366 name of the params argument.
16368 * expression.cs: Use EmitStoreOpcode to get the right opcode while
16369 initializing the array.
16371 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
16372 we can use this elsewhere.
16374 * statement.cs: Finish implementation of foreach for single
16377 * cs-parser.jay: Use an out-of-band stack to pass information
16378 around, I wonder why I need this.
16380 foreach_block: Make the new foreach_block the current_block.
16382 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
16383 function used to return a static Parameters structure. Used for
16384 empty parameters, as those are created very frequently.
16386 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
16388 2001-11-15 Ravi Pratap <ravi@ximian.com>
16390 * interface.cs : Default modifier is private, not public. The
16391 make verify test passes again.
16393 2001-11-15 Ravi Pratap <ravi@ximian.com>
16395 * support.cs (ReflectionParameters): Fix logic to determine
16396 whether the last parameter is a params one. Test 9 passes again.
16398 * delegate.cs (Populate): Register the builders we define with
16399 RegisterParameterForBuilder. Test 19 passes again.
16401 * cs-parser.jay (property_declaration): Reference $6 instead
16402 of $$ to get at the location.
16404 (indexer_declaration): Similar stuff.
16406 (attribute): Ditto.
16408 * class.cs (Property): Register parameters for the Get and Set methods
16409 if they exist. Test 23 passes again.
16411 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
16412 call to EmitArguments as we are sure there aren't any params arguments.
16413 Test 32 passes again.
16415 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
16416 IndexOutOfRangeException.
16418 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
16419 Test 33 now passes again.
16421 2001-11-15 Miguel de Icaza <miguel@ximian.com>
16423 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
16424 broke a bunch of things. Will have to come up with a better way
16425 of tracking locations.
16427 * statement.cs: Implemented foreach for single dimension arrays.
16429 2001-11-09 Miguel de Icaza <miguel@ximian.com>
16431 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
16432 an error. This removes the lookup from the critical path.
16434 * cs-parser.jay: Removed use of temporary_loc, which is completely
16437 2001-11-14 Miguel de Icaza <miguel@ximian.com>
16439 * support.cs (ReflectionParameters.ParameterModifier): Report
16440 whether the argument is a PARAMS argument or not.
16442 * class.cs: Set the attribute `ParamArrayAttribute' on the
16443 parameter argument.
16445 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
16446 and cons_param_array_attribute (ConstructorInfo for
16447 ParamArrayAttribute).,
16449 * codegen.cs: Emit the return using the `Return' statement, that
16450 way we can report the error correctly for missing return values.
16452 * class.cs (Method.Emit): Clean up.
16454 * expression.cs (Argument.Resolve): Take another argument: the
16455 location where this argument is used. Notice that this is not
16456 part of the "Argument" class as to reduce the size of the
16457 structure (we know the approximate location anyways).
16459 Test if the argument is a variable-reference, if not, then
16460 complain with a 206.
16462 (Argument.Emit): Emit addresses of variables.
16464 (Argument.FullDesc): Simplify.
16466 (Invocation.DoResolve): Update for Argument.Resolve.
16468 (ElementAccess.DoResolve): ditto.
16470 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
16471 method should be virtual, as this method is always virtual.
16473 (NewDelegate.DoResolve): Update for Argument.Resolve.
16475 * class.cs (ConstructorInitializer.DoResolve): ditto.
16477 * attribute.cs (Attribute.Resolve): ditto.
16479 2001-11-13 Miguel de Icaza <miguel@ximian.com>
16481 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
16483 * expression.cs (ParameterReference): Drop IStackStorage and implement
16484 IAssignMethod instead.
16486 (LocalVariableReference): ditto.
16488 * ecore.cs (FieldExpr): Drop IStackStorage and implement
16489 IAssignMethod instead.
16491 2001-11-13 Miguel de Icaza <miguel@ximian.com>
16493 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
16494 enumerations that are used in heavily used structures derive from
16495 byte in a laughable and pathetic attempt to reduce memory usage.
16496 This is the kind of pre-optimzations that you should not do at
16497 home without adult supervision.
16499 * expression.cs (UnaryMutator): New class, used to handle ++ and
16500 -- separatedly from the other unary operators. Cleans up the
16501 code, and kills the ExpressionStatement dependency in Unary.
16503 (Unary): Removed `method' and `Arguments' from this class, making
16504 it smaller, and moving it all to SimpleCall, so I can reuse this
16505 code in other locations and avoid creating a lot of transient data
16506 strucutres when not required.
16508 * cs-parser.jay: Adjust for new changes.
16510 2001-11-11 Miguel de Icaza <miguel@ximian.com>
16512 * enum.cs (Enum.Populate): If there is a failure during
16515 * cs-parser.jay (opt_enum_base): we used to catch type errors
16516 here, but this is really incorrect. The type error should be
16517 catched during semantic analysis.
16519 2001-12-11 Ravi Pratap <ravi@ximian.com>
16521 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
16522 current_local_parameters as expected since I, in my stupidity, had forgotten
16525 * attribute.cs (GetValidPlaces): Fix stupid bug.
16527 * class.cs (Method::Emit): Perform check on applicability of attributes.
16529 (Constructor::Emit): Ditto.
16531 (Field::Emit): Ditto.
16533 (Field.Location): Store location information.
16535 (Property, Event, Indexer, Operator): Ditto.
16537 * cs-parser.jay (field_declaration): Pass in location for each field.
16539 * ../errors/cs0592.cs : Add.
16541 2001-11-12 Ravi Pratap <ravi@ximian.com>
16543 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
16545 (InitCoreTypes): Update accordingly.
16547 (RegisterAttrType, LookupAttr): Implement.
16549 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
16550 info about the same.
16552 (Resolve): Update to populate the above as necessary.
16554 (Error592): Helper.
16556 (GetValidPlaces): Helper to the above.
16558 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
16560 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
16562 2001-11-12 Ravi Pratap <ravi@ximian.com>
16564 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
16566 * ../errors/cs0617.cs : Add.
16568 2001-11-11 Ravi Pratap <ravi@ximian.com>
16570 * enum.cs (Emit): Rename to Populate to be more consistent with what
16571 we expect it to do and when exactly it is called.
16573 * class.cs, rootcontext.cs : Update accordingly.
16575 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
16576 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
16578 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
16580 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
16581 of a fieldinfo using the above, when dealing with a FieldBuilder.
16583 2001-11-10 Ravi Pratap <ravi@ximian.com>
16585 * ../errors/cs0031.cs : Add.
16587 * ../errors/cs1008.cs : Add.
16589 * ../errrors/cs0543.cs : Add.
16591 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
16594 (FindMembers): Implement.
16596 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
16597 enums and delegates too.
16599 (enum_types): Rename to builder_to_enum.
16601 (delegate_types): Rename to builder_to_delegate.
16603 * delegate.cs (FindMembers): Implement.
16605 2001-11-09 Ravi Pratap <ravi@ximian.com>
16607 * typemanager.cs (IsEnumType): Implement.
16609 * enum.cs (Emit): Re-write parts to account for the underlying type
16610 better and perform checking etc.
16612 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
16613 of the underlying type.
16615 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
16618 * enum.cs (error31): Helper to report error #31.
16620 * cs-parser.jay (enum_declaration): Store location of each member too.
16622 * enum.cs (member_to_location): New hashtable.
16624 (AddEnumMember): Update location hashtable.
16626 (Emit): Use the location of each member while reporting errors.
16628 2001-11-09 Miguel de Icaza <miguel@ximian.com>
16630 * cs-parser.jay: A for_initializer if is a
16631 local_variable_declaration really ammount to have an implicit
16632 block with the variable declaration and no initializer for for.
16634 * statement.cs (For.Emit): Cope with null initializers.
16636 This fixes the infinite loop on for initializers.
16638 2001-11-08 Miguel de Icaza <miguel@ximian.com>
16640 * enum.cs: More cleanup.
16642 * ecore.cs: Remove dead code.
16644 * class.cs (Property.Emit): More simplification.
16645 (Event.Emit): ditto.
16647 Reworked to have less levels of indentation.
16649 2001-11-08 Ravi Pratap <ravi@ximian.com>
16651 * class.cs (Property): Emit attributes.
16661 * enum.cs (Emit): Ditto.
16663 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
16666 * class.cs (Field, Event, etc.): Move attribute generation into the
16667 Emit method everywhere.
16669 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
16670 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
16671 as we had no way of defining nested enums !
16673 * rootcontext.cs : Adjust code accordingly.
16675 * typemanager.cs (AddEnumType): To keep track of enum types separately.
16677 2001-11-07 Ravi Pratap <ravi@ximian.com>
16679 * expression.cs (EvalConstantExpression): Move into ecore.cs
16681 * enum.cs (Enum): Rename some members and make them public and readonly
16682 according to our convention.
16684 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
16687 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
16689 (Enum::Emit): Write a simple version for now which doesn't try to compute
16690 expressions. I shall modify this to be more robust in just a while.
16692 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
16694 (TypeContainer::CloseType): Create the Enum types too.
16696 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
16698 * expression.cs (EvalConstantExpression): Get rid of completely.
16700 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
16701 user-defined values and other cases.
16703 (IsValidEnumLiteral): Helper function.
16705 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
16706 out there in the case we had a literal FieldExpr.
16708 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
16710 (Literalize): Revamp a bit to take two arguments.
16712 (EnumLiteral): New class which derives from Literal to wrap enum literals.
16714 2001-11-06 Ravi Pratap <ravi@ximian.com>
16716 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
16718 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
16720 (Resolve): Use the above to ensure we have proper initializers.
16722 2001-11-05 Ravi Pratap <ravi@ximian.com>
16724 * expression.cs (Expression::EvalConstantExpression): New method to
16725 evaluate constant expressions.
16727 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
16729 2001-11-07 Miguel de Icaza <miguel@ximian.com>
16731 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
16734 (Binary.ResolveOperator): Handle operator != (object a, object b)
16735 and operator == (object a, object b);
16737 (Binary.DoNumericPromotions): Indicate whether the numeric
16738 promotion was possible.
16740 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
16743 Made the ArrayAccess implement interface IAssignMethod instead of
16744 IStackStore as the order in which arguments are passed reflects
16747 * assign.cs: Instead of using expr.ExprClass to select the way of
16748 assinging, probe for the IStackStore/IAssignMethod interfaces.
16750 * typemanager.cs: Load InitializeArray definition.
16752 * rootcontext.cs (RootContext.MakeStaticData): Used to define
16753 static data that can be used to initialize arrays.
16755 2001-11-05 Miguel de Icaza <miguel@ximian.com>
16757 * expression.cs: Handle operator== and operator!= for booleans.
16759 (Conditioal.Reduce): Implement reducer for the ?: operator.
16761 (Conditional.Resolve): Implement dead code elimination.
16763 (Binary.Resolve): Catch string literals and return a new
16764 concatenated string.
16766 (Unary.Reduce): Implement reduction of unary expressions.
16768 * ecore.cs: Split out the expression core handling here.
16770 (Expression.Reduce): New method used to perform constant folding
16771 and CSE. This is needed to support constant-expressions.
16773 * statement.cs (Statement.EmitBoolExpression): Pass true and false
16774 targets, and optimize for !x.
16776 2001-11-04 Ravi Pratap <ravi@ximian.com>
16778 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
16779 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
16780 set custom atttributes.
16782 * literal.cs (Literal::GetValue): New abstract method to return the actual
16783 value of the literal, cast as an object.
16785 (*Literal): Implement GetValue method.
16787 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
16788 expressions to the arraylist but objects of type Argument.
16790 * class.cs (TypeContainer::Emit): Emit our attributes too.
16792 (Method::Emit, Constructor::Emit): Ditto.
16794 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
16795 to be ignoring earlier.
16797 2001-11-03 Ravi Pratap <ravi@ximian.com>
16799 * attribute.cs (AttributeSection::Define): Implement to do the business
16800 of constructing a CustomAttributeBuilder.
16802 (Attribute): New trivial class. Increases readability of code.
16804 * cs-parser.jay : Update accordingly.
16806 (positional_argument_list, named_argument_list, named_argument): New rules
16808 (attribute_arguments): Use the above so that we are more correct.
16810 2001-11-02 Ravi Pratap <ravi@ximian.com>
16812 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
16813 to perform all checks for a method with a params parameter.
16815 (Invocation::OverloadResolve): Update to use the above method and therefore
16816 cope correctly with params method invocations.
16818 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
16821 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
16822 constructors in our parent too because we can't afford to miss out on
16825 * attribute.cs (AttributeSection): New name for the class Attribute
16827 Other trivial changes to improve readability.
16829 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
16830 use the new class names.
16832 2001-11-01 Ravi Pratap <ravi@ximian.com>
16834 * class.cs (Method::Define): Complete definition for params types too
16836 (Indexer::Define): Ditto.
16838 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
16839 Cope everywhere with a request for info about the array parameter.
16841 2001-11-01 Ravi Pratap <ravi@ximian.com>
16843 * tree.cs (RecordNamespace): Fix up to check for the correct key.
16845 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
16846 local_variable_type to extract the string corresponding to the type.
16848 (local_variable_type): Fixup the action to use the new helper method.
16850 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
16853 * expression.cs : Clean out code which uses the above.
16855 2001-10-31 Ravi Pratap <ravi@ximian.com>
16857 * typemanager.cs (RegisterMethod): Check if we already have an existing key
16858 and bale out if necessary by returning a false.
16860 (RegisterProperty): Ditto.
16862 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
16863 and print out appropriate error messages.
16865 * interface.cs (everywhere): Ditto.
16867 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
16868 location to constructor.
16870 * class.cs (Property, Event, Indexer): Update accordingly.
16872 * ../errors/cs111.cs : Added.
16874 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
16875 of a method, as laid down by the spec.
16877 (Invocation::OverloadResolve): Use the above method.
16879 2001-10-31 Ravi Pratap <ravi@ximian.com>
16881 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
16882 now take a TypeContainer and a Parameters object.
16884 (ParameterData): Modify return type of ParameterModifier method to be
16885 Parameter.Modifier and not a string.
16887 (ReflectionParameters, InternalParameters): Update accordingly.
16889 * expression.cs (Argument::GetParameterModifier): Same here.
16891 * support.cs (InternalParameters::ParameterType): Find a better way of determining
16892 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
16893 symbol in it at all so maybe this is only for now.
16895 2001-10-30 Ravi Pratap <ravi@ximian.com>
16897 * support.cs (InternalParameters): Constructor now takes an extra argument
16898 which is the actual Parameters class.
16900 (ParameterDesc): Update to provide info on ref/out modifiers.
16902 * class.cs (everywhere): Update call to InternalParameters to pass in
16903 the second argument too.
16905 * support.cs (ParameterData): Add ParameterModifier, which is a method
16906 to return the modifier info [ref/out etc]
16908 (InternalParameters, ReflectionParameters): Implement the above.
16910 * expression.cs (Argument::ParameterModifier): Similar function to return
16911 info about the argument's modifiers.
16913 (Invocation::OverloadResolve): Update to take into account matching modifiers
16916 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
16917 a new SetFormalParameters object which we pass to InternalParameters.
16919 2001-10-30 Ravi Pratap <ravi@ximian.com>
16921 * expression.cs (NewArray): Merge into the ArrayCreation class.
16923 2001-10-29 Ravi Pratap <ravi@ximian.com>
16925 * expression.cs (NewArray): Merge classes NewBuiltinArray and
16926 NewUserdefinedArray into one as there wasn't much of a use in having
16929 * expression.cs (Argument): Change field's name to ArgType from Type.
16931 (Type): New readonly property which returns the proper type, taking into
16932 account ref/out modifiers.
16934 (everywhere): Adjust code accordingly for the above.
16936 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
16937 whether we are emitting for a ref or out parameter.
16939 * expression.cs (Argument::Emit): Use the above field to set the state.
16941 (LocalVariableReference::Emit): Update to honour the flag and emit the
16944 * parameter.cs (Attributes): Set the correct flags for ref parameters.
16946 * expression.cs (Argument::FullDesc): New function to provide a full desc.
16948 * support.cs (ParameterData): Add method ParameterDesc to the interface.
16950 (ReflectionParameters, InternalParameters): Implement the above method.
16952 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
16955 (Invocation::FullMethodDesc): Ditto.
16957 2001-10-29 Miguel de Icaza <miguel@ximian.com>
16959 * cs-parser.jay: Add extra production for the second form of array
16962 * expression.cs (ArrayCreation): Update to reflect the above
16965 * Small changes to prepare for Array initialization.
16967 2001-10-28 Miguel de Icaza <miguel@ximian.com>
16969 * typemanager.cs (ImplementsInterface): interface might be null;
16970 Deal with this problem;
16972 Also, we do store negative hits on the cache (null values), so use
16973 this instead of calling t.GetInterfaces on the type everytime.
16975 2001-10-28 Ravi Pratap <ravi@ximian.com>
16977 * typemanager.cs (IsBuiltinType): New method to help determine the same.
16979 * expression.cs (New::DoResolve): Get rid of array creation code and instead
16980 split functionality out into different classes.
16982 (New::FormArrayType): Move into NewBuiltinArray.
16984 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
16987 (NewBuiltinArray): New class to handle creation of built-in arrays.
16989 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
16990 account creation of one-dimensional arrays.
16992 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
16994 (NewUserdefinedArray::DoResolve): Implement.
16996 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
16998 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
16999 we maintain inside the TypeManager. This is necessary to perform lookups on the
17002 (LookupType): Update to perform GetType on the module builders too.
17004 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
17006 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
17008 2001-10-23 Ravi Pratap <ravi@ximian.com>
17010 * expression.cs (New::DoResolve): Implement guts of array creation.
17012 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
17014 2001-10-27 Miguel de Icaza <miguel@ximian.com>
17016 * expression.cs: Fix bug I introduced lsat night that broke
17019 (Expression.Resolve): Report a 246 error (can not resolve name)
17020 if we find a SimpleName in the stream.
17022 (Expression.ResolveLValue): Ditto.
17024 (Expression.ResolveWithSimpleName): This function is a variant of
17025 ResolveName, this one allows SimpleNames to be returned without a
17026 warning. The only consumer of SimpleNames is MemberAccess
17028 2001-10-26 Miguel de Icaza <miguel@ximian.com>
17030 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
17031 might arrive here. I have my doubts that this is correct.
17033 * statement.cs (Lock): Implement lock statement.
17035 * cs-parser.jay: Small fixes to support `lock' and `using'
17037 * cs-tokenizer.cs: Remove extra space
17039 * driver.cs: New flag --checked, allows to turn on integer math
17042 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
17043 Threading.Monitor.Exit
17045 2001-10-23 Miguel de Icaza <miguel@ximian.com>
17047 * expression.cs (IndexerAccess::DoResolveLValue): Set the
17048 Expression Class to be IndexerAccess.
17050 Notice that Indexer::DoResolve sets the eclass to Value.
17052 2001-10-22 Miguel de Icaza <miguel@ximian.com>
17054 * class.cs (TypeContainer::Emit): Emit code for indexers.
17056 * assign.cs (IAssignMethod): New interface implemented by Indexers
17057 and Properties for handling assignment.
17059 (Assign::Emit): Simplify and reuse code.
17061 * expression.cs (IndexerAccess, PropertyExpr): Implement
17062 IAssignMethod, clean up old code.
17064 2001-10-22 Ravi Pratap <ravi@ximian.com>
17066 * typemanager.cs (ImplementsInterface): New method to determine if a type
17067 implements a given interface. Provides a nice cache too.
17069 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
17072 (ConvertReferenceExplicit): Ditto.
17074 * delegate.cs (Delegate::Populate): Update to define the parameters on the
17075 various methods, with correct names etc.
17077 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
17078 Operator.UnaryNegation.
17080 * cs-parser.jay (operator_declarator): Be a little clever in the case where
17081 we have a unary plus or minus operator.
17083 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
17086 * everywhere : update accordingly.
17088 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
17091 * class.cs (Method::Define): For the case where we are implementing a method
17092 inherited from an interface, we need to set the MethodAttributes.Final flag too.
17093 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
17095 2001-10-21 Ravi Pratap <ravi@ximian.com>
17097 * interface.cs (FindMembers): Implement to work around S.R.E
17100 * typemanager.cs (IsInterfaceType): Implement.
17102 (FindMembers): Update to handle interface types too.
17104 * expression.cs (ImplicitReferenceConversion): Re-write bits which
17105 use IsAssignableFrom as that is not correct - it doesn't work.
17107 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
17108 and accordingly override EmitStatement.
17110 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
17111 using the correct logic :-)
17113 2001-10-19 Ravi Pratap <ravi@ximian.com>
17115 * ../errors/cs-11.cs : Add to demonstrate error -11
17117 2001-10-17 Miguel de Icaza <miguel@ximian.com>
17119 * assign.cs (Assign::Resolve): Resolve right hand side first, and
17120 then pass this as a hint to ResolveLValue.
17122 * expression.cs (FieldExpr): Add Location information
17124 (FieldExpr::LValueResolve): Report assignment to readonly
17127 (Expression::ExprClassFromMemberInfo): Pass location information.
17129 (Expression::ResolveLValue): Add new method that resolves an
17132 (Expression::DoResolveLValue): Default invocation calls
17135 (Indexers): New class used to keep track of indexers in a given
17138 (IStackStore): Renamed from LValue, as it did not really describe
17139 what this did. Also ResolveLValue is gone from this interface and
17140 now is part of Expression.
17142 (ElementAccess): Depending on the element access type
17144 * typemanager.cs: Add `indexer_name_type' as a Core type
17145 (System.Runtime.CompilerServices.IndexerNameAttribute)
17147 * statement.cs (Goto): Take a location.
17149 2001-10-18 Ravi Pratap <ravi@ximian.com>
17151 * delegate.cs (Delegate::VerifyDelegate): New method to verify
17152 if two delegates are compatible.
17154 (NewDelegate::DoResolve): Update to take care of the case when
17155 we instantiate a delegate from another delegate.
17157 * typemanager.cs (FindMembers): Don't even try to look up members
17158 of Delegate types for now.
17160 2001-10-18 Ravi Pratap <ravi@ximian.com>
17162 * delegate.cs (NewDelegate): New class to take care of delegate
17165 * expression.cs (New): Split the delegate related code out into
17166 the NewDelegate class.
17168 * delegate.cs (DelegateInvocation): New class to handle delegate
17171 * expression.cs (Invocation): Split out delegate related code into
17172 the DelegateInvocation class.
17174 2001-10-17 Ravi Pratap <ravi@ximian.com>
17176 * expression.cs (New::DoResolve): Implement delegate creation fully
17177 and according to the spec.
17179 (New::DoEmit): Update to handle delegates differently.
17181 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
17182 because of which we were printing out arguments in reverse order !
17184 * delegate.cs (VerifyMethod): Implement to check if the given method
17185 matches the delegate.
17187 (FullDelegateDesc): Implement.
17189 (VerifyApplicability): Implement.
17191 * expression.cs (Invocation::DoResolve): Update to accordingly handle
17192 delegate invocations too.
17194 (Invocation::Emit): Ditto.
17196 * ../errors/cs1593.cs : Added.
17198 * ../errors/cs1594.cs : Added.
17200 * delegate.cs (InstanceExpression, TargetMethod): New properties.
17202 2001-10-16 Ravi Pratap <ravi@ximian.com>
17204 * typemanager.cs (intptr_type): Core type for System.IntPtr
17206 (InitCoreTypes): Update for the same.
17208 (iasyncresult_type, asynccallback_type): Ditto.
17210 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
17213 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
17216 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
17217 the builders for the 4 members of a delegate type :-)
17219 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
17222 * expression.cs (New::DoResolve): Implement guts for delegate creation.
17224 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
17226 2001-10-15 Miguel de Icaza <miguel@ximian.com>
17228 * statement.cs (Break::Emit): Implement.
17229 (Continue::Emit): Implement.
17231 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
17232 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
17233 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
17234 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
17237 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
17238 properties that track the label for the current loop (begin of the
17239 loop and end of the loop).
17241 2001-10-15 Ravi Pratap <ravi@ximian.com>
17243 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
17244 use of emitting anything at all.
17246 * class.cs, rootcontext.cs : Get rid of calls to the same.
17248 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
17250 (Populate): Define the constructor correctly and set the implementation
17253 * typemanager.cs (delegate_types): New hashtable to hold delegates that
17256 (AddDelegateType): Implement.
17258 (IsDelegateType): Implement helper method.
17260 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
17262 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
17263 and accordingly handle it.
17265 * delegate.cs (Populate): Take TypeContainer argument.
17266 Implement bits to define the Invoke method. However, I still haven't figured out
17267 how to take care of the native int bit :-(
17269 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
17270 Qualify the name of the delegate, not its return type !
17272 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
17275 (StandardConversionExists): Checking for array types turns out to be recursive.
17277 (ConvertReferenceExplicit): Implement array conversion.
17279 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
17281 2001-10-12 Ravi Pratap <ravi@ximian.com>
17283 * cs-parser.jay (delegate_declaration): Store the fully qualified
17284 name as it is a type declaration.
17286 * delegate.cs (ReturnType, Name): Rename members to these. Make them
17289 (DefineDelegate): Renamed from Define. Does the same thing essentially,
17290 as TypeContainer::DefineType.
17292 (Populate): Method in which all the definition of the various methods (Invoke)
17295 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
17298 (CloseDelegate): Finally creates the delegate.
17300 * class.cs (TypeContainer::DefineType): Update to define delegates.
17301 (Populate, Emit and CloseType): Do the same thing here too.
17303 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
17304 delegates in all these operations.
17306 2001-10-14 Miguel de Icaza <miguel@ximian.com>
17308 * expression.cs: LocalTemporary: a new expression used to
17309 reference a temporary that has been created.
17311 * assign.cs: Handle PropertyAccess back here, so that we can
17312 provide the proper semantic access to properties.
17314 * expression.cs (Expression::ConvertReferenceExplicit): Implement
17315 a few more explicit conversions.
17317 * modifiers.cs: `NEW' modifier maps to HideBySig.
17319 * expression.cs (PropertyExpr): Make this into an
17320 ExpressionStatement, and support the EmitStatement code path.
17322 Perform get/set error checking, clean up the interface.
17324 * assign.cs: recognize PropertyExprs as targets, and if so, turn
17325 them into toplevel access objects.
17327 2001-10-12 Miguel de Icaza <miguel@ximian.com>
17329 * expression.cs: PropertyExpr::PropertyExpr: use work around the
17332 * typemanager.cs: Keep track here of our PropertyBuilders again to
17333 work around lameness in SRE.
17335 2001-10-11 Miguel de Icaza <miguel@ximian.com>
17337 * expression.cs (LValue::LValueResolve): New method in the
17338 interface, used to perform a second resolution pass for LValues.
17340 (This::DoResolve): Catch the use of this in static methods.
17342 (This::LValueResolve): Implement.
17344 (This::Store): Remove warning, assigning to `this' in structures
17347 (Invocation::Emit): Deal with invocation of
17348 methods on value types. We need to pass the address to structure
17349 methods rather than the object itself. (The equivalent code to
17350 emit "this" for structures leaves the entire structure on the
17351 stack instead of a pointer to it).
17353 (ParameterReference::DoResolve): Compute the real index for the
17354 argument based on whether the method takes or not a `this' pointer
17355 (ie, the method is static).
17357 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
17358 value types returned from functions when we need to invoke a
17359 method on the sturcture.
17362 2001-10-11 Ravi Pratap <ravi@ximian.com>
17364 * class.cs (TypeContainer::DefineType): Method to actually do the business of
17365 defining the type in the Modulebuilder or Typebuilder. This is to take
17366 care of nested types which need to be defined on the TypeBuilder using
17367 DefineNestedMethod.
17369 (TypeContainer::GetClassBases): Implement. Essentially the code from the
17370 methods in RootContext, only ported to be part of TypeContainer.
17372 (TypeContainer::GetInterfaceOrClass): Ditto.
17374 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
17376 * interface.cs (Interface::DefineInterface): New method. Does exactly
17377 what RootContext.CreateInterface did earlier, only it takes care of nested types
17380 (Interface::GetInterfaces): Move from RootContext here and port.
17382 (Interface::GetInterfaceByName): Same here.
17384 * rootcontext.cs (ResolveTree): Re-write.
17386 (PopulateTypes): Re-write.
17388 * class.cs (TypeContainer::Populate): Populate nested types too.
17389 (TypeContainer::Emit): Emit nested members too.
17391 * typemanager.cs (AddUserType): Do not make use of the FullName property,
17392 instead just use the name argument passed in as it is already fully
17395 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
17396 to TypeContainer mapping to see if a type is user-defined.
17398 * class.cs (TypeContainer::CloseType): Implement.
17400 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
17401 the default constructor.
17403 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
17406 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
17408 * interface.cs (CloseType): Create the type here.
17410 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
17413 Remove all the methods which are now in TypeContainer.
17415 2001-10-10 Ravi Pratap <ravi@ximian.com>
17417 * delegate.cs (Define): Re-write bits to define the delegate
17420 2001-10-10 Miguel de Icaza <miguel@ximian.com>
17422 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
17424 * expression.cs (ImplicitReferenceConversion): handle null as well
17425 as a source to convert to any reference type.
17427 * statement.cs (Return): Perform any implicit conversions to
17428 expected return type.
17430 Validate use of return statement.
17432 * codegen.cs (EmitContext): Pass the expected return type here.
17434 * class.cs (Method, Constructor, Property): Pass expected return
17435 type to EmitContext.
17437 2001-10-09 Miguel de Icaza <miguel@ximian.com>
17439 * expression.cs: Make DoResolve take an EmitContext instead of a
17442 Replaced `l' and `location' for `loc', for consistency.
17444 (Error, Warning): Remove unneeded Tc argument.
17446 * assign.cs, literal.cs, constant.cs: Update to new calling
17449 * codegen.cs: EmitContext now contains a flag indicating whether
17450 code is being generated in a static method or not.
17452 * cs-parser.jay: DecomposeQI, new function that replaces the old
17453 QualifiedIdentifier. Now we always decompose the assembled
17454 strings from qualified_identifier productions into a group of
17457 2001-10-08 Miguel de Icaza <miguel@ximian.com>
17459 * rootcontext.cs: Deal with field-less struct types correctly now
17460 by passing the size option to Define Type.
17462 * class.cs: Removed hack that created one static field.
17464 2001-10-07 Miguel de Icaza <miguel@ximian.com>
17466 * statement.cs: Moved most of the code generation here.
17468 2001-10-09 Ravi Pratap <ravi@ximian.com>
17470 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
17473 (ElementAccess): Remove useless bits for now - keep checks as the spec
17476 2001-10-08 Ravi Pratap <ravi@ximian.com>
17478 * expression.cs (ElementAccess::DoResolve): Remove my crap code
17479 and start performing checks according to the spec.
17481 2001-10-07 Ravi Pratap <ravi@ximian.com>
17483 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
17484 rank_specifiers instead.
17486 (rank_specifiers): Change the order in which the rank specifiers are stored
17488 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
17490 * expression.cs (ElementAccess): Implement the LValue interface too.
17492 2001-10-06 Ravi Pratap <ravi@ximian.com>
17494 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
17495 except that user defined conversions are not included.
17497 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
17498 perform the conversion of the return type, if necessary.
17500 (New::DoResolve): Check whether we are creating an array or an object
17501 and accordingly do the needful.
17503 (New::Emit): Same here.
17505 (New::DoResolve): Implement guts of array creation.
17507 (New::FormLookupType): Helper function.
17509 2001-10-07 Miguel de Icaza <miguel@ximian.com>
17511 * codegen.cs: Removed most of the code generation here, and move the
17512 corresponding code generation bits to the statement classes.
17514 Added support for try/catch/finalize and throw.
17516 * cs-parser.jay: Added support for try/catch/finalize.
17518 * class.cs: Catch static methods having the flags override,
17519 virtual or abstract.
17521 * expression.cs (UserCast): This user cast was not really doing
17522 what it was supposed to do. Which is to be born in fully resolved
17523 state. Parts of the resolution were being performed at Emit time!
17527 2001-10-05 Miguel de Icaza <miguel@ximian.com>
17529 * expression.cs: Implicity convert the result from UserCast.
17531 2001-10-05 Ravi Pratap <ravi@ximian.com>
17533 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
17534 prevented it from working correctly.
17536 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
17537 merely ConvertImplicit.
17539 2001-10-05 Miguel de Icaza <miguel@ximian.com>
17541 * typemanager.cs: Make the LookupTypeContainer function static,
17542 and not per-instance.
17544 * class.cs: Make static FindMembers (the one that takes a Type
17547 * codegen.cs: Add EmitForeach here.
17549 * cs-parser.jay: Make foreach a toplevel object instead of the
17550 inline expansion, as we need to perform semantic analysis on it.
17552 2001-10-05 Ravi Pratap <ravi@ximian.com>
17554 * expression.cs (Expression::ImplicitUserConversion): Rename to
17555 UserDefinedConversion.
17557 (Expression::UserDefinedConversion): Take an extra argument specifying
17558 whether we look for explicit user conversions too.
17560 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
17562 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
17564 (ExplicitUserConversion): Make it a call to UserDefinedConversion
17565 with the appropriate arguments.
17567 * cs-parser.jay (cast_expression): Record location too.
17569 * expression.cs (Cast): Record location info.
17571 (Expression::ConvertExplicit): Take location argument.
17573 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
17574 to determine if we are doing explicit conversions.
17576 (UserCast::Emit): Update accordingly.
17578 (Expression::ConvertExplicit): Report an error if everything fails.
17580 * ../errors/cs0030.cs : Add.
17582 2001-10-04 Miguel de Icaza <miguel@ximian.com>
17584 * modifiers.cs: If the ABSTRACT keyword is present, also set the
17585 virtual and newslot bits.
17587 * class.cs (TypeContainer::RegisterRequiredImplementations):
17588 Record methods we need.
17590 (TypeContainer::MakeKey): Helper function to make keys for
17591 MethodBases, since the Methodbase key is useless.
17593 (TypeContainer::Populate): Call RegisterRequiredImplementations
17594 before defining the methods.
17596 Create a mapping for method_builders_to_methods ahead of time
17597 instead of inside a tight loop.
17599 (::RequireMethods): Accept an object as the data to set into the
17600 hashtable so we can report interface vs abstract method mismatch.
17602 2001-10-03 Miguel de Icaza <miguel@ximian.com>
17604 * report.cs: Make all of it static.
17606 * rootcontext.cs: Drop object_type and value_type computations, as
17607 we have those in the TypeManager anyways.
17609 Drop report instance variable too, now it is a global.
17611 * driver.cs: Use try/catch on command line handling.
17613 Add --probe option to debug the error reporting system with a test
17616 * report.cs: Add support for exiting program when a probe
17617 condition is reached.
17619 2001-10-03 Ravi Pratap <ravi@ximian.com>
17621 * expression.cs (Binary::DoNumericPromotions): Fix the case when
17622 we do a forcible conversion regardless of type, to check if
17623 ForceConversion returns a null.
17625 (Binary::error19): Use location to report error.
17627 (Unary::error23): Use location here too.
17629 * ../errors/cs0019.cs : Check in.
17631 * ../errors/cs0023.cs : Check in.
17633 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
17634 case of a non-null MethodInfo object with a length of 0 !
17636 (Binary::ResolveOperator): Flag error if overload resolution fails to find
17637 an applicable member - according to the spec :-)
17638 Also fix logic to find members in base types.
17640 (Unary::ResolveOperator): Same here.
17642 (Unary::report23): Change name to error23 and make first argument a TypeContainer
17643 as I was getting thoroughly confused between this and error19 :-)
17645 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
17646 (::FindMostEncompassedType): Implement.
17647 (::FindMostEncompassingType): Implement.
17648 (::StandardConversionExists): Implement.
17650 (UserImplicitCast): Re-vamp. We now need info about most specific
17651 source and target types so that we can do the necessary conversions.
17653 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
17654 mathematical union with no duplicates.
17656 2001-10-03 Miguel de Icaza <miguel@ximian.com>
17658 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
17659 in order from base classes to child classes, so that we can in
17660 child classes look up in our parent for method names and
17661 attributes (required for handling abstract, virtual, new, override
17662 constructs: we need to instrospect our base class, and if we dont
17663 populate the classes in order, the introspection might be
17664 incorrect. For example, a method could query its parent before
17665 the parent has any methods and would determine that the parent has
17666 no abstract methods (while it could have had them)).
17668 (RootContext::CreateType): Record the order in which we define the
17671 2001-10-02 Miguel de Icaza <miguel@ximian.com>
17673 * class.cs (TypeContainer::Populate): Also method definitions can
17674 fail now, keep track of this.
17676 (TypeContainer::FindMembers): Implement support for
17677 DeclaredOnly/noDeclaredOnly flag.
17679 (Constructor::Emit) Return the ConstructorBuilder.
17681 (Method::Emit) Return the MethodBuilder.
17682 Check for abstract or virtual methods to be public.
17684 * rootcontext.cs (RootContext::CreateType): Register all the
17685 abstract methods required for the class to be complete and the
17686 interface methods that must be implemented.
17688 * cs-parser.jay: Report error 501 (method requires body if it is
17689 not marked abstract or extern).
17691 * expression.cs (TypeOf::Emit): Implement.
17693 * typemanager.cs: runtime_handle_type, new global type.
17695 * class.cs (Property::Emit): Generate code for properties.
17697 2001-10-02 Ravi Pratap <ravi@ximian.com>
17699 * expression.cs (Unary::ResolveOperator): Find operators on base type
17700 too - we now conform exactly to the spec.
17702 (Binary::ResolveOperator): Same here.
17704 * class.cs (Operator::Define): Fix minor quirk in the tests.
17706 * ../errors/cs0215.cs : Added.
17708 * ../errors/cs0556.cs : Added.
17710 * ../errors/cs0555.cs : Added.
17712 2001-10-01 Miguel de Icaza <miguel@ximian.com>
17714 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
17715 single integer which is really efficient
17717 2001-10-01 Ravi Pratap <ravi@ximian.com>
17719 * expression.cs (Expression::ImplicitUserConversion): Use location
17720 even in the case when we are examining True operators.
17722 * class.cs (Operator::Define): Perform extensive checks to conform
17723 with the rules for operator overloading in the spec.
17725 * expression.cs (Expression::ImplicitReferenceConversion): Implement
17726 some of the other conversions mentioned in the spec.
17728 * typemanager.cs (array_type): New static member for the System.Array built-in
17731 (cloneable_interface): For System.ICloneable interface.
17733 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
17734 we start resolving the tree and populating types.
17736 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
17738 2001-10-01 Miguel de Icaza <miguel@ximian.com>
17740 * expression.cs (Expression::ExprClassFromMemberInfo,
17741 Expression::Literalize): Create literal expressions from
17742 FieldInfos which are literals.
17744 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
17745 type casts, because they were wrong. The test suite in tests
17748 (ImplicitNumericConversion): ushort to ulong requires a widening
17751 Int32 constant to long requires widening cast as well.
17753 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
17754 for integers because the type on the stack is not i4.
17756 2001-09-30 Miguel de Icaza <miguel@ximian.com>
17758 * expression.cs (report118): require location argument.
17760 * parameter.cs: Do not dereference potential null value.
17762 * class.cs: Catch methods that lack the `new' keyword when
17763 overriding a name. Report warnings when `new' is used without
17764 anything being there to override.
17766 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
17768 * class.cs: Only add constructor to hashtable if it is non-null
17769 (as now constructors can fail on define).
17771 (TypeManager, Class, Struct): Take location arguments.
17773 Catch field instance initialization in structs as errors.
17775 accepting_filter: a new filter for FindMembers that is static so
17776 that we dont create an instance per invocation.
17778 (Constructor::Define): Catch errors where a struct constructor is
17781 * cs-parser.jay: Pass location information for various new
17784 * delegate.cs (Delegate): take a location argument.
17786 * driver.cs: Do not call EmitCode if there were problesm in the
17787 Definition of the types, as many Builders wont be there.
17789 * decl.cs (Decl::Decl): Require a location argument.
17791 * cs-tokenizer.cs: Handle properly hex constants that can not fit
17792 into integers, and find the most appropiate integer for it.
17794 * literal.cs: Implement ULongLiteral.
17796 * rootcontext.cs: Provide better information about the location of
17797 failure when CreateType fails.
17799 2001-09-29 Miguel de Icaza <miguel@ximian.com>
17801 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
17804 * expression.cs (Binary::CheckShiftArguments): Add missing type
17806 (Binary::ResolveOperator): Add type to the logical and and logical
17807 or, Bitwise And/Or and Exclusive Or code paths, it was missing
17810 (Binary::DoNumericPromotions): In the case where either argument
17811 is ulong (and most signed types combined with ulong cause an
17812 error) perform implicit integer constant conversions as well.
17814 2001-09-28 Miguel de Icaza <miguel@ximian.com>
17816 * expression.cs (UserImplicitCast): Method should always be
17818 (Invocation::BetterConversion): Simplified test for IntLiteral.
17820 (Expression::ImplicitNumericConversion): Split this routine out.
17821 Put the code that performs implicit constant integer conversions
17824 (Expression::Resolve): Become a wrapper around DoResolve so we can
17825 check eclass and type being set after resolve.
17827 (Invocation::Badness): Remove this dead function
17829 (Binary::ResolveOperator): Do not compute the expensive argumnets
17830 unless we have a union for it.
17832 (Probe::Emit): Is needs to do an isinst and then
17833 compare against null.
17835 (::CanConvert): Added Location argument. If the Location argument
17836 is null (Location.Null), then we do not report errors. This is
17837 used by the `probe' mechanism of the Explicit conversion. We do
17838 not want to generate an error for something that the user
17839 explicitly requested to be casted. But the pipeline for an
17840 explicit cast first tests for potential implicit casts.
17842 So for now, if the Location is null, it means `Probe only' to
17843 avoid adding another argument. Might have to revise this
17846 (ClassCast): New class used to type cast objects into arbitrary
17847 classes (used in Explicit Reference Conversions).
17849 Implement `as' as well.
17851 Reverted all the patches from Ravi below: they were broken:
17853 * The use of `level' as a mechanism to stop recursive
17854 invocations is wrong. That was there just to catch the
17855 bug with a strack trace but not as a way of addressing
17858 To fix the problem we have to *understand* what is going
17859 on and the interactions and come up with a plan, not
17860 just get things going.
17862 * The use of the type conversion cache that I proposed
17863 last night had an open topic: How does this work across
17864 protection domains. A user defined conversion might not
17865 be public in the location where we are applying the
17866 conversion, a different conversion might be selected
17867 (ie, private A->B (better) but public B->A (worse),
17868 inside A, A->B applies, but outside it, B->A will
17871 * On top of that (ie, even if the above is solved),
17872 conversions in a cache need to be abstract. Ie, `To
17873 convert from an Int to a Short use an OpcodeCast', not
17874 `To convert from an Int to a Short use the OpcodeCast on
17875 the variable 5' (which is what this patch was doing).
17877 2001-09-28 Ravi Pratap <ravi@ximian.com>
17879 * expression.cs (Invocation::ConversionExists): Re-write to use
17880 the conversion cache
17882 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
17883 cache all conversions done, not just user-defined ones.
17885 (Invocation::BetterConversion): The real culprit. Use ConversionExists
17886 to determine if a conversion exists instead of acutually trying to
17887 perform the conversion. It's faster too.
17889 (Expression::ConvertExplicit): Modify to use ConversionExists to check
17890 and only then attempt the implicit conversion.
17892 2001-09-28 Ravi Pratap <ravi@ximian.com>
17894 * expression.cs (ConvertImplicit): Use a cache for conversions
17895 already found. Check level of recursion and bail out if necessary.
17897 2001-09-28 Miguel de Icaza <miguel@ximian.com>
17899 * typemanager.cs (string_concat_string_string, string_concat_object_object):
17900 Export standard methods that we expect for string operations.
17902 * statement.cs (Block::UsageWarning): Track usage of variables and
17903 report the errors for not used variables.
17905 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
17908 2001-09-27 Miguel de Icaza <miguel@ximian.com>
17910 * codegen.cs: remove unnneded code
17912 * expression.cs: Removed BuiltinTypeAccess class
17914 Fix the order in which implicit conversions are
17917 The previous fixed dropped support for boxed conversions (adding a
17918 test to the test suite now)
17920 (UserImplicitCast::CanConvert): Remove test for source being null,
17921 that code is broken. We should not feed a null to begin with, if
17922 we do, then we should track the bug where the problem originates
17923 and not try to cover it up here.
17925 Return a resolved expression of type UserImplicitCast on success
17926 rather than true/false. Ravi: this is what I was talking about,
17927 the pattern is to use a static method as a "constructor" for
17930 Also, do not create arguments until the very last minute,
17931 otherwise we always create the arguments even for lookups that
17932 will never be performed.
17934 (UserImplicitCast::Resolve): Eliminate, objects of type
17935 UserImplicitCast are born in a fully resolved state.
17937 * typemanager.cs (InitCoreTypes): Init also value_type
17938 (System.ValueType).
17940 * expression.cs (Cast::Resolve): First resolve the child expression.
17942 (LValue): Add new method AddressOf to be used by
17945 Change the argument of Store to take an EmitContext instead of an
17946 ILGenerator, because things like FieldExpr need to be able to call
17947 their children expression to generate the instance code.
17949 (Expression::Error, Expression::Warning): Sugar functions for
17952 (Expression::MemberLookup): Accept a TypeContainer instead of a
17953 Report as the first argument.
17955 (Expression::ResolvePrimary): Killed. I still want to improve
17956 this as currently the code is just not right.
17958 (Expression::ResolveMemberAccess): Simplify, but it is still
17961 (Unary::Resolve): Catch errors in AddressOf operators.
17963 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
17964 index to a byte for the short-version, or the compiler will choose
17965 the wrong Emit call, which generates the wrong data.
17967 (ParameterReference::Emit, ::Store): same.
17969 (FieldExpr::AddressOf): Implement.
17971 * typemanager.cs: TypeManager: made public variable instead of
17974 * driver.cs: document --fatal.
17976 * report.cs (ErrorMessage, WarningMessage): new names for the old
17977 Error and Warning classes.
17979 * cs-parser.jay (member_access): Turn built-in access to types
17980 into a normal simplename
17982 2001-09-27 Ravi Pratap <ravi@ximian.com>
17984 * expression.cs (Invocation::BetterConversion): Fix to cope
17985 with q being null, since this was introducing a bug.
17987 * expression.cs (ConvertImplicit): Do built-in conversions first.
17989 2001-09-27 Ravi Pratap <ravi@ximian.com>
17991 * expression.cs (UserImplicitCast::Resolve): Fix bug.
17993 2001-09-27 Ravi Pratap <ravi@ximian.com>
17995 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
17996 I had introduced long ago (what's new ?).
17998 * expression.cs (UserImplicitCast::CanConvert): Static method to do
17999 the work of all the checking.
18000 (ConvertImplicit): Call CanConvert and only then create object if necessary.
18001 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
18003 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
18004 that is the right way.
18006 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
18007 overloading resolution. Use everywhere instead of cutting and pasting code.
18009 (Binary::ResolveOperator): Use MakeUnionSet.
18011 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
18012 we have to convert to bool types. Not complete yet.
18014 2001-09-27 Miguel de Icaza <miguel@ximian.com>
18016 * typemanager.cs (TypeManager::CSharpName): support ushort.
18018 * expression.cs (Expression::TryImplicitIntConversion): Attempts
18019 to provide an expression that performsn an implicit constant int
18020 conversion (section 6.1.6).
18021 (Expression::ConvertImplicitRequired): Reworked to include
18022 implicit constant expression conversions.
18024 (Expression::ConvertNumericExplicit): Finished.
18026 (Invocation::Emit): If InstanceExpression is null, then it means
18027 that we perform a call on this.
18029 2001-09-26 Miguel de Icaza <miguel@ximian.com>
18031 * expression.cs (Unary::Emit): Remove some dead code.
18032 (Probe): Implement Resolve and Emit for `is'.
18033 (Expression::ConvertImplicitRequired): Attempt to do constant
18034 expression conversions here. Maybe should be moved to
18035 ConvertImplicit, but I am not sure.
18036 (Expression::ImplicitLongConstantConversionPossible,
18037 Expression::ImplicitIntConstantConversionPossible): New functions
18038 that tell whether is it possible to apply an implicit constant
18039 expression conversion.
18041 (ConvertNumericExplicit): Started work on explicit numeric
18044 * cs-parser.jay: Update operator constants.
18046 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
18047 (Parameters::GetSignature): Hook up VerifyArgs here.
18048 (Parameters::VerifyArgs): Verifies that no two arguments have the
18051 * class.cs (Operator): Update the operator names to reflect the
18052 ones that the spec expects (as we are just stringizing the
18055 * expression.cs (Unary::ResolveOperator): Fix bug: Use
18056 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
18057 previous usage did only work for our methods.
18058 (Expression::ConvertImplicit): Handle decimal implicit numeric
18059 conversions as well.
18060 (Expression::InternalTypeConstructor): Used to invoke constructors
18061 on internal types for default promotions.
18063 (Unary::Emit): Implement special handling for the pre/post
18064 increment/decrement for overloaded operators, as they need to have
18065 the same semantics as the other operators.
18067 (Binary::ResolveOperator): ditto.
18068 (Invocation::ConversionExists): ditto.
18069 (UserImplicitCast::Resolve): ditto.
18071 2001-09-26 Ravi Pratap <ravi@ximian.com>
18073 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
18074 operator, return after emitting body. Regression tests pass again !
18076 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
18077 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
18078 (Invocation::OverloadResolve): Ditto.
18079 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
18081 * everywhere : update calls to the above methods accordingly.
18083 2001-09-26 Miguel de Icaza <miguel@ximian.com>
18085 * assign.cs (Assign): Make it inherit from ExpressionStatement.
18087 * expression.cs (ExpressionStatement): New base class used for
18088 expressions that can appear in statements, so that we can provide
18089 an alternate path to generate expression that do not leave a value
18092 (Expression::Emit, and all the derivatives): We no longer return
18093 whether a value is left on the stack or not. Every expression
18094 after being emitted leaves a single value on the stack.
18096 * codegen.cs (EmitContext::EmitStatementExpression): Use the
18097 facilties of ExpressionStatement if possible.
18099 * cs-parser.jay: Update statement_expression.
18101 2001-09-25 Miguel de Icaza <miguel@ximian.com>
18103 * driver.cs: Change the wording of message
18105 2001-09-25 Ravi Pratap <ravi@ximian.com>
18107 * expression.cs (Binary::ResolveOperator): Had forgottten to set
18108 the type of the expression to the return type of the method if
18109 we have an overloaded operator match ! The regression tests pass again !
18110 (Unary::ResolveOperator): Ditto.
18112 * expression.cs (Invocation::ConversionExists): Correct the member lookup
18113 to find "op_Implicit", not "implicit" ;-)
18114 (UserImplicitCast): New class to take care of user-defined implicit conversions.
18115 (ConvertImplicit, ForceConversion): Take TypeContainer argument
18117 * everywhere : Correct calls to the above accordingly.
18119 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
18120 (ConvertImplicit): Do user-defined conversion if it exists.
18122 2001-09-24 Miguel de Icaza <miguel@ximian.com>
18124 * assign.cs: track location.
18125 (Resolve): Use implicit conversions on assignment.
18127 * literal.cs: Oops. Not good, Emit of short access values should
18128 pass (Bytes) or the wrong argument will be selected.
18130 * expression.cs (Unary::Emit): Emit code for -expr.
18132 (Unary::ResolveOperator): Handle `Substract' for non-constants
18133 (substract from zero from the non-constants).
18134 Deal with Doubles as well.
18136 (Expression::ConvertImplicitRequired): New routine that reports an
18137 error if no implicit conversion exists.
18139 (Invocation::OverloadResolve): Store the converted implicit
18140 expressions if we make them
18142 2001-09-24 Ravi Pratap <ravi@ximian.com>
18144 * class.cs (ConstructorInitializer): Take a Location argument.
18145 (ConstructorBaseInitializer): Same here.
18146 (ConstructorThisInitializer): Same here.
18148 * cs-parser.jay : Update all calls accordingly.
18150 * expression.cs (Unary, Binary, New): Take location argument.
18151 Update accordingly everywhere.
18153 * cs-parser.jay : Update all calls to the above to take a location
18156 * class.cs : Ditto.
18158 2001-09-24 Ravi Pratap <ravi@ximian.com>
18160 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
18161 (Invocation::BetterConversion): Same here
18162 (Invocation::ConversionExists): Ditto.
18164 (Invocation::ConversionExists): Implement.
18166 2001-09-22 Ravi Pratap <ravi@ximian.com>
18168 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
18169 Also take an additional TypeContainer argument.
18171 * All over : Pass in TypeContainer as argument to OverloadResolve.
18173 * typemanager.cs (CSharpName): Update to check for the string type and return
18176 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
18179 2001-09-21 Ravi Pratap <ravi@ximian.com>
18181 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
18182 (Invocation::BetterFunction): Implement.
18183 (Invocation::BetterConversion): Implement.
18184 (Invocation::ConversionExists): Skeleton, no implementation yet.
18186 Okay, things work fine !
18188 2001-09-21 Miguel de Icaza <miguel@ximian.com>
18190 * typemanager.cs: declare and load enum_type, delegate_type and
18193 * expression.cs (Expression::Emit): Now emit returns a value that
18194 tells whether a value is left on the stack or not. This strategy
18195 might be reveted tomorrow with a mechanism that would address
18196 multiple assignments.
18197 (Expression::report118): Utility routine to report mismatches on
18200 (Unary::Report23): Report impossible type/operator combination
18203 (Unary::IsIncrementableNumber): Whether the type can be
18204 incremented or decremented with add.
18205 (Unary::ResolveOperator): Also allow enumerations to be bitwise
18207 (Unary::ResolveOperator): Implement ++, !, ~,
18209 (Invocation::Emit): Deal with new Emit convetion.
18211 * All Expression derivatives: Updated their Emit method to return
18212 whether they leave values on the stack or not.
18214 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
18215 stack for expressions that are statements.
18217 2001-09-20 Miguel de Icaza <miguel@ximian.com>
18219 * expression.cs (LValue): New interface. Must be implemented by
18221 (LocalVariableReference, ParameterReference, FieldExpr): Implement
18224 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
18225 interface for generating code, simplifies the code.
18227 2001-09-20 Ravi Pratap <ravi@ximian.com>
18229 * expression.cs (everywhere): Comment out return statements in ::Resolve
18230 methods to avoid the warnings.
18232 2001-09-20 Miguel de Icaza <miguel@ximian.com>
18234 * driver.cs (parse): Report error 2001 if we can not open the
18237 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
18240 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
18243 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
18244 otherwise nested blocks end up with the same index.
18246 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
18248 * expression.cs: Instead of having FIXMEs in the Resolve
18249 functions, throw exceptions so it is obvious that we are facing a
18252 * cs-parser.jay (invocation_expression): Pass Location information.
18254 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
18255 Use a basename for those routines because .NET does not like paths
18258 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
18261 2001-09-19 Miguel de Icaza <miguel@ximian.com>
18263 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
18264 are loading the correct data types (throws an exception if not).
18265 (TypeManager::InitCoreTypes): Use CoreLookupType
18267 * expression.cs (Unary::ResolveOperator): return the child
18268 expression for expressions which are just +expr.
18269 (Unary::ResolveOperator): Return negative literals for -LITERAL
18270 expressions (otherwise they are Unary {Literal}).
18271 (Invocation::Badness): Take into account `Implicit constant
18272 expression conversions'.
18274 * literal.cs (LongLiteral): Implement long literal class.
18275 (IntLiteral): export the `Value' of the intliteral.
18277 2001-09-19 Ravi Pratap <ravi@ximian.com>
18279 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
18281 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
18282 instead of 'Operator'
18284 * expression.cs (Binary::ResolveOperator): Update accordingly.
18285 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
18288 * cs-parser.jay (unary_expression): Update to use the new names.
18290 * gen-treedump.cs (GetUnary): Same here.
18292 * expression.cs (Unary::Resolve): Implement.
18293 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
18294 operators are found instead of making noise ;-)
18295 (Unary::ResolveOperator): New method to do precisely the same thing which
18296 Binary::ResolveOperator does for Binary expressions.
18297 (Unary.method, .Arguments): Add.
18298 (Unary::OperName): Implement.
18299 (Unary::ForceConversion): Copy and Paste !
18301 * class.cs (Operator::Define): Fix a small bug for the case when we have
18304 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
18305 for the inbuilt operators. Only overloading works for now ;-)
18307 2001-09-18 Miguel de Icaza <miguel@ximian.com>
18309 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
18310 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
18312 * expression.cs (This::Emit): Implement.
18313 (This::Resolve): Implement.
18314 (TypeOf:Resolve): Implement.
18315 (Expression::ResolveSimpleName): Add an implicit this to instance
18317 (MemberAccess::Resolve): Deal with Parameters and Fields.
18318 Bind instance variable to Field expressions.
18319 (FieldExpr::Instance): New field used to track the expression that
18320 represents the object instance.
18321 (FieldExpr::Resolve): Track potential errors from MemberLookup not
18323 (FieldExpr::Emit): Implement.
18325 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
18326 the last instruction contains a return opcode to avoid generating
18327 the last `ret' instruction (this generates correct code, and it is
18328 nice to pass the peverify output).
18330 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
18331 initializer for static and instance variables.
18332 (Constructor::Emit): Allow initializer to be null in the case of
18333 static constructors. Only emit initializer for instance
18336 (TypeContainer::FindMembers): Return a null array if there are no
18339 Also fix the code for the MemberTypes.Method branch, as it was not
18340 scanning that for operators (or tried to access null variables before).
18342 * assign.cs (Assign::Emit): Handle instance and static fields.
18346 * driver.cs: Stop compilation if there are parse errors.
18348 * cs-parser.jay (constructor_declaration): Provide default base
18349 initializer for non-static constructors.
18350 (constructor_declarator): Do not provide a default base
18351 initializers if none was specified.
18352 Catch the fact that constructors should not have parameters.
18354 * class.cs: Do not emit parent class initializers for static
18355 constructors, that should be flagged as an error.
18357 2001-09-18 Ravi Pratap <ravi@ximian.com>
18359 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
18360 Move back code into TypeContainer::Populate.
18362 2001-09-18 Ravi Pratap <ravi@ximian.com>
18364 * class.cs (TypeContainer::AddConstructor): Fix the check to
18365 compare against Name, not Basename.
18366 (Operator::OpType): Change Plus and Minus to Add and Subtract.
18368 * cs-parser.jay : Update accordingly.
18370 * class.cs (TypeContainer::FindMembers): For the case where we are searching
18371 for methods, don't forget to look into the operators too.
18372 (RegisterMethodBuilder): Helper method to take care of this for
18373 methods, constructors and operators.
18374 (Operator::Define): Completely revamp.
18375 (Operator.OperatorMethod, MethodName): New fields.
18376 (TypeContainer::Populate): Move the registering of builders into
18377 RegisterMethodBuilder.
18378 (Operator::Emit): Re-write.
18380 * expression.cs (Binary::Emit): Comment out code path to emit method
18381 invocation stuff for the case when we have a user defined operator. I am
18382 just not able to get it right !
18384 2001-09-17 Miguel de Icaza <miguel@ximian.com>
18386 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
18389 (Expression::MemberLookup): Provide a version that allows to
18390 specify the MemberTypes and BindingFlags.
18392 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
18393 so it was not fetching variable information from outer blocks.
18395 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
18396 Beforefieldinit as it was buggy.
18398 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
18399 that Ravi put here.
18401 * class.cs (Constructor::Emit): Only emit if block is not null.
18402 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
18403 deal with this by semantically definining it as if the user had
18406 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
18407 constructors as we now "emit" them at a higher level.
18409 (TypeContainer::DefineDefaultConstructor): Used to define the
18410 default constructors if none was provided.
18412 (ConstructorInitializer): Add methods Resolve and Emit.
18414 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
18416 2001-09-17 Ravi Pratap <ravi@ximian.com>
18418 * class.cs (TypeContainer::EmitDefaultConstructor): Register
18419 the default constructor builder with our hashtable for methodbuilders
18422 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
18423 and argument_count is 0 in which case we have a match.
18424 (Binary::ResolveOperator): More null checking and miscellaneous coding
18427 2001-09-17 Ravi Pratap <ravi@ximian.com>
18429 * rootcontext.cs (IsNameSpace): Compare against null.
18431 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
18433 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
18434 and Unary::Operator.
18436 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
18439 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
18440 we have overloaded operators.
18441 (Binary::ResolveOperator): Implement the part which does the operator overload
18444 * class.cs (Operator::Emit): Implement.
18445 (TypeContainer::Emit): Emit the operators we have too.
18447 * expression.cs (Binary::Emit): Update to emit the appropriate code for
18448 the case when we have a user-defined operator.
18450 2001-09-17 Miguel de Icaza <miguel@ximian.com>
18452 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
18454 2001-09-16 Ravi Pratap <ravi@ximian.com>
18456 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
18457 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
18458 (Constructor::Emit): Implement.
18459 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
18460 if we have no work to do.
18461 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
18464 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
18465 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
18467 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
18470 2001-09-15 Ravi Pratap <ravi@ximian.com>
18472 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
18474 (Tree::RecordNamespace): Method to do what the name says ;-)
18475 (Tree::Namespaces): Property to get at the namespaces hashtable.
18477 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
18480 * rootcontext.cs (IsNamespace): Fixed it :-)
18482 2001-09-14 Miguel de Icaza <miguel@ximian.com>
18484 * class.cs (TypeContainer::FindMembers): Add support for
18486 (MethodCore): New class that encapsulates both the shared aspects
18487 of a Constructor and a Method.
18488 (Method, Constructor): Factored pieces into MethodCore.
18490 * driver.cs: Added --fatal which makes errors throw exceptions.
18491 Load System assembly as well as part of the standard library.
18493 * report.cs: Allow throwing exceptions on errors for debugging.
18495 * modifiers.cs: Do not use `parent', instead use the real type
18496 container to evaluate permission settings.
18498 * class.cs: Put Ravi's patch back in. He is right, and we will
18499 have to cope with the
18501 2001-09-14 Ravi Pratap <ravi@ximian.com>
18503 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
18504 FamORAssem, not FamANDAssem.
18506 2001-09-14 Miguel de Icaza <miguel@ximian.com>
18508 * driver.cs: Added --parse option that only parses its input files
18511 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
18512 incorrect. IsTopLevel is not used to tell whether an object is
18513 root_types or not (that can be achieved by testing this ==
18514 root_types). But to see if this is a top-level *class* (not
18515 necessarly our "toplevel" container).
18517 2001-09-14 Ravi Pratap <ravi@ximian.com>
18519 * enum.cs (Enum::Define): Modify to call the Lookup method on the
18520 parent instead of a direct call to GetType.
18522 2001-09-14 Ravi Pratap <ravi@ximian.com>
18524 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
18525 Modifiers.TypeAttr. This should just be a call to that method.
18527 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
18528 object so that we can determine if we are top-level or not.
18530 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
18533 * enum.cs (Enum::Define): Ditto.
18535 * modifiers.cs (FieldAttr): Re-write.
18537 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
18538 (TypeContainer::HaveStaticConstructor): New property to provide access
18539 to precisely that info.
18541 * modifiers.cs (MethodAttr): Re-write.
18542 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
18544 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
18545 of top-level types as claimed.
18547 2001-09-13 Miguel de Icaza <miguel@ximian.com>
18549 * expression.cs (MemberLookup): Fruitless attempt to lookup
18550 constructors. Maybe I need to emit default constructors? That
18551 might be it (currently .NET emits this for me automatically).
18552 (Invocation::OverloadResolve): Cope with Arguments == null.
18553 (Invocation::EmitArguments): new function, shared by the new
18554 constructor and us.
18555 (Invocation::Emit): Handle static and instance methods. Emit
18556 proper call instruction for virtual or non-virtual invocations.
18557 (New::Emit): Implement.
18558 (New::Resolve): Implement.
18559 (MemberAccess:Resolve): Implement.
18560 (MethodGroupExpr::InstanceExpression): used conforming to the spec
18561 to track instances.
18562 (FieldExpr::Resolve): Set type.
18564 * support.cs: Handle empty arguments.
18566 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
18567 SimpleLookup): Auxiliary routines to help parse a qualifier
18570 Update qualifier_identifier rule.
18572 * codegen.cs: Removed debugging messages.
18574 * class.cs: Make this a global thing, this acts just as a "key" to
18575 objects that we might have around.
18577 (Populate): Only initialize method_builders_to_methods once.
18579 * expression.cs (PropertyExpr): Initialize type from the
18582 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
18583 Resolve pattern. Attempt to implicitly convert value to boolean.
18586 * expression.cs: Set the type for the int32/int32 argument case.
18587 (Binary::ResolveOperator): Set the return type to boolean for
18588 comparission operators
18590 * typemanager.cs: Remove debugging print code.
18592 (Invocation::Resolve): resolve type.
18594 * class.cs: Allocate a MemberInfo of the correct size, as the code
18595 elsewhere depends on the test to reflect the correct contents.
18597 (Method::) Keep track of parameters, due to System.Reflection holes
18599 (TypeContainer::Populate): Keep track of MethodBuilders to Method
18602 (TypeContainer::FindMembers): Use ArrayList and then copy an array
18603 of the exact size and return that.
18605 (Class::LookupMethodByBuilder): New function that maps
18606 MethodBuilders to its methods. Required to locate the information
18607 on methods because System.Reflection bit us again.
18609 * support.cs: New file, contains an interface ParameterData and
18610 two implementations: ReflectionParameters and InternalParameters
18611 used to access Parameter information. We will need to grow this
18614 * expression.cs (Invocation::GetParameterData): implement a cache
18615 and a wrapper around the ParameterData creation for methods.
18616 (Invocation::OverloadResolve): Use new code.
18618 2001-09-13 Ravi Pratap <ravi@ximian.com>
18620 * class.cs (TypeContainer::EmitField): Remove and move into
18621 (Field::Define): here and modify accordingly.
18622 (Field.FieldBuilder): New member.
18623 (TypeContainer::Populate): Update accordingly.
18624 (TypeContainer::FindMembers): Implement.
18626 2001-09-13 Miguel de Icaza <miguel@ximian.com>
18628 * statement.cs: (VariableInfo::VariableType): New field to be
18629 initialized with the full type once it is resolved.
18631 2001-09-12 Miguel de Icaza <miguel@ximian.com>
18633 * parameter.cs (GetParameterInfo): Use a type cache to compute
18634 things only once, and to reuse this information
18636 * expression.cs (LocalVariableReference::Emit): Implement.
18637 (OpcodeCast::Emit): fix.
18639 (ParameterReference::Resolve): Implement.
18640 (ParameterReference::Emit): Implement.
18642 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
18643 that are expressions need to stay as Expressions.
18645 * typemanager.cs (CSharpName): Returns the C# name of a type if
18648 * expression.cs (Expression::ConvertImplicit): New function that
18649 implements implicit type conversions.
18651 (Expression::ImplicitReferenceConversion): Implements implicit
18652 reference conversions.
18654 (EmptyCast): New type for transparent casts.
18656 (OpcodeCast): New type for casts of types that are performed with
18657 a sequence of bytecodes.
18659 (BoxedCast): New type used for casting value types into reference
18660 types. Emits a box opcode.
18662 (Binary::DoNumericPromotions): Implements numeric promotions of
18663 and computation of the Binary::Type.
18665 (Binary::EmitBranchable): Optimization.
18667 (Binary::Emit): Implement code emission for expressions.
18669 * typemanager.cs (TypeManager): Added two new core types: sbyte
18672 2001-09-12 Ravi Pratap <ravi@ximian.com>
18674 * class.cs (TypeContainer::FindMembers): Method which does exactly
18675 what Type.FindMembers does, only we don't have to use reflection. No
18676 implementation yet.
18678 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
18679 typecontainer objects as we need to get at them.
18680 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
18682 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
18683 typecontainer object.
18685 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
18686 of just a Report object.
18688 2001-09-11 Ravi Pratap <ravi@ximian.com>
18690 * class.cs (Event::Define): Go back to using the prefixes "add_" and
18692 (TypeContainer::Populate): Now define the delegates of the type too.
18693 (TypeContainer.Delegates): Property to access the list of delegates defined
18696 * delegates.cs (Delegate::Define): Implement partially.
18698 * modifiers.cs (TypeAttr): Handle more flags.
18700 2001-09-11 Ravi Pratap <ravi@ximian.com>
18702 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
18704 (Operator::Define): Re-write logic to get types by using the LookupType method
18705 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
18706 (Indexer::Define): Ditto.
18707 (Event::Define): Ditto.
18708 (Property::Define): Ditto.
18710 2001-09-10 Ravi Pratap <ravi@ximian.com>
18712 * class.cs (TypeContainer::Populate): Now define operators too.
18713 (TypeContainer.Operators): New property to access the list of operators
18715 (Operator.OperatorMethodBuilder): New member to hold the method builder
18716 for the operator we are defining.
18717 (Operator::Define): Implement.
18719 2001-09-10 Ravi Pratap <ravi@ximian.com>
18721 * class.cs (Event::Define): Make the prefixes of the accessor methods
18722 addOn_ and removeOn_
18724 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
18725 of the location being passed in too. Ideally, this should go later since all
18726 error reporting should be done through the Report object.
18728 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
18729 (Populate): Iterate thru the indexers we have and define them too.
18730 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
18731 for the get and set accessors.
18732 (Indexer::Define): Implement.
18734 2001-09-09 Miguel de Icaza <miguel@ximian.com>
18736 * expression.cs (Binary::Resolve): Beginning of it. I scratched
18737 my previous implementation, did not work.
18739 * typemanager.cs: Add a couple of missing types (the longs).
18741 * literal.cs: Use TypeManager.bool_type instead of getting it.
18743 * expression.cs (EventExpr): New kind of expressions.
18744 (Expressio::ExprClassFromMemberInfo): finish
18746 2001-09-08 Miguel de Icaza <miguel@ximian.com>
18748 * assign.cs: Emit stores to static fields differently.
18750 2001-09-08 Ravi Pratap <ravi@ximian.com>
18752 * Merge in changes and adjust code to tackle conflicts. Backed out my
18753 code in Assign::Resolve ;-)
18755 2001-09-08 Ravi Pratap <ravi@ximian.com>
18757 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
18758 instead Report.Error and also pass in the location.
18759 (CSharpParser::Lexer): New readonly property to return the reference
18760 to the Tokenizer object.
18761 (declare_local_variables): Use Report.Error with location instead of plain
18765 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
18766 (Operator.CheckBinaryOperator): Ditto.
18768 * cs-parser.jay (operator_declarator): Update accordingly.
18770 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
18771 (CheckBinaryOperator): Same here.
18773 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
18774 on the name without any prefixes of namespace names etc. This is because we
18775 already might have something already fully qualified like
18776 'System.Console.WriteLine'
18778 * assign.cs (Resolve): Begin implementation. Stuck ;-)
18780 2001-09-07 Ravi Pratap <ravi@ximian.com>
18782 * cs-tokenizer.cs (location): Return a string which also contains
18785 * expression.cs (ElementAccess): New class for expressions of the
18786 type 'element access.'
18787 (BaseAccess): New class for expressions of the type 'base access.'
18788 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
18791 * cs-parser.jay (element_access): Implement action.
18792 (base_access): Implement actions.
18793 (checked_expression, unchecked_expression): Implement.
18795 * cs-parser.jay (local_variable_type): Correct and implement.
18796 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
18798 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
18800 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
18801 name and the specifiers.
18803 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
18805 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
18806 making them all public ;-)
18808 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
18811 2001-09-07 Miguel de Icaza <miguel@ximian.com>
18813 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
18815 (FieldExpr, PropertyExprs): New resolved expressions.
18816 (SimpleName::MemberStaticCheck): Perform static checks for access
18817 to non-static fields on static methods. Maybe this should be
18818 generalized for MemberAccesses.
18819 (SimpleName::ResolveSimpleName): More work on simple name
18822 * cs-parser.jay (primary_expression/qualified_identifier): track
18823 the parameter index.
18825 * codegen.cs (CodeGen::Save): Catch save exception, report error.
18826 (EmitContext::EmitBoolExpression): Chain to expression generation
18827 instead of temporary hack.
18828 (::EmitStatementExpression): Put generic expression code generation.
18830 * assign.cs (Assign::Emit): Implement variable assignments to
18831 local variables, parameters and fields.
18833 2001-09-06 Miguel de Icaza <miguel@ximian.com>
18835 * statement.cs (Block::GetVariableInfo): New method, returns the
18836 VariableInfo for a variable name in a block.
18837 (Block::GetVariableType): Implement in terms of GetVariableInfo
18839 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
18840 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
18842 2001-09-06 Ravi Pratap <ravi@ximian.com>
18844 * cs-parser.jay (operator_declaration): Continue on my quest : update
18845 to take attributes argument.
18846 (event_declaration): Ditto.
18847 (enum_declaration): Ditto.
18848 (indexer_declaration): Ditto.
18850 * class.cs (Operator::Operator): Update constructor accordingly.
18851 (Event::Event): Ditto.
18853 * delegate.cs (Delegate::Delegate): Same here.
18855 * enum.cs (Enum::Enum): Same here.
18857 2001-09-05 Ravi Pratap <ravi@ximian.com>
18859 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
18861 * ../tests/cs0658.cs : New file to demonstrate error 0658.
18863 * attribute.cs (Attributes): New class to encapsulate all attributes which were
18864 being passed around as an arraylist.
18865 (Attributes::AddAttribute): Method to add attribute sections.
18867 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
18868 (struct_declaration): Update accordingly.
18869 (constant_declaration): Update.
18870 (field_declaration): Update.
18871 (method_header): Update.
18872 (fixed_parameter): Update.
18873 (parameter_array): Ditto.
18874 (property_declaration): Ditto.
18875 (destructor_declaration): Ditto.
18877 * class.cs (Struct::Struct): Update constructors accordingly.
18878 (Class::Class): Ditto.
18879 (Field::Field): Ditto.
18880 (Method::Method): Ditto.
18881 (Property::Property): Ditto.
18882 (TypeContainer::OptAttribute): update property's return type.
18884 * interface.cs (Interface.opt_attributes): New member.
18885 (Interface::Interface): Update to take the extra Attributes argument.
18887 * parameter.cs (Parameter::Parameter): Ditto.
18889 * constant.cs (Constant::Constant): Ditto.
18891 * interface.cs (InterfaceMemberBase): New OptAttributes field.
18892 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
18893 the attributes as a parameter.
18894 (InterfaceProperty): Update constructor call.
18895 (InterfaceEvent): Ditto.
18896 (InterfaceMethod): Ditto.
18897 (InterfaceIndexer): Ditto.
18899 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
18900 pass the attributes too.
18901 (interface_event_declaration): Ditto.
18902 (interface_property_declaration): Ditto.
18903 (interface_method_declaration): Ditto.
18904 (interface_declaration): Ditto.
18906 2001-09-05 Miguel de Icaza <miguel@ximian.com>
18908 * class.cs (Method::Define): Track the "static Main" definition to
18909 create an entry point.
18911 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
18912 EntryPoint if we find it.
18914 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
18915 (EmitContext::ig): Make this variable public.
18917 * driver.cs: Make the default output file be the first file name
18918 with the .exe extension.
18920 Detect empty compilations
18922 Handle various kinds of output targets. Handle --target and
18923 rename -t to --dumper.
18925 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
18926 methods inherited from Expression return now an Expression. This
18927 will is used during the tree rewriting as we resolve them during
18930 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
18931 the spec. Missing entirely is the information about
18932 accessability of elements of it.
18934 (Expression::ExprClassFromMemberInfo): New constructor for
18935 Expressions that creates a fully initialized Expression based on
18936 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
18939 (Invocation::Resolve): Begin implementing resolution of invocations.
18941 * literal.cs (StringLiteral): Implement Emit.
18943 2001-09-05 Ravi Pratap <ravi@ximian.com>
18945 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
18948 2001-09-04 Ravi Pratap <ravi@ximian.com>
18950 * cs-parser.jay (attribute_arguments): Implement actions.
18951 (attribute): Fix bug in production. Implement action.
18952 (attribute_list): Implement.
18953 (attribute_target): Implement.
18954 (attribute_target_specifier, opt_target_specifier): Implement
18955 (CheckAttributeTarget): New method to check if the attribute target
18957 (attribute_section): Implement.
18958 (opt_attributes): Implement.
18960 * attribute.cs : New file to handle attributes.
18961 (Attribute): Class to hold attribute info.
18963 * cs-parser.jay (opt_attribute_target_specifier): Remove production
18964 (attribute_section): Modify production to use 2 different rules to
18965 achieve the same thing. 1 s/r conflict down !
18966 Clean out commented, useless, non-reducing dimension_separator rules.
18968 * class.cs (TypeContainer.attributes): New member to hold list
18969 of attributes for a type.
18970 (Struct::Struct): Modify to take one more argument, the attribute list.
18971 (Class::Class): Ditto.
18972 (Field::Field): Ditto.
18973 (Method::Method): Ditto.
18974 (Property::Property): Ditto.
18976 * cs-parser.jay (struct_declaration): Update constructor call to
18977 pass in the attributes too.
18978 (class_declaration): Ditto.
18979 (constant_declaration): Ditto.
18980 (field_declaration): Ditto.
18981 (method_header): Ditto.
18982 (fixed_parameter): Ditto.
18983 (parameter_array): Ditto.
18984 (property_declaration): Ditto.
18986 * constant.cs (Constant::Constant): Update constructor similarly.
18987 Use System.Collections.
18989 * parameter.cs (Parameter::Parameter): Update as above.
18991 2001-09-02 Ravi Pratap <ravi@ximian.com>
18993 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
18994 (TypeContainer.delegates): New member to hold list of delegates.
18996 * cs-parser.jay (delegate_declaration): Implement the action correctly
18997 this time as I seem to be on crack ;-)
18999 2001-09-02 Miguel de Icaza <miguel@ximian.com>
19001 * rootcontext.cs (RootContext::IsNamespace): new function, used to
19002 tell whether an identifier represents a namespace.
19004 * expression.cs (NamespaceExpr): A namespace expression, used only
19005 temporarly during expression resolution.
19006 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
19007 utility functions to resolve names on expressions.
19009 2001-09-01 Miguel de Icaza <miguel@ximian.com>
19011 * codegen.cs: Add hook for StatementExpressions.
19013 * class.cs: Fix inverted test for static flag in methods.
19015 2001-09-02 Ravi Pratap <ravi@ximian.com>
19017 * class.cs (Operator::CheckUnaryOperator): Correct error number used
19018 to make it coincide with MS' number.
19019 (Operator::CheckBinaryOperator): Ditto.
19021 * ../errors/errors.txt : Remove error numbers added earlier.
19023 * ../errors/cs1019.cs : Test case for error # 1019
19025 * ../errros/cs1020.cs : Test case for error # 1020
19027 * cs-parser.jay : Clean out commented cruft.
19028 (dimension_separators, dimension_separator): Comment out. Ostensibly not
19029 used anywhere - non-reducing rule.
19030 (namespace_declarations): Non-reducing rule - comment out.
19032 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
19033 with TypeContainer::AddEnum.
19035 * delegate.cs : New file for delegate handling classes.
19036 (Delegate): Class for declaring delegates.
19038 * makefile : Update.
19040 * cs-parser.jay (delegate_declaration): Implement.
19042 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
19044 * class.cs (Event::Define): Implement.
19045 (Event.EventBuilder): New member.
19047 * class.cs (TypeContainer::Populate): Update to define all enums and events
19049 (Events): New property for the events arraylist we hold. Shouldn't we move to using
19050 readonly fields for all these cases ?
19052 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
19054 * class.cs (Property): Revamp to use the convention of making fields readonly.
19055 Accordingly modify code elsewhere.
19057 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
19058 the Define method of the Property class.
19060 * class.cs : Clean up applied patch and update references to variables etc. Fix
19062 (TypeContainer::Populate): Update to define all the properties we have. Also
19063 define all enumerations.
19065 * enum.cs (Define): Implement.
19067 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
19069 * cs-parser.jay (overloadable_operator): The semantic value is an
19070 enum of the Operator class.
19071 (operator_declarator): Implement actions.
19072 (operator_declaration): Implement.
19074 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
19075 validity of definitions.
19076 (Operator::CheckBinaryOperator): Static method to check for binary operators
19077 (TypeContainer::AddOperator): New method to add an operator to a type.
19079 * cs-parser.jay (indexer_declaration): Added line to actually call the
19080 AddIndexer method so it gets added ;-)
19082 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
19083 already taken care of by the MS compiler ?
19085 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
19087 * class.cs (Operator): New class for operator declarations.
19088 (Operator::OpType): Enum for the various operators.
19090 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
19092 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
19093 ostensibly handle this in semantic analysis.
19095 * cs-parser.jay (general_catch_clause): Comment out
19096 (specific_catch_clauses, specific_catch_clause): Ditto.
19097 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
19098 (catch_args, opt_catch_args): New productions.
19099 (catch_clause): Rewrite to use the new productions above
19100 (catch_clauses): Modify accordingly.
19101 (opt_catch_clauses): New production to use in try_statement
19102 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
19103 and re-write the code in the actions to extract the specific and
19104 general catch clauses by being a little smart ;-)
19106 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
19107 Hooray, try and catch statements parse fine !
19109 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
19111 * statement.cs (Block::GetVariableType): Fix logic to extract the type
19112 string from the hashtable of variables.
19114 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
19115 I end up making that mistake ;-)
19116 (catch_clauses): Fixed gross error which made Key and Value of the
19117 DictionaryEntry the same : $1 !!
19119 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
19121 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
19123 * cs-parser.jay (event_declaration): Correct to remove the semicolon
19124 when the add and remove accessors are specified.
19126 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
19128 * cs-parser.jay (IndexerDeclaration): New helper class to hold
19129 information about indexer_declarator.
19130 (indexer_declarator): Implement actions.
19131 (parsing_indexer): New local boolean used to keep track of whether
19132 we are parsing indexers or properties. This is necessary because
19133 implicit_parameters come into picture even for the get accessor in the
19134 case of an indexer.
19135 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
19137 * class.cs (Indexer): New class for indexer declarations.
19138 (TypeContainer::AddIndexer): New method to add an indexer to a type.
19139 (TypeContainer::indexers): New member to hold list of indexers for the
19142 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
19144 * cs-parser.jay (add_accessor_declaration): Implement action.
19145 (remove_accessor_declaration): Implement action.
19146 (event_accessors_declaration): Implement
19147 (variable_declarators): swap statements for first rule - trivial.
19149 * class.cs (Event): New class to hold information about event
19151 (TypeContainer::AddEvent): New method to add an event to a type
19152 (TypeContainer::events): New member to hold list of events.
19154 * cs-parser.jay (event_declaration): Implement actions.
19156 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
19158 * cs-parser.jay (dim_separators): Implement. Make it a string
19159 concatenating all the commas together, just as they appear.
19160 (opt_dim_separators): Modify accordingly
19161 (rank_specifiers): Update accordingly. Basically do the same
19162 thing - instead, collect the brackets here.
19163 (opt_rank_sepcifiers): Modify accordingly.
19164 (array_type): Modify to actually return the complete type string
19165 instead of ignoring the rank_specifiers.
19166 (expression_list): Implement to collect the expressions
19167 (variable_initializer): Implement. We make it a list of expressions
19168 essentially so that we can handle the array_initializer case neatly too.
19169 (variable_initializer_list): Implement.
19170 (array_initializer): Make it a list of variable_initializers
19171 (opt_array_initializer): Modify accordingly.
19173 * expression.cs (New::NType): Add enumeration to help us
19174 keep track of whether we have an object/delegate creation
19175 or an array creation.
19176 (New:NewType, New::Rank, New::Indices, New::Initializers): New
19177 members to hold data about array creation.
19178 (New:New): Modify to update NewType
19179 (New:New): New Overloaded contructor for the array creation
19182 * cs-parser.jay (array_creation_expression): Implement to call
19183 the overloaded New constructor.
19185 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
19187 * class.cs (TypeContainer::Constructors): Return member
19188 constructors instead of returning null.
19190 2001-08-26 Miguel de Icaza <miguel@ximian.com>
19192 * typemanager.cs (InitCoreTypes): Initialize the various core
19193 types after we have populated the type manager with the user
19194 defined types (this distinction will be important later while
19195 compiling corlib.dll)
19197 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
19198 on Expression Classification. Now all expressions have a method
19199 `Resolve' and a method `Emit'.
19201 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
19202 generation from working. Also add some temporary debugging
19205 2001-08-24 Miguel de Icaza <miguel@ximian.com>
19207 * codegen.cs: Lots of code generation pieces. This is only the
19208 beginning, will continue tomorrow with more touches of polish. We
19209 handle the fundamentals of if, while, do, for, return. Others are
19210 trickier and I need to start working on invocations soon.
19212 * gen-treedump.cs: Bug fix, use s.Increment here instead of
19215 * codegen.cs (EmitContext): New struct, used during code
19216 emission to keep a context. Most of the code generation will be
19219 * cs-parser.jay: Add embedded blocks to the list of statements of
19220 this block. So code generation proceeds in a top down fashion.
19222 2001-08-23 Miguel de Icaza <miguel@ximian.com>
19224 * statement.cs: Add support for multiple child blocks.
19226 2001-08-22 Miguel de Icaza <miguel@ximian.com>
19228 * codegen.cs (EmitCode): New function, will emit the code for a
19229 Block of code given a TypeContainer and its ILGenerator.
19231 * statement.cs (Block): Standard public readonly optimization.
19232 (Block::Block constructors): Link children.
19233 (Block::Child): Child Linker.
19234 (Block::EmitVariables): Emits IL variable declarations.
19236 * class.cs: Drop support for MethodGroups here, delay until
19238 (Method::): Applied the same simplification that I did before, and
19239 move from Properties to public readonly fields.
19240 (Method::ParameterTypes): Returns the parameter types for the
19241 function, and implements a cache that will be useful later when I
19242 do error checking and the semantic analysis on the methods is
19244 (Constructor::GetCallingConvention): Renamed from CallingConvetion
19245 and made a method, optional argument tells whether this is a class
19246 or a structure to apply the `has-this' bit.
19247 (Method::GetCallingConvention): Implement, returns the calling
19249 (Method::Define): Defines the type, a second pass is performed
19250 later to populate the methods.
19252 (Constructor::ParameterTypes): implement a cache similar to the
19253 one on Method::ParameterTypes, useful later when we do semantic
19256 (TypeContainer::EmitMethod): New method. Emits methods.
19258 * expression.cs: Removed MethodGroup class from here.
19260 * parameter.cs (Parameters::GetCallingConvention): new method.
19262 2001-08-21 Miguel de Icaza <miguel@ximian.com>
19264 * class.cs (TypeContainer::Populate): Drop RootContext from the
19267 (Constructor::CallingConvention): Returns the calling convention.
19268 (Constructor::ParameterTypes): Returns the constructor parameter
19271 (TypeContainer::AddConstructor): Keep track of default constructor
19272 and the default static constructor.
19274 (Constructor::) Another class that starts using `public readonly'
19275 instead of properties.
19277 (Constructor::IsDefault): Whether this is a default constructor.
19279 (Field::) use readonly public fields instead of properties also.
19281 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
19282 track of static constructors; If none is used, turn on
19283 BeforeFieldInit in the TypeAttributes.
19285 * cs-parser.jay (opt_argument_list): now the return can be null
19286 for the cases where there are no arguments.
19288 (constructor_declarator): If there is no implicit `base' or
19289 `this', then invoke the default parent constructor.
19291 * modifiers.cs (MethodAttr): New static function maps a set of
19292 modifiers flags into a MethodAttributes enum
19293 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
19294 MethodAttr, TypeAttr to represent the various mappings where the
19295 modifiers are used.
19296 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
19298 2001-08-19 Miguel de Icaza <miguel@ximian.com>
19300 * parameter.cs (GetParameterInfo): Fix bug where there would be no
19303 * interface.cs (PopulateIndexer): Implemented the code generator
19304 for interface indexers.
19306 2001-08-17 Miguel de Icaza <miguel@ximian.com>
19308 * interface.cs (InterfaceMemberBase): Now we track the new status
19311 (PopulateProperty): Implement property population. Woohoo! Got
19312 Methods and Properties going today.
19314 Removed all the properties for interfaces, and replaced them with
19315 `public readonly' fields.
19317 2001-08-16 Miguel de Icaza <miguel@ximian.com>
19319 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
19320 initialize their hashtables/arraylists only when they are needed
19321 instead of doing this always.
19323 * parameter.cs: Handle refs and out parameters.
19325 * cs-parser.jay: Use an ArrayList to construct the arguments
19326 instead of the ParameterCollection, and then cast that to a
19329 * parameter.cs: Drop the use of ParameterCollection and use
19330 instead arrays of Parameters.
19332 (GetParameterInfo): Use the Type, not the Name when resolving
19335 2001-08-13 Miguel de Icaza <miguel@ximian.com>
19337 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
19338 and instead use public readonly fields.
19340 * class.cs: Put back walking code for type containers.
19342 2001-08-11 Miguel de Icaza <miguel@ximian.com>
19344 * class.cs (MakeConstant): Code to define constants.
19346 * rootcontext.cs (LookupType): New function. Used to locate types
19349 2001-08-08 Miguel de Icaza <miguel@ximian.com>
19351 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
19352 this System.Reflection code is. Kudos to Microsoft
19354 * typemanager.cs: Implement a type cache and avoid loading all
19355 types at boot time. Wrap in LookupType the internals. This made
19356 the compiler so much faster. Wow. I rule!
19358 * driver.cs: Make sure we always load mscorlib first (for
19359 debugging purposes, nothing really important).
19361 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
19362 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
19364 * rootcontext.cs: Lookup types on their namespace; Lookup types
19365 on namespaces that have been imported using the `using' keyword.
19367 * class.cs (TypeContainer::TypeAttr): Virtualize.
19368 (Class::TypeAttr): Return attributes suitable for this bad boy.
19369 (Struct::TypeAttr): ditto.
19370 Handle nested classes.
19371 (TypeContainer::) Remove all the type visiting code, it is now
19372 replaced with the rootcontext.cs code
19374 * rootcontext.cs (GetClassBases): Added support for structs.
19376 2001-08-06 Miguel de Icaza <miguel@ximian.com>
19378 * interface.cs, statement.cs, class.cs, parameter.cs,
19379 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
19380 Drop use of TypeRefs, and use strings instead.
19382 2001-08-04 Miguel de Icaza <miguel@ximian.com>
19386 * class.cs (Struct::Struct): set the SEALED flags after
19387 checking the modifiers.
19388 (TypeContainer::TypeAttr): new property, returns the
19389 TypeAttributes for a class.
19391 * cs-parser.jay (type_list): Oops, list production was creating a
19392 new list of base types.
19394 * rootcontext.cs (StdLib): New property.
19395 (GetInterfaceTypeByName): returns an interface by type name, and
19396 encapsulates error handling here.
19397 (GetInterfaces): simplified.
19398 (ResolveTree): Encapsulated all the tree resolution here.
19399 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
19402 * driver.cs: Add support for --nostdlib, to avoid loading the
19403 default assemblies.
19404 (Main): Do not put tree resolution here.
19406 * rootcontext.cs: Beginning of the class resolution.
19408 2001-08-03 Miguel de Icaza <miguel@ximian.com>
19410 * rootcontext.cs: Provide better error reporting.
19412 * cs-parser.jay (interface_base): set our $$ to be interfaces.
19414 * rootcontext.cs (CreateInterface): Handle the case where there
19415 are no parent interfaces.
19417 (CloseTypes): Routine to flush types at the end.
19418 (CreateInterface): Track types.
19419 (GetInterfaces): Returns an array of Types from the list of
19420 defined interfaces.
19422 * typemanager.c (AddUserType): Mechanism to track user types (puts
19423 the type on the global type hash, and allows us to close it at the
19426 2001-08-02 Miguel de Icaza <miguel@ximian.com>
19428 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
19429 RecordInterface instead.
19431 * cs-parser.jay: Updated to reflect changes above.
19433 * decl.cs (Definition): Keep track of the TypeBuilder type that
19434 represents this type here. Not sure we will use it in the long
19435 run, but wont hurt for now.
19437 * driver.cs: Smaller changes to accomodate the new code.
19439 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
19442 * rootcontext.cs (CreateInterface): New method, used to create
19443 the System.TypeBuilder type for interfaces.
19444 (ResolveInterfaces): new entry point to resolve the interface
19446 (CodeGen): Property, used to keep track of the code generator.
19448 2001-07-26 Miguel de Icaza <miguel@ximian.com>
19450 * cs-parser.jay: Add a second production for delegate_declaration
19453 (enum_body): Put an opt_comma here instead of putting it on
19454 enum_body or enum_member_declarations so we can handle trailing
19455 commas on enumeration members. Gets rid of a shift/reduce.
19457 (type_list): Need a COMMA in the middle.
19459 (indexer_declaration): Tell tokenizer to recognize get/set
19461 * Remove old targets.
19463 * Re-add the parser target.
19465 2001-07-13 Simon Cozens <simon@simon-cozens.org>
19467 * cs-parser.jay: Add precendence rules for a number of operators
19468 ot reduce the number of shift/reduce conflicts in the grammar.
19470 2001-07-17 Miguel de Icaza <miguel@ximian.com>
19472 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
19475 Get rid of old crufty code.
19477 * rootcontext.cs: Use this to keep track of the parsed
19478 representation and the defined types available to the program.
19480 * gen-treedump.cs: adjust for new convention.
19482 * type.cs: Split out the type manager, and the assembly builder
19485 * typemanager.cs: the type manager will live here now.
19487 * cil-codegen.cs: And the code generator here.
19489 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
19491 * makefile: Fixed up for easy making.
19493 2001-07-13 Simon Cozens <simon@simon-cozens.org>
19495 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
19498 (unary_expression): Expand pre_increment_expression and
19499 post_decrement_expression to reduce a shift/reduce.
19501 2001-07-11 Simon Cozens
19503 * cs-tokenizer.cs: Hex numbers should begin with a 0.
19505 Improve allow_keyword_as_indent name.
19507 2001-06-19 Miguel de Icaza <miguel@ximian.com>
19509 * Adjustments for Beta2.
19511 2001-06-13 Miguel de Icaza <miguel@ximian.com>
19513 * decl.cs: Added `Define' abstract method.
19514 (InTransit): new property, used to catch recursive definitions.
19516 * interface.cs: Implement `Define'.
19518 * modifiers.cs: Map Modifiers.constants to
19519 System.Reflection.TypeAttribute flags.
19521 * class.cs: Keep track of types and user-defined types.
19522 (BuilderInit): New method for creating an assembly
19523 (ResolveType): New function to launch the resolution process, only
19524 used by interfaces for now.
19526 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
19527 that are inserted into the name space.
19529 2001-06-08 Miguel de Icaza <miguel@ximian.com>
19531 * ARGH. I have screwed up my tree so many times due to the use of
19532 rsync rather than using CVS. Going to fix this at once.
19534 * driver.cs: Objetify driver. Load assemblies, use assemblies to
19537 2001-06-07 Miguel de Icaza <miguel@ximian.com>
19539 * Experiment successful: Use System.Type rather that our own
19542 2001-05-25 Miguel de Icaza <miguel@ximian.com>
19544 * cs-parser.jay: Removed nsAliases from here.
19546 Use new namespaces, handle `using XXX;'
19548 * namespace.cs: Reimplemented namespace handling, use a recursive
19549 definition of the class. Now we can keep track of using clauses
19550 and catch invalid using clauses.
19552 2001-05-24 Miguel de Icaza <miguel@ximian.com>
19554 * gen-treedump.cs: Adapted for all the renaming.
19556 * expression.cs (Expression): this class now has a Type property
19557 which returns an expression Type.
19559 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
19560 `Type', as this has a different meaning now in the base
19562 2001-05-22 Miguel de Icaza <miguel@ximian.com>
19564 * interface.cs, class.cs: Removed from all the sources the
19565 references to signature computation, as we can not do method
19566 signature computation during the parsing time, as we are not
19567 trying to solve at that point distinguishing:
19571 void a (NS.Blah x) {}
19574 Which depending on the context might be valid or not, as we do not
19575 know if Blah is the same thing as NS.Blah at that point.
19577 * Redid everything so the code uses TypeRefs now instead of
19578 Types. TypeRefs are just temporary type placeholders, that need
19579 to be resolved. They initially have a pointer to a string and the
19580 current scope in which they are used. This is used later by the
19581 compiler to resolve the reference to an actual Type.
19583 * DeclSpace is no longer a CIR.Type, and neither are
19584 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
19585 are all DeclSpaces, but no Types.
19587 * type.cs (TypeRefManager): This implements the TypeRef manager,
19588 which keeps track of all the types that need to be resolved after
19589 the parsing has finished.
19591 2001-05-13 Miguel de Icaza <miguel@ximian.com>
19593 * ARGH. We are going to have to store `foreach' as a class rather
19594 than resolving it, as we need to verify error 1579 after name
19595 resolution. *OR* we could keep a flag that says `This request to
19596 IEnumerator comes from a foreach statement' which we can then use
19597 to generate the error.
19599 2001-05-10 Miguel de Icaza <miguel@ximian.com>
19601 * class.cs (TypeContainer.AddMethod): we now add methods to the
19602 MethodGroup instead of the method hashtable.
19604 * expression.cs: Add MethodGroup abstraction, which gets us one
19605 step closer to the specification in the way we handle method
19608 * cs-parser.jay (primary_expression): qualified_identifier now
19609 tried to match up an identifier to a local variable reference or
19610 to a parameter reference.
19612 current_local_parameters is now a parser global variable that
19613 points to the current parameters for the block, used during name
19616 (property_declaration): Now creates an implicit `value' argument to
19619 2001-05-09 Miguel de Icaza <miguel@ximian.com>
19621 * parameter.cs: Do not use `param' arguments as part of the
19622 signature, per the spec.
19624 2001-05-08 Miguel de Icaza <miguel@ximian.com>
19626 * decl.cs: Base class for classes, structs and interfaces. This
19627 is the "Declaration Space"
19629 * cs-parser.jay: Use CheckDef for checking declaration errors
19630 instead of having one on each function.
19632 * class.cs: Factor out some code for handling error handling in
19633 accordance to the "Declarations" section in the "Basic Concepts"
19634 chapter in the ECMA C# spec.
19636 * interface.cs: Make all interface member classes derive from
19637 InterfaceMemberBase.
19639 2001-05-07 Miguel de Icaza <miguel@ximian.com>
19641 * Many things: all interfaces are parsed and generated in
19642 gen-treedump. Support for member variables, constructors,
19643 destructors, properties, constants is there.
19645 Beginning of the IL backend, but very little done, just there for
19648 2001-04-29 Miguel de Icaza <miguel@ximian.com>
19650 * cs-parser.jay: Fix labeled statement.
19652 * cs-tokenizer.cs (escape): Escape " and ' always.
19653 ref_line, ref_name: keep track of the line/filename as instructed
19654 by #line by the compiler.
19657 2001-04-27 Miguel de Icaza <miguel@ximian.com>
19659 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
19660 to match the values in System.CodeDOM.
19662 Divid renamed to Divide.
19664 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
19666 (Statements.set): remove.
19668 * System.CodeDOM/CodeCatchClause.cs: always have a valid
19671 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
19672 falseStatements always have valid values.
19674 * cs-parser.jay: Use System.CodeDOM now.